Print Page | Close Window

asp topsite script

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=9919
Printed Date: 31 March 2026 at 6:23pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: asp topsite script
Posted By: salmants
Subject: asp topsite script
Date Posted: 18 February 2004 at 3:28am

i have downloaded topsite mentor from script-asp.tk.The seeting of the files inctopsite.asp is requiered which is as follows.

I have done customization but still the topsite mentor is not working.There is a problem in this file plz see

<%

'''TODO for you! Configuration:
''''1. Database connection
Function IncTopsite_GetDatabaseConn()
 Dim oRet
 Dim strDSN
 strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("topsite2.mdb")
 Set oRet = Server.CreateObject ("ADODB.Connection")
 oRet.Open strDSN 
 Set IncTopsite_GetDatabaseConn = oRet
 IncTopsite_PerhapsCleanUp oRet
End Function


'''TODO for you! Configuration:
''''2. Config variables
''''''''''''    Edit These where pointed ...   HoSt.TrUe.Ws
Const g_strPath = " http://www.nicepakistan.net/topsite - http://www.nicepakistan.net/topsite " ' write top site directory
Const g_strButtonImagePath = " http://www.nicepakistan.net/Topsite/topsite.gif - http://www.nicepakistan.net/Topsite/topsite.gif " ' your voting button
Const g_AdminUID = "admin" ' admin user name
Const g_AdminPassword = "admin" ' admin password
Const g_ClickThruPage = True

Const g_MailServer = "mail.nicepakistan.net" 'your mail server
Const g_OutgoingMailFrom = " mailto:greeting@nicepakistan.net - greeting@nicepakistan.net " ' your email

Const g_strSiteBgColor1 = "white" ' background color
Const g_strSiteBgColor2 = "white" ' background color 2
Const g_strBodyColor = "white" ' body color

''''''''''''   Ended.   Don't write under this... your site will work ccorrectly. If not send mail at mailto:host@true.ws - host@true.ws or http://www.host.true.ws - www.host.true.ws


'This variable could be set to
' DAY for hits/day ranking or
' TOTAL for total hits ranking

Const g_strRankOption = "TOTAL"

'If set to true then clicking will take the user to another page and if he/she clicks
' there a hit will be counted. This is to defeat cheating

Const g_fUseGateway = False

 

 

'''TODO for you! Configuration:
''''3. Some ads if you'd like

Function FAQ_GetAd(nNumber)
 Select Case nNumber
  Case 1
   FAQ_GetAd = ""
  Case 2
   FAQ_GetAd = ""
  Case 3
   FAQ_GetAd = ""
 End Select 
End Function

Function IncTopsite_PerhapsCleanUp( oConn )

 If g_strRankOption = "TOTAL" Then
  IncTopsite_PerhapsCleanUp = False
  Exit Function
 End If

 Dim sNow, sStart, fShouldCleanup
 sNow = Now()
 sStart = Application("ts_start")
 If sStart = "" Then
  Dim oRSWhenStart
  Set oRSWhenStart = oConn.Execute("select startdate from "& IncTopsite_GetTablePrefix() & "sysvar " )
  If oRSWhenStart.EOF Then
   oRSWhenStart.Close
   Set oRSWhenStart = Server.CreateObject("ADODB.Recordset")
      Set oRSWhenStart.ActiveConnection = oConn
   oRSWhenStart.Open "select * from " & IncTopsite_GetTablePrefix() & "sysvar where id = -1", ,1,3
   oRSWhenStart.AddNew()
   oRSWhenStart("startdate") = Now()
   oRSWhenStart.Update
   oRSWhenStart.Close
   Set oRSWhenStart = Nothing
   sStart = Application("ts_start")
   Exit Function
  Else
   sStart = oRSWhenStart("startdate")
   oRSWhenStart.Close
   Set oRSWhenStart = Nothing
  End If
 End If
 fShouldCleanup = False
 
 If ShouldCleanUp( g_strRankOption, sStart, sNow ) = True Then
  oConn.Execute("update  " & IncTopsite_GetTablePrefix() & "site set incount=0,outcount=0")
  Set oRSWhenStart = Server.CreateObject("ADODB.Recordset")
     Set oRSWhenStart.ActiveConnection = oConn
  oRSWhenStart.Open "select * from " & IncTopsite_GetTablePrefix() & "sysvar", ,1,3
  oRSWhenStart("startdate") = Now()
  oRSWhenStart.Update
  oRSWhenStart.Close
  Set oRSWhenStart = Nothing
 End If
