vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Datastore - How to display data? (https://vborg.vbsupport.ru/showthread.php?t=114555)

Aurous 05-01-2006 11:55 PM

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:

Code:

title                data
radiocache        info that updates every few minutes via cron file.

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

Adrian Schneider 05-02-2006 01:22 AM

In 3.5, datastore goes to: $vbulletin->fieldName... so in your case $vbulletin->radiocache.

Aurous 05-02-2006 02:18 AM

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?

Adrian Schneider 05-02-2006 03:14 AM

$vbulletin->anything won't work in templates unless you enclose it in braces ( {}s ). What do you have stored there?

Aurous 05-02-2006 09:00 AM

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 ?

Adrian Schneider 05-02-2006 01:39 PM

{$vbulletin->test} in the template

Aurous 05-03-2006 12:27 AM

Ahh! Thank you so much. Works fine now.

Aurous 05-09-2006 03:00 PM

Quick question:

Is there any work around for $specialtemplates yet? Basically any work around to NOT edit .php file that is. BTW, this method -> https://vborg.vbsupport.ru/showthrea...801#post770801
doesnt work anymore.

Although, Kirby's solution work fine as mentioned in Boofo's post -> https://vborg.vbsupport.ru/showthrea...970#post771970

Any workaround yet?

Boofo 05-09-2006 03:06 PM

Quote:

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 -> https://vborg.vbsupport.ru/showthrea...801#post770801
doesnt work anymore.

Although, Kirby's solution work fine as mentioned in Boofo's post -> https://vborg.vbsupport.ru/showthrea...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. ;)

Aurous 05-09-2006 03:15 PM

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:
Code:

if (THIS_SCRIPT == 'index')
{
$specialtemplates[] = 'item';
}

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.


All times are GMT. The time now is 05:00 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.01183 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete