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 ....
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.
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 .... 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 - 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
// $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);
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
Joined: Dec 02, 2006 Posts: 1252 Location: Texas, USA
Posted:
Mon Mar 23, 2009 5:37 pm
Yes, I too like the idea of adding the ability to display blocks by module.
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 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