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 General Discussion
Author Message
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Wed Jul 10, 2013 3:15 pm Reply with quote

in modules.php

if i try:
Code:


if(file_exists('modulemaker/modules/' . $name . '/' . $file . '.php')) {
            $modpath = 'modulemaker/';
         } else {
            $modpath = '';
         }
         if($name == 'Atest'){
         $modpath .= 'modules/' . $name . '/' . $file . '.php';
         }else{
         $modpath .= 'modules/' . $name . '/' . $file . '.php';
         }


module is stored in: root>modulemaker/modules/Atest

Everything is alright.

If i try:

Code:


         if(file_exists('modulemaker/modules/' . $name . '/' . $file . '.php')) {
            $modpath = 'modulemaker/';
         } else {
            $modpath = '';
         }
         if($name == 'Atest'){
         $modpath .= $name . '/' . $file . '.php';
         }else{
         $modpath .= 'modules/' . $name . '/' . $file . '.php';
         }


module is stored in: root>modulemaker/Atest

Sorry, that module file was not found.
[ Go Back ]

Why it is depending on a modules directory?
Where is that ruled?


Last edited by wHiTeHaT on Thu Jul 25, 2013 2:02 pm; edited 1 time in total 
View user's profile Send private message Send e-mail
wHiTeHaT







PostPosted: Wed Jul 10, 2013 3:30 pm Reply with quote

A quick search brings me to Groups:

define('_FILENOTFOUND','Sorry, that module file was not found.');

The only language definition is inside the Groups module.
How can it be that this define loads language content of the Groups module?

strange no?
 
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Wed Jul 10, 2013 4:17 pm Reply with quote

Its not strange, modules are based in the modules folder and all files are forced to this folder, that is simply logical. Was a constant in a module defined, so you can use it in other modules too.

easy or not?

_________________
Github: RavenNuke 
View user's profile Send private message
wHiTeHaT







PostPosted: Wed Jul 10, 2013 4:47 pm Reply with quote

No you not correct.
If i load a module it either loads the language of that module , or it falls back to the default languages.
It should not load a language definition from another module , that is what it's doing now.
The logic fails if have 2 same defines for 2 modules.

Atleast if you answering the last post i made.

[FYI]
The define i'm talking about is inside the modules.php file:

Code:


         } else {
            $pagetitle = '- ' . _FILENOTFOUND;
            include_once 'header.php';
            OpenTable();
            echo '<div class="text-center"><span class="thick">' , _FILENOTFOUND , '</span><br />'
               , _GOBACK , '</div>';
            CloseTable();
            include_once 'footer.php';
            die ();
         }


Last edited by wHiTeHaT on Wed Jul 10, 2013 4:55 pm; edited 1 time in total 
neralex







PostPosted: Wed Jul 10, 2013 4:54 pm Reply with quote

Aha and from where should you get the definition from the constant _FILENOTFOUND from the land of no where? Smile Believe me and try it out and you would see it works!

Wink


Last edited by neralex on Wed Jul 10, 2013 4:58 pm; edited 2 times in total 
wHiTeHaT







PostPosted: Wed Jul 10, 2013 4:56 pm Reply with quote

From the root> languages
 
neralex







PostPosted: Wed Jul 10, 2013 5:00 pm Reply with quote

But there is no constant like _FILENOTFOUND defined! If you would create the same defined constant in another module so you get a PHP error, that the constant is allready defined in a language file of another module.
 
wHiTeHaT







PostPosted: Wed Jul 10, 2013 5:05 pm Reply with quote

No not true, if that is the case, what seems so, then it isn't well coded.
each module uses the function get_lang() , and when this is called, it should only load language for that module.

Do you really read?

Are you agree that if i load module Topics , it should load the languages from that module , and when the define isn't there , it should fall back to the default script language , in this case folder languageS what is in root.


You say you agree it loads a define content from any module , as long as it holding the define.
Are you aware that this could lead to misinformation?
 
neralex







PostPosted: Wed Jul 10, 2013 5:07 pm Reply with quote

*gg*
 
wHiTeHaT







PostPosted: Wed Jul 10, 2013 5:12 pm Reply with quote

are you trolling or what?
 
wHiTeHaT







PostPosted: Wed Jul 10, 2013 5:29 pm Reply with quote

But beside arguing about how the language structure is.
It hasn't anything to do with the main question.

Why a module is forced to use a modules folder either it is in the standard modules folder or is in a
folder: somefolder/modules/
and not is able to load from just: somefolder/

I really like to figure that out.
 
wHiTeHaT







PostPosted: Wed Jul 10, 2013 5:44 pm Reply with quote

problem SOLVED
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Thu Jul 11, 2013 8:26 am Reply with quote

and what was the solution wHiTeHaT?
 
View user's profile Send private message
wHiTeHaT







PostPosted: Thu Jul 11, 2013 2:02 pm Reply with quote

i made a mistake in the directory path:
Code:


         $ThemeSel = get_theme();
         if(file_exists('themes/' . $ThemeSel . '/modules/' . $name . '/' . $file . '.php')) {
            $modpath = 'themes/' . $ThemeSel . '/';
         } else {
            $modpath = '';
         }
         if($name == 'Atest'){
         $modpath .= 'modulemaker/' . $file . '.php';
         }else{
         $modpath .= 'modules/' . $name . '/' . $file . '.php';
         }

Works!!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating General Discussion

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 ©