vBulletin Modifications Follow us on twitter

[How-To] Simple hack development stages

Hey there! Welcome to vBHackers.com! A community for vBulletin enthusiasts to share modifications and offer each other support.
vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support > vBulletin Modification Tutorials

Reply
 
LinkBack (4) Thread Tools
Old 08-28-2006, 03:44 PM   4 links from elsewhere to this Post. Click to view. #1
Idan
Coder
Idan's Avatar
Join Date: Feb 2005
Real Name: Idan B.
Location: Israel
Idan is on a distinguished road

Post [How-To] Simple hack development stages

Hello,

i'm writing this small & simple "beginners guide" tutorial (was requested by garg @ http://www.vbhackers.com/showthread.php?t=5109).

step #1
Have some hack idea (we'll get back to it later on) :p

step #2
next stage should be to put your forums into "debug mode". for that you have 2 ways to do so:
1. edit your config.php file (under /includes/ dir) to add this line:
You must first be a registered member to view any code.
2. download the wonderfull hack LiveWire made called VbDebug.
(vBDebug Options)
then just install it, and under admincp -> options you should have options to turn debug mode on/off.

step #3
We'll create first the product.
go into admincp -> plugins and products - >manage products

below you should see [Add/Import Product], click it & you'll get this screen:

fill product id, title, version & description.
you can leave blank the product url & check version url fields.
note that product id cannot be changed after it's created.
when done just click on save & now we have some product to start work with.

step #4
for most hacks, you'll require at some point to store for it some options. that can either be simple as "enabled ? yes/no", or some other customized input that your hack requires.
to add an option, login into admincp, there go into "Vbulletin options -> vbulletin option":

now you should see something like this:

click on it (Add new settings group) & you should see this:

just fill the fields. for product choose the product we've created in the previous step we made.
when done you'll get this:

here you can add/edit all the options you need for this group.
i'll post later more details guide about that if needed, but lets for example add a yes/no option.
so click add setting and in screen, fill for example like this:

note instead of choosing product "vbulletin" (like in the picture), just choose your product you've created in step #3.
when done hit save button on bottom, and we've made our first option var for this product.
note that this option/var can be later access from any "hook" (will be explained in next step briefly) via using this kind of code:
You must first be a registered member to view any code.
repeat this step till after you added all the options (vars) you think your new modification will require.

step #5
hooks system/plugins:
since version 3.5.x jellsoft provided easy way to add code without any need to update core system files.
in order to make your modification work, you'll need to add some php code to it. this where you need to think where do you want it placed.
if for example you want something to be done after every new thread started, then it would be logical to add it into newthread_xxxxx hook.
there is a big list of hooks, you don't have to remember it all - just browse the list.
to add new plugin, just go into admincp -> plugins and products -> plugin manager.
on the bottom you should see link [Add New Plugin] .
click it. again select your product name.
now under Hook Location choose the prefered hook location.
write some title for it. you can leave excution order with the default value of "5", unless you have several plugins under same hook and needs something to be done before the other, in that case just number it like the order you want (1 is done first)
and inside Plugin PHP Code just write your main code (php code).

note that any php code is valid, in addition i'll provide with some common code fragements to help you through coding:

common vbulleltin arrays:
1. you can access the current logged-in userinfo data using
You must first be a registered member to view any code.
so for example $vbulletin->userinfo[userid] will hold his id, $vbulletin->userinfo[username] his name/nick & so on.
2. another common array usefull is the $foruminfo[] - that holds some information about the current forum you're browsing.
so for example $foruminfo[forumid] will hold the forum id of the forum user is currently browsing (assuming you're inside forum hooks)

common vbulleltin mysql connections:
read from db:
You must first be a registered member to view any code.
write/update to db:
You must first be a registered member to view any code.
also check LiveWire datastore tutorial @ Cache System Explanation (datastore) for more information regarding that.

step #6 (optional)
if your modification contains any new templates, then be sure to make those under the admincp -> style and templates -> style manager
expand view for the skin you're using and add template you need.
Note that php vars will be available under the templates that work with the hooks. so if for example you change forumhome template, and you have inside forumhome_xxx hook php var, you will be able to do some conditional check inside the templates.

common vbulletin function to help you with when working under templates - "IF condition":
You must first be a registered member to view any code.
anyway, this is about all i have to write for this tutorial.
this pretty much cover making new modification from idea till coding stage.
i've tried to point out few common stuff to get you going.
be sure to check other great tutorials posted here & at vb.org.

hope this helps :classic:
__________________
vBHackers.com - vBulletin Modification Community

Last edited by Idan; 08-28-2006 at 04:11 PM..




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 08-28-2006, 03:53 PM   #2
vB Newbie
Join Date: Aug 2006
garg is on a distinguished road

Default

wow Thank you very very much. This is great and very helpful! It cleared up a lot of stuff for me :notworthy:




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-28-2006, 04:05 PM   #3
Michael Biddle
Staff
Michael Biddle's Avatar
Join Date: Feb 2005
Real Name: whitemike
Location: Anaheim
Michael Biddle is on a distinguished road

Default

Awsome tut dude
__________________
Support will only be offered through forums
Michael Biddle / vBHackers.com
vBSEO 3.3.0 Gold Released with New "Virtual HTML Display" Feature Available for download now

vBSEO Google Sitemap Generator - Version 2.5 Released

Crawlability Network: vBulletin SEO | vBulletin Hackers




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-28-2006, 04:12 PM   #4
Idan
Coder
Idan's Avatar
Join Date: Feb 2005
Real Name: Idan B.
Location: Israel
Idan is on a distinguished road

Default

fixed some typo in the vbulletin mysql code, missed "-" (->).
__________________
vBHackers.com - vBulletin Modification Community




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-28-2006, 06:31 PM   #5
Butcher
Administrator
Butcher's Avatar
Join Date: Oct 2004
Real Name: Dava
Location: lake district, england
Butcher is on a distinguished road

Default

great tutorial m8
willhelp alot of people this
__________________
The Red Lion - Your online pub




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-03-2006, 09:52 AM   #6
Rez
vB Newbie
Join Date: Aug 2006
Rez is on a distinguished road

Default

Thanksalot for this tutorial!




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-30-2006, 05:20 PM   #7
Coder
BamaStangGuy's Avatar
Join Date: Jun 2006
BamaStangGuy is on a distinguished road

Default

Very nice tutorial!




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-30-2006, 05:27 PM   #8
Joe Ward
Administrator
Joe Ward's Avatar
Join Date: Aug 2005
Joe Ward has disabled reputation

Default

I discovered this via a linkback. Great tutorial.
__________________
Joe Ward / vBHackers.com
vBSEO 3.3.0 Gold Released with New "Virtual HTML Display" Feature Available for download now

vBSEO Google Sitemap Generator - Version 2.5 Released

Crawlability Network: vBulletin SEO | vBulletin Hackers




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-09-2006, 01:29 PM   #9
Vb Geek!
Join Date: Aug 2006
Real Name: Farooq Azam
Location: Pakistan
farooqaaa is on a distinguished road

Default

thanks alot, its very helpful.

I learned a lot from this tut . And now just wait for my first Mod ;). hehe not joking




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-10-2006, 04:17 PM   #10
Coder
MadK's Avatar
Join Date: Nov 2006
Real Name: Leo J
Location: Canada
MadK is on a distinguished road

Default

Thanks a lot!




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



LinkBacks (?)
LinkBack to this Thread: http://www.vbhackers.com/f80/how-simple-hack-development-stages-5111/
Posted By For Type Date
How do I create my own mods? any tutorial to get me started? - vBulletin.org Forum This thread Refback 01-29-2007 08:47 PM
How do I create my own mods? any tutorial to get me started? - vBulletin.org Forum This thread Refback 01-29-2007 08:43 PM
Excellent Article on getting started with vBulletin Hacking - vBulletin Zone This thread Refback 12-01-2006 10:31 AM
Excellent Article on getting started with vBulletin Hacking - vBulletin Zone This thread Pingback 10-30-2006 05:19 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[How To] Run a Query Ken Iovino vBulletin Modification Tutorials 9 07-30-2008 02:29 AM
[How To] Run vBulletin On your P.C. Ken Iovino vBulletin Modification Tutorials 81 12-15-2007 02:50 AM
Install System Part 2 Ken Iovino Announcements 10 05-19-2005 10:40 AM


All times are GMT -3. The time now is 01:41 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc. (Patent Pending)