Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Oct 02, 2010 5:49 pm Reply with quote

I've been asked from time-to-time how to change the RavenNuke(tm)/PHP-Nuke home to not have a module there (i.e., an empty module). Essentially what is being asked for is to let the blocks around the home module control all of the content on the home page.

This is quite easy to do and I just had to do it for one of the sites I am the web master for and this is what you can do:

1) Create an empty module (skeleton) that only makes sure the header and footer is brought in. For the purpose of this posting example, my module name is going to be EmptyModule.

a) Simply create a new directory under modules like this:

modules/EmptyModule

b) Create an index.php file with just the following code in it:

Code:

<?php
/************************************************************************
* Script:     TegoNuke(tm) EmptyModule
* Version:    00.01.00
* Author:     Rob Herder (aka: montego) of montegoscripts.com
* Contact:    montego@montegoscripts.com
* Copyright:  Copyright © 2010 by Montego Scripts
* License:    GNU/GPL 2
************************************************************************/
if ( !defined('MODULE_FILE') ) { die('You can\'t access this file directly...'); }

// The following two lines ensure the broadest applicability showing/hiding right-hand blocks between versions of RavenNuke/PHP-Nuke
$index = 1; // set to 0 to hide right blocks
define('INDEX_FILE', true); // comment out this line if want to hide right blocks (with some RavenNuke themes, you may need to leave this in and change from "true" to "false"

include_once 'header.php';
include_once 'footer.php';
die();


(Yes, you saw that correctly, no closing "?>"! Better to get in the habit of NOT closing that tag.)

2) Upload the above to your hosting account to the appropriate directory (modules)

3) Simply go to the Administration Control Panel --> Modules and click on "Put in Home" link next to the EmptyModule module and then answer "Yes" to the following question.

DONE!

Yes, it is that easy. And, if you wanted to have some text show up rather than just nothing in-between your Center Up and Center Down blocks, simply echo that text/html out in-between the two include_once statements.

Have fun!
 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sun Oct 03, 2010 5:03 am Reply with quote

Nice one!
 
View user's profile Send private message
kguske
Community Giant



Joined: Dec 11, 2005
Posts: 32

PostPosted: Sat Oct 09, 2010 7:12 pm Reply with quote

Cool... What is the reason for no closing tag? Is it a PHP 6 thing I missed?

_________________
nukeSEO.com - PHPNuke SEO search engine optimization and other professional tools for PHP-Nuke 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Oct 10, 2010 10:03 am Reply with quote

The no closing tag stops the issue of accidental update of a script to include a blank line after the closing tag. See this FAQ on Raven's site:

http://www.ravenphpscripts.com/faq-2-.html#17

If you look at the good frameworks, such as CodeIgniter and Zend Framework, their scripts do not have closing tags.

Here is even a better explanation off the CI site:

http://codeigniter.com/user_guide/general/styleguide.html#php_closing_tag

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
kguske
Community Giant



Joined: Dec 11, 2005
Posts: 32

PostPosted: Sun Oct 10, 2010 10:51 am Reply with quote

Thanks! I really appreciate your guidance on these optimization / standardization issues.

_________________
nukeSEO.com - PHPNuke SEO search engine optimization and other professional tools for PHP-Nuke 
View user's profile Send private message
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Fri Oct 15, 2010 5:03 am Reply with quote

Thank you for sharing this trick montego. Tested and working incredibly well. Very Happy
 
View user's profile Send private message Visit poster's website
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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch
linear-bunch