% option explicit
response.buffer = true
%>
<% dim thePageTitle, thePageName, thePageNameLinks
thePageTitle = "BLOGGAR"
thePageName = "blogs_showLatestBlogs.asp"
thePageNameLinks = "blogs_showLatestBlogs.asp"
Session.LCID = 1041
dim intActualSessionUserID
intActualSessionUserID = int(session("userID"))
'response.write "intActualSessionUserID = " &intActualSessionUserID& "
"
'*************** 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;"
' 10 = blogs_showLatestBlogs.asp
call countClickPage(10, strUserID_donRollo)
dim intAntalBloggar_DB, intAntalBloggar_goodie
intAntalBloggar_DB = int(request("antalBloggar"))
if isNULL(intAntalBloggar_DB) then
intAntalBloggar_DB = 5
end if
if len(intAntalBloggar_DB) = 0 then
intAntalBloggar_DB = 5
end if
if intAntalBloggar_DB = 0 then
intAntalBloggar_DB = 5
end if
intAntalBloggar_goodie = intAntalBloggar_DB
'response.write "intAntalBloggar_DB = " &intAntalBloggar_DB& "
"
dim sql, rs
sql = "SELECT COUNT(*) AS antalBloggar "
sql = sql & "FROM tbl_blogg "
sql = sql & "WHERE "
sql = sql & "status = 1"
set rs = conn.execute(sql)
dim intAntalBloggar
intAntalBloggar = cint(rs("antalBloggar"))
'response.write "intAntalBloggar = " &intAntalBloggar& "
"
if intAntalBloggar_goodie > intAntalBloggar then
intAntalBloggar_goodie = intAntalBloggar
end if
dim theIP_stat, theDate_stat, theDateNow_stat
theIP_stat = Request.ServerVariables("REMOTE_HOST")
theDate_stat = date()
theDate_stat = replace(theDate_stat,"/","-")
theDateNow_stat = now()
theDateNow_stat = replace(theDateNow_stat,"/","-")
sql = "INSERT INTO tbl_statShowLatestBlogs "
sql = sql & "("
sql = sql & "userID, "
sql = sql & "ipNumber, "
sql = sql & "clickDate, "
sql = sql & "clickDateNow, "
sql = sql & "size "
sql = sql & ")"
sql = sql & "VALUES"
sql = sql & "("
sql = sql & ""&intActualSessionUserID&", "
sql = sql & "'"&theIP_stat&"', "
sql = sql & "'"&theDate_stat&"', "
sql = sql & "'"&theDateNow_stat&"', "
sql = sql & ""&intAntalBloggar&" "
sql = sql & ")"
set rs = conn.execute(sql)
dim sqlLoop1, rsLoop1
sqlLoop1 = "SELECT "
sqlLoop1 = sqlLoop1 & "B.bloggID, "
sqlLoop1 = sqlLoop1 & "B.userID, "
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 & "U.userProfileImage, "
sqlLoop1 = sqlLoop1 & "U.userHasProfileImage "
sqlLoop1 = sqlLoop1 & "FROM tbl_blogg B "
sqlLoop1 = sqlLoop1 & "INNER JOIN tbl_user U ON B.userID = U.userID "
sqlLoop1 = sqlLoop1 & "WHERE B.hasBeenDeleted = 0 "
sqlLoop1 = sqlLoop1 & "ORDER BY B.bloggID DESC LIMIT "&intAntalBloggar_DB&""
set rsLoop1 = conn.execute(sqlLoop1)
%>
www.donRollo.se
|
<% call showLogin() %>
|
|
|
|
|
<% call showMenu() %> |
|
<% call mainPage() %> |
|
|
<% call showBottom() %> |
<% sub mainPage() %>
|
|
|
Det finns ju nu <%=intAntalBloggar%> bloggar i databasen, nedan visas de <%=intAntalBloggar_goodie%> senaste. Den senaste bloggen finns såklart överst. |
|
<% if intAntalBloggar_DB = 0 then %>
|
Tyvärr, inga bloggar idag... Fast du kan kanske skriva dagens första? |
<% else %>
|
|
|
|
|
|
|
|
Rubrik på bloggen |
Skapad |
Visningar |
Unika |
|
|
<% dim intLoopBloggID, strLoopBloggTitle, dtmLoopDateNow
dim dtmLoopDate, intLoopCountClick, intLoopCountUniqueClick
dim intLoopCountClickSum, intLoopCountUniqueClickSum
dim intLoopCountReadBloggAll, intLoopCountUniqueReadBloggAll
dim strLoopBlogg, lenLoopBlogg, strLoopPrintBlogg
dim intLoopUserID
dim intLoopCountClickUnique
dim strBgColor : strBgColor = "333333"
dim strLoopUserProfileImage, intLoopUserHasProfileImage
intLoopCountClickSum = int(0)
intLoopCountUniqueClickSum = int(0)
do until rsLoop1.EOF
intLoopBloggID = int(rsLoop1("bloggID"))
intLoopUserID = int(rsLoop1("userID"))
strLoopBloggTitle = trim(rsLoop1("bloggTitle"))
strLoopBlogg = trim(rsLoop1("blogg"))
lenLoopBlogg = len(strLoopBlogg)
strLoopPrintBlogg = left(strLoopBlogg,180)
if lenLoopBlogg > 180 then
strLoopPrintBlogg = strLoopPrintBlogg & "..."
end if
dtmLoopDateNow = trim(rsLoop1("datumNow"))
dtmLoopDateNow = replace(dtmLoopDateNow,"/","-")
dtmLoopDate = trim(rsLoop1("datumDate"))
intLoopCountClick = int(rsLoop1("countClick"))
intLoopCountClickUnique = int(rsLoop1("countClickUnique"))
strLoopUserProfileImage = fixaTecken(trim(rsLoop1("userProfileImage")))
intLoopUserHasProfileImage = int(rsLoop1("userHasProfileImage"))
if strBgColor = "333333" then
strBgColor = "333333"
else
strBgColor = "333333"
end if
intLoopCountClickSum = intLoopCountClickSum+intLoopCountClick
intLoopCountUniqueClickSum = intLoopCountUniqueClickSum+intLoopCountClickUnique
%>
<%=strLoopBloggTitle%> |
<%=dtmLoopDateNow%> |
<%=intLoopCountClick%> |
<%=intLoopCountClickUnique%> |
|
|
<% select case intLoopUserHasProfileImage
case 1
%>
|
<% case 2 %>
|
<% case else %>
|
<% end select %>
|
<%=replace(strLoopPrintBlogg,"¤"," ")%> |
|
|
|
|
<% rsLoop1.MoveNext
loop
%>
|
|
|
|
|
<% end if %>
|
|
|
|
|
<% end sub %>