Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
vaudevillian
Worker
Worker


Joined: Jan 18, 2008
Posts: 143

PostPosted: Sat Apr 05, 2008 10:39 am Reply with quote

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.
 
View user's profile Send private message Send e-mail
jestrella
Moderator


Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic

PostPosted: Sat Apr 05, 2008 6:44 pm Reply with quote

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 Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
vaudevillian
PostPosted: Sat Apr 05, 2008 9:43 pm Reply with quote

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
PostPosted: Sat Apr 05, 2008 10:08 pm Reply with quote

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
PostPosted: Sun Apr 06, 2008 9:44 am Reply with quote

I did not have nsncb_func.php file in my install file for nsn blocks
 
vaudevillian
PostPosted: Sun Apr 06, 2008 11:26 am Reply with quote

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.
Only registered users can see links on this board! Get registered or login!

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
PostPosted: Sun Apr 06, 2008 12:03 pm Reply with quote

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
Involved


Joined: Jan 17, 2009
Posts: 272
Location: Missouri

PostPosted: Tue Mar 17, 2009 6:28 pm Reply with quote

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?
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Tue Mar 17, 2009 6:41 pm Reply with quote

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! 
View user's profile Send private message Send e-mail Visit poster's website
horrorcode
PostPosted: Tue Mar 17, 2009 6:45 pm Reply with quote

I thought of that, but I dont have much experience with it yet. I'm gonna toy around with it though.
 
nuken
PostPosted: Tue Mar 17, 2009 7:08 pm Reply with quote

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. RTFM


I think that will be something I put on my bucket list.
 
horrorcode
PostPosted: Tue Mar 17, 2009 7:11 pm Reply with quote

Yeah, its pretty advanced and will work great once we get it down. I thought I knew what to do...LOL
 
horrorcode
PostPosted: Tue Mar 17, 2009 7:22 pm Reply with quote

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
Worker


Joined: Jul 08, 2006
Posts: 123
Location: Bloomsburg,Pennsylvania

PostPosted: Wed Mar 18, 2009 5:58 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
abracadaver
New Member
New Member


Joined: Mar 05, 2009
Posts: 5
Location: Texas

PostPosted: Wed Mar 18, 2009 9:45 am Reply with quote

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: Only registered users can see links on this board! Get registered or login!

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
 
View user's profile Send private message Visit poster's website
nuken
PostPosted: Wed Mar 18, 2009 10:03 am Reply with quote

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. Cheers
 
horrorcode
PostPosted: Wed Mar 18, 2009 4:36 pm Reply with quote

Thanks again, hopefully some time will present itself for me to start learning the basics, and Im sure you guys will come in handy Smile

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
PostPosted: Fri Mar 20, 2009 12:15 am Reply with quote

I went ahead and wrote a tutorial to theme this a little better than it currently is, which can be seen here: Only registered users can see links on this board! Get registered or login!

I'll update this as I go, let me know if you have any ideas or advice.
 
horrorcode
PostPosted: Sun Mar 22, 2009 11:31 pm Reply with quote

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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©