Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Fri Jun 09, 2006 1:28 pm Reply with quote

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?
 
View user's profile Send private message Visit poster's website ICQ Number
Donovan







PostPosted: Fri Jun 09, 2006 1:54 pm Reply with quote

register_globals are off in the php.ini file aren't they. Crying or Very sad

What can I do here?
 
Donovan







PostPosted: Fri Jun 09, 2006 1:58 pm Reply with quote

This works. Nevermind.

$IMAGEPATH = $_SERVER['DOCUMENT_ROOT'];
$urlofimages="$IMAGEPATH/modules/MILPACS/images/ranks/small/";
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Jun 09, 2006 2:02 pm Reply with quote

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
 
View user's profile Send private message Send e-mail
Donovan







PostPosted: Fri Jun 09, 2006 2:25 pm Reply with quote

This does not work.

Code:
$urlofimages='images/ranks/small/';


But this does.

Code:
$urlofimages="$IMAGEPATH/modules/MILPACS/images/ranks/small/";


*shrugs*
 
Guardian2003







PostPosted: Fri Jun 09, 2006 2:39 pm Reply with quote

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: 9457
Location: Arizona

PostPosted: Sat Jun 10, 2006 8:26 pm Reply with quote

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.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©