PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Sun Mar 22, 2009 12:06 am Reply with quote Back to top

I know it exists but I can't seem to find that hack anywhere.

It gives you the ability to define which module a block will appear in or allow it to appear in all of them.

Anyone know of where I can find that hack?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Sun Mar 22, 2009 12:12 am Reply with quote Back to top

Can you give more details on this? I'm not connecting the dots Laughing. Thanks!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Sun Mar 22, 2009 12:57 am Reply with quote Back to top

Laughing Mabie that's why I can't find it in the searches. I'm doing a terrible job of naming it!

I don't know how else to describe it - it lets you choose which module a block will appear in... i.e. you can make a block that appears only in the your account module or only in the forums module or only in the weather module or whatever module you choose..... (left or right side blocks only- not center)

When you create the block you choose which module it displays in or you choose all for all modules.

It comes installed in nukeplatnium but Im sure it was a hack ....
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1252
Location: Texas, USA

PostPosted: Sun Mar 22, 2009 1:00 am Reply with quote Back to top

Someone mentioned a theme add-on that had that feature, cant remember name for sure, "autotheme" maybe???
View user's profile Send private message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Sun Mar 22, 2009 1:11 am Reply with quote Back to top

Nope this wasent theme related.

This is integrated in the blocks admin menu right under the "visible in which modules" is a "where is this block displayed" with a module list dropdown box and an all option at the top.
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3028
Location: United Kingdom

PostPosted: Sun Mar 22, 2009 3:28 am Reply with quote Back to top

How about this:
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3028
Location: United Kingdom

PostPosted: Sun Mar 22, 2009 3:28 am Reply with quote Back to top

BTW I believe Autotheme does have this ability as well.
View user's profile Send private message
horrorcode
Involved
Involved


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

PostPosted: Sun Mar 22, 2009 1:13 pm Reply with quote Back to top

Are you thinking of the blocks manager?

Only registered users can see links on this board!
Get registered or login to the forums!


Havent tried with RN but I think theres other posts talking about this.
View user's profile Send private message Visit poster's website MSN Messenger
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3028
Location: United Kingdom

PostPosted: Sun Mar 22, 2009 1:15 pm Reply with quote Back to top

There you go three options to choose from. Wink
View user's profile Send private message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Sun Mar 22, 2009 1:43 pm Reply with quote Back to top

Thanks guys! I will venture off and check these things out and report back Wink
View user's profile Send private message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Mon Mar 23, 2009 11:50 am Reply with quote Back to top

Okay Ravens option was fine - it would work - I dident test it. Too much work as you would have to define all your blocks in the theme and that would take forever if you got extensive.

Autotheme - I dident check it either.... as I rather assumed it was a theme that was built on Raven's theme suggestion. Again a bunch more work and the idea of dealing with a new "theme" did not please me.

So I went and downloaded that file from clanthemes ... after figuring out how to get some points Rolling Eyes .... and that worked - after a few adjustments and stealing a line of code from an old mainfile.php.

Basically the mod gives you a new blocks manager from the admin. It seems to work well and gives you a block page for each module. It lets you mass select the already made blocks to each mod ... so not too tedious.

Here is the last problem and I can't solve it - I need someone from here to solve it Smile - its using old code:

For simplicity here is the blocks function:

Code:

