Author |
Topic |
@tomic
Senior Member
USA
1790 Posts |
Posted - 25 August 2002 : 18:46:24
|
This MOD still works fine and dandy in 3.4.01 It picks members with photos and randomly places them wherever this file is included in a "Member Spotlight" box.
http://www.skepticfriends.org/download/privatemessages3_4_02.zip
Demo available at: http://www.skepticfriends.org/forum2/
User Name: demo Password: demo
Just save this as member_spotlight.asp and place it where you want it.
<%
Response.write "<table width=""150"" border=""0"" cellspacing=""0"" cellpadding=""0"" bgcolor=" & strHeadCellColor & ">" & vbCrLf & _
" <tr>" & vbCrLf & _
" <td align=""left"" valign=""top"">" & vbCrLf & _
" <table BORDER=""0"" bordercolor=""" & strHeadCellColor & """ cellspacing=""1"" cellpadding=""0"" width=""100%"">" & vbCrLf & _
" <tr>" & vbCrLf & _
" <td valign=""top"">" & vbCrLf & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"">" & vbCrLf & _
" <tr>" & vbCrLf & _
" <td align=""center"" bgcolor=" & strHeadCellColor & ">" & vbCrLf & _
" <table width=""100%"" cellpadding=""2"">" & vbCrLf & _
" <tr>" & vbCrLf & _
" <td valign=""top"" align=""center""><font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """>Member Spotlight</font></td>" & vbCrLf & _
" </tr>" & vbCrLf & _
" </table>" & vbCrLf & _
" </td>" & vbCrLf & _
" </tr>" & vbCrLf & _
" <tr>" & vbCrLf & _
" <td bgcolor=""" & strForumCellColor & """>" & vbCrLf & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""2"">"
'START MEMBER IN SPOTLITE SCRIPT
function MemInSpot
set rsMemInSpot = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT " & strTablePrefix & "MEMBERS.MEMBER_ID, " & strTablePrefix & "MEMBERS.M_PHOTO_URL, " & strTablePrefix & "MEMBERS.M_NAME, "
strSql = strSql & strTablePrefix & "MEMBERS.M_FIRSTNAME, " & strTablePrefix & "MEMBERS.M_LASTNAME, " & strTablePrefix & "MEMBERS.M_AGE"
strSql = strSql & " FROM " & strTablePrefix & "MEMBERS"
strSql = strSql & " WHERE FORUM_MEMBERS.M_PHOTO_URL <> ''"
rsMemInSpot.Open strSql, my_Conn,3,,adCmdText
Dim intRnd
Randomize Timer
intRnd = (Int(RND * rsMemInSpot.RecordCount))
rsMemInSpot.Move intRnd
strMemInSpot = rsMemInSpot("M_PHOTO_URL")
Response.Write " <tr><td align=center bgcolor=""" & strForumCellColor & """>" & vbCrLf & _
" <a href=""" & strForumURL & "pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """><font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strDefaultFontSize & """><b>" & rsMemInSpot("M_NAME") & "</b></font></A><br>" & vbCrLf
if Trim(rsMemInSpot("M_PHOTO_URL")) <> "" and lcase(rsMemInSpot("M_PHOTO_URL")) <> "http://" then
if lcase(left(strMemInSpot,7)) = "http://" then
Response.write " <a href=" & ChkString(rsMemInSpot("M_PHOTO_URL"), "display")& ">" & vbCrLf & _
" <img src=" & ChkString(rsMemInSpot("M_PHOTO_URL"), "display") & vbCrLf
elseif lcase(left(strMemInSpot,7)) <> "http://" then
Response.write " <a href=" & strForumURL & "images/" & ChkString(rsMemInSpot("M_PHOTO_URL"), "display")& ">" & vbCrLf & _
" <img src=" & strForumURL & "images/" & ChkString(rsMemInSpot("M_PHOTO_URL"), "display")& vbCrLf
end if
Response.write " alt=" & ChkString(rsMemInSpot("M_NAME"),"display")& vbCrLf & _
" width=""120"" height=""120"" border=""0"" hspace=""0"" vspace=""4""></a><br>" & vbCrLf
else
Response.Write getCurrentIcon(strIconPhotoNone,"No Photo Available","hspace=""0"" vspace=""4""") & "<br>" & vbCrLf _
end if
Response.Write " <a href=""" & strForumURL & "pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & rsMemInSpot("M_NAME") & "#039;s Profile</font></A><br>" & vbCrLf
Response.Write " </td></tr>"
rsMemInSpot.Close
Set rsMemInSpot = Nothing
end function
'END MEMBER IN SPOTLITE SCRIPT
call MemInSpot
Response.Write " </td>" & vbCrLf & _
" </tr>" & vbCrLf & _
" </table>" & vbCrLf & _
" </td>" & vbCrLf & _
" </tr>" & vbCrLf & _
"</table>" & vbCrLf & _
"</td>" & vbCrLf & _
"</tr>" & vbCrLf & _
"</table>" & vbCrLf & _
"</td>" & vbCrLf & _
"</tr>" & vbCrLf & _
"</table>"
%>
|
SportsBettingAcumen.com |
Edited by - @tomic on 11 September 2002 11:54:19 |
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 25 August 2002 : 21:45:10
|
You can extend this MOD even more than I have shown in my example. If you add other fields to the query you can then use them in the Spotlight box. Here's an example:
Name: " & rsMemInSpot("M_FIRSTNAME") & " " & rsMemInSpot("M_LASTNAME") & " Age: " & rsMemInSpot("M_AGE") & "
The query in the code above includes those 3 field(Firstname,Lastname,Age) but you could use anything from the member table. member Since, Number of Posts...whatever!
@tomic |
SportsBettingAcumen.com |
Edited by - @tomic on 25 August 2002 21:45:42 |
|
|
mafe
Starting Member
44 Posts |
Posted - 25 August 2002 : 22:11:43
|
ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/foro/member_spotlight.asp, line 30
|
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 25 August 2002 : 22:24:32
|
How and where did you use this file? What included files are present on that page?
@tomic |
SportsBettingAcumen.com |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 August 2002 : 23:20:58
|
it is most likely giving you an error on this line
rsMemInSpot.Move intRnd
The sql gets only those records, where picture link is provided. If no member picture link then there are no recs found and .move will give an error. so you need to check for EOF and BOF to make sure there are records found. Then only do the further processing.
Alternatively remove the where clause from the sql |
CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain
It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Prayer Of Forgiveness "I forgive all living beings. May all living beings forgive me! I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated) |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 11 September 2002 : 07:37:50
|
I noticed that you were not using the getCurrentIcon function in the above code.
Change from this:
Response.write " alt=" & ChkString(rsMemInSpot("M_NAME"),"display")& vbCrLf & _
" width=""120"" height=""120"" border=""0"" hspace=""0"" vspace=""4""></a><br>" & vbCrLf
else
Response.Write " <img src=/forum/no_photo.gif alt=""no photo available"" width=""150"" height=""150"" border=""0"" hspace=""0"" vspace=""4""><br>" & vbCrLf _
end if
to this:
Response.write " alt=" & ChkString(rsMemInSpot("M_NAME"),"display")& vbCrLf & _
" width=""120"" height=""120"" border=""0"" hspace=""0"" vspace=""4""></a><br>" & vbCrLf
else
Response.Write getCurrentIcon(strIconPhotoNone,"No Photo Available","hspace=""0"" vspace=""4""") & "<br>" & vbCrLf _
end if
|
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 11 September 2002 : 11:55:56
|
Hey thanks. I also forgot to update some other problems. strDefaultFont is now strDefaultFontFace and some other formatting issues are fixed.
@tomic |
SportsBettingAcumen.com |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 15 September 2002 : 15:35:49
|
quote:
Response.Write " <a href=""" & strForumURL & "pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & rsMemInSpot("M_NAME") & "#039;s Profile</font></A><br>" & vbCrLf
Should say:
Response.Write " <a href=""" & strForumURL & "pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & rsMemInSpot("M_NAME") & "'s Profile</font></A><br>" & vbCrLf
|
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 15 September 2002 : 19:19:48
|
quote: Originally posted by Carefree
quote:
Response.Write " <a href=""" & strForumURL & "pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & rsMemInSpot("M_NAME") & "#039;s Profile</font></A><br>" & vbCrLf
Should say:
Response.Write " <a href=""" & strForumURL & "pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & rsMemInSpot("M_NAME") & "'s Profile</font></A><br>" & vbCrLf
Or just add a & before #039; so that is looks like this ', and you will get a '.
|
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
Edited by - masterao on 15 September 2002 19:22:41 |
|
|
paulnickell
Starting Member
USA
32 Posts |
Posted - 19 September 2002 : 13:33:40
|
I get this too:
ADODB.Recordset error '800a0e7d' The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/forums/member_spotlight.asp, line 30
using it on default.asp with:
<!--#INCLUDE FILE="member_spotlight.asp" -->
|
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 19 September 2002 : 13:53:31
|
quote: ADODB.Recordset error '800a0e7d' The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/forums/member_spotlight.asp, line 30
using it on default.asp with:
<!--#INCLUDE FILE="member_spotlight.asp" -->
Can you give me any more than that? What is on line 30 for you(in case there's a change)? What kind of server are you on? What version of Snitz forums are you running?
@tomic |
SportsBettingAcumen.com |
|
|
antracit
Starting Member
Sweden
33 Posts |
Posted - 19 September 2002 : 17:07:07
|
Is it difficult to make this mod work with 3.3.xxx (ore 4.0B0.3 international)? Older versions than 3.4 |
johan |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 19 September 2002 : 17:50:09
|
I have used this MOD with 3.1R4 and 3.3.xx without any difficulties. I haven't touched internationalization and don't intend to until it's officially released.
@tomic |
SportsBettingAcumen.com |
|
|
paulnickell
Starting Member
USA
32 Posts |
Posted - 19 September 2002 : 18:10:12
|
quote: Originally posted by @tomic
quote: ADODB.Recordset error '800a0e7d' The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/forums/member_spotlight.asp, line 30
using it on default.asp with:
<!--#INCLUDE FILE="member_spotlight.asp" -->
Can you give me any more than that? What is on line 30 for you(in case there's a change)? What kind of server are you on? What version of Snitz forums are you running?
@tomic
Running 3.4 Snitz and SQL. Line #30 in member_spotlight.asp is:
rsMemInSpot.Open strSql, my_Conn,3,,adCmdText
Maybe that helps? Paul
|
|
|
antracit
Starting Member
Sweden
33 Posts |
Posted - 23 September 2002 : 02:57:29
|
Hello
Anyone knowing what to do to make this great mod show an assigned member instead of random? One more, if I still keep the random function it would be great if members with no picture was skipped. Something like “if no picture next”…
(Got it working with Internationel easy ) |
johan |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 23 September 2002 : 03:33:11
|
It does skip members with no photo:
strSql = strSql & " WHERE FORUM_MEMBERS.M_PHOTO_URL <> ''"
Meaning select the ones that are not null.
@tomic |
SportsBettingAcumen.com |
|
|
Topic |
|