1 (edited by dss 2005-06-06 05:53)

Topic: Can you write conditional php between index and viewforum/topic?

I'd like to show

div class=one

if it is the index.php

and

div class=two

if is is the viewforum.php or viewtopic.php

<?php 
if (is_index.php)
'<div class="one">'

else 
'<div class="two">'
?>

It seems like this is all done in the main.tpl

can i add condtional php to the main.tpl?

confused...

Re: Can you write conditional php between index and viewforum/topic?

use #punindex and #punviewtopic or #punviewforum?

3

Re: Can you write conditional php between index and viewforum/topic?

Do you mean use CSS to create an "if" condition?

I'm trying to change the header image <div class="headone"> which css defines containing a 250px tall image on every page.

I'd like to keep that on the index, and within a forum, or a topic, exchange it for a 100px image contained as the background of <div class="headtwo">

I didn't think i could do that purely with CSS.

or did you mean use an if somewhere in viewtopic and viewforum?

Re: Can you write conditional php between index and viewforum/topic?

ahh i thought you wanted a wrapper around the page for index and for the viewtopic and viewforum pages, anyway you should be able to just include some php yeh wink

edit: i'm not sure but i think it could be done purely in css, if you make a div, you can set its height and background to the 100px image, and you could override that for the case of #punindex

edit2: try adding this to the css (no need to edit the php at all wink)

#punindex #brdtitle {
    height: 0px;
    padding-top: 250px;
    background-color: red;
}
#brdtitle * {
    display: none;
}
#brdtitle {
    height: 0px;
    padding-top: 100px;
    background-color: green;
}

5 (edited by dss 2005-06-06 10:17)

Re: Can you write conditional php between index and viewforum/topic?

Well, this is genius!

Sadly, it only displays the #brdtitle, never the #punindex #brdtitle

not sure why exaclty, but it was a genuine stroke of genius coming up with it!

I applied your thinking to a wrapper i had in place to contain the head image:

The tpl

<pun_head>
</head>
<body>
<div id="wrapper">
<div id="headhome" onclick="location.href='http://imperialdub.com/dubmessages/';" style="cursor: pointer;">
</div>
<div id="punwrap">
<div id="pun<pun_page>" class="pun">

the css

/* Header Graphic */

#headhome {
    height: 100px;
    width: 100%;
    margin-top: 0px;
    padding: 0;
    align: center;
background: #FFF url(/images/logo2.jpg) no-repeat center top;
}

#headhome * {
    display: none;
}

#punindex #headhome {
    height: 250px;
    width: 100%;
    margin-top: 0px;
    padding: 0;
    align: center;
background: #FFF url(/images/logo.jpg) no-repeat center top;
}

/* End Header Graphic */

got me thinking...

thanks!

Re: Can you write conditional php between index and viewforum/topic?

well it works fine for me in FF and IE, hmm

7 (edited by dss 2005-06-06 10:19)

Re: Can you write conditional php between index and viewforum/topic?

I edited the above post to say more...

I think it's where i've got my wrapper, perhaps it falls before the #punindex comes in?

8

Re: Can you write conditional php between index and viewforum/topic?

Wow!

ok, I moved the div down to just above where the #brdtitle is, and it just works...

amazing stroke of genius!

Thank You!

Re: Can you write conditional php between index and viewforum/topic?

lol yeh if its out of the id it won't work wink

btw probablt no need for
#headhome * {
    display: none;
}
since theres nothing in your #headhome

10

Re: Can you write conditional php between index and viewforum/topic?

amazing...

thanks again.