function blocks($side) {
//  global $storynum, $prefix, $multilingual, $currentlang, $db, $admin, $user;
//  changed and added for Blocks by module

    global $storynum, $prefix, $multilingual, $currentlang, $db, $admin, $user, $name;
    if ($multilingual == 1) {
        $querylang = 'AND (blanguage=\''.$currentlang.'\' OR blanguage=\'\')';
    } else {
        $querylang = '';
    }
    if (strtolower($side[0]) == 'l') {
        $pos = 'l';
    } elseif (strtolower($side[0]) == 'r') {
        $pos = 'r';
    }  elseif (strtolower($side[0]) == 'c') {
        $pos = 'c';
    } elseif  (strtolower($side[0]) == 'd') {
        $pos = 'd';
    }
    $side = $pos;

//  $result = $db->sql_query('SELECT * FROM '.$prefix.'_blocks WHERE bposition=\''.$pos.'\' AND active=1 '.$querylang.' ORDER BY weight ASC');

if (isset($name)) {
  $sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view, b.expire, b.action, b.subscription FROM ".$prefix."_blocks b, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='$name' AND m.bposition='$pos' AND b.active='1' $querylang ORDER BY m.weight ASC";
} else {
// $result = $db->sql_query('SELECT * FROM '.$prefix.'_blocks WHERE bposition=\''.$pos.'\' AND active=1 '.$querylang.' ORDER BY weight ASC');
   $sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view, b.expire, b.action, b.subscription FROM ".$prefix."_blocks b WHERE b.bposition='$pos' AND b.active='1' $querylang ORDER BY b.weight ASC";
}
$result = $db->sql_query($sql);

    while($row = $db->sql_fetchrow($result)) {
        $groups = $row['groups'];
        $bid = intval($row['bid']);
        $title = stripslashes(check_html($row['title'], 'nohtml'));
        $content = stripslashes($row['content']);
        $url = stripslashes($row['url']);
        $blockfile = $row['blockfile'];
        $view = intval($row['view']);
        $expire = intval($row['expire']);
        $action = $row['action'];
        $action = substr("$action", 0,1);
        $now = time();
        $sub = intval($row['subscription']);
        if ($sub == 0 OR ($sub == 1 AND !paid())) {
            if ($expire != 0 AND $expire <= $now) {
                if ($action == 'd') {
                    $db->sql_query('UPDATE '.$prefix.'_blocks SET active=0, expire=\'0\' WHERE bid=\''.$bid.'\'');
                    return;
                } elseif ($action == 'r') {
                    $db->sql_query('DELETE FROM '.$prefix.'_blocks WHERE bid=\''.$bid.'\'');
                    return;
                }
            }
            if ($row['bkey'] == 'admin') {
                    adminblock();
            } elseif ($row['bkey'] == 'userbox') {
                    userblock();
            } elseif (empty($row['bkey'])) {
                if ($view == 0) {
                    render_blocks($side, $blockfile, $title, $content, $bid, $url);
                } elseif ($view == 1 AND is_user($user) || is_admin($admin)) {
                    render_blocks($side, $blockfile, $title, $content, $bid, $url);
                } elseif ($view == 2 AND is_admin($admin)) {
                    render_blocks($side, $blockfile, $title, $content, $bid, $url);
                } elseif ($view == 3 AND !is_user($user) || is_admin($admin)) {
                    render_blocks($side, $blockfile, $title, $content, $bid, $url);
                } elseif ($view > 3 AND in_groups($groups)) {
                    render_blocks($side, $blockfile, $title, $content, $bid, $url);
                }
            }
        }
    }
}


So basically it had me change 1 line of code and add a variable. The variable is $ name and is declared in global with everything else. No problem.

The line was:

// $result = $db->sql_query('SELECT * FROM '.$prefix.'_blocks WHERE bposition=\''.$pos.'\' AND active=1 '.$querylang.' ORDER BY weight ASC');

and needed changed to:

if (isset($name)) {
$sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view, b.expire, b.action, b.subscription FROM ".$prefix."_blocks b, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='$name' AND m.bposition='$pos' AND b.active='1' $querylang ORDER BY m.weight ASC";
} else {
// $result = $db->sql_query('SELECT * FROM '.$prefix.'_blocks WHERE bposition=\''.$pos.'\' AND active=1 '.$querylang.' ORDER BY weight ASC');
$sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view, b.expire, b.action, b.subscription FROM ".$prefix."_blocks b WHERE b.bposition='$pos' AND b.active='1' $querylang ORDER BY b.weight ASC";
}


And then I had to add the line from an old mainfile after comparing why I was not getting ANY blocks.

$result = $db->sql_query($sql);

My question to the team is his changed lines. What would be the new proper way to call for that data. ? Can someone please translate them?

I also make the motion that this feature be added to the CORE. IMHO The dynamics of blocks by module means the kind of dynamic content that can be offered on a "real website" - and not just the same left and right blocks on all of the pages.

Thank you all for your suggestions and special thanks to Horrorcode for leading me to that mod ... I searched for 2 days before asking here.


Last edited by draxx on Mon Mar 23, 2009 5:54 pm; edited 1 time in total
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1252
Location: Texas, USA

PostPosted: Mon Mar 23, 2009 5:37 pm Reply with quote Back to top

Yes, I too like the idea of adding the ability to display blocks by module. Smile

I noticed when tooling around with google sitemaps, that most pages that displayed both left and right blocks were deemed to be "to similar to each other". That might be different in some of the newer css based themes that load the center content first (ravenice? if I'm not mistaken?) ....

Still would be nice to be able to customize block content to be more relevant to the current module being viewed...
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum