This has probably been asked a million times however I can't seem to find an answer. Is there a way to differentiate the look of the left versus the right blocks when creating a theme
disgruntledtech Site Admin
Joined: Apr 14, 2003
Posts: 991
Location: Tulsa, OK
Posted:
Fri Jul 11, 2003 1:44 am
yes there is
Code:
function themefooter() {
global $index, $rightside;
if ($index == 1) {
echo "</td><td> </td><td valign=\"top\">";
$rightside = 1;
blocks(right);
echo "</td>";
}
echo "<br>";
footmsg();
}
in the footer, we make the variable $rightside global(accessible in other functions)
then set right side to 1 before we call blocks(right)
Code:
function themesidebox($title, $content) {
global $rightside;
if ($rightside) {
//right side code
echo "$title<br>$content";
} else {
//left side code
echo "$title<br>$content";
}
}
here we get the value of the global variable $rightside we set in the footer function and we output the rightside block code if it has a value -if not the leftside block code is used
Cergorach Nuke Cadet
Joined: Jun 03, 2003
Posts: 7
Posted:
Sun Jul 20, 2003 9:18 am
Ok, this is exactly what i was looking for, but it's not working that great, i now have of every rightsided block three times displayed. Any ideas on why this is? Or does anyone have a link to a theme that already diffirentiates between left and right blocks?
{edit}
Erm... Oops! I have to look harder before i complain, found the problem and corrected it. I placed some of the code in the wrong part of the theme. Doh!
Thanks guys!
{/edit}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum