Welcome to Geeklog, Anonymous Thursday, February 29 2024 @ 11:18 pm EST

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?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Wouldn't this help?

bye, Dirk
 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:

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}';}?>

 
 Quote

All times are EST. The time is now 11:18 pm.

  • 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