vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Saving to Vbulletin Options with Plugins (https://vborg.vbsupport.ru/showthread.php?t=211858)

kau 04-21-2009 07:25 PM

Saving to Vbulletin Options with Plugins
 
I have created an input box for my plugin

I can access the data that is saved into the vbulletin options from it like this:

$maincatid=$parser->registry->options['awesome_reviews_maincatid']

how can I save something to it manually?

Lynne 04-21-2009 08:00 PM

I'm pretty sure all options are saved in the settings table. You may want to look through the code used in saving the options in the admin cp to see if there is datamanager or what method is used there.

kau 04-21-2009 08:53 PM

here's kind of what i have been doing

$admindm =& datamanager_init('Admin', $vbulletin, ERRTYPE_CP);
//$admindm->set_existing($variable_array);
$admindm->validfields['awesome_reviews_maincatid'] = array(TYPE_STR, REQ_NO);
$admindm->set('awesome_reviews_maincatid', '6');
$admindm->save();

This freezes up at the set() part

I don't think datamanager has a section for the vbulletion options does it?.......

Lynne 04-21-2009 11:35 PM

Taking a quick look at options.php and the dooptions section, it calls the funtion save_settings. If you take a look at that, it looks like it just does the query. Perhaps you can reuse that code.

Dismounted 04-22-2009 07:05 AM

I have a question - why are you setting vBulletin settings outside of the Admin CP? This could potentially compromise security.

kau 04-22-2009 02:14 PM

Thx Lynne, when I first did my database dump I only saw that varname in datastore for some reason :) Now I see the setting


All times are GMT. The time now is 04:33 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.00957 seconds
  • Memory Usage 1,709KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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