You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 195 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - themesidebox [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
SideX
Nuke Soldier
Nuke Soldier


Joined: May 17, 2006
Posts: 23


PostPosted: Fri May 18, 2007 3:32 pm Reply with quoteBack to top

In my theme.php file I was using the themesidebox function like this:

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


However it wasn't rendering my php properly. So I changed it to

Code:
function themesidebox($title, $content) {
    include("themes/CS_BF2142/blocks.php");
}


Is there anything bad about doing this?
Find all posts by SideXView user's profileSend private message
hue
Support Mod
Support Mod


Joined: Apr 18, 2003
Posts: 368

Location: Ohio

PostPosted: Sat May 19, 2007 6:53 am Reply with quoteBack to top

Editing the html that was within the echo/print statement would probably be the best way .

_________________
Go Go Buckeyes!!
Find all posts by hueView user's profileSend private messageICQ Number
SideX
Nuke Soldier
Nuke Soldier


Joined: May 17, 2006
Posts: 23


PostPosted: Sat May 19, 2007 10:31 am Reply with quoteBack to top

Which echo/print statemenet are you talking about? The only one I see is the "print $r_file;" statement, which wouldn't follow the correct logic I need. There is no echo/print statements in blocks.php that work because implode, stripslashes, and eval cause it to not execute properly. At least thats what I'm blaming it on.

I'm trying to do something like (in pseudo code):
Code:

if($title = modules){
$img = "/themes/themename/images/1.gif";
} elseif ($title = survays){
$img = "/themes/themename/images/2.gif";
} else {
$img = "/themes/themename/images/blocks_01.gif";
}


Which will use different images depending on the block name.
Find all posts by SideXView user's profileSend private message
hue
Support Mod
Support Mod


Joined: Apr 18, 2003
Posts: 368

Location: Ohio

PostPosted: Sat May 19, 2007 11:10 am Reply with quoteBack to top

I should have clarified myself a bit more as I made just a "generalized" statement, and not so much intended directly towards your issue at hand. For example :
Code:
function themesidebox($title, $content) {
    echo "<table border=\"0\" align=\"center\" width=\"138\" cellpadding=\"0\" cellspacing=\"0\">"
        ."<tr><td background=\"themes/yourtheme/images/table-title.gif\" width=\"138\" height=\"20\">"
        ."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#FFFFFF\"><b>$title</b></font>"
        ."</td></tr><tr><td><img src=\"themes/yourtheme/images/pixel.gif\" width=\"100%\" height=\"3\"></td></tr></table>\n"
        ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"138\">\n"
        ."<tr><td width=\"138\" bgcolor=\"#000000\">\n"
        ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"138\">\n"
        ."<tr><td width=\"138\" bgcolor=\"#ffffff\">\n"
        ."$content"
        ."</td></tr></table></td></tr></table><br>";
}

_________________
Go Go Buckeyes!!
Find all posts by hueView user's profileSend private messageICQ Number
SideX
Nuke Soldier
Nuke Soldier


Joined: May 17, 2006
Posts: 23


PostPosted: Sat May 19, 2007 6:11 pm Reply with quoteBack to top

Ah OK. Thats pretty much what I was doing, but rather than including the block code inside the theme.php file I was putting the echo statement in blocks.php and just including it. Same difference Very Happy

Thanks
Find all posts by SideXView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.216 Seconds - 206 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::