vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Create pages for the AdminCP (https://vborg.vbsupport.ru/showthread.php?t=83122)

hangoutforums 04-01-2006 04:29 PM

to view the examples you can just view the attachments at the bottom of dream's post.

This is a really useful tutorial, thanks

antialiasis 05-02-2006 10:16 PM

Does anybody have a guide like this for making Mod CP pages? I'm a bit confused...

melefire 05-20-2006 07:22 PM

thanks, very useful

-=Sniper=- 05-20-2006 08:07 PM

excellent, try to keep it updated :)

rogersnm 05-22-2006 05:18 PM

Hey can anybody answer this?

https://vborg.vbsupport.ru/showthread.php?t=116382

Kirk Y 05-27-2006 03:16 AM

Is it just me, or does adminfunctions.php not exist?

Adrian Schneider 05-27-2006 04:04 AM

Quote:

Originally Posted by acidburn0520
Is it just me, or does adminfunctions.php not exist?

It is in the /includes directory.

Kirk Y 05-27-2006 04:15 PM

Ah-ha! Thanks. Is there some easier way to get the information that Dream got from adminfunctions.php without having to read through all the file's code?

Quarterbore 11-20-2006 02:42 AM

HOW TO ADD CHECK BOXES!

Disclaimer: There may be better ways to do this but I searched quite a bit and finally hacked this together using some basic PHP!

About this example: In this example I am going to work with results from a database query. This is a worst case example (I think) so anybody should be able to figure it out for a simpler case.

Page 1: This is the form that the Admin Adds the data to!

PHP Code:


$cell
[1] = 'This is a Demo!<dfn> Imagine you had a list of options (usergroups perhaps).</dfn>';

        
//Following is an example of data already saved (perhaps called back from a database)
        
$selected_OPTIONS 'Radio|Power Brakes|V8|4x4';

        
//Following is a query to get a list of ALL options that are possible
        
$checkboxs_get mysql_query("
                SELECT option, optionid, display
                FROM " 
TABLE_PREFIX "demo
                ORDER BY display

        //Need to Start to Build the Checkbox DIV
        
$checkbox_options = '<div align="left">';

        //Loop through the Possibilities from the database
       while (
$checkbox = mysql_fetch_array($checkboxs_get))
    {
          //  If the checkbox was selected before, we need to define 
$checkboxselected
          if (in_array(trim(
$checkbox[option]), $selected_types))
         { 
$checkboxselected = "checked=\"checked\""; }

          
// Need to create this option for the checkbox list
          
$checkbox_options .='<input type="checkbox" name="option[]" value="' $checkbox[optionid] . '"' $checkboxselected '>' .  $checkbox[option] . '<br />'
    
          
// Need to clear the $checkboxselected for the next pass!
          
$checkboxselected ='';
    }

        
// Need to Close the Checklist DIV
        
$checkbox_options .='</div>';

$cell[2] = $checkbox_options;

print_cells_row($cell); 

Page Two - This is the page that receives the data!

PHP Code:

foreach($_POST['option'] as $value) {
$selected_options .= $value;
$selected_options .= '|';
}
// From Here you would likely want to save the data in your database!

$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "demo SET options = '$selected_options' WHERE some_field = $something"); 


jerudc 12-14-2006 02:57 PM

you can use can_administer() to check
the following bitfield permissions

[ismoderator] => 1
[cancontrolpanel] => 2
[canadminsettings] => 4
[canadminstyles] => 8
[canadminlanguages] => 16
[canadminforums] => 32
[canadminthreads] => 64
[canadmincalendars] => 128
[canadminusers] => 256
[canadminpermissions] => 512
[canadminfaq] => 1024
[canadminimages] => 2048
[canadminbbcodes] => 4096
[canadmincron] => 8192
[canadminmaintain] => 16384
[canadminupgrade] => 32768
[canadminplugins] => 65536


All times are GMT. The time now is 10:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01359 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete