<%@ LANGUAGE="VBSCRIPT" %> <%enablesessionstate=false%> <% ' This Script displayed the user's CD collection information in a nicely formatted way ' So the user can show off his collection to other users. ' If the user did not enable this option, a menu will be displayed for the user (if user login data was submitted), ' otherwise, and error will be displayed. ' response.ContentType="text/html" set conntemp=server.createobject("adodb.connection") conntemp.open "DSN=CDizzMain" theSession=CLng(vod(request.querystring("session"),0)) clientSerial=request.querystring("CID") clientVersion=request.querystring("Cver") action=request.querystring("action") userNum=CLng(vod(request.querystring("u"),0)) language=request.querystring("lang") languageSet=false if len(language)<>3 then language=request.form("defaultLanguage") end if if len(language)=3 then Response.charset = getCharset(language) languageSet=true end if pageType="ErrorUnknown" ' This is the default response: Collection not found. Select Case action Case "edit", "submit", "open" ' Check if clientSerial is valid mySQL="SELECT * FROM users WHERE clientSerial='" & clientSerial & "'" Case Else If userNum>0 Then mySQL="SELECT * FROM users WHERE userID=" & userNum Else showErrorPage "Unknown User" End If End Select Set rstemp=conntemp.execute(mySQL) If rstemp.eof Then showErrorPage "Unknown User" End If userID=rstemp("userID") rank=rstemp("rank") showCollection=tf(rstemp("showCollection")) fshowCollection=showCollection username=rstemp("username") firstName=rstemp("firstName") lastName=rstemp("lastName") password=rstemp("password") email=rstemp("email") birthYear=rstemp("birthYear") birthMonth=rstemp("birthMonth") birthDay=rstemp("birthDay") countryID=rstemp("countryID") rstemp.close If action="open" Then ' Redirect to short URL prt "Redirecting..." response.redirect "?u=" & userID response.end End If 'useGroups=0 'sortType=0 'numberOfAlbums=0 ' Maximum albums to display in the page showHitCount="true" showUserVote="true" showAlbumVoteScore="true" ' Load preferences from server 'mySQL="SELECT * FROM userCollectionPrefs LEFT JOIN languages ON userCollectionPrefs.defaultLanguageID=languages.languageID WHERE userID=" & userID mySQL="SELECT * FROM userCollectionPrefs WHERE userID=" & userID Set rstemp=conntemp.execute(mySQL) If rstemp.eof Then newUser=1 Else newUser=0 showRealName=rstemp("showRealName") showUsername=rstemp("showUsername") showEmail=rstemp("showEmail") showURL=rstemp("showURL") showUserRank=rstemp("showUserRank") showAge=rstemp("showAge") showUserPlugins=rstemp("showUserPlugins") numberOfAlbums=rstemp("numberOfAlbums") ' Maximum albums to display in the page showHitCount=tf(rstemp("showHitCount")) showUserVote=tf(rstemp("showUserVote")) showAlbumVoteScore=tf(rstemp("showAlbumVoteScore")) bgColor=rstemp("bgColor") bgColor2=rstemp("bgColor2") bgImage=rstemp("bgImage") headerImage=rstemp("headerImage") fontColor1=rstemp("fontColor1") fontColor2=rstemp("fontColor2") linkColor=rstemp("linkColor") vlinkColor=rstemp("vlinkColor") alinkColor=rstemp("alinkColor") myURL=rstemp("myURL") useGroups=rstemp("useGroups") sortType=rstemp("sortType") ' Default Sort order headerText=rstemp("headerText") descriptionText=rstemp("descriptionText") defaultLanguageID=rstemp("defaultLanguageID") defaultLanguage=rstemp("defaultLanguage") End If rstemp.close if languageSet=false then language=defaultLanguage Response.charset = getCharset(language) end if cPageHeader "My CDizz Collection - [CDizz]" If action="submit" Then ' Get all the variables from the form showCollection=tf(request.form("showCollection")) showRealName=request.form("showRealName") showUsername=request.form("showUsername") showEmail=request.form("showEmail") showURL=request.form("showURL") showUserRank=request.form("showUserRank") showAge=request.form("showAge") showUserPlugins=request.form("showUserPlugins") numberOfAlbums=vod(request.form("numberOfAlbums"), 0) ' Maximum albums to display in the page showHitCount=tf(request.form("showHitCount")) showUserVote=tf(request.form("showUserVote")) showAlbumVoteScore=tf(request.form("showAlbumVoteScore")) bgColor=request.form("bgColor") bgColor2=request.form("bgColor2") bgImage=request.form("bgImage") headerImage=request.form("headerImage") fontColor1=request.form("fontColor1") fontColor2=request.form("fontColor2") linkColor=request.form("linkColor") vlinkColor=request.form("vlinkColor") alinkColor=request.form("alinkColor") myURL=request.form("myURL") useGroups=vod(request.form("useGroups"),0) sortType=vod(request.form("sortType"),0) ' Default Sort order headerText=request.form("headerText") descriptionText=request.form("descriptionText") uUsername=request.form("username") uPassword=request.form("password") defaultLanguage=request.form("defaultLanguage") ' Check if password matches, and save new preferences If LCase(username)=LCase(uUsername) and password=uPassword Then If fshowCollection<>showCollection Then mySQL="UPDATE users SET showCollection=" & tf(showCollection) & " WHERE userID=" & userID ' printSQL mySQL Set rstemp=conntemp.execute(mySQL) End If If newUser=1 Then mySQL="INSERT INTO userCollectionPrefs (userID, showRealName, showUsername, showEmail, showURL, showUserRank, showAge, showUserPlugins, numberOfAlbums, showHitCount, showUserVote, showAlbumVoteScore, bgColor, bgColor2, bgImage, headerImage, fontColor1, fontColor2, linkColor, vlinkColor, alinkColor, myURL, useGroups, sortType, headerText, descriptionText, defaultLanguage) VALUES (" & userID & "," & tf(showRealName) & "," & tf(showUsername) & "," & tf(showEmail) & "," & tf(showURL) & "," & tf(showUserRank) & "," & tf(showAge) & "," & tf(showUserPlugins) & "," & numberOfAlbums & "," & tf(showHitCount) & "," & tf(showUserVote) & "," & tf(showAlbumVoteScore) & ",'" & bgColor & "','" & bgColor2 & "','" & bgImage & "','" & headerImage & "','" & fontColor1 & "','" & fontColor2 & "','" & linkColor & "','" & vlinkColor & "','" & alinkColor & "','" & myURL & "'," & useGroups & "," & sortType & ",'" & degeresh(headerText) & "','" & degeresh(descriptionText) & "', '" & defaultLanguage & "')" Else mySQL="UPDATE userCollectionPrefs SET userID=" & userID & ", showRealName=" & tf(showRealName) & ", showUsername=" & tf(showUsername) & ", showEmail=" & tf(showEmail) & ", showURL=" & tf(showURL) & ", showUserRank=" & tf(showUserRank) & ", showAge=" & tf(showAge) & ", showUserPlugins=" & tf(showUserPlugins) & ", numberOfAlbums=" & numberOfAlbums & ", showHitCount=" & tf(showHitCount) & ", showUserVote=" & tf(showUserVote) & ", showAlbumVoteScore=" & tf(showAlbumVoteScore) & ", bgColor='" & bgColor & "', bgColor2='" & bgColor2 & "', bgImage='" & bgImage & "', headerImage='" & headerImage & "', fontColor1='" & fontColor1 & "', fontColor2='" & fontColor2 & "', linkColor='" & linkColor & "', vlinkColor='" & vlinkColor & "', alinkColor='" & alinkColor & "', myURL='" & myURL & "', useGroups=" & useGroups & ", sortType=" & sortType & ", headerText='" & degeresh(headerText) & "', descriptionText='" & degeresh(descriptionText) & "', defaultLanguage='" & defaultLanguage & "' WHERE userID=" & userID End If ' printSQL mySQL Set rstemp=conntemp.execute(mySQL) prt "

