View Single Post
  #2 (permalink)  
Old 09-14-2004, 12:22 PM
mikem mikem is offline
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
I know how it was done but I haven't got a hold of coldblooded to find out if there are directions on how to do it.

Basically is goes like this: This is just an example. My theme name is Anagram, yours may be different.

First does your theme use a blocks.html file?
If it does, then do the following.
open your theme.php
edit the function themesidebox area at the bottom of the file from this:

Code:
/************************************************************/
/* Function themesidebox()                                  */
/*                                                          */
/* Control look of your blocks. Just simple.                */
/************************************************************/

function themesidebox($title, $content) {
    $tmpl_file = "themes/Anagram/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}
to look like this
Code:
/************************************************************/
/* Function themesidebox()                                  */
/*                                                          */
/* Control look of your blocks. Just simple.                */
/************************************************************/

function themesidebox($title, $content) {
	include("themes/Anagram/blocks.php");
	
/*    $tmpl_file = "themes/Anagram/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
*/
}
I just commented out the old code and added the 'includes' line to include the blocks.php file we need to make from our blocks.html file.

OK open your blocks.html file. Mine looks like this:

Code:
<table width="165" border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td><table width="165" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td bgcolor="#660000"><table width="100%" border="0" cellpadding="1" cellspacing="1">
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td bgcolor="#FFFFCC"><table width="100%" border="0" cellspacing="0" cellpadding="1">
                          <tr>
                            <td height="20" background="themes/Anagram/images/cell2.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="3">
                                <tr>
                                  <td><font class="blocktitle">$title</font></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr>
                            <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
                                <tr>
                                  <td  background="themes/Anagram/images/column-bg.jpg" bgcolor="#CEC091"><font class="content">$content</font></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
and I change it to this

Code:
<table width="165" border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td><table width="165" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td bgcolor="#660000"><table width="100%" border="0" cellpadding="1" cellspacing="1">
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td bgcolor="#FFFFCC"><table width="100%" border="0" cellspacing="0" cellpadding="1">
                          <tr>
                            <td height="20" background="themes/Anagram/images/cell2.jpg">
                            <?php 
        if (!empty($title)) { 
                        $img_name=explode(" ",$title); 
                        $img_nametwo=$img_name[0]; 
                        if(file_exists("themes/Anagram/images/blocks/$img_nametwo.gif")) { 
                                echo "<IMG SRC=\"themes/Anagram/images/blocks/$img_nametwo.gif\" width=\"156\" height=\"21\" align=\"middle\">"; 
                        } else { 
                                echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
                                <tr>
                                  <td><font class=\"blocktitle\">$title</font></td>
                                </tr>
                              </table>";
                        } 
        } 
?>
			</td>
                          </tr>
                          <tr>
                            <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
                                <tr>
                                  <td  background="themes/Anagram/images/column-bg.jpg" bgcolor="#CEC091">
                                  <?php 
echo "<font class=\"content\">$content</font>\n" 
?>
                                  </td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
Your going to have to play with that part since I have no clear cut instructions. Save your changed blocks.html as blocks.php and upload it and your edited theme.php file to your themes/Yourtheme folder.

Now you need to make a new directory in your themes/Yourtheme/images folder called blocks. That is where you would upload your block title images.

Last step.
Go to your Nuke Admin/Blocks and edit one of your blocks that you have a title image for. Let's say the name of the image is sitevisitors.gif. You need to make the title of your block sitevisitors. That should do it. If your theme only uses a theme.php, then all your editing will be done to it's function themesidebox area.
Reply With Quote