Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 82
7 members and 75 guests
ass6reetmanageb, getzw5tridofy6n, gratoiduat5kmes, res3sawumewotg4, roofrepairoa, stozlx2ragegq7q, zcchenenxiop
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
tattoo fonts
http://www.checkoutmyink.com/category/tattoo-fonts-tattoo

Go Back   Nukemods Forum > PHP-Nuke 7.x > Nuke 7.x - Blocks

Reply
 
LinkBack Thread Tools Display Modes
How do I get image title in block instead of text?
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 1
Join Date: Oct 2004
How do I get image title in block instead of text? - 05-11-2005, 04:20 PM

How do I use image title instead of text? Do I have to hack or tweak theme.php or something? I know this can be done but I can't find the hack or tweak, Dose anyway know how to do this or where to find a site that tell you?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Super Moderator
 
coldblooded's Avatar
 
Status: Offline
Posts: 624
Join Date: Jan 2002
Location: USA
05-12-2005, 03:05 PM

Little different depending on the theme, but I'll use our themes as an example. Backup your theme first.

Put a file named blocks.php in the theme folder, paste the html from the blocks.html file the theme is currently using in there.

Then replace:
Code:
<font class="block-title">$title</font>
With:
Code:
<?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\">$title"; 
                        } 
        } 
?>
And replace:
Code:
<font class="content">$content</font>
With:
Code:
<?php 
echo "<font class=\"content\">$content</font>\n" 
?>
Then in your theme.php replace:
Code:
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/YOUR_THEME/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}
With:
Code:
function themesidebox($title, $content) { 

        include("themes/YOUR_THEME/blocks.php"); 
}
Make up your block title image gifs, and put them in themes\YOUR_THEME\images\blocks. The name of the block must match the name of the image (name the block modules and it will look for modules.gif). All references to YOUR_THEME need to be changed to your theme name.


The more we learn... the more we realize how little we actually know.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 6
Join Date: May 2005
05-13-2005, 10:25 PM

nice ive been searching for a tut. on how to do this but of course the current theme im using is a bit different. For example my block.html is set up like this
Code:
<table id="SKV3 Block" width="170" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td background="themes/SKV3/images/B/SKV3_B_01.gif" width="170" height="50" align="center" valign="middle">$title</td>
  </tr>
  <tr> 
    <td background="themes/SKV3/images/B/SKV3_B_02.gif" width="170"> 
      <table width="75%" border="0" cellpadding="0" cellspacing="0" align="center">
        <tr> 
          <td>$content</td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td> [img]themes/SKV3/images/B/SKV3_B_03.gif[/img]</td>
  </tr>
</table>
can you offer any assistance. Thanks in advance
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Super Moderator
 
coldblooded's Avatar
 
Status: Offline
Posts: 624
Join Date: Jan 2002
Location: USA
05-13-2005, 10:51 PM

Sure, try this for your blocks.php:

Code:
<table id="SKV3 Block" width="170" border="0" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td background="themes/SKV3/images/B/SKV3_B_01.gif" width="170" height="50" align="center" valign="middle">
<?php 
        if (!empty($title)) { 


                        $img_name=explode(" ",$title); 
                        $img_nametwo=$img_name[0]; 
                        if(file_exists("themes/SKV3/images/blocks/$img_nametwo.gif")) { 
                                echo "<IMG SRC=\"themes/YOUR_THEME/images/blocks/$img_nametwo.gif\">"; 
                        } else { 
                                echo "<font class=\"blocktitle\">$title"; 
                        } 
        } 
?>
	</td> 
  </tr> 
  <tr> 
    <td background="themes/SKV3/images/B/SKV3_B_02.gif" width="170"> 
      <table width="75%" border="0" cellpadding="0" cellspacing="0" align="center"> 
        <tr> 
          <td>
<?php 
echo "<font class=\"content\">$content</font>\n" 
?>
		  </td> 
        </tr> 
      </table></td> 
  </tr> 
  <tr> 
    <td> [img]themes/SKV3/images/B/SKV3_B_03.gif[/img]</td> 
  </tr> 
</table>
I'm not sure what theme that is, it can take some adjusting.


The more we learn... the more we realize how little we actually know.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 6
Join Date: May 2005
05-16-2005, 01:20 AM

thanks man it worked an looks fine in fire fox but in regular i.e it has slice like a space in between the next image for the block. Itll just take some adjusting. Thanks for the help m8 :wink:
   
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
Help with Quick title mod & Forum Center block! izone Nuke 7.x - Blocks 0 10-13-2005 09:58 AM
Scrolling text block evilsmiley Nuke 7.x - Blocks 1 01-22-2005 11:53 AM
Font text colors in Block. sentinela Site design 4 10-16-2004 12:40 AM
Mod/ Block Tutorial or looking for a Text Mod Silent54 Open topics 0 08-24-2004 05:07 PM
Block title displayed as an image Si Purged Topics 3 03-12-2003 09:51 AM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.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