Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2006, 11:55 PM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-02-2006, 01:22 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In 3.5, datastore goes to: $vbulletin->fieldName... so in your case $vbulletin->radiocache.
Reply With Quote
  #3  
Old 05-02-2006, 02:18 AM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 05-02-2006, 03:14 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$vbulletin->anything won't work in templates unless you enclose it in braces ( {}s ). What do you have stored there?
Reply With Quote
  #5  
Old 05-02-2006, 09:00 AM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #6  
Old 05-02-2006, 01:39 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

{$vbulletin->test} in the template
Reply With Quote
  #7  
Old 05-03-2006, 12:27 AM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh! Thank you so much. Works fine now.
Reply With Quote
  #8  
Old 05-09-2006, 03:00 PM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 05-09-2006, 03:06 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 05-09-2006, 03:15 PM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05878 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete