PDA

View Full Version : Simple plugin code help.


rob30UK
11-23-2005, 05:17 PM
I have a plugin question.

I need to create a plugin to fill a variable from the database.

I added an extra field called resource_url to the forums MySQL table. For the mod I'm doing, each forum has a resource url associated with it

I need a plugin (I'm told on the on hook: forumdisplay_complete) to pull out the data from that database field and put it in a variable, so i can use it in templates.

That is my main requirement.

If there was also a way I could populate the field using the forum manager then that would be Excellent.... but I can live with editing the DB directly if need be.

Thankyou for any help!

Marco van Herwaarden
11-23-2005, 08:48 PM
If you add the field to the forum table, there is no need to create a plugin to show it. Just add it to your template.

Adding it to the forum options in the admincp involves a bit more coding.

rob30UK
11-23-2005, 09:58 PM
Marco.... I know I'm just a dense Noob when it comes to PHP (I'm an ASP man), but how do I show it?

Do I use $foruminfo[MYFIELDNAME] ??

merk
11-23-2005, 10:37 PM
Yes. $foruminfo is filled with the query:


SELECT *
FROM " . TABLE_PREFIX . "forum
WHERE forumid = $forumid