PDA

View Full Version : how to know "which hook" ?


zodehala
01-24-2007, 07:12 PM
i try to create new plug-in to fetch (show in postpit) thread count which is posted by X

posbit_legacy :

$vbphrase[total_posts]: <strong>$userinfo[posts]</strong> | Total threads: <strong>$threadcount[count] (<phrase 1="$postsperday">$vbphrase[x_posts_per_day]</phrase>)


hook : showthread_postbit_create

$threadcount=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE postuserid = '$userinfo[userid]'");


but do nothing , and following error
Fatal error: Using $this when not in object context in /forum/showthread.php(1044) : eval()'d code on line 2


how can i know (find out) which hook will i use ? any read me ? any referance ?

paul41598
01-24-2007, 07:30 PM
try postbit_display_complete

zodehala
01-24-2007, 07:56 PM
try postbit_display_complete


Fatal error: Call to a member function query_first() on a non-object in forum/includes/class_postbit.php(296) : eval()'d code on line 1

paul41598
01-24-2007, 07:58 PM
do um:


global $vbulletin;

$threadcount=$vbulletin->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE postuserid = '$userinfo[userid]'");

See if that helps