Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Beowulf1976 on July 21, 2017, 01:54:08 PM

Title: Why does WYSIWYG view of a post insist on BORKING whatever the user puts in box?
Post by: Beowulf1976 on July 21, 2017, 01:54:08 PM
On my forum, on the nexus forum which looks suspiciously SMF based.. and other forums that use SMF..


The WYSIWYG version of creating a post completely and utterly borks every single post, as soon as one starts pressing delete to remove spaces, and whenever one tries to use formatting.


WHY?!


Is there no fix for this?


Example:


All I did was delete a few spaces/blanks instead of backspacing, and when I re posted it came up with this:




I checked my error logs and I have 318,618 General errors, and they all seem to be the same:




2: in_array() expects parameter 2 to be array, boolean given




File: /***/***/public_html/forum/Themes/default/BoardIndex.template.php (http://www.friendsofinigo.com/forum/index.php?action=admin;area=logs;sa=errorlog;file=L2hvbWUxL2ZyaWVuZHM2L3B1YmxpY19odG1sL2ZvcnVtL1RoZW1lcy9kZWZhdWx0L0JvYXJkSW5kZXgudGVtcGxhdGUucGhw;line=156)








on line 156, 160, 171 and 175




Lines 156-177:             if ($context['user']['is_logged']  && in_array($board['id'], boardsAllowedTo('post_new') || $context['user']['is_admin'])  && empty($modSettings['enable_new_topic_button']) && empty($modSettings['enable_new_topic_button_placement']) && !$board['is_redirect'])
            echo'         
               <a href="', $scripturl . '?action=post;board=',  $board['id'] ,'"><img src="', $settings['images_url'], '/icons/post.gif" alt="*" title="', $txt['new_topic'],'" /></a>';




            if ($context['user']['is_logged']  && in_array($board['id'], boardsAllowedTo('post_new') || $context['user']['is_admin'])  && !empty($modSettings['enable_new_topic_button']) && empty($modSettings['enable_new_topic_button_placement']) && !$board['is_redirect'])
            echo'         
               <a href="', $scripturl . '?action=post;board=',  $board['id'] ,'"><img src="', $settings['images_url'], '/english/new.gif" alt="*" title="', $txt['new_topic'],'" /></a>';








            echo '
                  </a>
               </td>
               <td class="info">
                  <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';




            if ($context['user']['is_logged']  && in_array($board['id'], boardsAllowedTo('post_new') || $context['user']['is_admin'])  && empty($modSettings['enable_new_topic_button']) && !empty($modSettings['enable_new_topic_button_placement']) && !$board['is_redirect'])
            echo'         
               <a href="', $scripturl . '?action=post;board=',  $board['id'] ,'"><img src="', $settings['images_url'], '/icons/post.gif" alt="*" title="', $txt['new_topic'],'" /></a>';








            if ($context['user']['is_logged']  && in_array($board['id'], boardsAllowedTo('post_new') || $context['user']['is_admin'])  && !empty($modSettings['enable_new_topic_button']) && !empty($modSettings['enable_new_topic_button_placement']) && !$board['is_redirect'])
            echo'         
               <a href="', $scripturl . '?action=post;board=',  $board['id'] ,'"><img src="', $settings['images_url'], '/english/new.gif" alt="*" title="', $txt['new_topic'],'" /></a>';

Looking at it as someone who does not REMOTELY know what any of that means, I can see that the lines it complains about are the lines in the code that SEEM to be identical, which is:            if ($context['user']['is_logged']  && in_array($board['id'], boardsAllowedTo('post_new') || $context['user']['is_admin'])  && !empty($modSettings['enable_new_topic_button']) && !empty($modSettings['enable_new_topic_button_placement']) && !$board['is_redirect'])

[size=78%]Now whether the echo' bit is part of each line, I personally have NO idea, all I know is that it has pulled up the seemingly identical lines (which is quite possibly why the [/size][size=78%]http://custom.simplemachines.org/mods/index.php?mod=2698 (http://custom.simplemachines.org/mods/index.php?mod=2698)[/size][size=78%]]New Topic Button on Board Index mod is not remotely working)[/size]

[size=78%]I shall post here and if you guys think it's specific to that mod, I will post in that mod.[/size]




I look forward to your help.




Best wishes




Beo



I didn't actually add ANY of that font editing, your forum software did it automatically just because I pressed the delete key a few times.

Title: Re: Why does WYSIWYG view of a post insist on BORKING whatever the user puts in box?
Post by: Sir Osis of Liver on July 21, 2017, 01:59:13 PM
WYSIWYG in 2.0 is a tad buggy.  I believe it's been fixed in 2.1, but shouldn't be used in 2.0 if you're having problems.
Title: Re: Why does WYSIWYG view of a post insist on BORKING whatever the user puts in box?
Post by: Arantor on July 21, 2017, 06:48:11 PM
It was completely replaced in 2.1 as the 2.0 one was deemed unfixable with the levels of changes browsers implemented.
Title: Re: Why does WYSIWYG view of a post insist on BORKING whatever the user puts in box?
Post by: Beowulf1976 on July 22, 2017, 07:10:12 PM
Thank you everyone, unfortunately I doubt I'll be moving to 2.1 any time soon :( (I am not remotely well enough at the moment to do such a task.)
Title: Re: Why does WYSIWYG view of a post insist on BORKING whatever the user puts in box?
Post by: Sir Osis of Liver on July 22, 2017, 11:33:41 PM
2.1 is still in beta, and should not be used for production forums.  Relax, and take care of yourself.
Title: Re: Why does WYSIWYG view of a post insist on BORKING whatever the user puts in box?
Post by: Steve on July 23, 2017, 09:47:17 AM
Marking solved as your question has been answered. If you have any other questions regarding this topic, by all means, mark this unsolved and let us know.

And as Sir O said, take care of yourself.