Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2008, 01:13 PM
Hex_legend Hex_legend is offline
 
Join Date: May 2007
Posts: 750
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 12-31-2008, 03:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you just talking about adding settings for your product? If so, you just go into debug mode and add them.
Reply With Quote
  #3  
Old 12-31-2008, 04:05 PM
Hex_legend Hex_legend is offline
 
Join Date: May 2007
Posts: 750
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 12-31-2008, 04:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 12-31-2008, 04:30 PM
Hex_legend Hex_legend is offline
 
Join Date: May 2007
Posts: 750
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 12-31-2008, 04:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-31-2008, 04:53 PM
Hex_legend Hex_legend is offline
 
Join Date: May 2007
Posts: 750
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 12-31-2008, 05:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 01-01-2009, 03:54 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 01-01-2009, 12:33 PM
Hex_legend Hex_legend is offline
 
Join Date: May 2007
Posts: 750
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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.04387 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete