Author |
Message |
vaudevillian
Worker


Joined: Jan 18, 2008
Posts: 143
|
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
Moderator

Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic
|
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. |
_________________ "For those whom have not reach the sky... Every mountain seems high"
Best Regards
Jonathan Estrella
http://about.me/jestrella04 |
|
|
 |
vaudevillian

|
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

|
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

|
Posted:
Sun Apr 06, 2008 9:44 am |
|
I did not have nsncb_func.php file in my install file for nsn blocks |
|
|
|
 |
vaudevillian

|
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.
www.speakeyzy.com
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

|
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. |
|
|
|
 |
horrorcode
Involved


Joined: Jan 17, 2009
Posts: 272
Location: Missouri
|
Posted:
Tue Mar 17, 2009 6:28 pm |
|
Sorry to open an old topic, but, I figured this is as good a place as any.
Would there be any way to edit it to use the block functions, lets say blocks r?
If not, is there any possible way to create and get it to use opentable3? I can get it to use 2 but that wont work right.
That may be more of a theme issue, but are the opentable functions defined anywhere else throughout the core? |
|
|
|
 |
nuken
RavenNuke(tm) Development Team

Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Tue Mar 17, 2009 6:41 pm |
|
Doesn't auto themes have a center blocks feature that allows for theme changes in those blocks? |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
 |
horrorcode

|
Posted:
Tue Mar 17, 2009 6:45 pm |
|
I thought of that, but I dont have much experience with it yet. I'm gonna toy around with it though. |
|
|
|
 |
nuken

|
Posted:
Tue Mar 17, 2009 7:08 pm |
|
I just installed autothemes on a test site and I feel like I need an AutoThemes For Dummies book to use it. It has quite a few options.
I think that will be something I put on my bucket list. |
|
|
|
 |
horrorcode

|
Posted:
Tue Mar 17, 2009 7:11 pm |
|
Yeah, its pretty advanced and will work great once we get it down. I thought I knew what to do...LOL |
|
|
|
 |
horrorcode

|
Posted:
Tue Mar 17, 2009 7:22 pm |
|
You CAN set it to use OpenTable3, but for some reason it calls the other opentables as well. But thats okay, for now just rewriting the opentables in the theme is easy enough. Thanks again. |
|
|
|
 |
mars
Worker


Joined: Jul 08, 2006
Posts: 123
Location: Bloomsburg,Pennsylvania
|
Posted:
Wed Mar 18, 2009 5:58 am |
|
If anyone needs AutoTheme help feel free to contact me, I am not sure it will be able to fix the above situation but with AT you can create as many block areas as you want and assign whatever theme style you want to each of them. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
 |
abracadaver
New Member


Joined: Mar 05, 2009
Posts: 5
Location: Texas
|
Posted:
Wed Mar 18, 2009 9:45 am |
|
mars wrote: | If anyone needs AutoTheme help feel free to contact me, I am not sure it will be able to fix the above situation but with AT you can create as many block areas as you want and assign whatever theme style you want to each of them. |
I can also help either individuals with specific issues/questions or the RN devs if they still want to integrate AutoTheme into RN.
Also, if you have specific questions or issues with AutoTheme, feel free to post here or at the AutoTheme forums: http://www.spidean.com/name-SpideanForums.phtml
To some of the above questions, yes, with AutoTheme you can use a template for center blocks, left, right or any block by name. You can also create other areas in addition to c, l, r. You can even use a template for opentable and opentable2.
Thanks!
-Shawn |
|
|
|
 |
nuken

|
Posted:
Wed Mar 18, 2009 10:03 am |
|
Thank you for support. I installed AT on a test site and it works great. I can't wait to get time to try some of the features out. Without a doubt, it is a powerful theme system. Awesome job.  |
|
|
|
 |
horrorcode

|
Posted:
Wed Mar 18, 2009 4:36 pm |
|
Thanks again, hopefully some time will present itself for me to start learning the basics, and Im sure you guys will come in handy
For now Im actually trying to rewrite the tables in the center blocks files, as theyre defined in too many places and I dont see why it wasnt solved earlier, just gotta figure out why its still using the first opentable. Anyone else ever looked at it? |
|
|
|
 |
horrorcode

|
Posted:
Fri Mar 20, 2009 12:15 am |
|
I went ahead and wrote a tutorial to theme this a little better than it currently is, which can be seen here:
http://www.horror-code.com/ftopicp-11.html#11
I'll update this as I go, let me know if you have any ideas or advice. |
|
|
|
 |
horrorcode

|
Posted:
Sun Mar 22, 2009 11:31 pm |
|
Dont know why it took me so long but what I discovered is that some themes dont have the appropriate functions to theme this properly in the first place.
Anyways, open up nsncb_func.php and do a search for something like Code:themecenterbox($title, $content);
|
Well some themes dont even use that, not mine anyways, not the point. To go ahead and theme this to your own linking, eg. more like the side blocks, just go ahead and change the above(everywhere you see it) to Code:themecenterblocks($title, $content);
|
This way it doesnt conflict with your current themes appearance.
Now save and upload. Next open yourtheme/theme.php and add something like:
Code:function themecenterblocks($content) {
global $blockside;
$tmpl_file = "themes/Your_Theme/centerblocks.html";
$thefile = implode('', file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = '$r_file="'."$thefile".'";';
eval($thefile);
print $r_file;
}
|
right before the closing ?> of course replace Your_Theme.
Next create the file this is calling, centerblocks.html, and copy the tables etc from your themes blockleft.html or blockright.html file, you may not have one in which case youll need to find the correct lines from theme.php.
In any case this may take some tweaking but you should find this is pretty simple, you may also need to tweak the way title and content are displayed, if you need more assistance read over what I have on my site at the above link^^ and be sure to ask here so we can help. |
|
|
|
 |
|