Preferences Updated.

" prt "Click to view your personal collection page." ' response.redirect ("?u=" & userID) Else prt "

Error username / password mismatch

" ' prt password & "," & uPassword End If End If ' Display edit form If action="edit" or action="submit" Then %>

<%=textt("My CD Collection")%> <%=textt("Page Preferences")%>

<% DrawCheckBox "showCollection", showCollection %> <%=textt("Publish 'My CD Collection' Page")%>

<%=textt("Display Options:")%>

<%=textt("Default language for page:")%>
<%=textt("Personal Details")%><%=textt("CD Information")%>
<% DrawCheckBox "showRealName", showRealName %> <%=textt("Display My Full Name")%> <% DrawCheckBox "showHitCount", showHitCount %> <%=textt("Times CD was played in CDizz")%>
<% DrawCheckBox "showUsername", showUsername %> <%=textt("Display My Username")%> <% DrawCheckBox "showAlbumVoteScore", showAlbumVoteScore %> <%=textt("CDizz average vote score")%>
<% DrawCheckBox "showEmail", showEmail %> <%=textt("Display My Email")%> <% DrawCheckBox "showUserVote", showUserVote %> <%=textt("My vote score")%>
<% DrawCheckBox "showUserRank", showUserRank %> <%=textt("Display My CDizz Rank")%>

<%=textt("Username:")%>
<%=textt("Password")%>:

>
[<%=textt("Open")%> <%=textt("New User")%>] [<%=textt("Restore Collection")%>]
<% End If If showCollection="true" or action="edit" or action="submit" Then ' Title prt "

