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
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Oct 10, 2008 12:20 pm Reply with quote

If you are a Gallery user then you know that the Integration Package available from NukedGallery.net comes with an optional sidebar block. What is somewhat confusing is that there are really two sidebars. The first can be turned on when you go into Modules Administration for Gallery. The check box for it says: "Show sidebar (uncheck if you use the G2 Sidebar block)"

As implied, this is mutually exclusive with the G2 Sidebar block that gets installed in the /blocks directory.

What I have found is that Gallery itself looks substantially better with the G2 Sidebar block than it does with the "show sidebar" option turned on. (Incidentally you can customize the G2 Sidebar block using site administration in Gallery, then themes ... but you have to go into native Gallery rather than the integrated version to do so. Your url will be something like:

http://mysite.com/nukeroot/modules/gallery2/main.php

to get into the native administration. I think this is a bug in the integration but they aren't terribly responsive to these things.

Anyway, back to the point. The problem with turning the G2 Sidebar on and putting it in the left column of your page(s) is that it occupies space on every page ... whether you are in Gcalendar or News or Content. It is really only needed (and wanted) when you are using Gallery. But there is no conditional inclusion of blocks built into Nuke ... not even into Ravennuke.

But ... we can hack can't we. Here below is the render_blocks function of mainfile (from the upcoming 2.3 version) rewritten to accomplish this.

Code:
function render_blocks($side, $blockfile, $title, $content, $bid, $url) {

   global $name;
    if(!defined('BLOCK_FILE')) {
        define('BLOCK_FILE', true);
    }
    if (empty($url)) {
        if (empty($blockfile)) {
            // GT-NExtGEn 0.5 by Bill Murrin (Audioslaved) http://gt.audioslaved.com (c) 2004
            //Modified by montego from http://montegoscripts.com for TegoNuke(tm) ShortLinks
            global $tnsl_bAutoTapBlocks;
            if (defined('TNSL_USE_SHORTLINKS') && isset($tnsl_bAutoTapBlocks) && $tnsl_bAutoTapBlocks) {
                $content = tnsl_fShortenBlockURLs('', $content);
            }
            //End of GT-NExtGEn / ShortURLs
            if ($side == 'c') {
                themecenterbox($title, $content);
            } elseif ($side == 'd') {
                themecenterbox($title, $content);
            } else {
                themesidebox($title, $content);
            }
        } else {
            if ($side == 'c') {
                blockfileinc($title, $blockfile, 1);
            } elseif ($side == 'd') {
                blockfileinc($title, $blockfile, 1);
            } else {
               if ($name != 'gallery2' && $title != 'G2 Sidebar') {
                   blockfileinc($title, $blockfile);
            }
            if ($name == 'gallery2') {
               blockfileinc($title, $blockfile);
            }
            }
        }
    } else {
        if ($side == 'c' OR $side == 'd') {
            headlines($bid,1);
        } else {
            headlines($bid);
        }
    }
}


If you have Gallery and decide to do this please take appropriate cautions. I'm not quite sure if this is fully compatible with pre-2.30 releases so you will need to test that. Make sure you save off a good copy of your present mainfile and be prepared to restore it if this gives you headaches. If you are not familiar with editing PHP files or don't have a good editor then leave this alone.

What I'm doing on my sites is turning off the imageblock that's built into the G2 Sidebar (through themes admin in Gallery as mentioned above) and instead using the separate G2 Imageblock. You can see a sample of this in action at my test site fkelly.org. Click on Gallery to see the sidebar in action and the home page to see it hidden.
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sun Oct 12, 2008 9:25 am Reply with quote

Looks good sir.

One thing I would like to do in a future RN release is make blocks completely configurable by module too. Shouldn't be that difficult to do.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
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 ©