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] Add Options per forum
![]() |
| | #1 |
| |
Status: Offline What this is This guide will teach you to use the hooks system to add options to your admincp/forum.php page. One finished, you will be able to add new options to your forum with just a few lines of code. Don't understand? Ever wanted to turn something on, but only in one of your forums? For example, lets say you want to execute code, but only in forum I.D. 2, 16, and 45. Lets begin! In this tutorial we will assume that you want a yes or no option; in order to enable/disable some code. In order to do that we first need to create a new row in the database. This will hold the information of which forums will be enabled/disabled. Always remember that '1' is considered as on, or enabled. And that '0' is considered off, or disabled. Please make sure this is all done on a test forum! We have to store the data! Run this SQL Query: Code: ALTER TABLE forum ADD (
var smallint(3) unsigned not null default ''
)
Now that we have added our new row named 'var'. We now have to add the on/off option in the forums manager area of the admin control panel. Add the option in the ACP To add this new option in the ACP we need to create a new hook and add some code to that hook. The hook name should be: forumadmin_edit_form And the code should be: PHP Code: That will actually add the yes/no row to all your forums in the admincp. So when you click on the save button, it will add your selection to the database. But how does it know which row to add it to? Glad you asked. You have to create one more hook! The hook name should be: forumdata_start And the code to add there is the following PHP Code: I want to add more then just one option! Then you will need to repeat this tutorial for each option you would like to have. Now that you have saved both hooks. You can now use the following code in any of your hooks. PHP Code: HTML Code: <if condition="$foruminfo['var'] == 1"> <!-- Your Code Here --> </if> If you have 2 or more options being added to the forums, you can place all the code in each hook. For example: Hookname: forumadmin_edit_form Code: PHP Code: Code: PHP Code: Custom Fields The following fields can also be used. PHP Code: PHP Code: PHP Code: ![]() This tutorial was created for a member who needed to know how to do this exact thing, so I figured I would teach everyone. :p Ken Iovino / Escalate Media |
|
| | #2 |
| |
Status: Offline Nice guide. Very useful for comparing the changes of vB 3.0.x to 3.5 . |
|
| | #3 | |||||||||
Location: Israel Age: 29 ![]() |
Status: Offline another GREAT valuable tutorial guide, as always. nice work m8 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 | |||||||||
|
| | #4 | ||||||||
| vB Newbie
![]() |
Status: Offline Nice post and easy tut to get a fast grip of coding for 3.5 Thanks a'lot | ||||||||
|
| | #6 |
| |
Status: Offline Thanks, very useful..... but how would I go about creating a completely seperate page in the admincp so I can control my featured artist set-up? is it another php page and then what? |
|
| | #7 |
| |
Status: Offline Coding the ACP is the hardest aspect of vB due to the way it works and bugger all for custom coding. |
|
| | #8 |
| |
Status: Offline Instead of running a SQL query could I use: $db->query_write("ALTER TABLE " "forum ADD (Variable smallint(3) unsigned not null default '' )"); in the install section for a products install code? what would be the uninstall code for that? $db->query("DROP TABLE `" "Variable`;"); Last edited by HDRebel88; 08-09-2006 at 10:56 AM. |
|
| | #9 |
| |
Status: Offline Wow, thanks. Nice tutorial LiveWire, Deffinately helped me! ![]() Adrian |
|
| | #10 |
| |
Status: Offline thanks for the tut nice work hope to see more |
|
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [How To] Run a Query | Ken Iovino | vBulletin Modification Tutorials | 9 | 07-30-2008 05:29 AM |
| [How To] Run a vb page outside of the forum directory | Junior | vBulletin Modification Tutorials | 7 | 01-10-2007 10:05 PM |
| How i add google ad to forum index? | hkboi | Off Topic | 2 | 03-22-2005 10:36 AM |
All times are GMT. The time now is 05:18 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.























. 







