PDA

View Full Version : Changing styles


mandarinfish
24th of January 2003 (Fri), 01:40
I'm having a problem changing the styles on my exhibition pages. I've selected a particular style for both the exhibition pages and the index page, but the pages stay with the original style. I can go into the styles info editor and preview them, but I cannot see the other styles on my pages. I have probably omitted some configuration setting, but if you have any ideas, I'd appreciate hearing them.

thanks,
Linda

Pekka
24th of January 2003 (Fri), 04:47
If style file is not found in "path/stylename.php" EE has a failsafe system that prevents error messages appearing and automatically reverts to original (default) style for that exhibition/index.

But what I can't fathom is why you can see the styles in preview but not online, as preview uses the same checks and when style is not found it should give an error message explaining the reason.

Just to make sure: Are you sure you view the same gallery you're editing?

mandarinfish
24th of January 2003 (Fri), 10:36
Hi Pekka,

Yes, I am definitely viewing the same gallery that I'm editing. The only other gallery is the D30 gallery that you included in the installation, and I have the same trouble with it. I can set the styles, but when I view the exhibition, it is shown using original.

The only difference with preview appears to be that it is being done from a different directory. I am wondering if there is some php build setting for my installation of php that causes paths to be handled differently. Other functions seem to work fine, but I don't know that I've tried everything out.

thanks for any help,
Linda

Pekka
24th of January 2003 (Fri), 11:08
mandarinfish wrote:
Hi Pekka,

Yes, I am definitely viewing the same gallery that I'm editing. The only other gallery is the D30 gallery that you included in the installation, and I have the same trouble with it. I can set the styles, but when I view the exhibition, it is shown using original.

Ok.

The only difference with preview appears to be that it is being done from a different directory.

Then there's our problem.

Try this:
There is an "include path" variable in the beginning of fetchsettings.php, uncomment it (remove // from the beginning) and edit the path so that it has the server path to your gallery. Let me know if this helped.

Example:

// ini_set ("include_path",".:/home/pathtosites/mysite/mywebroot/mygallery/myfolder/");

edit to (example)

ini_set ("include_path",".:/home/sites/domain/wwwroot/gallery/");

mandarinfish
24th of January 2003 (Fri), 14:59
So this is interesting. I tried enabling that include path setting, but it didn't help, so I tracked the problem down in the fetchsettings script to the file_exists test statement, which is failing. It fails even though the file does exist. The path is correct (./styles/whateverstyle.php). file_exists doesn't pay attention to the include paths for some reason. I tried using literal strings with several relative paths and they all failed. What did work was a string with the absolute path. So that's what I'm using as a workaround for the file_exists test (I'm using an absolute path to the root instead of $toroot). The actual include still uses the path and toroot vars, and that works fine. If I get a chance, I'll try to track this down further, but for now, I have a workaround. I do wonder what is different about my php installation from others that file_exists just doesn't work that way for me. Anyway, thanks for your help in this!

Linda

mandarinfish
25th of January 2003 (Sat), 16:29
After looking a bit more on the php site, it appears this is a bug with php 4.2.3 and apache 2.*, fixed in 4.3. I can't upgrade to 4.3, as that breaks some other stuff i'm using PHP for. So for now, I've changed my workaround in fetchsettings.php to the same as others are doing, using;

if (file_exists(realpath($relPath)))

which works fine.

Thought I'd let you know!

Linda