| Author |
Message |
Donovan Client

Joined: Oct 07, 2003 Posts: 735 Location: Ohio
|
Posted:
Fri Jun 09, 2006 1:28 pm |
|
One returns a local path to the www root.
What if I have my Nuke install in a subdomain for testing my module?
ServerName subdomain.example.com
I have dropdown boxes in my modules that I read the contents of some images folders, and then set that record to whatever image I want.
This no longer works because I am using a subdomain for testing and am getting an incorrect local path.
| Code: | | $urlofimages="$DOCUMENT_ROOT/modules/MILPACS/images/ranks/small/"; |
How can I get this to work no matter where my module is installed? |
|
|
 |
 |
Donovan Client

Joined: Oct 07, 2003 Posts: 735 Location: Ohio
|
Posted:
Fri Jun 09, 2006 1:54 pm |
|
register_globals are off in the php.ini file aren't they.
What can I do here? |
|
|
 |
 |
Donovan Client

Joined: Oct 07, 2003 Posts: 735 Location: Ohio
|
Posted:
Fri Jun 09, 2006 1:58 pm |
|
This works. Nevermind.
$IMAGEPATH = $_SERVER['DOCUMENT_ROOT'];
$urlofimages="$IMAGEPATH/modules/MILPACS/images/ranks/small/"; |
|
|
 |
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
|
Posted:
Fri Jun 09, 2006 2:02 pm |
|
As images that 'belong' to a module should always placed within the modules directory, the link should be relative i.e. | Code: | | $urlofimages='images/ranks/small/'; |
Don't forget there are other nuke variables already defined that you can use but you would have to declare them in the php file.
| Code: | $nuke_url - this should be whatever is set in your nuke references
$module_name - MILPACS |
|
|
|
|
 |
Donovan Client

Joined: Oct 07, 2003 Posts: 735 Location: Ohio
|
Posted:
Fri Jun 09, 2006 2:25 pm |
|
This does not work.
| Code: | | $urlofimages='images/ranks/small/'; |
But this does.
| Code: | | $urlofimages="$IMAGEPATH/modules/MILPACS/images/ranks/small/"; |
*shrugs* |
|
|
 |
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
|
Posted:
Fri Jun 09, 2006 2:39 pm |
|
Thats great.
You might want to change the $IMAGEPATH to something slightly more unique though just in case something else tries to use it.
Perhaps $MIL_IMAGEPATH ? |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Sat Jun 10, 2006 8:26 pm |
|
I always use "modules/$module_name/images/image.jpg". You could also use "./modules/$module_name/images/image.jpg".
This will work regardless of where your nuke is installed as "." is also where modules.php is, which is where everything is "relative" to. |
|
|
|
 |
|
|
|
|