% option explicit
response.buffer = true
%>
<% dim thePageTitle, thePageName, thePageNameLinks
thePageTitle = "BLOGGARES BLOGGAR"
thePageName = "blogs_showBloggersBlogs.asp¤"&replace(request.querystring,"&","|")
thePageNameLinks = "blogs_showBloggersBlogs.asp"
dim intRequestUserID
intRequestUserID = int(request("userID"))
'response.write "intRequestUserID = " &intRequestUserID& "
"
'*************** 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;"
' 16 = blogs_showBloggersBlogs.asp
call countClickPage(16, strUserID_donRollo)
dim intSortBy, strSortBy
intSortBy = int(request("sortBy"))
select case intSortBy
case 1
strSortBy = "B.bloggTitle ASC"
case 2
strSortBy = "B.bloggTitle DESC"
case 3
strSortBy = "B.datumNow DESC"
case 4
strSortBy = "B.datumNow ASC"
case 5
strSortBy = "B.countClick DESC"
case 6
strSortBy = "B.countClick ASC"
case 7
strSortBy = "B.countClickUnique DESC"
case 8
strSortBy = "B.countClickUnique ASC"
case 9
strSortBy = "countReadBloggAll"
case 10
strSortBy = "countUniqueReadBloggAll"
case 11
strSortBy = "B.countComments DESC"
case 12
strSortBy = "B.countComments ASC"
case 13
strSortBy = "B.bloggPoints DESC"
case 14
strSortBy = "B.bloggPoints ASC"
case else
strSortBy = "B.datumNow DESC"
end select
dim intPageSize, intCurrentPage, intUserTypeID
dim strSQL, objRS, arrProducts, intTotalProducts
dim intTotalPages, intStart, intEnd, intCurrentProduct
dim i, intVspace
dim intRequestThisOutput
intPageSize = int(request("size"))
intCurrentPage = int(request("page"))
intRequestThisOutput = int(request("showThisOutput"))
session.timeout = 480
' ----- set default values if no querystring has been sent yet -----------------------
if intPageSize = 0 Then
intPageSize = int(5)
Else
intPageSize = CInt(intPageSize)
End if
if intCurrentPage = 0 Then
intCurrentPage = 1
else
intCurrentPage = CInt(intCurrentPage)
end if
dim sql, rs
sql = "SELECT "
sql = sql & "userID, "
sql = sql & "bloggName, "
sql = sql & "userAlias, "
sql = sql & "countBloggs, "
sql = sql & "userProfileImage, "
sql = sql & "userHasProfileImage "
sql = sql & "FROM "
sql = sql & "tbl_user "
sql = sql & "WHERE "
sql = sql & "userID = "&intRequestUserID&";"
set rs = conn.execute(sql)
dim strBloggName_DB, strUserAlias_DB, intCountBloggs_DB
dim strUserProfileImage_DB, intUserHasProfileImage_DB
dim intUserID_DB
intUserID_DB = int(rs("userID"))
strBloggName_DB = trim(rs("bloggName"))
strUserAlias_DB = trim(rs("userAlias"))
intCountBloggs_DB = int(rs("countBloggs"))
strUserProfileImage_DB = trim(rs("userProfileImage"))
intUserHasProfileImage_DB = int(rs("userHasProfileImage"))
dim sqlLoop1, rsLoop1
sqlLoop1 = "SELECT "
sqlLoop1 = sqlLoop1 & "B.userID, "
sqlLoop1 = sqlLoop1 & "B.bloggID, "
sqlLoop1 = sqlLoop1 & "B.bloggTitle, "
sqlLoop1 = sqlLoop1 & "B.blogg, "
sqlLoop1 = sqlLoop1 & "B.datumNow, "
sqlLoop1 = sqlLoop1 & "B.datumDate, "
sqlLoop1 = sqlLoop1 & "B.countClick, "
sqlLoop1 = sqlLoop1 & "B.countClickUnique, "
sqlLoop1 = sqlLoop1 & "B.countComments, "
sqlLoop1 = sqlLoop1 & "U.userProfileImage, "
sqlLoop1 = sqlLoop1 & "U.userHasProfileImage, "
sqlLoop1 = sqlLoop1 & "U.userAlias, "
sqlLoop1 = sqlLoop1 & "B.bloggPoints "
sqlLoop1 = sqlLoop1 & "FROM tbl_blogg B "
sqlLoop1 = sqlLoop1 & "INNER JOIN tbl_user U ON B.userID = U.userID "
sqlLoop1 = sqlLoop1 & "WHERE "
sqlLoop1 = sqlLoop1 & "B.userID = "&intRequestUserID&" "
sqlLoop1 = sqlLoop1 & "AND B.hasBeenDeleted = 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() %>
|
|
|
<% select case intUserHasProfileImage_DB
case 1
%>
|
<% case 2 %>
|
<% case else %>
|
<% end select %>
Bloggare: |
<%=strUserAlias_DB%> |
Namn på bloggen: |
<%=strBloggName_DB%> |
Antal bloggar: |
<%=intCountBloggs_DB%> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% if intSortBy = 1 then %>
Rubrik på bloggen |
<% else %>
Rubrik på bloggen |
<% end if %>
<% if intSortBy = 3 then %>
Skapad |
<% else %>
Skapad |
<% end if %>
<% if intSortBy = 5 then %>
Visningar |
<% else %>
Visningar |
<% end if %>
<% if intSortBy = 7 then %>
Unika |
<% else %>
Unika |
<% end if %>
|
|
<% dim intLoopBloggID, strLoopBloggTitle, dtmLoopDateNow
dim dtmLoopDate, intLoopCountUniqueClick
dim intLoopCountClickSum, intLoopCountUniqueClickSum
dim intLoopCountReadBloggAll, intLoopCountUniqueReadBloggAll
dim strLoopBlogg, lenLoopBlogg, strLoopPrintBlogg
dim strBgColor : strBgColor = "333333"
dim intLoopCountClick, intLoopCountClickUnique
dim strLoopUserProfileImage, intLoopUserHasProfileImage
dim strLoopUserAlias, intLoopUserID, intLoppCountComments
dim intLoopBloggPoints
intLoopCountClickSum = int(0)
intLoopCountUniqueClickSum = int(0)
dim countLoop : countLoop = 1
Do
if countLoop = 3 then
countLoop = 1
end if
intLoopUserID = int(arrBloggar(0,intCurrentProduct))
intLoopBloggID = int(arrBloggar(1,intCurrentProduct))
strLoopBloggTitle = trim(arrBloggar(2,intCurrentProduct))
strLoopBlogg = trim(arrBloggar(3,intCurrentProduct))
lenLoopBlogg = len(strLoopBlogg)
strLoopPrintBlogg = left(strLoopBlogg,160)
if lenLoopBlogg > 160 then
strLoopPrintBlogg = strLoopPrintBlogg & "..."
end if
dtmLoopDateNow = trim(arrBloggar(4,intCurrentProduct))
dtmLoopDateNow = replace(dtmLoopDateNow,"/","-")
dtmLoopDate = trim(arrBloggar(5,intCurrentProduct))
intLoopCountClick = int(arrBloggar(6,intCurrentProduct))
intLoopCountClickUnique = int(arrBloggar(7,intCurrentProduct))
intLoppCountComments = int(arrBloggar(8,intCurrentProduct))
strLoopUserProfileImage = trim(arrBloggar(9,intCurrentProduct))
intLoopUserHasProfileImage = int(arrBloggar(10,intCurrentProduct))
strLoopUserAlias = trim(arrBloggar(11,intCurrentProduct))
if strBgColor = "333333" then
strBgColor = "333333"
else
strBgColor = "333333"
end if
intLoopBloggPoints = int(arrBloggar(12,intCurrentProduct))
intLoopCountClickSum = intLoopCountClickSum+intLoopCountClick
intLoopCountUniqueClickSum = intLoopCountUniqueClickSum+intLoopCountClickUnique
%>
<%=strLoopBloggTitle%> |
<%=dtmLoopDateNow%> |
<%=intLoopCountClick%> |
<%=intLoopCountClickUnique%> |
|
|
|
|
|
<% select case intLoopUserHasProfileImage
case 1
%>
|
<% case 2 %>
|
<% case else %>
|
<% end select %>
|
|
|
|
|
<% countLoop = countLoop + 1
intCurrentProduct = intCurrentProduct + 1
If intCurrentProduct >= intTotalBloggar Then Exit Do
Loop While intCurrentProduct <= intEnd - 1
%>
|
|
|
|
|
|
|
<< |
|
< |
|
<% 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 %>