vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Conditional Templates (https://vborg.vbsupport.ru/showthread.php?t=186827)

cmedic101 07-31-2008 04:51 AM

Conditional Templates
 
Good Day,

I am trying to display a different Header logo in a single forum. Could this be done using the conditionals commands? Would this be done in the forums Display Template?

I tryed using the entry below but it failed to work..

<if condition="($forumid,== 32))"><scr="images/Mustanglogo.jpg"
</if>

any help would be great

Regards,

Cmedic101

MoT3rror 07-31-2008 06:08 AM

Try
Code:

<if condition="THIS_SCRIPT = 'forumdisplay' AND $forumid == 32">
<image scr="images/Mustanglogo.jpg" />
<else />
<image src="linktosecondimage" />
</if>


Dismounted 07-31-2008 06:53 AM

Code:

<if condition="$foruminfo['forumid'] == 32"><img scr="images/Mustanglogo.jpg" border="0" /></if>

cmedic101 07-31-2008 07:07 AM

Quote:

Originally Posted by MoT3rror (Post 1588067)
Try
Code:

<if condition="THIS_SCRIPT = 'forumdisplay' AND $forumid == 32">
<image scr="images/Mustanglogo.jpg" />
<else />
<image src="linktosecondimage" />
</if>


Thanks for the reply... after using the entry I am getting the folowing error

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected '=' in /vb/includes/adminfunctions_template.php(3716) : eval()'d code on line 15

cmedic101 07-31-2008 07:38 AM

1 Attachment(s)
Quote:

Originally Posted by Dismounted (Post 1588088)
Code:

<if condition="$foruminfo['forumid'] == 32"><img scr="images/Mustanglogo.jpg" border="0" /></if>

Thanks for the reply.. After using the above code I can see the image block above the default header logo graphic. I am thinking that maybe I need to do something in the header template to cancel the default logo when this fourm is called on.

any ideas?


thanks for your help

cmedic101

Dismounted 07-31-2008 07:42 AM

Code:

<if condition="$foruminfo['forumid'] == 32"><img scr="images/Mustanglogo.jpg" border="0" /><else />YOUR DEFAULT CODE HERE</if>

cmedic101 07-31-2008 08:39 AM

Quote:

Originally Posted by Dismounted (Post 1588120)
Code:

<if condition="$foruminfo['forumid'] == 32"><img scr="images/Mustanglogo.jpg" border="0" /><else />YOUR DEFAULT CODE HERE</if>

I tryed the above code in forum display template and I still get the missing graphic box.

should I be putting the code in another tepmplate?


thank you

cmedic101

Opserty 07-31-2008 09:00 AM

The missing graphics box means its a problem with your HTML not the condition or anything like that. Check the image is there e.t.c.

You have the condition now, so just look into the HTML code and see why it is not working. ;)

cmedic101 07-31-2008 09:10 AM

Quote:

Originally Posted by Opserty (Post 1588169)
The missing graphics box means its a problem with your HTML not the condition or anything like that. Check the image is there e.t.c.

You have the condition now, so just look into the HTML code and see why it is not working. ;)

I checked the graphics and even re-uploaded them to be sure. The are there and working..

when i click properties there is no information avilable regarding an image path

thank you
cmedic101

Opserty 07-31-2008 09:24 AM

Whats the code you are using? (Copy and paste it from your template)

cmedic101 07-31-2008 09:49 AM

Quote:

Originally Posted by Opserty (Post 1588190)
Whats the code you are using? (Copy and paste it from your template)

Here is my Forum Display

$stylevar[htmldoctype]
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$foruminfo[title_clean]<if condition="$pagenumber>1"> - <phrase 1="$pagenumber">$vbphrase[page_x]</phrase></if> - $vboptions[bbtitle]</title>
<if condition="$show['inlinemod']"><script type="text/javascript" src="clientscript/vbulletin_inlinemod.js?v=$vboptions[simpleversion]"></script></if>
</head>
<body>
<if condition="$foruminfo['forumid'] == 32"><img scr="images/mustanglogo.gif" border="0" /><else />scr="images/storm/misc/stormlogo.gif"</if>
$header
$navbar
<if condition="in_array($forumid, array(50,51))"><center><SCRIPT LANGUAGE="JavaScript1.2" src="http://www.codeamber.org/js/hcodea.js">
</script></center>
</P>
</if>

I could not copy the the full template because of restrictions

Dismounted 07-31-2008 09:53 AM

It should be:
Code:

