vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   How to show extra fields from node table in template? (https://vborg.vbsupport.ru/showthread.php?t=323559)

ifuyivara 10-03-2016 05:26 PM

How to show extra fields from node table in template?
 
I'm upgrading the template of a very old vbulletin installation. However I need to use the "oldid" field in the new node table to display the correct image on each forum (since those images are named after the old id of the forums). How can I extract this information? I can see the data in the node table under the "oldid" field but is there a way to extract this field in the template so I can use it?

I'm working on the display_Forums_item template
Thank you.

noypiscripter 10-03-2016 06:55 PM

I checked the code and it looks like the "oldid" is not exposed in the forum node object in the display_Forums_item template.

You could try:

{vb:raw forum.oldid}

but I doubt it has a value. But it wouldn't hurt to try. Maybe oldid isn't there for me because I don't have and old id

ifuyivara 10-04-2016 03:05 PM

Yeah I tried that and came out empty.

I had to expose the oldid in order to be able to use it so ended up modifying the core :(

It's not ideal but I couldn't find any other way around that (I don't know why you wouldn't expose the old id if it's there in the table anyways).

I modified node.php to include the oldid in the return array for the channel nodes

Now I can use it from the templates.

noypiscripter 10-04-2016 11:40 PM

You might want to create an enhancement request in JIRA to officially fix it.

http://tracker.vbulletin.com/secure/...91&issuetype=4


All times are GMT. The time now is 04:16 AM.

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.01067 seconds
  • Memory Usage 1,712KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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