Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 02 May 2006, 00:55
Aurous Aurous is offline
 
Join Date: Apr 2004
Datastore - How to display data?

Hello

I am facing a problem and cant seem to grab the general idea of how datastore caching works in vBulletin 3.5.x.

I created a new row in datastore:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now this data is to be displayed in Index.php and basically here's where the problem starts. In 3.0.x version I just edited init.php and added radiocache in "$specialtemplates" and used $datastore[radiocache] in template to display the data. But now, I am a bit confused with how things work in vb 3.5.0

I searched around but didnt find enough information to solve my problem. I am not very good with php/mysql. Here's what I tried so far:

I edited index.php and added radiocache to the $specialtemplates array. How do I go about it from there? Any help will be much appreciated. I am sure this will also help other coders who are interested in datastore.

Just so you know, I am using vB 3.5.4.

Thanks.

Aurous

Last edited by Aurous; 02 May 2006 at 03:23.
Reply With Quote
  #2  
Old 02 May 2006, 02:22
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
In 3.5, datastore goes to: $vbulletin->fieldName... so in your case $vbulletin->radiocache.
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #3  
Old 02 May 2006, 03:18
Aurous Aurous is offline
 
Join Date: Apr 2004
I already tried that, but it doesnt display anything. No results on the page whatsoever, while the data is obviously there in the table. Also added 'radiocache' in index.php :

$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue',
'radiocache'
);

Am I missing anything else here?
Reply With Quote
  #4  
Old 02 May 2006, 04:14
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
$vbulletin->anything won't work in templates unless you enclose it in braces ( {}s ). What do you have stored there?
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #5  
Old 02 May 2006, 10:00
Aurous Aurous is offline
 
Join Date: Apr 2004
Well right now I just have "test" (without quotes) and nothing shows. I tried "{test}" and that didnt help either. Can you please test this out and see if its working for u? Anything to work in functions_databuild.php ?

Last edited by Aurous; 02 May 2006 at 20:09.
Reply With Quote
  #6  
Old 02 May 2006, 14:39
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
{$vbulletin->test} in the template
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #7  
Old 03 May 2006, 01:27
Aurous Aurous is offline
 
Join Date: Apr 2004
Ahh! Thank you so much. Works fine now.
Reply With Quote
  #8  
Old 09 May 2006, 16:00
Aurous Aurous is offline
 
Join Date: Apr 2004
Quick question:

Is there any work around for $specialtemplates yet? Basically any work around to NOT edit .php file that is. BTW, this method -> http://www.vbulletin.org/forum/showt...801#post770801
doesnt work anymore.

Although, Kirby's solution work fine as mentioned in Boofo's post -> http://www.vbulletin.org/forum/showt...970#post771970

Any workaround yet?
Reply With Quote
  #9  
Old 09 May 2006, 16:06
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by Aurous
Quick question:

Is there any work around for $specialtemplates yet? Basically any work around to NOT edit .php file that is. BTW, this method -> http://www.vbulletin.org/forum/showt...801#post770801
doesnt work anymore.

Although, Kirby's solution work fine as mentioned in Boofo's post -> http://www.vbulletin.org/forum/showt...970#post771970

Any workaround yet?
Nope, that's the only way to do it for now. But since the config.php doesn't get overwritten on an upgrade, no need to re-edit the file.

And they both do still work, by the way. I am using it both ways in my config.php.
Reply With Quote
  #10  
Old 09 May 2006, 16:15
Aurous Aurous is offline
 
Join Date: Apr 2004
Hmm, that is sad! Any word from vBulletin regarding this? I mean on one hand they want to promote plugins and on other they have a system where you cant really live without a file edit. Although config.php isnt a big issue here, but why edit anything to begin with?

I tried editing config.php as follows:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

but it didnt show anything in the index page. Then I just edited the $specialtemplate array in index.php manually, added 'item' and it worked fine.

Last edited by Aurous; 09 May 2006 at 16:19.
Reply With Quote
  #11  
Old 09 May 2006, 16:18
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Here's what I use and it works perfectly.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You need the global part. Yours is for a single template also.
Reply With Quote
  #12  
Old 09 May 2006, 16:39
Aurous Aurous is offline
 
Join Date: Apr 2004
Oh ya, I forgot about declaring global variable. This works too for single template.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

hmm we can use this for multiple templates too I believe:

$specialtemplates[] = 'item1';
$specialtemplates[] = 'item2';
etc.
Reply With Quote
  #13  
Old 09 May 2006, 17:08
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by Aurous
Oh ya, I forgot about declaring global variable. This works too for single template.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

hmm we can use this for multiple templates too I believe:

$specialtemplates[] = 'item1';
$specialtemplates[] = 'item2';
etc.
No, use the array_merge for multiple templates.
Reply With Quote
  #14  
Old 09 May 2006, 17:38
Aurous Aurous is offline
 
Join Date: Apr 2004
Ok. Thanks for all the info I am starting to like datastore!
Reply With Quote
  #15  
Old 09 May 2006, 17:41
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by Aurous
Ok. Thanks for all the info I am starting to like datastore!
Remember, the datastore is your friend.

I try to use it whenever I can. We just did a forumhome counter for my site that uses the datastore and saves on an unessessary query. It uses 1 query to update the datastore and no query to pull the info from the datstore. It works great.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 12:42.

Layout Options | Width: Wide Color: