MyBB Community Forums

Full Version: Error PHP after editing plugin's template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry for my english in advance (I'm Polish).

I have a problem... I had about 15 plugins installed and all were been OK but yesterday I got a PHP error.

When I edit template of any plugin and save its showing php error on forum:
 Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING in /home/accounts_e/emillo/public_html/inc/plugins/myshoutbox.php(1984) : eval()'d code on line 49  Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING in /home/accounts_e/emillo/public_html/inc/plugins/myshoutbox.php(1897) : eval()'d code on line 49

I have reinstalled MyBB but now I have the same error...

I think MyBB is converting my templates to PHP... After saving template this is new look:
<style type=\"text/css\">

.shoutbox {
    margin: 0;
    padding: 0;
    left: 0;
}


li.shoutbox_normal {
    list-style: none;
    margin: 0;
    position: relative;
    cursor: pointer;
    color: transparent;
    display: inline ;
    border: 1px;
    border-color: #FFFFFF;
}

li.shoutbox_color {
    list-style: none;
    position: relative;
    cursor: pointer;
    color: transparent;
    display: inline ;
    border: 0px;
    float: left;
    margin: 1px;
}

.shoutbox_button_color a {
    width: 9px;
    height: 9px;
    display: block;
    border: 1px solid #FFF;
}

</style>

<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" class=\"tborder\">
<thead>
<tr>
<td class=\"thead\" colspan=\"5\">
<div class=\"tcat_hp\" colspan=\"2\">
<div class=\"tcat_right\">
  <div class=\"tcat_left\">
