vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do I make a vbulletin plugin ? (https://vborg.vbsupport.ru/showthread.php?t=155133)

nascimbeni 08-13-2007 05:34 PM

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;
?>

Eikinskjaldi 08-13-2007 08:38 PM

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.

cbiweb 03-09-2009 01:02 PM

Quote:

Originally Posted by Eikinskjaldi (Post 1316820)
How to make a plugin instructions can be found on this board. Do a bit of searching.

Can you direct me (and anyone else) to where it is? I tried searching and got pages of results that do not take me where I want to go. (and I didn't even find this thread by searching here, I got from Google! :rolleyes: )

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?

Marco van Herwaarden 03-09-2009 01:09 PM

In the manual: Plugin System
And in our Articles section.

cbiweb 03-09-2009 01:31 PM

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
  • Page Generation 0.01112 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete