PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Donovan
Client


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

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

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
Client


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

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

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

What can I do here?
View user's profile Send private message Visit poster's website ICQ Number
Donovan
Client


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

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

This works. Nevermind.

$IMAGEPATH = $_SERVER['DOCUMENT_ROOT'];
$urlofimages="$IMAGEPATH/modules/MILPACS/images/ranks/small/";
View user's profile Send private message Visit poster's website ICQ Number
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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 Visit poster's website
Donovan
Client


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

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

This does not work.

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


But this does.

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


*shrugs*
View user's profile Send private message Visit poster's website ICQ Number
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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 ?
View user's profile Send private message Send e-mail Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

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

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.
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum