Welcome to Geeklog, Anonymous Thursday, October 10 2024 @ 12:31 am EDT
Geeklog Forums
Changing a header image per one topic
Status: offline
orfilms
Forum User
Regular Poster
Registered: 08/02/05
Posts: 70
I want to change the header image for one of my topics (note, not the topic image but the big header of my site image) but for that topic only. I found a hack called Chameleon from squatty, which changes the theme of the site per topic, but I don't need to change the whole theme and the version is pretty old.
My question to you is:
is it possible to do a php statement in the header.thtml file that would be something like
IF this page comes from topic "DVD"
print "image = dvd.jpg"
ELSE
print "image = normal"
you can tell I come from the BASIC days. Anyone know how to code this or if its possible?
My question to you is:
is it possible to do a php statement in the header.thtml file that would be something like
IF this page comes from topic "DVD"
print "image = dvd.jpg"
ELSE
print "image = normal"
you can tell I come from the BASIC days. Anyone know how to code this or if its possible?
8
9
Quote
Status: offline
1000ideen
Forum User
Full Member
Registered: 08/04/03
Posts: 1298
Actually I did this with 2 different CSS and Dirk's help like this in the header.thtml:
<?php
global $_CONF, $topic;
if ($topic == 'topicB') {print $_CONF['layout_url'] . '/topicB.css';}
else {print $_CONF['layout_url'] . '/style.css';}?>
title="{theme}">
It says mainly if the chosen topic is "topicB" then chose the css topicB.css
Obviously topicB.css contains a background pic which is different from style.css. I deleted the usual logo.gif in the header.thtml.
background:url(images/logo_topicB.gif);
background-repeat:no-repeat;
/*background:url(images/header-bg.png) #5A94D6;*/
border-bottom:1px solid #CCCCCC;
}
If you also want to change the site slogan in the header.thtml:
if ($topic == 'topicB') {print 'site slogan topicB';} else {print '{site_slogan}';}?>
Text Formatted Code
<link rel="stylesheet" type="text/css" href= <?php
global $_CONF, $topic;
if ($topic == 'topicB') {print $_CONF['layout_url'] . '/topicB.css';}
else {print $_CONF['layout_url'] . '/style.css';}?>
title="{theme}">
It says mainly if the chosen topic is "topicB" then chose the css topicB.css
Obviously topicB.css contains a background pic which is different from style.css. I deleted the usual logo.gif in the header.thtml.
Text Formatted Code
.header-logobg-container-inner {background:url(images/logo_topicB.gif);
background-repeat:no-repeat;
/*background:url(images/header-bg.png) #5A94D6;*/
border-bottom:1px solid #CCCCCC;
}
If you also want to change the site slogan in the header.thtml:
Text Formatted Code
<?php global $_CONF, $topic;if ($topic == 'topicB') {print 'site slogan topicB';} else {print '{site_slogan}';}?>
7
10
Quote
All times are EDT. The time is now 12:31 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content