vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Fetching a column from the datastore in global_start messes up the forum time (https://vborg.vbsupport.ru/showthread.php?t=261857)

Yellow Slider 04-11-2011 10:09 PM

Fetching a column from the datastore in global_start messes up the forum time
 
I'm trying to fetch a column from the datastore in global_start using the following code:
PHP Code:

$vbulletin->datastore->fetch(array('datastore')); 

And for some reason, the forum time get set to GMT (not everywhere though), ignoring users preferences.
Anyone familiar with this issue?

Thanks.

Boofo 04-11-2011 10:44 PM

Grab it from the init_startup hook instead, like so:

Code:

$datastore_fetch[] = "'your column name here'";

Make sure it has the single and double quotes like in the example.

Yellow Slider 04-11-2011 11:19 PM

Quote:

Originally Posted by Boofo (Post 2183620)
Grab it from the init_startup hook instead, like so:

Code:

$datastore_fetch[] = "'your column name here'";
Make sure it has the single and double quotes like in the example.

That did the job, thanks.
By the way, a new var has been added, $new_datastore_fetch, which doesn't require single quotes.

Boofo 04-11-2011 11:40 PM

Have you tried the new variable?

Yellow Slider 04-12-2011 04:16 PM

Quote:

Originally Posted by Boofo (Post 2183630)
Have you tried the new variable?

I was actually too lazy to change it afterwards, but the comment says '$new_datastore_fetch does not require single quotes', so I guess it should be working of that what you mean.

Boofo 04-12-2011 05:46 PM

I tested it and it works fine without the single quotes. Thanks for pointing it out to me. I didn't know about the change. Actually, it is better to use the new way as it doesn't need to parse the extra quotes. These all work for it:

Code:

$new_datastore_fetch[] = 'your column name here';
$new_datastore_fetch[] = "your column name here";  <-- I am using this one
$new_datastore_fetch[] = your column name here;



All times are GMT. The time now is 05:02 PM.

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.01042 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_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