View Full Version : How to show extra fields from node table in template?
ifuyivara
10-03-2016, 05:26 PM
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/CreateIssue.jspa?pid=10091&issuetype=4
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.