SSI conditional help, ssi image gallery detect file |
SSI conditional help, ssi image gallery detect file |
Harley |
Apr 17 2009, 11:41 PM
Post
#1
|
Group: Members Posts: 4 Joined: 17-April 09 Member No.: 8,363 |
I have been rewriting my fathers web site with server side includes to make future editing easier and faster.
colorwrite.webs.com My web hosting service is running Apache/1.3.39 (Unix) mod_jk/1.2.26 mod_layout/3.2 mod_gzip/1.3.19.1a mod_throttle/3.1.2 No, they do not support php, and they have no idea they support ssi. My question is can a fsize or flastmod be sent to a variable? or even better, used directly in an if directive? I would like to keep my photo gallery images and descriptions in the same folder to find and edit them easily rather than wading through a massive html file like I was just a week ago. And also be able to reuse the descriptions on other pages. -I have seen what I want to do several times in a google search, but my server does not seem to allow directives within directives like this... <!--#config errmsg=""--> <--#if expr="<!--#flastmod file="$fn/$ct.txt"--> != //" --> <!--#include file="$fn/$ct.txt"--> <--#else --> No description for $fn/$in$ct.jpg, move on to next <--#endif --> -I have also seen this wich seems to only work in Apache/2 <!--#if expr="-A /$fn/$ct.txt"--> <!--#include file="$fn/$ct.txt"--> <!--#else -->No text for $in$ct.jpg <!--#endif --> -This is my current code (abbreviated), it works, but has limitations. -contents of topic.html <!--#set var="in" value="image name" --> <!--#set var="fn" value="folder name" --> <!--#set var="ct" value="01" --><!--#include file="list.shtml" --> <!--#set var="ct" value="02" --><!--#include file="list.shtml" --> and repeat -contents of list.shtml <!--#set var="ip" value=".html/gallery/project/$fn/$in" --> <!-- image path_info for link --> <!--#set var="lnk" value="$pp$fn$ip$ct" --> <!-- link to image number whatever --> <!--#set var="tp" value="$pp$fn/$in$ct.jpg" --> <!-- path to thumbnail number whatever --> <li> <a href="<!--#echo var="lnk" -->"> <img src="<!--#echo var="tp" -->"> <span> <!--#config errmsg="No text for $in$ct.jpg"--> <!--#include file="$fn/$ct.txt" --> </span></a></li> |
pandy |
Apr 18 2009, 01:30 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
My question is can a fsize or flastmod be sent to a variable? or even better, used directly in an if directive? Yes, but the syntax you use is all wrong. You can't nest directives for starters. I got a severe case of dumbness right now and have to go to beed in a hurry, but a think the solution lies here. http://httpd.apache.org/docs/2.2/mod/mod_i...ml#substitution Honestly, I know this can be done, but I'm not sure how to write it. I'll try tonight (it's morning now) if you haven't figured it out on your own by then, but I can't promise I can do it. Those dollar signs always get me. Hopefully Darin or someone else can straight this out. |
Harley |
Apr 18 2009, 07:51 PM
Post
#3
|
Group: Members Posts: 4 Joined: 17-April 09 Member No.: 8,363 |
I found this example today and it doesn't seen to work either?
There must be a way to do this, I have seen many examples that do not seem to work, is everyone else wrong, or did I miss something simple? <!--#fcreated virtual="TEST.TXT" fmt="?" --> <!--#if var={THE_FILE_NAME} eqs="" --> File does not exist! <!--#else --> File exists! <!--#endif --> |
pandy |
Apr 18 2009, 10:12 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Hi, I spoke out of turn yesterday. It seems your first example is legit. But I think you have the quotes wrong. You have double quotes everywhere, like this.
CODE <--#if expr="<!--#flastmod file="$fn/$ct.txt"--> != //" --> Try to alternate double and single quotes, like this. CODE <--#if expr='<!--#flastmod file="$fn/$ct.txt"--> != //' --> I haven't tried the whole thing. I just did this, which worked CODE <!--#if expr='<!--#flastmod value="test.txt" --> != //' --> YES! <!--#endif --> |
Harley |
Apr 19 2009, 12:45 AM
Post
#5
|
Group: Members Posts: 4 Joined: 17-April 09 Member No.: 8,363 |
Valiant effort, but still no dice. I can't believe how many 404s I have encountered looking for this info.
After Googling for about an hour I found this passage which seems to suggest the problem is the server version not allowing nested directives. QUOTE "All the information relates to PHP4 and Apache 1.3. Little appears to have changed with PHP5 but Apache 2.x seems on first glance to allow a more flexible approach to nesting SSI and PHP." Perhaps the answer is to eliminate the IF ELSE and allow it to fail quietly on the client end, filling up the error log on the server end. I would attempt to contact WEBS.COM, but they insist ssi is not enabled on their servers, and my Premium user support tickets take up to a week for flakey, sometimes horribly incorrect answers. They do not have an e-mail address. I would cry if they found out the truth and turned ssi off. |
pandy |
Apr 19 2009, 01:28 AM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I'm stumped too. I've never tried this before. Didn't my simple snip work either? If not, I guess it's the server. They run Apache 1.3?
|
Harley |
Apr 19 2009, 05:14 PM
Post
#7
|
Group: Members Posts: 4 Joined: 17-April 09 Member No.: 8,363 |
Yes, they are
QUOTE My web hosting service is running Apache/1.3.39 (Unix) mod_jk/1.2.26 mod_layout/3.2 mod_gzip/1.3.19.1a mod_throttle/3.1.2 I did get it running, I can ony imagine what their error log looks like without the If directives example here:gallery/project/39oiltank.html |
grykolip |
Apr 30 2009, 04:58 AM
Post
#8
|
Group: Members Posts: 1 Joined: 30-April 09 Member No.: 8,480 |
i tryed to get it running but i coludnt
This post has been edited by grykolip: Apr 30 2009, 04:58 AM |
Lo-Fi Version | Time is now: 23rd April 2024 - 08:39 AM |