PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
mrbilly
Worker
Worker


Joined: Jun 07, 2006
Posts: 114

PostPosted: Wed Jul 19, 2006 6:19 pm Reply with quote Back to top

I am trying to make a module I have created myself, (ie not a module already supplied with my PHPNuke Installation), display in the home page of my website.

However, when I select one I have created myself, all I can see on the home page is the following error:


You can't access this file directly...


If I select a module that is supplied with the PHPNuke package, it displayed in the home page without any problems.

Please can someone help with this?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Wed Jul 19, 2006 7:56 pm Reply with quote Back to top

Compare your module to one of the standard modules. Make sure that the first 6 or 8 lines are the same.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
mrbilly
Worker
Worker


Joined: Jun 07, 2006
Posts: 114

PostPosted: Sun Jul 23, 2006 6:02 am Reply with quote Back to top

Yes...Thank you for this Raven.

I took your advise and see the following difference...

The standard modules have the initial code as follows:

<?php

if ( !defined('MODULE_FILE') )
{
die("You can't access this file directly...");
}

define('INDEX_FILE', true);
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);



However the modules I creat myself, (using an online html to php-nuke module converter), have the following code:


<?php

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");

}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
define('INDEX_FILE', true);


If I change the code provided by the online converter to be the same as a standard module, (as you advised), the module I created does now display perfectly in the home page. I am not sure why this is exactly (and your further advise on this would be appreciated), but as i say everything does now work.

Thank you.


RavensScripts
View user's profile Send private message
montego
Site Admin


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

PostPosted: Mon Jul 24, 2006 6:50 am Reply with quote Back to top

Quote:

If I change the code provided by the online converter to be the same as a standard module, (as you advised), the module I created does now display perfectly in the home page. I am not sure why this is exactly (and your further advise on this would be appreciated), but as i say everything does now work.


The reason is those converters a very, very old. The newer patchsets changed the way certain things are done in PHP-Nuke. Unfortunately, the converter you are using has not been updated in a long time.
View user's profile Send private message Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum