View Full Version : Admin CP
Hex_legend
12-31-2008, 01:13 PM
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 (https://vborg.vbsupport.ru/showthread.php?t=83122)
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
// ######################## 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
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
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.