The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Create pages for the AdminCP
I was going to spend some time researching this, so I figured I could help some people save time by writing it down. This is not a full tutorial, more of a kick-off, and its aimed at developers. How to add a link to the AdminCP left side navigation: Please refer to KirbyDE's [How to] Add entries to AdminCP Navigation Menu (in 3.5) thread. Basic AdminCP page code: PHP Code:
This is the basic code. Its already password protected, so if you create a myscript.php with that code and upload to the "admincp" folder, you can call it from a browser and it will ask for the admin password. You can use "ignore_user_abort(true);" as described in this post. You can use can_administer() to check for admin permissions, 'canadminstyles' in this case: PHP Code:
(to-do: describe print_cp_header() optional parameters title, onload, headinsert, marginwidth and bodyattributes defined in adminfunctions.php) You can put anything you like inside the html page. vBulletin has a good number of standard functions that builds the html code for you. These functions can be found in "admincp/adminfunctions.php" (thanks Zero Tolerance for pointing it out). Im going to describe them in this how-to as time lets me. Creating a message box with a "go back" link: example image PHP Code:
In this example the page will be redirected to Google in 10 seconds. PHP Code:
Creating a table: example The standard table has 2 columns. PHP Code:
Function "print_table_footer" parameters (from adminfunctions.php) Quote:
Creating a form: vBulletin has standard functions to build forms. You call "print_form_header()", which opens the form and table tags, call a few functions to build the form inputs, and then close the form with a submit button row. An empty form example PHP Code:
Quote:
Input functions for a table: Here I'll use common examples, but each function has a set of parameters that should be read in "admincp/adminfunctions.php" if you are going to use them. Text input example PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
Other functions to use inside tables: Description row example PHP Code:
PHP Code:
PHP Code:
PHP Code:
Submit / Reset buttons row: This closes the form and table tags, so you don't have to use "print_table_footer" with it. Submit and reset buttons example PHP Code:
PHP Code:
seems I underestimated the ammount of work. should I bother finishing this? gotta work on this more later anyway. trying to keep the second post for myself... nope automerges not sure the best formatting... playing around... |
#22
|
|||
|
|||
ok, Thank's, But how can I save it into the DB and use it on the tamplates? (Like FORUMDISPLAY).
|
#23
|
|||
|
|||
excellent, thank's
|
#24
|
|||
|
|||
Is there a way to add an image to the right of an input row some how?
Here is my input row: PHP Code:
PHP Code:
Steve |
#25
|
|||
|
|||
is there a way to restrict a dropdown to one part of the "print_cells_row"?
I'm looking to create a row with a few dropdowns in it...I can't seem to find anywhere where it says you can do that. Looks like you can only stack dropdowns on rows. |
#26
|
|||
|
|||
first thank you very much for this article.. really handy!!
and some of the link attachment images are broken, check out wich one: Text area -> attachment.php/?attachmentid=27190 https://vborg.vbsupport.ru/attachmen...chmentid=27190 Yes / No / other radios -> attachment.php/?attachmentid=27275 https://vborg.vbsupport.ru/attachmen...chmentid=27275 "Yes" radio -> attachment.php/?attachmentid=27276 https://vborg.vbsupport.ru/attachmen...chmentid=27276 Multiple radios -> attachment.php/?attachmentid=27273 https://vborg.vbsupport.ru/attachmen...chmentid=27273 Select -> attachment.php/?attachmentid=27189 https://vborg.vbsupport.ru/attachmen...chmentid=27189 Single checkbox -> attachment.php/?attachmentid=27270 https://vborg.vbsupport.ru/attachmen...chmentid=27270 Password -> attachment.php/?attachmentid=27272 https://vborg.vbsupport.ru/attachmen...chmentid=27272 Date -> attachment.php/?attachmentid=27274 https://vborg.vbsupport.ru/attachmen...chmentid=27274 Submit and reset buttons -> attachment.php/?attachmentid=27143 https://vborg.vbsupport.ru/attachmen...chmentid=27143 |
#27
|
||||
|
||||
Thanks, this article is so old I can't remember how to do pages for the admincp anymore :P
j/k, but I have no intention of updating the images. they should be in this thread somewhere. |
#28
|
|||
|
|||
Ok, sorry for that...
also, just for those that wonder, here is the code for hidden fields: PHP Code:
|
#29
|
||||
|
||||
No problem, glad it was of help.
Anyone can take this article and redo it, add more info and repost it if they want. I won't be updating it. |
#30
|
||||
|
||||
Quote:
PHP Code:
|
#31
|
|||
|
|||
Where will the rows INSERT to?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|