% option explicit
response.buffer = true
%>
<% dim thePageTitle, thePageName, thePageNameLinks
thePageTitle = "ALLA BLOGGARE"
thePageName = "blogs_allBloggers.asp€"&replace(request.querystring,"&","|")
thePageNameLinks = "blogs_allBloggers.asp"
'*************** OPEN THE DATABASE
dim conn
set conn = Server.CreateObject ("ADODB.Connection")
conn.Open "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=191516-poker;User=191516_vt67146;Password=DBpoker0;Option=3;"
' 15 = blogs_allBloggers.asp
call countClickPage(15, strUserID_donRollo)
dim sql, rs
sql = "SELECT "
sql = sql & "userAlias, "
sql = sql & "countBloggs, "
sql = sql & "bloggName "
sql = sql & "FROM tbl_user "
sql = sql & "ORDER BY countBloggs DESC LIMIT 1"
set rs = conn.execute(sql)
dim strMaxUserAlias, intMaxCountBloggs, strMaxBloggName
strMaxUserAlias = trim(rs("userAlias"))
intMaxCountBloggs = int(rs("countBloggs"))
strMaxBloggName = trim(rs("bloggName"))
sql = "SELECT "
sql = sql & "COUNT(*) AS antalBloggar "
sql = sql & "FROM tbl_user "
sql = sql & "WHERE activeBlogg = 1"
set rs = conn.execute(sql)
dim intAntalBloggar
intAntalBloggar = cint(rs("antalBloggar"))
dim intSortBy, strSortBy
intSortBy = int(request("sortBy"))
select case intSortBy
case 1
strSortBy = "countBloggs DESC"
case 2
strSortBy = "userAlias ASC"
case 3
strSortBy = "bloggName ASC"
case 4
strSortBy = "countReadBloggAll DESC"
case 5
strSortBy = "countUniqueReadBloggAll DESC"
case 6
strSortBy = "userAlias ASC"
case 7
strSortBy = "bloggName ASC"
case 8
strSortBy = "countBloggs"
case 9
strSortBy = "countReadBloggAll"
case 10
strSortBy = "countUniqueReadBloggAll"
case else
strSortBy = "countBloggs DESC, countReadBloggAll DESC"
end select
dim intPageSize, intCurrentPage, intUserTypeID
dim strSQL, objRS, arrProducts, intTotalProducts
dim intTotalPages, intStart, intEnd, intCurrentProduct
dim i, intVspace
dim intRequestThisOutput, intSortOrder
intPageSize = int(request("size"))
intCurrentPage = int(request("page"))
intSortOrder = int(request("sortOrder"))
intRequestThisOutput = int(request("showThisOutput"))
session.timeout = 480
' ----- set default values if no querystring has been sent yet -----------------------
if intSortOrder = 0 then
intSortOrder = int(1)
end if
if intPageSize = 0 Then
intPageSize = int(20)
Else
intPageSize = CInt(intPageSize)
End if
if intCurrentPage = 0 Then
intCurrentPage = 1
else
intCurrentPage = CInt(intCurrentPage)
end if
dim sqlLoop1, rsLoop1
sqlLoop1 = "SELECT "
sqlLoop1 = sqlLoop1 & "userID, "
sqlLoop1 = sqlLoop1 & "userAlias, "
sqlLoop1 = sqlLoop1 & "userMail, "
sqlLoop1 = sqlLoop1 & "userCity, "
sqlLoop1 = sqlLoop1 & "bloggName, "
sqlLoop1 = sqlLoop1 & "countBloggs, "
sqlLoop1 = sqlLoop1 & "countReadBloggAll, "
sqlLoop1 = sqlLoop1 & "countUniqueReadBloggAll, "
sqlLoop1 = sqlLoop1 & "userProfileImage, "
sqlLoop1 = sqlLoop1 & "userHasProfileImage "
sqlLoop1 = sqlLoop1 & "FROM tbl_user "
sqlLoop1 = sqlLoop1 & "WHERE "
sqlLoop1 = sqlLoop1 & "countBloggs <> 0 "
sqlLoop1 = sqlLoop1 & "ORDER BY "&strSortBy&";"
set rsLoop1 = conn.execute(sqlLoop1)
dim arrBloggar
If NOT rsLoop1.EOF Then
arrBloggar = rsLoop1.GetRows()
Else
ReDim arrBloggar(0,-1)
End if
dim intTotalBloggar
intTotalBloggar = UBound(arrBloggar,2)+1
If intTotalBloggar > 0 Then
' ----- calculate total pages --------------------
intTotalPages = Int(intTotalBloggar/intPageSize)
If NOT intTotalBloggar mod intPageSize = 0 Then
intTotalPages = intTotalPages + 1
End if
' ------------------------------------------------
intStart = (intPageSize * intCurrentPage) - intPageSize
intEnd = intStart + intPageSize
intCurrentProduct = intStart
i = 0
end if
%>
www.donRollo.se
|
<% call showLogin() %>
|
|
|
|
|
<% call showMenu() %> |
|
<% call mainPage() %> |
|
|
<% call showBottom() %> |
<% sub mainPage() %>
|
|
|
Antal Bloggare: |
<%=intAntalBloggar%> st |
Bloggarkung: |
<%=strMaxUserAlias%> <%=intMaxCountBloggs%> st ("<%=strMaxBloggName%>") |
|
|
|
|
|
|
|
|
|
|
|
<% if intSortBy = 2 then %>
Bloggare |
<% else %>
Bloggare |
<% end if %>
<% if intSortBy = 3 then %>
Namn på bloggen |
<% else %>
Namn på bloggen |
<% end if %>
<% if intSortBy = 1 then %>
Antal |
<% else %>
Antal |
<% end if %>
<% if intSortBy = 4 then %>
Visningar |
<% else %>
Visningar |
<% end if %>
<% if intSortBy = 5 then %>
Unika |
<% else %>
Unika |
<% end if %>
|
<% dim intLoopUserID, strLoopUserAlias, strLoopUserCity, strLoopBloggName
dim intLoopCountReadBloggAll, intLoopCountUniqueReadBloggAll
dim intLoopCountClickSum, intLoopCountUniqueClickSum
dim strLoopUserMail, intCountBloggs
dim strUserProfileImage, intUserHasProfileImage
dim strBgColor : strBgColor = "333333"
dim intLoopCountBloggs
intLoopCountBloggs = int(0)
intLoopCountClickSum = int(0)
intLoopCountUniqueClickSum = int(0)
dim countLoop : countLoop = 1
Do
if countLoop = 3 then
countLoop = 1
end if
intLoopUserID = int(arrBloggar(0,intCurrentProduct))
strLoopUserAlias = trim(arrBloggar(1,intCurrentProduct))
strLoopUserCity = trim(arrBloggar(2,intCurrentProduct))
strLoopUserMail = trim(arrBloggar(3,intCurrentProduct))
strLoopBloggName = trim(arrBloggar(4,intCurrentProduct))
intCountBloggs = int(arrBloggar(5,intCurrentProduct))
intLoopCountReadBloggAll = int(arrBloggar(6,intCurrentProduct))
intLoopCountUniqueReadBloggAll = int(arrBloggar(7,intCurrentProduct))
strUserProfileImage = trim(arrBloggar(8,intCurrentProduct))
intUserHasProfileImage = int(arrBloggar(9,intCurrentProduct))
if strBgColor = "333333" then
strBgColor = ""
else
strBgColor = "333333"
end if
intLoopCountClickSum = intLoopCountClickSum+intLoopCountReadBloggAll
intLoopCountUniqueClickSum = intLoopCountUniqueClickSum+intLoopCountUniqueReadBloggAll
intLoopCountBloggs = intLoopCountBloggs+intCountBloggs
'response.write "intLoopUserID = " &intLoopUserID& " "
'response.write "strUserProfileImage = " &strUserProfileImage& " "
'response.write "intUserHasProfileImage = " &intUserHasProfileImage& " "
%>
<% if strBgColor = "333333" then %>
<% else %>
<% end if %>
<% select case intUserHasProfileImage
case 1
%>
|
<% case 2 %>
|
<% case else %>
|
<% end select %>
<%=strLoopUserAlias%> |
<%=strLoopBloggName%> |
<%=intCountBloggs%> |
<%=intLoopCountReadBloggAll%> |
<%=intLoopCountUniqueReadBloggAll%> |
|
|
<% countLoop = countLoop + 1
intCurrentProduct = intCurrentProduct + 1
If intCurrentProduct >= intTotalBloggar Then Exit Do
Loop While intCurrentProduct <= intEnd - 1
%>
|
|
|
|
<%=intLoopCountBloggs%> |
<%=intLoopCountClickSum%> |
<%=intLoopCountUniqueClickSum%> |
|
|
|
|
|
|
|
<< |
|
< |
|
<% dim intMin, intMax, tempLink
intMin = max(intCurrentPage-4, 1) 'get the first number
intMax = min(intMin+9, intTotalPages) 'get the last number
If cint(intCurrentPage) > cint(intTotalPages)-10 then
intMin = max(intMax-9,1)
End if
For i = intMin To intMax
If i = cint(intCurrentPage) then
tempLink = "_"
Else
tempLink = "_"
End if
%>
<%=replace(tempLink,"_",i)%> |
|
<% Next %>
> |
|
>> |
|
|
|
|
|
|
|
|
|
|
|
<% end sub %>