" If tf(showRealName)="true" Then prt firstName & " " & lastName & "'s CD Collection" Else If tf(showUsername)="true" Then prt textt("My CD Collection") & " - " & username Else prt textt("My CD Collection") End If End If prt "

" ' Display Rank If tf(showUserRank)="true" Then prt "

" & textt("Rank") & ": " & rank prt "    " prt "RSS" prt "

" End If ' mySQL="SELECT Albums.Title, Albums.LongTitle, Albums.albumVoteScore, Albums.albumNumVotes, Artists.artistName, Artists.artistURL, userCollections.AccessCount, votes.voteScore, votes.voteMultiplier FROM (((Artists INNER JOIN Albums ON Artists.artistID = Albums.ArtistID) INNER JOIN cdizzIDTable ON Albums.albumID = cdizzIDTable.albumID) INNER JOIN userCollections ON cdizzIDTable.ID = userCollections.discID) LEFT JOIN votes ON Albums.albumID=votes.albumID WHERE (votes.voteType=10 OR votes.voteType IS NULL) AND userCollections.userID=" & userID & " AND (votes.userID=" & userID & " OR votes.userID IS NULL) ORDER BY userCollections.AccessCount DESC" ' mySQL="SELECT Albums.Title, Albums.LongTitle, Albums.albumVoteScore, Albums.albumNumVotes, Artists.artistName, Artists.artistURL, userCollections.AccessCount, votes.voteScore, votes.voteMultiplier FROM votes RIGHT JOIN (((Artists INNER JOIN Albums ON Artists.artistID = Albums.ArtistID) INNER JOIN cdizzIDTable ON Albums.albumID = cdizzIDTable.albumID) INNER JOIN userCollections ON cdizzIDTable.ID = userCollections.discID) ON votes.userID = userCollections.userID WHERE ((votes.voteType=10 AND votes.albumID=Albums.albumID) OR votes.voteID IS NULL) AND userCollections.userID=" & userID & " ORDER BY userCollections.AccessCount DESC" mySQL="SELECT Albums.albumID, Albums.Title, Albums.LongTitle, Albums.albumVoteScore, Albums.albumNumVotes, Artists.artistName, Artists.artistURL, userCollections.AccessCount, votes.voteScore, votes.voteMultiplier FROM (((Artists INNER JOIN Albums ON Artists.artistID = Albums.ArtistID) INNER JOIN cdizzIDTable ON Albums.albumID = cdizzIDTable.albumID) INNER JOIN userCollections ON cdizzIDTable.ID = userCollections.discID) LEFT JOIN votes ON (Albums.albumID=votes.albumID AND votes.voteType=10) WHERE userCollections.userID=" & userID & " AND (votes.userID=" & userID & " OR votes.userID IS NULL) ORDER BY userCollections.AccessCount DESC" ' printSQL mySQL Set rstemp=conntemp.execute(mySQL) If not rstemp.eof Then prt "" If showHitCount="true" Then prt "" End If If showAlbumVoteScore="true" Then prt "" End If If showUserVote="true" Then prt "" End If prt "" ts=1 Else ts=0 End If While not rstemp.eof prt "" prt "" If showHitCount="true" Then prt "" End If If showAlbumVoteScore="true" Then prt "" End If If showUserVote="true" Then prt "" End If prt "" rstemp.movenext Wend If ts=1 Then prt "
" & textt("CD Title") & "" & textt("Artist") & "" & textt("Times Played") & "" & textt("CDizz Score") & "" & textt("My Vote") & "
" prt rstemp("Title") & "" aURL=rstemp("artistURL") If aURL<>"" Then %><% End If prt rstemp("artistName") If aURL<>"" Then prt "" End If prt "" & rstemp("AccessCount") & "" & rstemp("albumVoteScore") 'If rstemp("albumNumVotes")>0 Then ' prt " (" & rstemp("albumNumVotes") & " votes)" 'End If prt "" & rstemp("voteScore") / rstemp("voteMultiplier") & "
" End If Else %>

<%=textt("My CD Collection")%>

Collection Unavailable!

To Enable your own CD Collection page, Open your CDizz Player, and select "Edit 'My CD Collection' Page" in the Tools menu.

<% End If prt "

 

" cPageFooter Set rstemp=nothing conntemp.close Set conntemp=nothing response.end Sub showErrorPage (ErrorText) cPageHeader textt("CDizz -Collection not found") prt "

" & ErrorText & "

" cPageFooter response.end End Sub Sub cPageHeader (titleText) %> <%=titleText%> >
<% End Sub Sub cPageFooter %>


© Copyright 2003-2006 - CDizz by Animagics Inc. All rights reserved. <% End Sub Function DrawCheckBox(Name,value) %> checked <% End If %>> <% End Function Function tf(theValue) value=LCase(CStr(theValue)) If value="true" or value="on" or value="yes" or value="1" Then tf="true" Else tf="false" End If End Function %>