vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Please Help! This is driving me nuts... (https://vborg.vbsupport.ru/showthread.php?t=141254)

jarosciak 03-06-2007 01:21 AM

Please Help! This is driving me nuts...
 
I need to programmatically change the value of smtp_host in vbulletin mysql db, under datastore / options

This screenshot shows which variable/database/table I am referring to:
http://www.vbulletin.com/forum/attac...0&d=1173109661

It would be very simple if datastore / options, had only one value in it, but there is like 50 different variables and I need to change the value of only one of them, lets say it is variable: smtp_host

How do I do this?

This is my code, to do change the value of 'smtp_host' to 'smtp.mail.com':
PHP Code:

<?php
require_once('./global.php');
require_once(
'./includes/functions_user.php');
$vbulletin->options unserialize($vbulletin->options);
$vbulletin->options['smtp_host'] = 'smtp.mail.com';
$result build_datastore('options'serialize($optionstmp));
?>

But, when I tried to run it, it gave me this error:
Warning: unserialize() expects parameter 1 to be string, array given in \smtp.php on line ...

Afterwards, my whole forum went haywire and I had to restore the 'datastore' table from the backup, because it was giving me this error:
Fatal error: Cannot create references to/from string offsets nor overloaded objects in: C:\..\..\includes\class_core.php on line 1283

Anyhow, any suggestion on how I can update this one field?
It'll be something simple, I bet, but I am stuck on it, the whole rest of my hack is already done...

Can someone help?

Joe :confused:

Anyone?

Could anyone please look at this?
It must be simple, but for some reason it won't work...


All times are GMT. The time now is 05:26 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.01063 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
  • (1)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