vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How do I display vb Database information in a template? (https://vborg.vbsupport.ru/showthread.php?t=231282)

acanuck 12-27-2009 02:35 AM

How do I display vb Database information in a template?
 
I installed this side column mod onto my forum:'
https://vborg.vbsupport.ru/showthread.php?t=229496

Now I have a template called 'ss_rightcolumn_contents" where I can add content that I want to display in that column.

I have been trying to display information from the "forum" table of the database but so far have been unsuccessful. Here is some of the code I tried putting in the template:



PHP Code:

forum{vb:raw forum.forumid}

or

$foruminfo['forumid']

or

{
vb:raw foruminfo.forumid

All these didn't work.

I'm looking for someone to help tell me what I need to do to be able to display forum information in the side column.

Please let me know if you know the solution.

I can also pay a small donation for helping me out with this!

Thanks :)

Lynne 12-27-2009 02:46 AM

Questions regarding modifications need to be asked in the modification thread.

One thing to help.... look at the other templates used on that page and see what variables are used there. Or, look at the php page being called and see what variables are being used there.

acanuck 12-27-2009 02:57 AM

Thanks Lynne :-)

Generally speaking though, regardless of this particular mod, how can I extract information from vb tables to display in any template?

Lynne 12-27-2009 03:00 AM

First you would need to query the database to get the information, then assign the results to a variable and then use the variable in the template, usually like {vb:raw array.name}

acanuck 12-27-2009 03:21 AM

Quote:

Originally Posted by Lynne (Post 1939114)
First you would need to query the database to get the information, then assign the results to a variable and then use the variable in the template, usually like {vb:raw array.name}

Thanks :)

So I'd need to create a plugin with the php query and variable declaration?

Lynne 12-27-2009 03:05 PM

Yes, if the query has not already been made. There are also hooks you can use to 'plugin' to existing queries if you just need to add a couple of fields to a query.


All times are GMT. The time now is 07:05 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.00992 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
  • (1)bbcode_php_printable
  • (1)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