Author |
Message |
wHiTeHaT
Life Cycles Becoming CPU Cycles
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jul 18, 2004
Posts: 579
|
Posted:
Wed Jul 10, 2013 3:15 pm |
|
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 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 3:30 pm |
|
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Wed Jul 10, 2013 4:17 pm |
|
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? |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 4:47 pm |
|
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 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 4:54 pm |
|
Aha and from where should you get the definition from the constant _FILENOTFOUND from the land of no where? Believe me and try it out and you would see it works!
![Wink](modules/Forums/images/smiles/icon_wink.gif) |
Last edited by neralex on Wed Jul 10, 2013 4:58 pm; edited 2 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 4:56 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 5:00 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 5:05 pm |
|
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 5:07 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 5:12 pm |
|
are you trolling or what? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 5:29 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 10, 2013 5:44 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Thu Jul 11, 2013 8:26 am |
|
and what was the solution wHiTeHaT? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 11, 2013 2:02 pm |
|
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!!
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|