PDA

View Full Version : need help making my 1st simple plugin


Power_user_EX
10-09-2011, 01:54 PM
hello ,
I want to add a custom field in the postbit. To get the data I need to run an sql query on table reputation. The result of the query will be an interger (i.e count).

So how do i register a template variable in php and access that in template code ?

What must be the necessary files to be included to make the plugin ?

-Regards ,
Power_user_EX

Lynne
10-09-2011, 09:04 PM
Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)

Are you sure you need to actually run an individual query for each postbit (that's 20 extra queries per page) instead of just hooking into an existing query for $post?

Power_user_EX
10-12-2011, 07:05 AM
Thx Lynne... for the link :D Will go through it asap. Also do you know ny article which mentions what all info is present in $post and to access the same.

Lynne
10-12-2011, 03:27 PM
If you go to the showthread.php file, you'll see the query that will create the $post variable around line 943.