Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Active Users Lite Code Question
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 4

NiteOwl
Junior Member

Canada
403 Posts

Posted - 27 September 2003 :  17:55:32  Show Profile  Visit NiteOwl's Homepage
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  Show Profile
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
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 27 September 2003 :  23:10:01  Show Profile  Visit NiteOwl's Homepage
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
Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 27 September 2003 :  23:58:13  Show Profile
Are you getting errors ? Do you have a page you can show me ?
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  00:33:03  Show Profile  Visit NiteOwl's Homepage
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=-
Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 28 September 2003 :  01:08:18  Show Profile
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 !
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  01:23:54  Show Profile  Visit NiteOwl's Homepage
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=-
Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 28 September 2003 :  02:10:35  Show Profile
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 & _
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  02:15:16  Show Profile  Visit NiteOwl's Homepage
ewww, now thats exactly what I wanted!! Thank you sir! Now I have happy feet.

-=NiteOwl=-
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  02:23:39  Show Profile  Visit NiteOwl's Homepage
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
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  02:30:06  Show Profile  Visit NiteOwl's Homepage
I made the number 25% each and the display is perfect, thanks "The Impact"

-=NiteOwl=-
Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 28 September 2003 :  02:50:34  Show Profile
No probs NiteOwl. Glad to be of service !
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  03:50:53  Show Profile  Visit NiteOwl's Homepage
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=-
Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 28 September 2003 :  04:14:34  Show Profile
You could use this to get your date.
DateAdd("h", vbShortDate, +3)
I'm pretty sure thats what to use.
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 September 2003 :  04:59:02  Show Profile  Visit NiteOwl's Homepage
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=-
Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 28 September 2003 :  05:08:41  Show Profile
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.
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.41 seconds. Powered By: Snitz Forums 2000 Version 3.4.07