<div class=\"expcolimage\"><img src=\"{$theme[\'imgdir\']}/collapse.gif\" id=\"shoutbox_img\" class=\"expander\" alt=\"[-]\" /></div>
<div><strong>{$lang->mysb_shoutbox}</strong> (<a href=\"index.php?action=full_shoutbox\">{$lang->mysb_fullsbox}</a> - <a href=\"pspshoutbox.php\" title=\"Click here for the Portable Device version\">Portable Device version</a>)<br /></div>
</td>
</tr>
</thead>

<tbody id=\"shoutbox_e\">
<tr>
<td class=\"trow2\" width=\"100%\" align=\"center\" colspan=\"3\"><form onSubmit=\"ShoutBox.sendMessage(); $(\'send_to\').value = \'\'; return false;\">{$lang->mysb_uid} <input type=\"text\" id=\"send_to\" size=\"30\" /> - <input type=\"submit\" value=\"{$lang->mysb_sendnow}\" id=\"sending-status\" /> <br /> <small>({$lang->mysb_sendnow_desc})</small></form>{$mysb_message}<div id=\"shoutbox_sendinfo\"></div></td>
</tr>
<tr>
<td class=\"trow2\" width=\"12%\" align=\"center\"><strong>Bot Info</strong></td>
<td class=\"trow2\" width=\"66%\" align=\"center\"><form onSubmit=\"ShoutBox.postShout(); $(\'shout_data\').value = \'\'; return false;\">{$lang->mysb_shout} <input type=\"text\" id=\"shout_data\" size=\"50\" /> - <input type=\"submit\" value=\"{$lang->mysb_shoutnow}\" id=\"shouting-status\" /></form></td>
<td class=\"trow2\" width=\"12%\" align=\"center\"><strong>User Panel</strong></td>
</tr>
<tr>
<td class=\"trow1\" width=\"12%\" align=\"center\"><font size=\"2\"><strong>Bot Mood</strong>: {$botmood}<br><strong>Bot State</strong>: {$botstate}</font></td>
<td class=\"trow1\" width=\"76%\"><font size=\"{$mybb->settings[\'mysb_text_size\']}\"><div id=\"shoutbox_data\" style=\"height: {$mybb->settings[\'mysb_height\']}px; overflow: auto;\">{$lang->mysb_loading}</div></font></td>
<td class=\"trow1\" width=\"12%\" align=\"center\">
<a style=\"cursor: pointer;\" id=\"talktobot\" onclick=\"ShoutBox.talkToBot(); return false;\">{$lang->mysb_talkbot}</a>
<br />
<!--<a style=\"cursor: pointer;\" id=\"smilies\" onclick=\"window.open(\'misc.php?action=smilies&popup=true&editor=clickableEditor\',\'Smilies\',\'scrollbars=yes, menubar=no,width=460,height=360,toolbar=no\');\">Smilies</a>-->
<a style=\"cursor: pointer;\" id=\"shoutbox_smilies\">Smilies</a>
        
        <div id=\"shoutbox_smilies_popup\" class=\"popup_menu\" style=\"display: none; padding: 15px; background: #F2F2F2; color: #000000; border: 1px solid #000000; width: 500px; height: 200px; overflow: auto;\">
        <ul class=\"shoutbox\">
            {$smilie_inserter}
        </ul>

        </div>
        <script type=\"text/javascript\">
            new ShoutboxPopupMenu(\"shoutbox_smilies\");
        </script>
<br />

<a style=\"cursor: pointer;\" id=\"shoutbox_popup\">PopupSB</a>
        
        <div id=\"shoutbox_popup_popup\" class=\"popup_menu\" style=\"display: none; padding: 15px; background: #F2F2F2; color: #000000; border: 1px solid #000000;\">
        <ul class=\"shoutbox\">
            <a style=\"cursor: pointer;\" onclick=\"window.open(\'shoutbox.php\',\'{$lang->mysb_shoutbox}\',\'scrollbars=yes, menubar=no,width=825,height=449,toolbar=no\');\">{$lang->mysb_shoutbox}</a>
            <br />
            <a style=\"cursor: pointer;\" onclick=\"window.open(\'shoutbox.php?action=full\',\'FullShoutBox\',\'scrollbars=yes, menubar=no,width=660,height=260,toolbar=no\');\">Full ShoutBox</a>
        </ul>

        </div>
        <script type=\"text/javascript\">
            new ShoutboxPopupMenu(\"shoutbox_popup\");
        </script>
<br />

<a style=\"cursor: pointer;\" id=\"shoutbox_mycode\">MyCode</a>
        
        <div id=\"shoutbox_mycode_popup\" class=\"popup_menu\" style=\"display: none; padding: 15px; background: #F2F2F2; color: #000000; border: 1px solid #000000;\">
        <ul class=\"shoutbox\">
            <a style=\"cursor: pointer;\" onclick=\"ShoutBox.mycodeAdd(\'B\');\">Bold</a>
            <br />
            <a style=\"cursor: pointer;\" onclick=\"ShoutBox.mycodeAdd(\'I\');\">Italic</a>
            <br />
            <a style=\"cursor: pointer;\" onclick=\"ShoutBox.mycodeAdd(\'U\');\">Underline</a>
            <br />
            <a style=\"cursor: pointer;\" onclick=\"ShoutBox.mycodeAdd(\'S\');\">Strike</a>
        </ul>

        </div>
        <script type=\"text/javascript\">
            new ShoutboxPopupMenu(\"shoutbox_mycode\");
        </script>
<br />

<a style=\"cursor: pointer;\" id=\"shoutbox_colors\">Colors</a>
        <span class=\"shoutbox_button_color\">
            <div id=\"shoutbox_colors_popup\" class=\"popup_menu\" style=\"display: none; padding: 15px; background: #F2F2F2; color: #000000; border: 1px solid #000000;\">
                <ul class=\"shoutbox\">
                    <li class=\"shoutbox_color\" style=\"background: #800000;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'800000\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #8B4513;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'8B4513\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #006400;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'006400\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #2F4F4F;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'2F4F4F\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #000080;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'000080\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #4B0082;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'4B0082\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #800080;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'800080\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #000000;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'000000\');\"></a></li>
                </ul>
                
                <ul class=\"shoutbox\">
                    <li class=\"shoutbox_color\" style=\"background: #FF0000;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FF0000\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #DAA520;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'DAA520\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #6B8E23;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'6B8E23\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #708090;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'708090\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #0000CD;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'0000CD\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #483D8B;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'483D8B\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #C71585;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'C71585\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #696969;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'696969\');\"></a></li>
                </ul>
                
                <ul class=\"shoutbox\">
                    <li class=\"shoutbox_color\" style=\"background: #FF4500;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FF4500\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #FFA500;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FFA500\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #808000;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'808000\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #4682B4;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'4682B4\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #1E90FF;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'1E90FF\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #9400D3;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'9400D3\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #FF1493;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FF1493\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #A9A9A9;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'A9A9A9\');\"></a></li>
                </ul>
                
                <ul class=\"shoutbox\">
                    <li class=\"shoutbox_color\" style=\"background: #FF6347;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FF6347\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #FFD700;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FFD700\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #32CD32;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'32CD32\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #87CEEB;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'87CEEB\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #00BFFF;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'00BFFF\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #9370DB;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'9370DB\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #FF69B4;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FF69B4\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #DCDCDC;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'DCDCDC\');\"></a></li>
                </ul>
                
                <ul class=\"shoutbox\">
                    <li class=\"shoutbox_color\" style=\"background: #FFDAB9;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FFDAB9\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #FFFFE0;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FFFFE0\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #98FB98;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'98FB98\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #E0FFFF;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'E0FFFF\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #87CEFA;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'87CEFA\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #E6E6FA;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'E6E6FA\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #DDA0DD;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'DDA0DD\');\"></a></li>
                    <li class=\"shoutbox_color\" style=\"background: #FFFFFF;\"><a style=\"cursor: pointer;\" onclick=\"ShoutBox.colorAdd(\'FFFFFF\');\"></a></li>
                </ul>
            </div>
         </span>
        <script type=\"text/javascript\">
            new ShoutboxPopupMenu(\"shoutbox_colors\");
        </script>
<br />

</tr>
</tbody>
</table>

<script>
ShoutBox.refreshInterval = {$mybb->settings[\'mysb_refresh_interval\']};
ShoutBox.MaxEntries = {$mybb->settings[\'mysb_shouts_main\']};
ShoutBox.lang = [\'{$lang->mysb_posting}\', \'{$lang->mysb_shoutnow}\', \'{$lang->mysb_loading}\', \'{$lang->mysb_flood_check}\', \'{$lang->mysb_no_perform}\', \'{$lang->mysb_sending}\', \'{$lang->mysb_sendnow}\', \'{$lang->mysb_already_sent}\', \'{$lang->mysb_deleted}\', \'{$lang->mysb_invalid}\', \'{$lang->mysb_self}\', \'{$lang->mysb_report_invalid_sid}\', \'{$lang->mysb_shout_reported}\', \'{$lang->mysb_shout_already_reported}\'];
ShoutBox.bindSmilieInserter(\"sb_clickable_smilies\");
{$extra_js}
Event.observe(window, \'load\', ShoutBox.showShouts);
</script>

<br />

There are characteristic for PHP \ before " and '...

Can someone help me?

Sorry for my english again.
Tell your host to disable magic quotes.
Like Matt said, all you need to do is have your host disable magic_quotes.
Any other method?

And how can I do that? Write to my host owner or disable it somewhere in MyBB ACP?
No, there's no other method, that's what's causing it. Your host will have to do it.
You have to write to your host support team/owner.
Ok thank you for help MattRogowski Smile