Server path variable for upload preferences
Posted: 06 October 2008 05:32 PM   [ Ignore ]  
Summer Student
Total Posts:  4
Joined  07-29-2008

I am presently working on a new web site that is under development but something makes the development very complicated and I would like to know if someone has a way to fix this.

I am working on this site with a partner so we work on each of our local development web servers and we both connect to a development database that is located on an external web server. There are 2 development web servers that are synced using Subversion and 1 development database. We used the config.php configurations from this site to be able to easily work on each of our local web server but we are now having problems with the upload preferences. I did not find any other way to store the upload preferences beside using the control panel which stores them in the database. Since we only use 1 database, it makes it very complicated to always have to change the preferences in the control panel when we want to test something.

Is it possible to set the root server path somewhere in the config.php file or the path.php file and then be able to use it in the upload preferences? I also tried to use the {site_url} variable for URL of Upload Directory preference and that did not seem to work.

It would be nice to have a variable in the config.php or the path.php for the root of the server path, it would be much easier to configure development servers.

Thank you.

Profile
 
 
Posted: 06 October 2008 05:52 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12381
Joined  04-29-2002

Jean-Francois, one thing you could do for testing purposes is to define two different global variables for testing purposes.

So you’d have a filedir_1 and a filedir_2, but is the issue inside of entries, or inside of templates?

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 06 October 2008 06:08 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  4
Joined  07-29-2008

I am having issues when I try to publish a new article and I am having issues with the template that wants to display the uploaded images.

I use the File extension by Mark Huot for uploading those images when I publish and then I use variables like {image-1} inside a <img> tag to display them in the template. I am guessing that when I use {image-1}, it gets the url of that image using the preferences inside the upload preferences so this is why it needs to be change if each servers use a different development URL. Something similar must happen when I try to upload an image, it uses the directory path from the preferences.

Profile
 
 
Posted: 06 October 2008 06:30 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12381
Joined  04-29-2002

I can’t speak about using Mark’s File extension - I don’t use it.

What I have done on the front end is to create a global variable called {img_dir} which I use in templates.

You could put that variable in your path.php file.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64912 Total Logged-in Users: 32
Total Topics: 81863 Total Anonymous Users: 14
Total Replies: 440098 Total Guests: 194
Total Posts: 521961    
Members ( View Memberlist )
Newest Members:  bjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkeybenekwhobutsb