vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   changing Admin Settings Manually (https://vborg.vbsupport.ru/showthread.php?t=245086)

bailz66 06-22-2010 10:08 PM

changing Admin Settings Manually
 
Hello

I have a custom PHP page which i wanted to use to activate and stop a setting in VB from running

I am working with VSA chatbox.

What i want to do is enable it and disable it based on a time of day.

PHP Code:

$query "update vb_setting set value = 0 where varname = 'vsachatbox_enable_product' or varname = 'vsaaddon_enable_product'"

This works and the database updates but it seems that the system doesnt read this in. Is there something i am missing which also happens when the submit button is pressed on the admin settings interface?

KDawg08 06-23-2010 12:16 AM

Why not run it as a cron? An automatic generation of it would work perfectly. so it will disable it in the manage products section and it should remove it completely then x hours later it turns it back on.

BY THE WAY did you set yourself as SUPER ADMIN in your config.php? You can't run database queries unless you do.

bailz66 06-23-2010 02:47 AM

Thanks heaps for the reply

The database queries run and the database is updated.

Its run within a seperate script i have that gets score from a live sporting match.

At the start of the script say time = -5 minutes the chatbox is turned on with the query.

At the end of the script Time = +5 minutes the Chatbox is turned off in the query

This updates the database and everything in theory works fine. The problem is that the chatbox although looks like its working wont work unless the settings save button in admin is also clicked

KDawg08 06-23-2010 03:05 AM

If you are smart enough (which i'm not) you could have it remove the shoutbox code from your template modifications in forumhome templates or navbar whichever you inserted the <--Shoutbox--> code. You can supposedly find this IN the database, and if u can, you can have it recode the full page WITHOUT it, then have it recode the shoutbox back in it when you want it back on again.

Lynne 06-23-2010 03:05 AM

Probably the datastore table needs to be updated also. Look where title=options... the setting should the there too.

bailz66 06-23-2010 05:30 AM

Ah yep seems to be to do with the datastore function. Looks like a lot of goop

;i:3;s:25:"vsachatbox_enable_product";i:0;s:22:

This is from the datastore DB entry.

I am unsure which part of that i would need to change for it to be enabled, maybe i will just have a play :)


All times are GMT. The time now is 09:21 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.00987 seconds
  • Memory Usage 1,717KB
  • 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
  • (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