End Function

Function IncTopsite_GetTablePrefix()
 'IncTopsite_GetTablePrefix = ""
 IncTopsite_GetTablePrefix = "" 
End Function


Function ShouldCleanUp( g_strRankOption, sStart, sNo )
 If g_strRankOption = "DAY" Then
  If DateDiff( "d", sStart, sNo ) > 1 Then
   ShouldCleanUp = True
   Exit Function
  End If
 End If
 ShouldCleanUp = False
End Function


Sub ListCategories( nSelected, fListAll ) 
 Dim oRSCats
 Dim sSelected
 Set oRSCats = oConn.Execute("select id, txt from  " & IncTopsite_GetTablePrefix() & "cat order by txt ")
 If fListAll = True Then
  If nSelected = "" Or CInt(nSelected)=0 Then
   sSelected = "selected "
  Else
   sSelected = ""
  End If
  Response.Write "<option " & sSelected & "value=""" & "0" & """>" &  "All" & "</option>"
 End If
 While Not oRSCats.EOF
  If CInt(nSelected) = CInt(oRSCats("id").Value) Then
   sSelected = "selected "
  Else
   sSelected = ""
  End If
  Response.Write "<option " & sSelected & "value=""" & oRSCats("id") & """>" &  oRSCats("txt") & "</option>"
  oRSCats.MoveNext
 Wend
 oRSCats.Close
 Set oRSCats = Nothing
End Sub


'Not working yet
Const g_AdminEmail = " mailto:webmaster@nicepakistan.net - webmaster@nicepakistan.net " 'Set this so you will get email when someone has joined the list and validation is needed
Const g_ValidationNeeded = True

%>




Replies:
Posted By: pmormr
Date Posted: 09 April 2004 at 10:56pm
might help if you posted what the error you received was and where it was... that's like 400 lines of code

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Semikolon
Date Posted: 10 April 2004 at 4:47am

nah, it was just 156

but anyways, we need the error



Posted By: salmants
Date Posted: 10 April 2004 at 4:56am

Dear

plz visit http://nicepakistan.net/top/joinlist.asp - http://nicepakistan.net/top/joinlist.asp ,when i submit data into field,it does saves into access database but does not email id to the submitter.Can any one create one such file for me that not only saves data into access database but also email the id (which is the primary key in the access database) to the email provided by the form submitterusing CDONTS

access database (topsite2.mdb)has following field s into the table named site:

id(which creates automatically as it is primary key)

url

sitename

sitedescr

catid

incount

outcount

joinedwhen

email

password

This databse has another table named cat

which includes fileds:

id

txt (like category computer,sports)

Another table in this database is

sysvar has following fields:

id

startdate

i think i have explained evry thing.

waiting for a good solution

 

http://localhost/top/joinlist.asp -  



Posted By: Semikolon
Date Posted: 10 April 2004 at 5:17am
read the CDONTS tutorial in the ASP section of this site


Posted By: Scotty32
Date Posted: 14 April 2004 at 5:11am

oooh i think i found that toplist

i had an error with it emailing out

so i scrapped it and made my own

umm sorry i cant help, since i could never fix it



-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: salmants
Date Posted: 15 April 2004 at 1:55am

Dear Scotty

can u give your topsite script to me.I will be very thankful to you.



Posted By: Scotty32
Date Posted: 15 April 2004 at 4:46am

umm i would but its not really complete and is still kinda buggy

it acctually ties into the forum though

if your good enuf with ASP you could prob fix it up

i WAS planning to start a release of it (but not using the forum)

but that will be a LONG way off yet since Win5 on jodohost kinda f***** up just a tad, so i have the fun job of uploading like 3-4 big sites

and i lost an Access database my site was running off, funny thing is i *was* planning to move it to SQL within the next couple of days

last i checked there wasnt many good toplists out there

so you could wait a while for mine

untill then check out http://www.hotscripts.com - www.hotscripts.com and http://www.aspin.com - www.aspin.com or search http://www.google.com - www.google.com



-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net