![]() |
How do I make a vbulletin plugin ?
How do I 'make' a plug in ?
Sorry I did not grasp how vbulletin works yet. On the top of my forum ( next to the logo ) at http://my.lifeinitaly.com I want to add a piece of php code that selects 4 / 5 random images. I hove the code and it works : you can see the images here http://my.lifeinitaly.com/images.php ( the code is below ) - I need then to add something to the header template but what and how ? I could not find any instruction on how to built a plugin <?php $host = 'localhost'; $dbUser = ''; $dbPass = ''; $db = 'photopost'; mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error()); mysql_select_db("$db") or die(mysql_error()); $result = mysql_query("SELECT id,cat,bigimage,width,height FROM pp_photos WHERE storecat = '0' and width > height ORDER BY rand() LIMIT 6" ) or die(mysql_error()); $imgs1=''; while($row = mysql_fetch_array( $result )) { $imgs1 = $imgs1 . "<a href=\"/photopost/showphoto.php?photo=" . $row['id'] . "\"><img width=105 height=75 src=\"/photopost/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\" border=\"0\"></a>"; } print $imgs1; ?> |
How to make a plugin instructions can be found on this board. Do a bit of searching. Really, you just did the equivalent of logging onto a php site and asking "how do I code in php?"
Here is a couple of pointers... If you import global.php into your script you have access to the $vbulletin object, including the $vbulletin->db object which is already connected to your database and comes with a bunch of helper functions vbulletin uses a template system, which means it separates php and html. It is rare you concatenate some html and print it, much more likely you eval template. Do some research, ask a specific question. |
Quote:
I tried searching the following: - make plugin - how do i make a plugin - plugin - vbulletin plugin All I get is pages and pages of mods, articles or programming discussions that tell me everything except how to make a plugin. So when someone does search around here for how to make a plugin, he gets no help. :confused: Since you seem to know where to find it, how about helping by telling? Please? |
|
Okay, the vB manual is a good resource, and I'm guessing there isn't a standalone article that explains it? At least you pointed me in the right direction. Thanks.
|
All times are GMT. The time now is 08:08 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|