<img src="<if condition="$foruminfo['forumid'] == 32">images/mustanglogo.gif<else />images/storm/misc/stormlogo.gif</if>" border="0" />

Opserty 07-31-2008 09:58 AM

src not scr

Dismounted 07-31-2008 10:00 AM

Oops, fixed. Was copied and pasted from cmedic101's template :p.

cmedic101 07-31-2008 10:07 AM

Quote:

Originally Posted by Dismounted (Post 1588209)
It should be:
Code:

<img src="<if condition="$foruminfo['forumid'] == 32">images/mustanglogo.gif<else />images/storm/misc/stormlogo.gif</if>" border="0" />

Quote:

Originally Posted by Opserty (Post 1588213)
src not scr

Thank you so much for your help!

After I placed that entry in Forum display it was showing both header logos.. I move it to the Header template and it works perfect!


Thank you again

Regards,

Cmedic101

cmedic101 08-02-2008 10:49 AM

Ok... This is working great. Now the next question is how can I have a different graphic for all of my forums by to this command listed below but keep the origional forum home logo in place.

<img src="<if condition="$foruminfo['forumid'] == 32">images/mustanglogo.gif<else />images/storm/misc/stormlogo.gif</if>" border="0" />

thanks in advance

cmedic101

Dismounted 08-02-2008 11:09 AM

Code:

<img src="<if condition="$foruminfo['forumid'] == 32">images/mustanglogo.gif<else /><if condition="$foruminfo['forumid'] == X">images/storm/misc/randomlogo.gif<else />images/storm/misc/stormlogo.gif</if></if>" border="0" />
Basically, keep nesting the conditionals (ugly - I know).

cmedic101 08-02-2008 12:12 PM

Wow... that worked real well... thanks for your help and very quick reply


Sincerely,

cmedic101:up:

scoyote 08-28-2008 03:27 AM

OK, can I break in here too?

I want to do the same thing but I can't figure out how to leave the default header/logo in place because I don't know where to find that information.

(I'm not a programmer, I had someone install and load banners etc....)

But, I need to display a different header/logo for one of my forums.

Dismounted 08-28-2008 07:37 AM

The code caters for that.

scoyote 08-28-2008 01:08 PM

I'm not sure what you mean?

What code would I need to display a separate logo/header on forum ID=11 and leave the default logo/header on the rest of the forums?

Sorry if I'm not understanding, you're gonna need to dumb it down for me ;-)

--------------- Added [DATE]1219985639[/DATE] at [TIME]1219985639[/TIME] ---------------

How do I make it display a different logo on one page and leave the default on the rest of the pages?

<img src="<if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png

(here is where I get goofed up, if I put the following in there it shows two logos because one is hard coded in there.)

<else />images/misc/headerlogo.png</if>" border="0" />





Since the default is hard coded somewhere.....I can't seem to make this work.

This doesn't work:

<img src="<if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png</if>"

That shows the muskiecentral.png and the headerlogo.png at the same time.

Dismounted 08-29-2008 07:36 AM

Code:

<img src="<if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png<else />images/misc/headerlogo.png</if>" border="0" />

scoyote 08-29-2008 03:03 PM

Thanks for the reply but that still shows both banners.

https://vborg.vbsupport.ru/external/2008/08/8.jpg

Dismounted 08-30-2008 05:53 AM

Post your template.

scoyote 08-30-2008 02:29 PM

This is the FORUM DISPLAY template, is that the one?
I can't post the entire template, it's longer than allowed.

Dismounted 08-31-2008 05:44 AM

Quote:

Originally Posted by scoyote (Post 1610614)
This is the FORUM DISPLAY template, is that the one?

The template where you are using the code...

scoyote 09-08-2008 02:21 AM

I'm sorry for the delayed response, I was out of town for a week.

That is the problem, I don't know where that is.

I had a programmer do it for me and he has not returned my emails so I'm guessing he's not available so I am trying to figure this out.

Where do you think he MIGHT have put that so it displays on every page?

I'm no programmer......as you can tell ;-)

scoyote 09-09-2008 07:55 PM

Here is the Header code....possibly it's in here?

<!-- logo -->
<a name="top"></a>

<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF" <!--background="images/misc/topback.png"-->

<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]"

border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]" id="header_right_cell">
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else />&nbsp;</if>
</td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

$ad_location[ad_header_end]

nando99 09-10-2008 12:39 PM

Just found this thread and figured it a good place to get additional help...

I'm using the following code in template postbit_attachmentthumbnail

