Ever since updating to MyBB 1.8.8, the Edit History Log plugin (v1.3) by Starpaul20 is doubling up its text in a post. Example:
Today, 01:47 AM (This post was last modified: Today, 01:50 AM by
addiesin. Edited 3 times in total. Edited 3 times in total.) (View Edit History) (View Edit History)
I can't seem to find the template code that is causing this. Can anyone please advise?
UPDATE: A little more digging and I discovered an extra
{$post['edithistory']}
in the postbit template. That removes one of the extra View History links, but the Edited X times in total is still doubled up.
Please post your "postbit_editedby" and "postbit_classic" templates.
Here is the postbit_editedby
<span class="edited_post">({$post['editnote']} {$post['editedprofilelink']}.<!-- editcount --><!-- editcount -->{$editreason})</span>
And postbit_classic
{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<div class="post classic {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
<div class="post_author scaleimages">
{$post['useravatar']}
<div class="author_information">
<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
<span class="smalltext">
{$post['usertitle']}<br />
{$post['groupimage']}
</span>
</div>
<div class="author_statistics">
{$post['user_details']}{$post['usercountry']}
</div>
</div>
<div class="post_content">
<div class="post_head">
{$post['posturl']}
{$post['icon']}
<span class="post_date">{$post['postdate']} <span class="post_edit" id="edited_by_{$post['pid']}">{$post['editedmsg']}{$post['edithistory']}</span></span>
{$post['subject_extra']}
</div>
<div class="post_body scaleimages" id="pid_{$post['pid']}">
{$post['message']}
</div>
{$post['attachments']}
{$post['signature']}
<div class="post_meta" id="post_meta_{$post['pid']}">
{$post['quick_quote']}
{$post['iplogged']}
</div>
</div>
<div class="post_controls">
<div class="postbit_buttons author_buttons float_left">
{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_like']}
</div>
<div class="postbit_buttons post_management_buttons float_right">
{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quickrestore']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_purgespammer']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
</div>
</div>
</div>
I did notice that these are listed both under Post Bit Templates and Post Templates. Both contain the same code.
You have <!-- editcount --> twice in the first template, remove one of them.
That did it. I always thought <!-- --> was commenting stuff out. It never occurred to me to remove it. Thanks!
It doed. but plugjns sem to use it as a variable insert of some sort
It's a workaround for setting variables in certain templates - based on where some hooks run, you can't populate a variable because the template has already been parsed, so you have to put in a replacement, and do a str_replace on it afterwards. So somewhere in the code it will do:
$template = str_replace('<!-- editcount -->', $plugin_html, $template);
Then whatever the plugin is trying to show will be in the template.
Some people, myself included, do something like {plugin_thing} in the template, and str_replace that instead, but the issue with that is that if the plugin isn't running, this may still be in the template, and will show up. So, a workaround for that is to use a HTML comment, so if the plugin isn't able to str_replace it, it won't show up anyway.
So now you know
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1690 - BIGINT UNSIGNED value is out of range in '(`xxx`.`mybb_posts`.`editcount` - 1)'
Query:
UPDATE mybb_posts SET `editcount`=editcount-1 WHERE pid='6723' LIMIT 1
Please contact the MyBB Group for technical support.
If selected 1 day
(2017-07-30, 03:25 PM)hkkp Wrote: [ -> ]
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1690 - BIGINT UNSIGNED value is out of range in '(`xxx`.`mybb_posts`.`editcount` - 1)'
Query:
UPDATE mybb_posts SET `editcount`=editcount-1 WHERE pid='6723' LIMIT 1
Please contact the MyBB Group for technical support.
If selected 1 day
Try recounting edit counts (Admin CP -> Tools & Maintenance -> Recount & Rebuild -> Recount Edit Count).