PDA

View Full Version : changing Admin Settings Manually


bailz66
06-22-2010, 10:08 PM
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.

$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 :)