% @ LANGUAGE=VBScript %>
<%
sdd = dd(objConn)
strSQL = "SELECT * FROM " & tablPfx & "Main;"
set rs = objConn.Execute(strSQL)
head_left1 = rs(1): display_left1 = rs(2): top_left1 = rs(3)
head_left2 = rs(4): display_left2 = rs(5): top_left2 = rs(6)
head_left3 = rs(7): display_left3 = rs(8): top_left3 = rs(9)
head_right1 = rs(10): display_right1 = rs(11): top_right1 = rs(12)
head_right2 = rs(13): display_right2 = rs(14): top_right2 = rs(15)
head_right3 = rs(16): display_right3 = rs(17): top_right3 = rs(18)
with_left = rs(19): with_right = rs(20)
rs.close
templateName = "Main_Page_Center"
set rs = objConn.Execute("SELECT " & tablPfx & "Template.body FROM " & tablPfx & "Template WHERE tname='" & templateName & "';")
If not rs.EOF then strbody = rs(0)
rs.close
%>
| <%= head_left1 %> |
<%= strbody %>
|
<%= head_right1 %> |
| <% Response.Write BuildContent(display_left1, top_left1) %> |
<% Response.Write BuildContent(display_right1, top_right1) %> |
|
|
|
| <%= head_left2 %> |
<%= head_right2 %> |
| <% Response.Write BuildContent(display_left2, top_left2) %> |
<% Response.Write BuildContent(display_right2, top_right2) %> |
|
|
|
| <%= head_left3 %> |
<%= head_right3 %> |
| <% Response.Write BuildContent(display_left3, top_left3) %> |
<% Response.Write BuildContent(display_right3, top_right3) %> |
|
|
|
<%
If session("admin_loggedin" & strSUnique) then Response.Write "
"
Function BuildContent(contentType, topDisplay)
contentType = CInt(contentType)
topDisplay = CInt(topDisplay)
msgNoAds = ""
msgNoAccounts = ""
Select Case contentType
'### TOP HOT ADS
'----------------------------------------
Case 1
I = 1
If mysql then
strSQL = "SELECT subject, adID FROM " & tablPfx & "Ads WHERE (hotlist = 1 AND status = 1) ORDER BY pdate DESC LIMIT 0," & topDisplay & ";"
Else: strSQL = "SELECT TOP " & topDisplay & " subject, adID FROM " & tablPfx & "Ads WHERE (hotlist = 1 AND status = 1) ORDER BY pdate DESC;"
End If
set rs = objConn.Execute(strSQL)
If not rs.EOF then
strHot = "" & vbcrlf
Do While not rs.EOF
If I > topDisplay then Exit Do
title = rs(0)
If Len(title) > 60 then title = Left(title, 60) & " ..."
strHot = strHot & "![]() | " & vbcrlf
strHot = strHot & "" & title & " |
" & vbcrlf
rs.MoveNext
I = I + 1
Loop
strHot = strHot & "
"
End If
If len(strHot) = 0 then strHot = msgNoAds
rs.close
BuildContent = strHot
'### MOST VISITED ADS
'-------------------------------------------
Case 2
If mysql then
strSQL = "SELECT subject, adID, adcounter FROM " & tablPfx & "Ads WHERE (status = 1) ORDER BY adcounter DESC LIMIT 0," & topDisplay & ";"
Else: strSQL = "SELECT TOP " & topDisplay & " subject, adID, adcounter FROM " & tablPfx & "Ads WHERE (status = 1) ORDER BY adcounter DESC;"
End If
set rs = objConn.Execute(strSQL)
If not rs.EOF then
strPop = "" & vbcrlf
Do While not rs.EOF
title = rs(0)
If Len(title) > 30 then title = Left(title, 30) & " ..."
strPop = strPop & "![]() | " & vbcrlf
strPop = strPop & "" & title & " (" & rs(2) & ") Hits |
" & vbcrlf
rs.MoveNext
Loop
strPop = strPop & "
"
End If
If len(strPop) = 0 then strPop = msgNoAds
rs.close
BuildContent = strPop
'### TOP POSTERS
'-------------------------------------------
Case 3
I = 1
If mysql then
strSQL = "SELECT userID, nick, ads FROM " & tablUPfx & "User WHERE (status = 0) ORDER BY ads DESC LIMIT 0," & topDisplay & ";"
Else: strSQL = "SELECT TOP " & topDisplay & " userID, nick, ads FROM " & tablUPfx & "User WHERE (status = 0) ORDER BY ads DESC;"
End If
set rs = objConn.Execute(strSQL)
If not rs.EOF then
strPoster = "" & vbcrlf
Do While not rs.EOF
If I > topDisplay then Exit Do
strPoster = strPoster & "![]() | " & vbcrlf
strPoster = strPoster & "" & rs(1) & " (" & rs(2) & ") Ads |
" & vbcrlf
rs.MoveNext
I = I + 1
Loop
strPoster = strPoster & "
"
End If
rs.close
If Len(strPoster) = 0 then strPoster = msgNoAccounts
BuildContent = strPoster
'### TOP NEW ADS (Picked From "Content News" Template)
'-------------------------------------------
Case 4
I = 1
If mysql then
strSQL = "SELECT subject, adID, adcounter FROM " & tablPfx & "Ads WHERE (status = 1) ORDER BY pdate DESC LIMIT 0," & topDisplay & ";"
Else: strSQL = "SELECT TOP " & topDisplay & " subject, adID FROM " & tablPfx & "Ads WHERE (status = 1) ORDER BY pdate DESC;"
End If
set rs = objConn.Execute(strSQL)
If not rs.EOF then
strPop = "" & vbcrlf
Do While not rs.EOF
If I > topDisplay then Exit Do
title = rs(0)
If Len(title) > 60 then title = Left(title, 60) & " ..."
strPop = strPop & "![]() | " & vbcrlf
strPop = strPop & "" & title & " |
" & vbcrlf
rs.MoveNext
I = I + 1
Loop
strPop = strPop & "
"
End If
If len(strPop) = 0 then strPop = msgNoAds
rs.close
BuildContent = strPop
'### NEWS TEMPLATE
'-------------------------------------------
Case 5
templateName = "Content_News"
set rs = objConn.Execute("SELECT " & tablPfx & "Template.body FROM " & tablPfx & "Template WHERE tname='" & templateName & "';")
If not rs.EOF then BuildContent = rs(0)
rs.close
'### EDITORS PICK
'-------------------------------------------
Case 6
strNoPick = "No ads has beed picked by Editor yet.
"
editor_pick = objConn.Execute("SELECT editor_pick FROM " & tablPfx & "Main ;")(0)
If Not editor_pick = Empty then
editor_pick = Trim(editor_pick)
arrayPick = split(editor_pick)
For each item in arrayPick
If Not item = Empty then strWhere = strWhere & " adID = '" & item & "' OR"
Next
If Len(strWhere) > 0 then
strSQL = "SELECT subject, adID FROM " & tablPfx & "Ads WHERE (status = 1) AND (" & strWhere & " adID = '');"
set rs = objConn.Execute(strSQL)
If Not rs.EOF then
strPick = "" & vbcrlf
Do While not rs.EOF
If I > topDisplay then Exit Do
title = rs(0)
If Len(title) > 60 then title = Left(title, 60) & " ..."
strPick = strPick & "![]() | " & vbcrlf
strPick = strPick & "" & title & " |
" & vbcrlf
rs.MoveNext
Loop
strPick = strPick & "
"
End If
If len(strPick) = 0 then strPick = strNoPick
rs.close
BuildContent = strPick
End If
Else: BuildContent = strNoPick
End If
'### CUSTOM TEMPLATES
'-------------------------------------------
Case 11, 12, 13, 14, 15, 16
templID = contentType - 10
templateName = "Custom_" & templID
set rs = objConn.Execute("SELECT " & tablPfx & "Template.body FROM " & tablPfx & "Template WHERE tname='" & templateName & "';")
If not rs.EOF then BuildContent = rs(0)
rs.close
End Select
End Function
setLocale server_locale
If Not CStr(Request.Cookies("clboard_hitcount" & strUnique)("nocount")) = "True" then
Response.Cookies("clboard_hitcount" & strUnique)("nocount") = True
objConn.Execute("INSERT INTO " & tablPfx & "HitLog(hitDate, IP, referer) VALUES (" & sdd & ConvDate(Now) & sdd & ", '" & Request.ServerVariables("REMOTE_ADDR") & "', '" & Request.ServerVariables("HTTP_REFERER") & "');")
set rs = objConn.Execute("SELECT " & tablPfx & "Counter.hitcounter FROM " & tablPfx & "Counter;")
If rs.EOF then
objConn.Execute("INSERT INTO " & tablPfx & "Counter (hitcounter) VALUES (1);")
Response.Cookies("clboard_hitcount" & strUnique)("visitor") = 1
Else:
newvalue = CLng(rs("hitcounter")) + 1
Response.Cookies("clboard_hitcount" & strUnique)("visitor") = newvalue
objConn.Execute("UPDATE " & tablPfx & "Counter SET hitcounter = '" & newvalue & "';")
End If
rs.close
ExpireAds
End If
%>