![]() |
VB Plugins - Good Coding practices
Is there any good resource for the best practices when writing plugins?
I have written a few for my personal site so far, however I would like to get into the practice of using the available VB functions when doing this. For example, here is a snip of code Code:
$content = ""; Just small stuff like that....if there is a good reference around somewhere it would save me a lot of questions here :) Thanks |
1- ... it is $results = $db->query_read("writethequeryhere,not seperate!");
2- no need of the "$content<>""" is the $content is not an array... !empty($content) or simply $content would do in the if-condition... also, for a good way to code vBulletin, simply read vBulletin core files and comprehend the rules of their protocol.. it is clear. |
Check out the articles section. Some of your code could be better.
Eg. Code:
$query = "SELECT title, sid, summary, username, rid, unix_timestamp....... PHP Code:
while($story = mysql_fetch_array($results)) { More like while ($story = $vbulletin->db->fetch_array($results)) { Things like that |
I had been browsing the article section for a bit, but I was looking in the wrong area. Found this one that explains using $vbulletin->db
https://vborg.vbsupport.ru/showthread.php?t=119350 I can spend an hour looking...but as soon as I post the question I will stumble on the answer in 5 minutes :) Do you mean reading the source files when you say "simply read vBulletin core files"? I would rather not be digging deep into the php files for what are probably simple questions and answers if possible. Thanks for the feedback..now that I know where to look in the article section I will start reading up...need to learn how to add admin options and settings :) |
Turn on debug mode :). Then you can add settings easily
|
sure i suggest to read the source files... they are all built the same way, so you learn quickly
|
I agree with nexialys. Reading the source files is one of the best ways to learn. Many coders use that method
|
vBulletin has their Coding Standards available in the documentation:
http://www.vbulletin.com/docs/html/codestandards This could help you out a bit. :) |
damn, i hope you will crawl across your entire script before releasing 4.0, because a lot of these standards are not applied to the actual version.. lol (like it always had)
|
Thanks for the great feedback. My goal is to expand the eFiction bridge I threw together into a much tighter integration, and if I am going to do that I want to do it right :)
Working on setting up a test server for development on VMWare, that way I wont thrash my site while trying to do this ;) |
All times are GMT. The time now is 01:20 AM. |
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:
|