Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5
Author Message
mvillamizar
Regular
Regular



Joined: Nov 02, 2004
Posts: 54
Location: Colombia

PostPosted: Sun Jan 09, 2005 10:58 am Reply with quote

Hi Reven,

Why in some creations of a module tutorials it has the line of code
Code:
require_once("mainfile.php");

and in some others, not.

What is the porpuse of that line? can you explain it to me, please? and where it should be?

Thanks a lot.
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Jan 09, 2005 12:24 pm Reply with quote

You should be using require_once. That way, if mainfile is already loaded, PHP won't try to load it again and cause an error.
 
View user's profile Send private message
mvillamizar







PostPosted: Mon Jan 10, 2005 2:31 pm Reply with quote

Well, I made the wrong question.

What is the purpose of the "mainfile.php" file? and why some modules require the file and some not?

Thanks
 
Raven







PostPosted: Mon Jan 10, 2005 5:25 pm Reply with quote

mainfile has many common functions and routines. Otherwise you would have to hand code them in everything. If your module doesn't need the routines then it doesn't call it.
 
drmike
Worker
Worker



Joined: Jul 15, 2004
Posts: 108
Location: Charlotte, NC

PostPosted: Mon Jan 10, 2005 5:28 pm Reply with quote

Calls the theme as well if I recall. Smile

-drmike

_________________
The Daria - Jane Conspiracy 
View user's profile Send private message Visit poster's website ICQ Number
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.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5

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 ©