Author |
Message |
draxx
Involved


Joined: Nov 19, 2003
Posts: 282
|
Posted:
Mon Jul 06, 2009 3:06 pm |
|
Okay I have the blocks by module hack - nice hack - ive insisted it be included and blah blah.
Anyways- I went a step further to add center blocks in all modules instead of just the home page.
function foot() {
global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $name, $admin;
if(defined('HOME_FILE')) {
blocks('Down');
}
// adding to show bottom blocks in all mods
else { blocks('Down');
}
The problem is here - as News is my home_file - when someone reads a news article I get all the center blocks I had defined for the home page - or in the case - the news module - on the article page.
Is there a way to say something like if its the home-file but not the home page? Is there an identifier for the home page? like If (defined(home_file)) && Home_page="False" then no blocks down?
Same way in header.php also. |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Mon Jul 06, 2009 4:27 pm |
|
Not that I know of. You could make it work specifically for news by adding if statements for $op. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Tue Jul 07, 2009 7:55 am |
|
Interesting. I have been looking at a problem like this too. I'd like to use one of the content pages as my "home page" but RN insists on having a home module and if you make content be the main module you get all the header stuff associated with it and the list of all content pages. And using standard RN (derived from *nuke) you HAVE TO have a home module. The name of that module gets stored in the _main table ... look at modules.php in the admin directory to see how.
Without rewriting the code the only workaround I can see for this is to create a do-nothing module (I think I've posted the code for that here at some time) that doesn't have any output and make that be the main module. Then use whatever blocks you want on your home page using center up and center down. By the way, center blocks are not defined on a per module basis ... they are universal no matter what module you put in home. |
|
|
|
 |
wHiTeHaT
Life Cycles Becoming CPU Cycles

Joined: Jul 18, 2004
Posts: 579
|
Posted:
Fri Jul 10, 2009 1:42 pm |
|
normaly this should work:
Code:
if(defined('HOME_FILE')||($name == 'News') AND ($file == 'article')) {
blocks('Down');
}
|
Dont forget to add the globals $name and $title else wont work |
|
|
|
 |
draxx

|
Posted:
Fri Jul 10, 2009 11:38 pm |
|
Thanks wHiTeHaT!
It took this:
//modified to display center blocks everywhere but article pages
if(($name == 'News') AND ($file == 'article')) {
//do nothing because top blocks on article pages is annoying
} else if((defined('HOME_FILE')) AND ($file != 'article')) {
//display the message box only on the home page but not on article pages
//this is done in case the module news is the home module
message_box();
blocks('Center');
} else {
// display center blocks everywhere else
blocks('Center');
} |
|
|
|
 |
nextgen
Worker


Joined: Sep 28, 2006
Posts: 241
|
Posted:
Fri Feb 03, 2012 2:19 pm |
|
Where can i find this modification friend ? |
_________________ alterednuke.com Your source for Ravennuke themes. |
|
|
 |
|