Re: last modified date
"Paul E. Ross" <[email protected]>
| Newsgroups | gmane.comp.apache.mod-layout |
|---|---|
| Message-ID | <[email protected]> |
eileen brouddus wrote: > Does anyone else include a last modified date in their footer? How have > you gotten mod_layout to display it. Go to http://webnew.wuacc.edu and see > that the SSI footer displays the lastmod date, but the footer appended by > mod_layout shows nothing. > > I know I read somewhere that the last modified date was removed by > mod_layout, but I'm curious as to why and if anyone has a workaround. > > We running apache 1.3.27, mod_layout 3.2.1, and php 4.3.2. > > Thanks, > > Eileen > > -- > Eileen Brouddus > University Webmaster > Washburn University > Phone: (785) 231-1010 ext. 2301 > [email protected] > http://www.washburn.edu > > > _______________________________________________ > Mod_layout mailing list > [email protected] > http://lists.tangent.org/mailman/listinfo/mod_layout > I'm using RCS for all my web pages so I have the following in my footer (I'll bracket the code with PRE just in case you don't read in text) <PRE> <?php if (ereg("\?",$REQUEST_URI)) { $temp = explode("?",$REQUEST_URI); $file_path = $temp[0]; } else { $file_path = $REQUEST_URI; } $temp = explode("/",$file_path); if (!(eregi(".htm",end($temp)) || eregi(".php",end($temp)))) { $temp[] = "index.html"; $file_path = implode("/",$temp); } $page = array_pop($temp); $dir_path = implode("/",$temp); $full_dir_path = $DOCUMENT_ROOT.$dir_path; $full_file_path = $DOCUMENT_ROOT.$file_path; if (file_exists($full_file_path)) { if (is_dir("$full_dir_path/RCS") && file_exists("$full_dir_path/RCS/$page, v")) { $mod_date = exec ("rlog $full_file_path | grep date: | head -1 | awk '{ print \$2 }'"); } else { $mod_date = date ("F d, Y", filemtime($full_file_path)); } print "Last updated: $mod_date"; } ?> </PRE> It's not very elegant, but, then, I don't have a lot of time to tweak stuff. Ergo, if someone has a prettier solution, I'm interested as well. -- Paul Ross Senior Software Engineer Raytheon Technical Services Company LLC 281.280.2997 281.280.4138 fax 713.736.9581 pager [email protected] http://www.opengov.us