Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   page owner information in footer of website (http://www.velocityreviews.com/forums/t878746-page-owner-information-in-footer-of-website.html)

Whitney 08-02-2004 07:47 PM

page owner information in footer of website
 
I would like all of our intranet pages to provide a link to the site
owner... and when clicked the visitor should be able to send the owner
an email.

I was using ASP to do this (see below) but I would like to not have
use the .asp extension on all 70,000 of our pages...

Can i somehow get this (or similiar) functionality using javascript?
You will notice that a _siteinfo.txt file has to be dropped into each
directory for the code to work.

This code also generates a page last modified date... but I did figure
out how to get that info using javascript.

<%
Dim fso, fname, iname, imail, fpath
Dim tsin, ln, contactline, fp, pagefile, pagedate

' Format of _siteinfo.txt data file...
'CONTACT_NAME=Whitney Cali
'CONTACT_EMAIL=webmaster@whatever.com


Set fso = Server.CreateObject("Scripting.FileSystemObject")
fp = Request.ServerVariables("PATH_TRANSLATED")

fpath = fso.GetParentFolderName(fp)

fname = fpath + "\_siteinfo.txt"

If fso.FileExists(fname) Then
Set f = fso.GetFile(fname)
Set tsin = f.OpenAsTextStream(1, -2)
Do While Not tsin.AtEndOfStream
ln = tsin.ReadLine()
If Left(ln,12) = "CONTACT_NAME" Then
iname = Mid(ln,14)
End If
If Left(ln,13) = "CONTACT_EMAIL" Then
imail = Mid(ln,15)
End If
If Left(ln,13) = "CONTACT_PHONE" Then
iphone = Mid(ln,15)
End If
Loop
' Close filestream
tsin.Close
If imail <> "" And iname <> "" Then
contactline = "Site Owner: <a href='mailto:" & imail & "?subject=Web
Site Feedback'>" & _
iname & "</a> Phone: " & iphone
Else
contactline = ""
End If
Else
contactline = ""
End If
Set tsin = Nothing

Set pagefile = fso.GetFile(fp)
pagedate = pagefile.DateLastModified

Set pagefile = Nothing
Set fso = Nothing

pagename = Request.ServerVariables("PATH_INFO")
%>

Thomas 'PointedEars' Lahn 08-03-2004 12:46 AM

Re: page owner information in footer of website
 
Whitney wrote:
> I would like all of our intranet pages to provide a link to the site
> owner... and when clicked the visitor should be able to send the owner
> an email.
>
> I was using ASP to do this (see below) but I would like to not have
> use the .asp extension on all 70,000 of our pages...


Don't do it then but let ASP parse *.html files, too.

> Can i somehow get this (or similiar) functionality using javascript?


Yes, but you will need a different server. ASP supports JScript, not
JavaScript.

> [...]
> [VBScript code snipped]


Wrong newsgroup.


PointedEars


All times are GMT. The time now is 04:06 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.