vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to add plugin options in control panel? (https://vborg.vbsupport.ru/showthread.php?t=277825)

gushin 01-31-2012 02:13 PM

How to add plugin options in control panel?
 
Hi! Sorry for my bad English (I'm from Russia :)). I write plugin to my vbulletin forum, and in accordance with the statement of work I should add plugin options in control panel, like in this screenshot:
https://vborg.vbsupport.ru/external/2012/01/2.jpg

Please write in detail how can I do it? :confused:

Disasterpiece 01-31-2012 02:24 PM

check out the cpnav*.xml files in includes/xml dir. This should give you a better idea.

gushin 01-31-2012 02:36 PM

Ok. Thanks. I find xml file, where I can add my item in vbulletin options. Can I edit this file by the methods of vbulletin during installation my plugin? Or should I just edit this file?

kh99 01-31-2012 02:50 PM

You should create a new xml file that starts with cpnav_, like cpnav_somemod.xml. If you put it in that directory vb will find it and your option menu will show up. You can control where it shows up by setting the displayorder attribute.

gushin 01-31-2012 03:09 PM

Everything is clear now, thanks a lot!

--------------- Added [DATE]1328102730[/DATE] at [TIME]1328102730[/TIME] ---------------

Hi!) I have new question on this topic. When I trying to create a new xml file in "/includes/xml" dir, I faced the problem of determining the path to this folder.
I first try scan directory '/includes/xml' for the presence of file cpnav_myplugin.xml
PHP Code:

$cpnav_dir '/includes/xml';
$cpnav_files scandir($cpnav_dir); 

And scandir() return error. I think that the problem is on the path to the directory. Does vbulletine constant or a variable that contains the path to the root of your site?

--------------- Added [DATE]1328104959[/DATE] at [TIME]1328104959[/TIME] ---------------

solved the problem by using $_SERVER ['DOCUMENT_ROOT']


All times are GMT. The time now is 01:12 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.00983 seconds
  • Memory Usage 1,719KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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