Images for 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   Images for Block Titles
lilaaron
CZ Newbie
lilaaron has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Webdesigner
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jul 26, 2004
0.00 posts per day
Posts: 5
Points: 422
   
Hi all icon_biggrin.gif

Need some help icon_rolleyes.gif

i want too make my theme like this 1 where there is a image for the block titles.

i am read a previous post but then the subject changed...

i tried 2 different ways

both in blocks.php and blocks.html

first try:

<table width=200 border=0 cellpadding=0 cellspacing=0>
  <tr>
    <td height="81">

<?php
    if (file_exists("themes/LowTech/blocks/modules/$title.gif")) {
   echo "<center><img src=\"themes/LowTech/blocks/modules/$title.gif\" border=\"0\" alt=\"\"><br><br>";
    } else {
      echo "<center><font class=\"option\"><b>$title</b></font></center><br><br>";
    }
?>

   </td>
  </tr>
  <tr>
    <td background="themes/LowTech/images/blocks_02.gif">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height=5 colspan="3"></td>
        </tr>
        <tr>
          <td width="24"> ;;</td>
          <td width="152"><font class="content">$content</font> </td>
          <td height=5 width="24"> ;;</td>
        </tr>
        <tr>
          <td colspan="3"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><img src="themes/LowTech/images/blocks_03.gif" width=200 height=48 alt=""></td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" background="themes/LowTech/images/blocks_05.gif">
  <tr>
    <td height=15></td>
  </tr>
</table>


Second Try:


<table width=200 border=0 cellpadding=0 cellspacing=0>
  <tr>
    <td height="81">

<?php
//Begin title switch by Telli
        if (!empty($title)) {


                        $img_name=explode(" ",$title);
                        $img_namecz=$img_name[0];
                        if(file_exists("themes/LowTech/images/modules/$img_namecz.gif")) {
                                echo "<center><IMG SRC=\"themes/LowTech/images/modules/$img_namecz.gif\"></center>";
                        } else {
                                echo "<center><font color=\"FFFFFF\"><b>$title</b></font></center>";
                        }
        }
?>
   </td>
  </tr>
  <tr>
    <td background="themes/LowTech/images/blocks_02.gif">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height=5 colspan="3"></td>
        </tr>
        <tr>
          <td width="24"> ;;</td>
          <td width="152"><font class="content">$content</font> </td>
          <td height=5 width="24"> ;;</td>
        </tr>
        <tr>
          <td colspan="3"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><img src="themes/LowTech/images/blocks_03.gif" width=200 height=48 alt=""></td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" background="themes/LowTech/images/blocks_05.gif">
  <tr>
    <td height=15></td>
  </tr>
</table>


and both Did Not work!

Heres wot i got in my theme.php


function themesidebox($title, $content) {
    $tmpl_file = "themes/LowTech/blocks.php";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}
?>


or


function themesidebox($title, $content) {
    $tmpl_file = "themes/LowTech/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}
?>


Have tried making the blocks.php and full php file and i got the same result... not working icon_cry.gif

this is wot it looks like

[img]Removed[/img]

and different when i try the other methods... but it never displays the image

Some questions you may ask

Is the image the same name as the blocks?
Yes, i no about the Case, and it matches

Is the image located as the Image URL is stated?
Yes the image is in the themes folder LowTech, and with another folder called modules, this is where the image is stored: themes/LowTech/images/modules/

Hope some1 can help
Thanks in Adv
LiL Aaron


Back to top Reply with quote
#2   re: Images for Block Titles
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.04 posts per day
Posts: 8089
Points: 494,430
   
blocks.php

title

<?php
        if (!empty($title)) {


                        $img_name=explode(" ",$title);
                        $img_nametwo=$img_name[0];
                        if(file_exists("themes/YOUR_THEME/images/blocks/$img_nametwo.gif")) {
                                echo "<IMG SRC=\"themes/YOUR_THEME/images/blocks/$img_nametwo.gif\">";
                        } else {
                                echo "<font class=\"blocktitle\"><b>$title</b>";
                        }
        }
?>


content

<?php
echo "$content\n"
?>


Then in your theme

function themesidebox($title, $content) {

        include("themes/YOUR_THEME/blocks.php");
}


The name of the image must match the title case does count.



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Images for Block Titles
lilaaron
CZ Newbie
lilaaron has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Webdesigner
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jul 26, 2004
0.00 posts per day
Posts: 5
Points: 422
   
hey dude,

thanks for the reply, but the image is still not showing icon_cry.gif

heres what i have got in my blocks.php


<table width=200 border=0 cellpadding=0 cellspacing=0>
  <tr>
    <td height="81">

<?php
        if (!empty($title)) {


                        $img_name=explode(" ",$title);
                        $img_nametwo=$img_name[0];
                        if(file_exists("themes/LowTech/images/blocks/$img_nametwo.gif")) {
                                echo "<IMG SRC=\"themes/LowTech/images/blocks/$img_nametwo.gif\">";
                        } else {
                                echo "<font class=\"blocktitle\"><center><b>$title</b></center>";
                        }
        }
?>

   </td>
  </tr>
  <tr>
    <td background="themes/LowTech/images/blocks_02.gif">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height=5 colspan="3"></td>
        </tr>
        <tr>
          <td width="24"> ;;</td>
          <td width="152">
      <?php
      echo "$content\n"
      ?>
   </td>
          <td height=5 width="24"> ;;</td>
        </tr>
        <tr>
          <td colspan="3"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><img src="themes/LowTech/images/blocks_03.gif" width=200 height=48 alt=""></td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" background="themes/LowTech/images/blocks_05.gif">
  <tr>
    <td height=15></td>
  </tr>
</table>


and look here too icon_cry.gif the block name matches the image name



and it shows up like this



Hope you can help

Thanks for your time and patience

LiL Aaron


Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.04 posts per day
Posts: 8089
Points: 494,430
   
Look at your paths.



themes/LowTech/images/blocks/$img_nametwo.gif

On your image its just themes/LowTech/blocks




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: Images for Block Titles
lilaaron
CZ Newbie
lilaaron has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Webdesigner
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jul 26, 2004
0.00 posts per day
Posts: 5
Points: 422
   
Thanks Dude

All working gud icon_biggrin.gif



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