Author |
Topic |
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 27 September 2003 : 17:55:32
|
I am interested in putting a link directly to the right of the graphic that appears on the top-left of the default page.
eg. the snitz graphic above, then directly to the right would appear my link, I have been testing and am having great difficulty finding the correct line to inset the code, any suggestions?
I saw a message from the Admin http://forum.snitz.com/forum/topic.asp?TOPIC_ID=19078 that outlined his global.asa file and the code that would be inserted in his home page, I want to insert the code in my inc_header.asp file but am unsure where exactly.
Edited: October 12, 2003 Link to the working ActiveUsersLite |
-=NiteOwl=-
|
Edited by - NiteOwl on 12 October 2003 19:05:54 |
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 27 September 2003 : 20:55:08
|
Does it help if I show you this code ?
"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"" width=""50%""><a href=""default.asp"" tabindex=""-1"">" & getCurrentIcon(strTitleImage & "||",strForumTitle,"") & "</a></td>" & vbNewLine & _
" <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine & _
" <table border=""0"" cellPadding=""2"" cellSpacing=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & strForumTitle & "</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine
call sForumNavigation()
Response.Write "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine The red is where the image is displayed.
Almost forgot, that's line 282 on a clean Snitz instalation.
|
Edited by - The Impact on 27 September 2003 20:56:10 |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 27 September 2003 : 23:10:01
|
Oh Boy, well I tried and I can not seem to insert the following code anywhere in the neighborhood of the code above.
'########## BEGIN Active Users CODE########################### Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Active Users: " & Application("ActiveUsers") & " Visits Today: " & Application("VisitorsToday") & "</font><br>" & vbCrLf Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Highest Active Users: " & Application("HighestToDate") & " " & "</font><br>" & vbCrLf '############# END Active Users CODE###########################
|
-=NiteOwl=-
|
Edited by - NiteOwl on 28 September 2003 02:33:08 |
|
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 27 September 2003 : 23:58:13
|
Are you getting errors ? Do you have a page you can show me ? |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 00:33:03
|
No errors, but the text is displaying in the wrong place, it displays top right hand corner of the screen, just under my forum name and after the word FAQ. My code looks like this:
"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td valign=""top"" width=""50%""><a href=""default.asp"" tabindex=""-1"">" & getCurrentIcon(strTitleImage & "||",strForumTitle,"") & "</a></td>" & vbNewLine & _ " <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine & _ " <table border=""0"" cellPadding=""2"" cellSpacing=""0"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & strForumTitle & "</b></font></td>" & vbNewLine & _ " </tr>" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine call sForumNavigation() '########## BEGIN Active Users CODE########################### Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Active Users: " & Application("ActiveUsers") & " Visits Today: " & Application("VisitorsToday") & "</font><br>" & vbCrLf 'Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Highest Active Users: " & Application("HighestToDate") & " " & "</font><br>" & vbCrLf '############# END Active Users CODE###########################
I find if I try to insert 'Active Users' code anywhere alse above this line I get errors, such as:
Microsoft VBScript compilation error '800a03ea'
Syntax error
/members/snitzDEV/inc_header.asp, line 282
'########## BEGIN Active Users CODE########################### ^
|
-=NiteOwl=-
|
|
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 28 September 2003 : 01:08:18
|
Try this :"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"" width=""30%""><a href=""default.asp"" tabindex=""-1"">" & getCurrentIcon(strTitleImage & "||",strForumTitle,"") & "</a></td>" & vbNewLine & _
" <td align=""center"" valign=""center"" width=""20%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Active Users: " & Application("ActiveUsers") & " Visits Today: " & Application("VisitorsToday") & "</font><br>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Highest Active Users: " & Application("HighestToDate") & " " & "</font><br>" & vbNewLine & _
" </td>" & vbNewLine
" <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine & _
" <table border=""0"" cellPadding=""2"" cellSpacing=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & strForumTitle & "</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine
call sForumNavigation()
Response.Write "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine Try that, if not working I'd try putting the red code into the begining Response.Writes of the ForumNavigation function.
Good luck ! |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 01:23:54
|
I get this error
Microsoft VBScript compilation error '800a0400'
Expected statement
/members/snitzDEV/inc_header.asp, line 289
" <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine & _ ^
|
-=NiteOwl=-
|
|
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 28 September 2003 : 02:10:35
|
Sorry that's my bad. Add the red in like so :
" <td align=""center"" valign=""center"" width=""20%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Active Users: " & Application("ActiveUsers") & " Visits Today: " & Application("VisitorsToday") & "</font><br>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Highest Active Users: " & Application("HighestToDate") & " " & "</font><br>" & vbNewLine & _
" </td>" & vbNewLine & _ |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 02:15:16
|
ewww, now thats exactly what I wanted!! Thank you sir! Now I have happy feet. |
-=NiteOwl=-
|
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 02:23:39
|
Edit - This is the final working code, also see the global.asp on the second page of posting near the end of the thread.
I have one last querry on this. To move the txt slightly to the left do I work with the 30% and 20%?
" <td valign=""top"" width=""30%""><a href=""default.asp"" tabindex=""-1"">" & getCurrentIcon(strTitleImage & "||",strForumTitle,"") & "</a></td>" & vbNewLine & _ " <td align=""center"" valign=""center"" width=""20%"">" & vbNewLine & _ " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Active Users: " & Application("ActiveUsers") & " Visits Today: " & Application("VisitorsToday") & "</font><br>" & vbNewLine & _ " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Highest Active Users: " & Application("HighestToDate") & " " & "</font><br>" & vbNewLine & _
As it so happens my numbers are slightly two big and the display wraps like this:
Active Users: 28 Visits Today: 116 Highest Active Users: 52 |
-=NiteOwl=-
|
Edited by - NiteOwl on 29 September 2003 23:19:43 |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 02:30:06
|
I made the number 25% each and the display is perfect, thanks "The Impact" |
-=NiteOwl=-
|
|
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 28 September 2003 : 02:50:34
|
No probs NiteOwl. Glad to be of service ! |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 03:50:53
|
Hi All - I was going to start a new topic, but this does actually relate to this one. The above works perfectly, my interest is in the global.asa file, my server is 3 hours time difference from me which makes my stats srat at 3am and end at 3am, I would naturally like to have some correction in the global.asa to compensate for this, if possible, its not taht big of a deal. The relevent lines are below:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
'################## START Snitz Active users ###################################### Sub Application_OnStart Application("ActiveUsers") = 0 Application("HighestToDate") = 0 Application("TodaysDate") = Date Application("VisitorsToday") = 0 End Sub
Sub Session_OnStart Session.Timeout = 20 '## minutes Session("Start") = Now Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 if Application("ActiveUsers") > Application("HighestToDate") then Application("HighestToDate") = Application("HighestToDate") + 1 end if
if Application("TodaysDate") = Date then Application("VisitorsToday") = Application("VisitorsToday") + 1 else Application("TodaysDate") = Date Application("VisitorsToday") = 1 end if
Application.UnLock End Sub
Sub Session_OnEnd ' Decrease the active visitors count when the session ends. Application.Lock Application("ActiveUsers") = Application("ActiveUsers") - 1 Application.UnLock End Sub '################## End Snitz Active users ######################################
</SCRIPT> |
-=NiteOwl=-
|
|
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 28 September 2003 : 04:14:34
|
You could use this to get your date.DateAdd("h", vbShortDate, +3) I'm pretty sure thats what to use. |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 28 September 2003 : 04:59:02
|
I am working on tis, I am looking at some of the books and it appears the code maybe this: mindyou it did not yet work grin
Sub Session_OnStart NewDate = DateAdd("h", +3, vbShortDate) Session.Timeout = 20 '## minutes Session("Start") = Now Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 |
-=NiteOwl=-
|
|
|
The Impact
Junior Member
Australia
398 Posts |
Posted - 28 September 2003 : 05:08:41
|
Checking if the time is right could be made lots easier if you change the vbShortDate to vbGeneralDate. Then it will display the date and time making it easier to check the adding is working. |
|
|
Topic |
|