MyBB Community Forums

Full Version: Undo Thread Rating field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've tried to use the "Undo thread rating" plugin ( http://community.mybb.com/mods.php?action=view&pid=79 ) but it does not appear next to the stars when I read a thread.
I went into the parameters for administrator group and the parameter "Can undo thread rating?" is checked.

I've tried on a fresh installation of MyBB 1.8.5 and 1.8.4 without success.

Is anybody is running this plugin in MyBB 1.8 ?

I don't understand, I've tried with different MyBB 1.8 versions, with the two releases of the plugin.
It is simple to use:
## INSTALLATION ##

1. Upload all files above, keeping the file structure intact.
2. Go to Configuration > Plugins
3. Click "Activate"
4. Enjoy!

I do not see what I'm doing wrong. It is on a fresh installation on localhost so no problem of compatibility between this plugin and another or regarding the theme.

As it does not work, by activation, I think I could manage to operate myself to see if it is working.
In the plugin file there is thi in the part "This function runs when the plugin is activated."

// Insert template
    $insert_array = array(
        'title'        => 'showthread_ratethread_undo',
        'template'    => $db->escape_string('<span class="smalltext">[<a href="misc.php?action=do_undorating&amp;tid={$thread[\'tid\']}&amp;my_post_key={$mybb->post_code}">{$lang->undo_rating}</a>]</span>'),
        'sid'        => '-1',
        'version'    => '',
        'dateline'    => TIME_NOW
    );


When I try to create such template I obtain the following error:
Quote:A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support.


This could be the problem for the activation ?

On a fresh online installation it does not work too.
It does not seem to create the "showthread_ratethread_undo" template.
you can change the template code to
<span class="smalltext"><a href="misc.php?action=do_undorating&amp;tid={$thread['tid']}&amp;my_post_key={$mybb->post_code}">{$lang->undo_rating}</a></span>
Thanks .m., and yes, I just found that the problem was coming from the escaping in the template line as I was able to create the following template:

$db->escape_string('<span class="smalltext">[<a href="misc.php?action=do_undorating&amp;tid={$thread['tid']}&amp;my_post_key={$mybb->post_code}">{$lang->undo_rating}</a>]</span>')

The first part "$db->escape_string" does not need to be included into the template ? If yes, I would like to keep the escape_string as in an other thread in mybb one user was saying that without this, it lets the opportunity for users to do sql injection: http://community.mybb.com/thread-119263-...#pid861563

Is there a way to fix the plugin ? (if it is broken, i did not find any other thread on such problem with this plugin).

I'm currently searching on tutorial for escaping characters, how I could manage this.
actually it is not a problem with the escape string function. looks like showthread_ratethread template is not modified as required.
check if <!-- undorating --> is added to the template
It is not added to the template but the template "showthread_ratethread_undo" is not created too.

In the plugin file, the addition inside "showthread_ratethread" comes after the creation of the new template.

I can manage to obtain the field if I do these two steps manually.

If I change the part of the escape character in the plugin it works for the modification of "showthread_ratethread", I've used the following thing :


'template'	=> $db->escape_string('<span class="smalltext">[<a href="misc.php?action=do_undorating&amp;tid={$thread[tid]}&amp;my_post_key={$mybb->post_code}">{$lang->undo_rating}</a>]</span>'),

And it seems to work properly.

However even if it is working well, no "showthread_ratethread_undo" is not created as I was expecting. ^^"
Update:

What I was thinking to solve the problem did not solve it finally. It "i don't know why" works on a test forum I've created but if I use the same plugin file, it does not work on my updated forum (default template).
Nothing is modified in showthread_ratethread template and I don't find the template showthread_ratethread_undo.

Ok, now it's working again even without any modification.

I just don't understand why it's working only after numerous attempts, numerous modifications and numerous reuploads of the plugin files -________-
Update:
Merging to a new Mybb without importing the settings.

Still not working.
Is there anybody using this plugin ???

New test: Using firefox portable so no conflict with any extensions, fresh install of mybb, only one account created: administrator, I've allowed myself to rate my own thread ( http://community.mybb.com/thread-161059-...pid1109488 ).

Result: No modification of template "showthread_ratethread" and no creation of "showthread_ratethread_undo". --> it is created under "global templates", I was looking into default.

It is still not working... Undecided


It does not find the
</ul>
		</div>

I delete the space between these in the plugin file and in the template, works fine. Why it is not working directly ? I've tried to paste the variable directly from the template file and it's not working.
Just found this thread with the same problem. The issue that was causing the hide this thread icon not to work for me was the fact that we had a sub-template and not utilizing just the default template. It might be an issue on how the plugin was written or not to support sub-templates or that it is old.

Removing our sub-template and using just the default solved this issue and now the "Undo thread rating" is working again... just wanted to share after a few hours of agony.