Hi all,
Currently i have two plug-ins to count "Top Tips" that are submitted by a form to a specific forum, every member of my forums has a "My Top Tips" count in their info bar along with a button to submit more if they wish.
My problem is they can submit a tip and the count increases fine, so mine shows 5, joe bloggs will show 3....etc however if the post is deleted the figure doesn't decrease and i have to go to the database and change the count manually, can anyone tweak my plugins to do this automatic please?
Quote:
Originally Posted by 1st plugin:
PRODUCT: VBulletin
HOOK LOCATION: postbit_display_start
EXECUTION ORDER: 5
PHP Code:
eval('$template_hook[postbit_userinfo_right] .= " ' . fetch_template('postbit_ctoptip') . '";');
|
Quote:
Originally Posted by 2nd plugin
PRODUCT: VBulletin
HOOK LOCATION: newthread_post_complete
EXECUTION ORDER: 5
PHP Code:
if (in_array($foruminfo['forumid'], array('52'))) {
$db->query_write("UPDATE vb_user SET ctoptip = ctoptip + 1 WHERE userid=" . $vbulletin->userinfo['userid']);
}
|
and this is the content of the template postbit_ctoptip
PHP Code:
<if condition="$post['ctoptip']>= '1'">$post[ctoptip] Top Tips<br /></if>