» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 53
0 members and 53 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
buy Rimonabant - Help dieters achieve significant weight loss without having to slog in the gym

Register Now! Contact Us

About this Page
This is a discussion on setting up your own block titles in image within the Site design forums, part of the General category; The first time I visit nukemods... man this site is great! I figured out that nukemods.com works with their ...



Go Back   Nukemods Forum » General » Site design

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-14-2004, 10:50 AM
Junior Member
 
Join Date: Sep 2004
Posts: 3
setting up your own block titles in image
The first time I visit nukemods... man this site is great!

I figured out that nukemods.com works with their own gifs that are used for the blocktitels. for example:

How can this be done?

thx for the answers in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-14-2004, 11:22 AM
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-14-2004, 12:12 PM
Junior Member
 
Join Date: Sep 2004
Posts: 3
8O

/me is off to code some! <- n00b @ work

thx for the support!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-14-2004, 12:41 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
Yes that is normal for a theme that does not use HTML files.

Try replacing that with this:

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

function themesidebox($title, $content) { 
    echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"150\">\n" 
    ."<tr>\n" 
    ."<td>\n";

        if (!empty($title)) { 
       $img_name=explode(" ",$title); 
       $img_nametwo=$img_name[0]; 
       if(file_exists("themes/YourthemeName/images/blocks/$img_nametwo.gif")) { 
    echo "<IMG SRC=\"themes/YourthemeName/images/blocks/$img_nametwo.gif\" align=\"middle\">"; 
       } else { 
    echo  "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#EEEEEE\" width=\"100%\">\n" 
   ."<tr>\n" 
   ."<td align=left><font class=\"content\" color=\"#363636\">$title</font></td>\n" 
   ."</tr>\n" 
   ."</table>\n"; 
             } 
       } 



   echo "</td>\n" 
   ."</tr>\n" 
   ."</table>\n" 

   ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"150\">\n" 
   ."<tr valign=\"top\"><td>\n" 
   ."$content\n" 
   ."</td></tr></table>\n" 
   ."
\n\n\n"; 
} 

?>
Change YourThemeName to the name of your theme. BACKUP your THEME.PHP before you upload your edited one.
I can't test that code, so it's gonna be trial and error for ya.

mikem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-14-2004, 12:49 PM
Junior Member
 
Join Date: Sep 2004
Posts: 3
YOU ROCK!!!

It works!


Quote:
sorry I deleted the previous post, you were too quick to answer -> it worked without your last post. I just copied the content you entered and it worked (ANd there is probably a difference between your Anagrama and mine, because I used the same theme)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-14-2004, 12:59 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
Originally Posted by Rodriguez
YOU ROCK!!!

It works!
woo, I got lucky. Hope you learned something...cause I didn't...hehe :wink:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-18-2004, 10:23 PM
Junior Member
 
Join Date: Aug 2004
Posts: 13
ok im having some trouble this is the code u said to modify but the code i have in my folder looks alittlt different



yours
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; 
}


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

function themesidebox($title, $content) {
			        if (@file_exists($content)) {
                $fp = fopen ($content, "r");
                $content = fread($fp, filesize($content));
                fclose ($fp);
                $content = "?>$content<?";
                $content = eval($content);
        } else if (eregi("^http", $content)) { 
                $fp = fopen ($content, "r"); 
                $content = fread($fp, 65535); 
                fclose ($fp); 
        }
    $tmpl_file = "themes/HeliusGray/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

?>
any reason why
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-19-2004, 08:05 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
Yes, you need to follow my FIRST instructions...look up about 4 or 5 posts.
http://www.nukemods.com/modules.php?...=16934#169 34
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-08-2007, 10:50 AM
Junior Member
 
Join Date: Dec 2004
Posts: 2
How to use for two word block titles
how do you make this work for a block title that has a space in it.

Example being:

Block title Site Visitors and the images in theme/images/blocks/ being named Site Visitors doesn't work nor adding a % to the image title.

I have this working perfectly for one word titles but I need this to work for titles that have a space.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove center block titles? protegechris Nuke 7.x - Blocks 5 02-02-2005 02:35 AM
How to insert a gif image in any block sentinela Site design 3 10-11-2004 11:27 AM
where do i get a random image download block? SureFire Purged Topics 3 08-10-2003 01:37 AM
PHP generated image help, setting bg image? Zathu_Koon Open topics 1 07-24-2003 11:10 AM
need help with a random image in a block smallfry Purged Topics 6 05-30-2003 11:14 PM


All times are GMT -5. The time now is 07:22 AM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31