Code:

<if condition="$forumid != 103">

<img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt="" style="display:none;"/>
<div style="float:left; display:block; width:111px; height:111px; text-align:center;">
<table cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle" height="111" width="111" style="margin:0px; padding:0px;">
<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" rel="Lightbox" id="attachment$attachment[attachmentid]"<if condition="$show['newwindow']"> target="_blank"</if>><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1&amp;d=$attachment[thumbnail_dateline]" border="0" alt="Click for a bigger size image." align="middle" style="border: solid 3px #cccccc;"/></a></td></tr></table>
</div>

<else />

<div align="center"><img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt=""/>
</div>

</if>

You can see a post from forum 103 here: http://www.fatboymagazine.com/showthread.php?t=33215 as you can see its not working - its still showing the thumb. I'd like to show thumbnails for attached images on most forums, but on a specific forum (id 103) I'd like to show the full attached image.

I tried both <if condition="$forumid != 103"> and <if condition="!in_array($forumid, array(103))"> and neither worked.

Anyone have any ideas?

scoyote 09-15-2008 01:15 AM

Any help....anyone?
I'm still trying to get more than one banner showing.

Dismounted 09-15-2008 05:37 AM

@scoyote:
Code:

<!-- logo -->
<a name="top"></a>

<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF" <!--background="images/misc/topback.png"-->

<tr>
        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="<if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png<else />$stylevar[titleimage]</if>" border="0" alt="$vboptions[bbtitle]" /></a></td>
        <td align="$stylevar[right]" id="header_right_cell">
                <if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else />&nbsp;</if>
        </td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

$ad_location[ad_header_end]

@nando99: The forum ID variable actually doesn't exist at the point where the template is called. You would have to create a plugin and bring $forum into focus.

scoyote 09-15-2008 11:49 AM

Sigh......I'm not really sure what you just said.

I'm guessing that something is wrong with the way my logo is being called and I cannot show a different logo on one of the forums?

Dismounted 09-15-2008 12:43 PM

I just posted an edited version of your header template. Disregard what I'm saying to nando99.

nando99 09-15-2008 02:39 PM

Quote:

Originally Posted by Dismounted (Post 1622453)
@nando99: The forum ID variable actually doesn't exist at the point where the template is called. You would have to create a plugin and bring $forum into focus.

Yeah... I had to use $GLOBALS[forumid] and it worked fine. Thanks.

scoyote 09-15-2008 08:00 PM

Dismounted.....thank you very much.
That is working perfectly.....!

I almost hate to ask this question....but....

Now, if I want to add another logo for forum ID 9

Do I need to enter that whole line again or add a comma and the other forum id????

if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png,
if condition="$foruminfo['forumid'] == 9">images/misc/ftm.png
<else />$stylevar[titleimage]</if>

Does it work like that?

Dismounted 09-16-2008 04:59 AM

Code:

<!-- logo -->
<a name="top"></a>

<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF" <!--background="images/misc/topback.png"-->

<tr>
        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="<if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png<else /><if condition="$foruminfo['forumid'] == 9">images/misc/ftm.png<else />$stylevar[titleimage]</if></if>" border="0" alt="$vboptions[bbtitle]" /></a></td>
        <td align="$stylevar[right]" id="header_right_cell">
                <if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else />&nbsp;</if>
        </td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

$ad_location[ad_header_end]


scoyote 01-29-2009 02:28 PM

OK....just never satisfied I guess ;-)

Now, my customer wants that logo to be linked to his website so he can click it to go directly there.

Can that logo be linked?

If so....can someone give me an example or is it just normal HTML code?

Lynne 01-29-2009 02:47 PM

Making a logo clickable is basic html - the basic structure:

HTML Code:

<a href="whatever.php"><img src="logo.jpg"></a>

scoyote 01-29-2009 03:58 PM

Then I'm doing it wrong?

I tried that and it didn't work for me.

Here is where I'm trying to do it:

<img src="<if condition="$foruminfo['forumid'] == 11">images/misc/muskiecentral.png<else /><if condition="$foruminfo['forumid'] == 9">images/misc/ftm.png<else />

So...where do you put that code inside there?

Dismounted 01-30-2009 03:46 AM

Before it, put:
Code:

<a href="whatever.php">
After it, put:
Code:

</a>


All times are GMT. The time now is 03:02 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.01462 seconds
  • Memory Usage 1,839KB
  • 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
  • (15)bbcode_code_printable
  • (1)bbcode_html_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete