vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Using the datastore in 3.6.4 (https://vborg.vbsupport.ru/showthread.php?t=137151)

thincom2000 01-21-2007 06:01 PM

Using the datastore in 3.6.4
 
I'm trying to use a datastore entry I created (the entry exists in the database in the datastore table) in a foreach() loop, but it tells me I have supplied an invalid argument for foreach()

Database record:
title = my_store
data = a:1:{i:1;s:6:"ITEM";}
unserialize = 1

PHP Code:

$vbulletin->my_store unserialize($vbulletin->my_store);
$store $vbulletin->mystore;

foreach (
$store AS $s)
{
         
$my_new_array[] = $s;


I've looked at tons of other examples from products I have installed and it seems to work fine everywhere else...

Kentaurus 01-21-2007 07:07 PM

Quote:

Originally Posted by thincom2000 (Post 1164440)
I've looked at tons of other examples from products I have installed and it seems to work fine everywhere else...

Try with this before:

PHP Code:

$extrads = array('my_store');
$vbulletin->datastore->fetch($extrads);

// ... then your code 

An alternative, is too add it to the $specialtemplates array at the script you are using it.

thincom2000 01-21-2007 08:09 PM

Setting it in $specialtemplates was the only thing that worked.

Is there a way to put the following in a plugin so that it will work?

PHP Code:

$specialtemplates[] = 'my_store'


Kentaurus 01-21-2007 08:20 PM

Sadly we still don't have an "easy" way to do it. But read this thread for a solution:
https://vborg.vbsupport.ru/showthread.php?t=111882

thincom2000 01-21-2007 08:58 PM

I hope they make it easier for 3.7

I may as well just use $vbulletin->options in this case.


All times are GMT. The time now is 11:50 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.01611 seconds
  • Memory Usage 1,722KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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