Swap Background for HTML Left & Right Block Titles

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Swap Background for HTML Left & Right Block Titles
jc81
CZ Newbie
jc81 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Dec 31, 2004
0.00 posts per day
Posts: 2
Points: 250
   
I know Telli has helped people do this for PHP block files but I am using XD-Redzone theme and it has a blockL and BlockR HTML. I've messed around with this for a few hours and now I surrender, I need help icon_sad.gif What I want to do is just change the background instead of adding an image because I think its easier to just add the graphic to the background.

Here is my Theme.PHP "Function themesidebox() "

function themesidebox($title, $content) {

   global $swapleftright, $bgcolor1, $bgcolor2;



if ($swapleftright=="0") {

    $tmpl_file = "themes/XD-Redzone/blockR.html";

} else {

    $tmpl_file = "themes/XD-Redzone/blockL.html";

}

    $thefile = implode("", file($tmpl_file));

    $thefile = addslashes($thefile);

    $thefile = "\$r_file=\"".$thefile."\";";

    eval($thefile);

    print $r_file;

}


blockL.HTML

<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="27" ><table width="100%" height="89" border="0" align="center" cellpadding="0" cellspacing="0" background="themes/XD-Redzone/images/blocks/shooping.gif">
        <tr>
          <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="44" valign="bottom" background="themes/XD-Redzone/images/blocks/BL1.gif"><br>
                    <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td valign="top"><div align="center"><strong><font color="#000000">$title</font></strong><font color="#000000"></font></div></td>
                      </tr>
                </table></td>
              </tr>
              <tr>
                <td valign="top"><img src="themes/XD-Redzone/images/blocks/BL2.gif" width="221" height="49" alt=""></td>
              </tr>
          </table></td>
        </tr>
      </table>
        <table width="154" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="themes/XD-Redzone/images/blocks/BL3.gif"><table width="80%" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="19" valign="top"><table width="90%" border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td>$content</td>
                      </tr>
                  </table></td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
                <td><p><img src="themes/XD-Redzone/images/blocks/BL4.gif" width="221" height="71" alt=""></p></td>
          </tr>
      </table></td>
  </tr>
</table>


blockR.HTML
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="27" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="themes/XD-Redzone/images/blocks/shooping.gif">
        <tr>
          <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="40" valign="top" background="themes/XD-Redzone/images/blocks/BR1.gif"><br>
                    <table width="78%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="5" valign="top"><div align="center"><strong>$title</strong></div></td>
                      </tr>
                  </table></td>
              </tr>
              <tr>
                <td valign="top"><img src="themes/XD-Redzone/images/blocks/BR2.gif" width="224" height="46" alt=""></td>
              </tr>
          </table></td>
        </tr>
      </table>
        <table width="154" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="themes/XD-Redzone/images/blocks/BR3.gif"><table width="80%" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="19" valign="top"><table width="99%" border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td width="8"> ;;</td>
                        <td>$content</td>
                      </tr>
                  </table></td>
                </tr>
              </table></td>
          </tr>
          <tr>
                <td><p><img src="themes/XD-Redzone/images/blocks/BR4.gif" width="224" height="77" alt=""></p></td>
          </tr>
      </table></td>
  </tr>
</table>


L & R are basically the same.


Back to top Reply with quote
#2   re: solution
jc81
CZ Newbie
jc81 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Dec 31, 2004
0.00 posts per day
Posts: 2
Points: 250
   
I'm posting the solution here to help whoever needs it. I found a matching theme with the title switch thing and added some stuff to allow a different background to and it turns off the title text still. I know its alot of text but its fairly easy to comprehend once you look at it awhile icon_wink.gif

/************************************************************/

/* Function themesidebox()                                  */

/************************************************************/

function themesidebox($title, $content) {
   global $swapleftright, $bgcolor1, $bgcolor2;

if ($swapleftright=="0") {

    $tmpl_file = "themes/XD-Redzone/blockR.html";

} else {

    $tmpl_file = "themes/XD-Redzone/blockL.html";

}

$ThemeSel = get_theme(); // block image titles code
$blockR = "themes/$ThemeSel/images/blocks/BR1.gif";
$blockL = "themes/$ThemeSel/images/blocks/BL1.gif";
$block1 = "themes/$ThemeSel/images/titles/$title.gif";
$block2 = "themes/$ThemeSel/images/titles/$title.gif";
$giftitle = "themes/$ThemeSel/images/blocks/$title.gif";
$jpgtitle = "themes/$ThemeSel/images/blocks/$title.jpg";
$jpegtitle = "themes/$ThemeSel/images/blocks/$title.jpeg";
$pngtitle = "themes/$ThemeSel/images/blocks/$title.png";
if(file_exists($block1)){
   $title = "";
}
else if(file_exists($pngtitle)){
   $title = "<img src=\"$pngtitle\">";
}
else if (file_exists($jpegtitle)){
   $title = "<img src=\"$jpegtitle\">";
}
else if(file_exists($jpgtitle)){
   $title = "<img src=\"$jpgtitle\">";
}
else if (file_exists($giftitle)){
   $title = "<img src=\"$giftitle\">";
}

if (file_exists($block1)){
   $BR1 = "background=\"$block1\">";
}
else {
   $BR1 = "background=\"$blockR\">";
}
if (file_exists($block2)){
   $BL1 = "background=\"$block2\">";
}
else {
   $BL1 = "background=\"$blockL\">";
}

$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;

}


Next open blockR and blockL HTML and replace background="url" with just $BR1 or $BL1.
Also create a titles folder to put the background files in and remember they have to share the same name as the title for this to work. If you want to add more file extensions just duplicate the relevant code and rename them.


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum