Author
Message
vaudevillian Worker Joined: Jan 18, 2008 Posts: 135
Posted:
Sat Apr 05, 2008 10:39 am
Im trying to figure out how to add the themes to the blocks inside the nsn center blocks.
Code that is nsn center block:
Code:
<?php
/********************************************************/
/* NSN Center Blocks for PHP-Nuke */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2003 by NukeScripts Network */
/********************************************************/
/* Original by: Richard Benfield */
/* http://www.benfield.ws */
/********************************************************/
if (eregi("cblocks.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $prefix, $db;
list($cb_enabled, $cb_height, $cb_count) = $db->sql_fetchrow($db->sql_query("select cb_enabled, cb_height, cb_count from ".$prefix."_c4blocks_config where cfgid='1'"));
if ($cb_enabled=='1') {
if ($cb_height <> "") {
$cblockheight = "height=\"$cb_height\" ";
} else {
$cblockheight = "";
}
echo "<table width=\"100%\" ".$cblockheight."border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\"><tr><td valign=\"top\">\n";
echo "<table width=\"100%\" ".$cblockheight."border=\"0\" cellspacing=\"1\" cellpadding=\"1\" bgcolor=\"$bgcolor1\"><tr><td valign=\"top\">\n";
echo "<font class=\"content\"><tr>";
$result3 = $db->sql_query("select cbid, name, title, wtype, width from ".$prefix."_c4blocks_list order by cbid asc");
while(list($cbid, $cblockname, $cblocktitle, $wtype, $width) = $db->sql_fetchrow($result3)) {
if ($cbid > $cb_count) {
} else {
if ($wtype == '0') {
echo "<td width=\"".$width."\" valign=\"top\" align=\"center\">\n";
} else {
echo "<td width=\"".$width."%\" valign=\"top\" align=\"center\">\n";
}
$content = "";
include("blocks/".$cblockname."");
themecenterbox($cblocktitle,$content);
}
}
echo "</td></tr></font>\n";
echo "</td></tr></table>\n";
echo "</td></tr></table>\n";
echo "<br>";
}
?>
I have tried to add a image to the tables but it is only comming up in the center block not the blocks themselfs. Any help would be greatly appreciated.
jestrella Worker Joined: Dec 01, 2005 Posts: 145 Location: Santiago, Dom. Rep.
Posted:
Sat Apr 05, 2008 6:44 pm
You must edit file /includes/nsncb_func.php
and make the desired changes there...
and if you can explain a bit more what changes you try to do would be better.
vaudevillian Worker Joined: Jan 18, 2008 Posts: 135
Posted:
Sat Apr 05, 2008 9:43 pm
I think what happened is I downloaded an older version of center blocks. There is no file nsncb_func.php
The file I downloaded is nsn center 4 blocks
I just got nsn_center_blocks_71-77_220
I will try this tomorrow. Thank you for your help. Sometimes even some little insite as to a file name helps out greatly.
jestrella Worker Joined: Dec 01, 2005 Posts: 145 Location: Santiago, Dom. Rep.
Posted:
Sat Apr 05, 2008 10:08 pm
if i am not wrong that is the latest available version of NSN center blocks.
The point is that those are kind of special blocks. Every block is rendered using a main function withing the nsncb_func.php file. this file is NOT located in the BLOCKS folder but within the INCLUDES folder in your nuke root folder.
That said if you already edited the needed files and what you are now trying to do is to add content to the center blocks, this is easily done through the admin system of your site. You should just activate the desired blocks and then start playing with them just as you do with normal blocks (add html code or select a file from the dropdown).
vaudevillian Worker Joined: Jan 18, 2008 Posts: 135
Posted:
Sun Apr 06, 2008 9:44 am
I did not have nsncb_func.php file in my install file for nsn blocks
vaudevillian Worker Joined: Jan 18, 2008 Posts: 135
Posted:
Sun Apr 06, 2008 11:26 am
I got the updated one installed. Works a little better as well.
What im trying to do is make those 4 center blocks inside the main box take on the theme.
you will see the 4 center blocks without the blocks theme.
So im trying to get those blocks to use the defualt theme that a user may choose.
jestrella Worker Joined: Dec 01, 2005 Posts: 145 Location: Santiago, Dom. Rep.
Posted:
Sun Apr 06, 2008 12:03 pm
Ok, now I'm getting it
It is because center blocks use the OpenTable/CloseTable functions and not the blocks() function.
Shame on PHP-Nuke base code.
View next topic
View previous 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