Topic: Advanced Question - Switching Directories

First of all, I absolutely love this product: both SVManager and Simpleviewer Pro. It's simple and clean so that I may easily customize it the way I or my clients need. I've spent many hours reconfiguring the PHP, the original FLA files (which has forced me to finally learn action script), and customizing webpages that integrate this viewer. Yesterday I got the viewer to play videos. Today, I'm figuring out how to link galleries to each other.

Now, I thought I'd figured this out. The concept is that there is a navigation bar throughout the entire site that links all the galleries together and updates automatically. Say you're in gallery root/g1. You'll see g2, g3, and g4 from there. If you update with gallery g5, it will automatically update and so will all the other pages. I did this by creating a constants2.php file and changing

define('GALLERY_DATA_FILE', 'data'.DIRECTORY_SEPARATOR.'../data/gallerydata.txt');


define('GALLERY_DATA_FILE', 'data'.DIRECTORY_SEPARATOR.'../../data/gallerydata.txt');

Essentially, I told the gallery folders to look up two directories for the data file instead of one by inserting an extra "../"

(other bits were involved as well, but I think this is the most important bit relative to this query)

I did this on my local computer (locally running apache/mysql) and it works! Wonderfully!!! It took a lot of teeth pulling, but it really paid off. But then I uploaded it to my server and I've one small, tiny glitch that won't seem to work out:

From my index file, I can see the galleries fine, but when I click on a gallery, I get "you have no galleries". It's not locating my gallerydata.txt file!

I've been working on this for several hours, and essentially figured out that it worked on my local machine because the DIRECTORY_SEPARATOR actually only replaces directories with backward slashes. So I can look up one directory ... but not two! ... when I'm on a non-local server.

The problem is, I know what's wrong, but I'm not sure how to fix it. I'd be happy with an absolute path instead of a relative path, though a relative path still certainly be ideal. I've scoured the forums, but there is very little info on the DIRECTORY_SEPARATOR ... and unfortunately, I'm still somewhat new to PHP. I can read it pretty well, but I'm still struggling with memorizing the language. Unlike CSS, ActionScript, and XML, the language is still very alien to me.

I realize this is a somewhat advanced topic, but literally I need just this last bug worked out and the site will be fully functioning.

I will continue my search while I wait for a reply.

Again, an excellent product. It's only ever failed where I didn't know enough.

Last edited by rlg (2010-01-04 08:10:24)

Re: Advanced Question - Switching Directories

OHHHHHHHHHHHHHHHHH! I DID IT! Like .... five second later.

I'm an idiot. I replaced the entire string:

define('GALLERY_DATA_FILE', 'data'.DIRECTORY_SEPARATOR.'../../data/gallerydata.txt');


define('GALLERY_DATA_FILE', '../data/gallerydata.txt');

(does the happy dance)

Re: Advanced Question - Switching Directories

Please can you give more detail as to how you did this. I have been able to get the gallery index menu to show up on my actual gallery page but the links are now relative to the gallery root
instead of

any help would be apprecaited!

Re: Advanced Question - Switching Directories

Could you please give us a little more information on what you are trying to achieve here. Which viewer are you using, is it SimpleViewer 2?


Jack Hardie
SimpleViewer Support Team.