Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
draxx
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

PostPosted: Mon Jul 06, 2009 3:06 pm Reply with quote

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.
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Jul 06, 2009 4:27 pm Reply with quote

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. 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



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

PostPosted: Tue Jul 07, 2009 7:55 am Reply with quote

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.
 
View user's profile Send private message Visit poster's website
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Fri Jul 10, 2009 1:42 pm Reply with quote

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







PostPosted: Fri Jul 10, 2009 11:38 pm Reply with quote

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
Worker



Joined: Sep 28, 2006
Posts: 241

PostPosted: Fri Feb 03, 2012 2:19 pm Reply with quote

Where can i find this modification friend ?

_________________
alterednuke.com Your source for Ravennuke themes. 
View user's profile Send private message Send e-mail
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating 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 ©