The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Custom HTML not accepting vb conditions
I've made a setting in forum manager which adds an extra option to add custom html to each forum.
my problem is when i use if conditions EXAMPLE: Code:
<if condition="THIS_SCRIPT == 'showthread">showthread</if> <if condition="THIS_SCRIPT == 'forumdisplay">forumdisplay</if> I created the row Code:
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "forum ADD (bannercode TEXT NOT NULL DEFAULT '')"); Code:
<if condition="$foruminfo['banner'] AND $foruminfo['bannerlink']"> <center> <a href="$foruminfo[bannerlink]" target="_blank"><img src="$foruminfo[banner]" alt="$foruminfo[banneralt]" border="0" /></a> </center> <br /> <else /> <if condition="$foruminfo['banner']"> <center> <img src="$foruminfo[banner]" alt="$foruminfo[banneralt]" border="0" /> </center> <br /> <else /> <if condition="$foruminfo['bannercode']"> <center> $foruminfo[bannercode] </center> <br /> </if> </if> </if> Code:
if (THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'showthread'){ if (THIS_SCRIPT == 'forumdisplay'){ $search_text = '$navbar'; $vbulletin->templatecache['FORUMDISPLAY'] = str_replace($search_text, $search_text.fetch_template('add_banner'), $vbulletin->templatecache['FORUMDISPLAY']); }else{ if ($foruminfo['bannerthread'] == '1'){ $search_text = '$navbar'; $vbulletin->templatecache['SHOWTHREAD'] = str_replace($search_text, $search_text.fetch_template('add_banner'), $vbulletin->templatecache['SHOWTHREAD']); } } eval('$add_banner = "' . fetch_template('add_banner') . '";'); } |
#2
|
||||
|
||||
May be this
Code:
<if condition="THIS_SCRIPT == showthread">showthread</if> <if condition="THIS_SCRIPT == forumdisplay">forumdisplay</if> OR <if condition="THIS_SCRIPT == 'showthread'">showthread</if> <if condition="THIS_SCRIPT == 'forumdisplay'">forumdisplay</if> |
#3
|
||||
|
||||
Quote:
I think it has something to do with the way the data is used from the DB but Im at a loss right now. |
#4
|
||||
|
||||
I did come up with a workaround by creating 2 separate options within the forum manager, one for forumdisplay, and one for showthread, but I really do need some help getting these to both be within one option.
|
#5
|
||||
|
||||
I have been using Add banner above forum
It allows you to add html per forum and still works with 3.8 |
Благодарность от: | ||
Dr.CustUmz |
#6
|
||||
|
||||
Quote:
Code:
<if condition="THIS_SCRIPT == showthread">showthread</if> Glad to see your still around eddie =) |
#7
|
|||
|
|||
Your trying to add the if conditions as the custom html but it's basicly seen as php and will not render meaning all it spits out is the html/text.
My suggestion would be to maybe just double up i.e create 2 sets of options 1 for showthread and 1 for forumdisplay rather then if else as it currently is, then have an enable/disable option for each. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|