PDA

View Full Version : Problem with banner code


BadGuy
06-21-2011, 09:13 AM
I have this problem with this code :

<vb:if condition="$foruminfo['banner_forum_link'] AND $foruminfo['banner_forum_txt'] AND $foruminfo['banner_forum_goto']">
<p align="center">
<a target="_blank" href="{vb:raw foruminfo.banner_forum_goto}"><img alt="{vb:raw foruminfo.banner_forum_txt}" src="{vb:raw foruminfo.banner_forum_link}" border="0"></a>
</p>
</vb:if>

Its working with with forumdisplay template but its not with showthread template

I added this code to both of them but its only show with forumdisplay .

This code is old hack from vb3 its for banner and its working fine with vb4 but only not showing the banners inside the threads .

and I added the banner from control panel but only show the banners in forumdisplay pages .

Any Idea ?

kh99
06-21-2011, 01:04 PM
Do you know how the banner data is getting added to foruminfo? Maybe it's not happening in showthread.php.

BadGuy
06-21-2011, 01:25 PM
I have this only in the control panel :

forumdata_start
$this->validfields['banner_forum_link'] = array(TYPE_STR, REQ_NO);
$this->validfields['banner_forum_txt'] = array(TYPE_STR, REQ_NO);
$this->validfields['banner_forum_goto'] = array(TYPE_STR, REQ_NO);

BadGuy
06-26-2011, 02:08 PM
Any advice ?

Lynne
06-26-2011, 03:04 PM
$foruminfo is not a valid variable to use in the SHOWTHREAD template. You need to use $threadinfo in there.

BadGuy
06-27-2011, 03:48 PM
Thansk

So just replaced this code :

<vb:if condition="$foruminfo['banner_forum_link'] AND $foruminfo['banner_forum_txt'] AND $foruminfo['banner_forum_goto']">
<p align="center">
<a target="_blank" href="{vb:raw foruminfo.banner_forum_goto}"><img alt="{vb:raw foruminfo.banner_forum_txt}" src="{vb:raw foruminfo.banner_forum_link}" border="0"></a>
</p>
</vb:if>


With this one ?

<vb:if condition="$threadinfo['banner_forum_link'] AND $threadinfo['banner_forum_txt'] AND $threadinfo['banner_forum_goto']">
<p align="center">
<a target="_blank" href="{vb:raw threadinfo.banner_forum_goto}"><img alt="{vb:raw threadinfo.banner_forum_txt}" src="{vb:raw threadinfo.banner_forum_link}" border="0"></a>
</p>
</vb:if>


I did that and nothing happend !!

kh99
06-27-2011, 04:02 PM
There's got to be code somewhere that adds 'banner_forum_link' to $foruminfo. If it's not adding it to threadinfo then just using threadinfo won't work. I looked at the code you posted above but I don't see how that does it. I think there must be more code somewhere else. Is this a mod you downloaded from here?

Lynne
06-27-2011, 05:22 PM
You need to add those custom fields to the $threadinfo array.