Hi radiodelicate and others, I am new to Snitz, just wanted a simple ASP forum that I could easily manage and from appearances looks like modify easily as well.
Anyways, I just wanted a simple way to display photos to posts and this is what I did...keeping that in mind all data arrays where modified by appending to rather than changing the structure in the middle.
After scanning the code and identifying topic.asp as the file to modify I ended up making the following mods...simple was all I had on my mind.
Step 1:
130 Member_Country = rsTopic("M_COUNTRY")
Insert: Member_PhotoURL = rsTopic("M_PHOTO_URL")
131 Topic_Date = rsTopic("T_DATE")
----------------------------------------
Step 2:
290 strSql = strSql & ", R.R_LAST_EDITBY, R.R_SIG, R.R_STATUS, R.R_DATE"
Modified: strSql = strSql & ", R.R_LAST_EDITBY, R.R_SIG, R.R_STATUS, R.R_DATE, M.M_PHOTO_URL"
----------------------------------------
Step 3:
510 rR_DATE = 21
511 if CanShowSignature = 1 then
512 rM_SIG = 22
513 end if
510 rR_DATE = 21
Insert: rM_PHOTO_URL = 22
511 if CanShowSignature = 1 then
Modified 513: rM_SIG = 23
512 end if
----------------------------------------
Step 4:
538 Reply_Date = arrReplyData(rR_DATE, iForum)
539 if CanShowSignature = 1 then
540 Reply_MemberSig = trim(arrReplyData(rM_SIG, iForum))
541 end if
538 Reply_Date = arrReplyData(rR_DATE, iForum)
Insert: Reply_PhotoURL = arrReplyData(rM_PHOTO_URL, iForum)
539 if CanShowSignature = 1 then
540 Reply_MemberSig = trim(arrReplyData(rM_SIG, iForum))
541 end if
----------------------------------------
Step 5:
560 Response.Write " </p>" & vbNewLine & _
561 " <p>" & vbNewLine
562 if strCountry = "1" and trim(Reply_MemberCountry) <> "" then
560 Response.Write " </p>" & vbNewLine & _
Insert: Response.write GetMemberPhoto(Reply_PhotoURL)
561 " <p>" & vbNewLine
562 if strCountry = "1" and trim(Reply_MemberCountry) <> "" then
----------------------------------------
Step 6:
767 Response.Write " </p>" & vbNewLine & _
768 " <p>" & vbNewLine
769 if strCountry = "1" and trim(Member_Country) <> "" then
767 Response.Write " </p>" & vbNewLine & _
Insert: Response.write GetMemberPhoto(Member_PhotoURL)
768 " <p>" & vbNewLine
769 if strCountry = "1" and trim(Member_Country) <> "" then
----------------------------------------
Step 7:
Last step, I added this function to the end of the file.
If the photo url does not have a .gif, .jpg, or .png extention
nothing is displayed. It's a simple function you can change it
easily.
'***************************************************************************
'*** 20090131 Modified by James Possible added GetMemberPhoto() function ***
'*** Displays the member's profile picture with posts only if the ***
'*** Photo URL contains any one of the following image extensions ***
'*** .gif or .jpg or .png ***
'***************************************************************************
Function GetMemberPhoto(ImageURL)
Const VALID_PICTURE_EXTENSIONS = " .gif .jpg .png "
Dim sReturn
sReturn = ""
If Len(ImageURL) > 4 Then
If Instr(1, VALID_PICTURE_EXTENSIONS, Right(ImageURL, 4), 1) > 0 Then
sReturn = "<p>" & vbNewLine & _
"<img src=" & """" & ImageURL & """" & vbNewLine & _
" width=" & """" & "150" & """" & vbNewLine & _
" height=" & """" & "150" & """" & vbNewLine & _
" border=" & """" & "0" & """" & "/>" & vbNewLine & _
"</p>" & vbNewLine
End If
End If
GetMemberPhoto = sReturn
End Function
Again, it's clean, it's simple and anyone change modify with ease.
If the user has an image that's to big they can goto...
http://www.resizeyourimage.com/
...save file and upload to any number of sites, (i.e., flickr.com, photobucket.com etc.)
I decided to worry about uploading later, infact I'm considering the integration with http://www.gravatar.com/ in the future.
Appreciate Snitz and hope this helps someone.
James
<