vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Admin CP (https://vborg.vbsupport.ru/showthread.php?t=200286)

Hex_legend 12-31-2008 01:13 PM

Admin CP
 
I am looking to learn how to code pages and options for the admin control panel.

So far, I have:

Hack Enabled - Yes | No
Which Layout - Layout 1 | Layout 2

Submit.

I can't seem to work out how to submit it (as there is no location to submit to) and how to actually get the hack to enable if enable is selected etc.

I have read the article here

But now I am still really stuck. Can anyone offer any guidance?

Lynne 12-31-2008 03:24 PM

Are you just talking about adding settings for your product? If so, you just go into debug mode and add them.

Hex_legend 12-31-2008 04:05 PM

I'm in Debug mode.
Added the product
Uploaded cpnav_xxxx.xml
Uploaded profiles_admin.php into admincp/

Just stuck on how to get the features working.

For instance - Hack enabled (yes) turns it on
Hack enabled (no) turns it off

Profile Layout 1 - Uses layout 1
Profile Layout 2 - Uses layout 2
Profile Layout Unchanged - Uses vBulletin Layout

Lynne 12-31-2008 04:27 PM

Well, now you need to use those variables to do what you want. They are settings like any other setting in vbulletin. So, you have $vbulletin->options['youroptions'] in your php and $vboptions['youroptions'] in your templates.

Hex_legend 12-31-2008 04:30 PM

All my php file has is:

PHP Code:

<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
@
set_time_limit(0);
 
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('style');
$specialtemplates = array('products');
 
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(
DIR '/includes/adminfunctions_template.php');
 
print_cp_header();
 
 
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminstyles'))
{
    
print_cp_no_permission();
}   
 
print_form_header('myscript');
print_table_header('MySpace Profile Add-On Options');

print_radio_row('MySpace Profiles Enabled?''inputname', array( 'yes' => 'Yes'
'no' => 'No' ));

print_radio_row('If Yes, Which Profile Layout?''inputname', array( 'profile 1' => 'Old Profile Layout'
'profile 2' => 'New Profile Layout' ));

print_submit_row("Submit");  
 
 
 
 
 
print_cp_footer();
?>

there is no template edits yet

Lynne 12-31-2008 04:34 PM

You also don't seem to be doing anything with the inputs from your form. You have a form with a submit button that does nothing.

Hex_legend 12-31-2008 04:53 PM

This is what I am asking.
How do I get it to do things?
Is there anymore articles out there that help with this kind of thing?
Same with plugins / hooks etc.

Lynne 12-31-2008 05:05 PM

Best way to learn is to find a modification that does something similar (in this case, does something in the admin cp) and then see what they did.

Dismounted 01-01-2009 03:54 AM

Coding in the Admin CP is very different to "normal" coding in vBulletin. It is very much like "beginner PHP", where you echo one thing, process the next, then echo it again.

Hex_legend 01-01-2009 12:33 PM

Quote:

Originally Posted by Dismounted (Post 1698322)
Coding in the Admin CP is very different to "normal" coding in vBulletin. It is very much like "beginner PHP", where you echo one thing, process the next, then echo it again.

Which do you think would be the easiest mod to look at to see how to get the hack to enable etc.

Dismounted 01-02-2009 03:14 AM

Why not use the default "vBulletin Options" functionality?

Hex_legend 01-03-2009 02:16 AM

Quote:

Originally Posted by Dismounted (Post 1698990)
Why not use the default "vBulletin Options" functionality?

I'm trying to learn how to do them.
At the mo, I've always got someone else to do it for me but I need the above for a new mod that I'm working on

Dismounted 01-03-2009 03:19 AM

My advice would be to look at the Admin CP, find a page you would like to replicate. Then look at that PHP file to see how it's done.


All times are GMT. The time now is 05:03 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01158 seconds
  • Memory Usage 1,743KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete