Member Log In
Site Navigation
Latest Modifications
- [vB 3.8.4] THX - Hack for VB. 3.8.4
By: bluedog - [vB 3.8.4] Cyb - Chatbox V.2.3
By: bluedog - [vB 4.0.x] PHPKD - Advanced Quick...
By: PHPKD - [vB 3.6.x] StopSpam
By: flappi282 - [vB 3.8.x] vBulletin Chat Addon for...
By: 123flashchat
Latest Template Mods
- [vB 4.0.x] Remove My Profile Link...
By: Ak Worm - [vB 3.8.x] Images DownloadBox...
By: cRs!MP - [vB 3.8.x] Adviertise Mod On Forum...
By: MG4 - [vB 3.8.4] Images PassWordBox...
By: cRs!MP - [vB 3.8.4] Footer Follow Ups
By: Ak Worm
Latest Styles
- [vB 4.0.x] 4.0.3 - VB4STYLE-TWEETA...
By: Belon - [vB 4.0.x] [4.0.3] vbdesigns.de...
By: Belon - [vB 3.8.4] CompletevB - Skylight
By: DreadKnight - [vB 3.8.3] [vB 3.8.4] Barcelona...
By: hoiquantinhoc.com - [vB 3.8.3] Natures Walk by vBSkin...
By: Chri5
Latest Graphics
- [vB ] [anim.]Team Ranks
By: cRs!MP - [vB ] Abstract Circles (3...
By: cRs!MP - [vB ] PlayStation Rank Images
By: cRs!MP - [vB 3.6.12] Heavy Stroked Button...
By: Shelley - [vB ] Minature Ranks.
By: Shelley
vBulletin Modifications »
General vBulletin Section »
vBulletin Modification Tutorials »
[How-To] Advanced hack modification development stages - Guide #1
![]() |
| | #1 | |||||||||
Location: Israel Age: 29 ![]() |
Status: Offline [How-To] Advanced hack modification development stages - Guide #1 Hello everyone, This guide has been long due. My previous guide [How-To] Simple hack development stages got alot of good feedback from this community, but it lacked more advanced topics. This guide is going to be first of many to come in near future, that will guide one through complete hack development, from concept to develop & actual coding stages on the vbulletin system. My goal in these guides is to give people a complete in-depth view of steps made so they may have refrence of how's it being done. This guide is complete walkthrough of development made of my last hack release Thread Promotion System that was developed according to request made @ [PAID REQUEST] Thread Promotion System So, lets get going: This guide assumes the following:
Development stages:
1. Modification Idea: as request mentioned, he wanted a system that would allow him to set forum as being able to have "thread promotion" inside it. Which actually means once reply count passed XX it will automatically moved from forum A to B. The above description tells us 2 things:
Analyze & Process Information: (1) Mod appearance on admincp (& Hook Location): With above said, right now the coder should "see" the modification in his mind. Knowing you'll add some section under "Forum Manager" as you want it to be intergated in way every new forum add or edit will allow you to set it. & you need some code to perform the check. This will later on be "translated" to "forumadmin_edit_form" hook code. (2) Mod Core Code (& Hook Location): Since idea speaks of "if reply count > XXX" common sense suggest this should be implanted right after a person finished to post new reply. As right then we can "ask" what was the reply number & have we passed the mark we aimed for. And if we did - do your "magic". This will later on be "translated" to "newreply_post_complete" hook code. (3) Possible pitfalls & consideration points in code:
In general you should know the structure of your vbulletin (at least the common tables that construct it). In our case: we are most likely to need some info (either fetch or set) from 3 tables : "forum", "thread", "post". these tables have parent-child relationshionship structure similar to following: forum -> thread -> posts (thread has forum parent id, post has thread parent id)
As reminder, we came to conclusion we will need the following information "present" for us:
"Enable" filed that will act as BOOLEAN (true/falsE). "Reply Count" field of int type. "Forum ID" field of int type (says to us which is the target forum to be moved thereads onto. Lets get to business, logon on your phpmyadmin, go to table "forum" & add 3 new fields: ![]() And screen after fill these: ![]() Once made, you'll see this screen: ![]() Please "save" the (copy & paste to some place, will be used later) the ALTER query, as we will need it to the install code: The query should be like the following: Code: ALTER TABLE `forum` ADD `enable_thread_promotion` TINYINT( 1 ) NOT NULL , ADD `reply_count_for_promotion` INT NOT NULL , ADD `target_forum_id` INT NOT NULL See my previous simple guide on details how it's made. This can be done either from config.php or install some plugin for it. 4. Create Product: Go to Admincp, from side nav select "Plugin & Products" -> "Manage Products" : ![]() Select "Add/Import Product": ![]() On the "Add New Product" screen fill the information as demonstrated in the following picture: ![]() When done, click "Save". Once product added you should see following screen: ![]() 5. Add Plugins: As discussed @ section 1, we will have in this modification 4 plugins/hooks.
So, lets start add them one by one: Admincp hook: From Admincp: "Plugins & Products" -> "Plugin Manager": ![]() Then select "Add new plugin": ![]() Then we fill the fields as shown in this picture: ![]() The code that was placed onto this hook is: PHP Code:
Data Manger Field Support hook: In the same way add another plugin, this time select "forumdata_start" as hook location. In there add code as shown in the next picture: ![]() Core Code hook: In the same way add another plugin, this time select "newreply_post_complete" as hook location. In there add code as shown in the next picture: ![]() I dont want to make this "monster post", You can get full source on the modification, i'll just put the following notes:
Core Code AJAX hook: This is exact copy & paste of previosu hook, just place it on "newreply_post_ajax" as hook location. ![]() At this point all plugins should be complete: ![]() 6. Testing Code: Check the code on your forum. Through it you'll find pitfall you didnt think about. In this case for example the reply count was zero-based, so i had to add -1 factor on code. These sort of things can only be found while you "hands on" code & test it, so dont be afraid ! Also general tip, if certain code not working, try to place php die("soem text"); on certain key points to tell if the code executed till that point. That can help to debug certain things. 7. Add Install/Uninstall Code: On Admincp go to "Plugin & Products" -> "Manage Products" & edit the current product we just did: ![]() Now we'll add the install/uninstall code, which is the db changes (add fields for install & drop fields for uninstall). Now it's time to use that ALTER query we wrote while back. Note the DROP query can be obtained from phpmyadmin as well. ![]() Then you will see this: ![]() When you have both MYSQL queries we can add it to product as shown here: ![]() All thats left now is to export & save ![]() 8. Export & save hack: From "Product Manger" choose export as seen here: ![]() Then save it on your directory: ![]() That's IT !! ![]() Congratulations, if you followed all this (long) guide, you have now made your hack successfully ![]() Dont forget to share back with community your work. I hope you appreciate the effort made here in writing this long tutorial (took me about 3 hours to write it). I did my best to cover all aspects & stages made, step-by-step, with screenshots for every step. If anyone has any further questions, post them here & i will help gladly. Enjoy Regards, Idan. * Support will only be given via forums ! * If this post solved/aided your problem, please click "mark as aid" / "mark as solution" as explained in here Last edited by Idan; 05-09-2009 at 10:23 PM. Reason: typos fixed | |||||||||
|
| | #2 | |||||||||
Location: Anaheim Age: 22 ![]() |
Status: Offline Extraordinary tutorial Idan. Thanks for sharing! Support will only be offered through forums Michael Biddle / vBHackers.comvBSEO 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 | |||||||||
|
| | #4 |
| |
Status: Offline Outstanding! I posted a few words and link to it on my help site, fantastic guide. |
|
![]() |
« [How-to] Make Custom Profile Fields show in Postbit
|
[How-To] AJAX in your Mods - In 5 simple steps »
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [How-To] Simple hack development stages | Idan | vBulletin Modification Tutorials | 14 | 04-22-2009 05:59 AM |
| Hack Installs / Working - Suggestion | VirtualBurn | Site Feedback | 11 | 08-16-2006 07:01 PM |
All times are GMT. The time now is 06:28 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.















































