Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Member spotlight
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

concep86
Junior Member

USA
140 Posts

Posted - 03 July 2001 :  14:33:00  Show Profile  Visit concep86's Homepage
Title: Random Member Spotlight Mod
Demo: http://63.209.180.164/ms.asp
Installation: 1. simply copy the function code to the file you want to use...
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
<%
''this function gives me a random picture every time the page is loaded
Function picofday()

strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=e:\forum\db\database.mdb" '## MS Access 97
dim objConnection
set objConnection = server.CreateObject("adodb.connection")
objConnection.Open strConnString

query = "SELECT FORUM_MEMBERS.MEMBER_ID, FORUM_MEMBERS.M_PHOTO_URL, FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_FIRSTNAME, FORUM_MEMBERS.M_LASTNAME, FORUM_MEMBERS.M_AGE FROM FORUM_MEMBERS WHERE FORUM_MEMBERS.M_PHOTO_URL<>'' "
Dim rspod
Set rspod= Server.CreateObject("ADODB.Recordset")
rspod.Open query, strConnString, 3, , adCmdText

Dim intRnd
Randomize Timer
intRnd = (Int(RND * rspod.RecordCount))

rspod.Move intRnd

Response.Write "     <BR>"
Response.Write "<IMG SRC=" & rspod("M_PHOTO_URL") & "><BR>"
Response.Write "     <BR>"
Response.Write "</TD</Tr><Tr><TD bgcolor=""#FFFFFF"">"
Response.Write "     <BR>"
Response.Write "     <IMG SRC=""foros/images/arrow.gif"">  UserName:<a href=""foros/pop_profile.asp?mode=display&id="& rspod("member_id") & """> " & rspod("M_NAME") & "</A><BR>"
Response.Write "     <BR>"
Response.Write "     <IMG SRC=""foros/images/arrow.gif"">  Name: " & rspod("M_FIRSTNAME") & " " & rspod("M_LASTNAME") & "<BR>"
Response.Write "     <BR>"
Response.Write "     <IMG SRC=""foros/images/arrow.gif"">  Age: " & rspod("M_age") & "<BR>"
Response.Write "     <BR>"
Response.Write "<BR><font color=""#990000""><center>Click on username for profile</center></font><BR>"
Response.Write "     <BR>"

rspod.Close
Set rspod = Nothing
End Function
%>

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
2. Change database connection string
3. Copy function call into page where you want the Member Spotlight to appear

Description: Displays a member spotlight box... I hope Alan takes this as flattery... It looks like the Member Spotlight he has on IAMVIET.com
Author: I won't take credit for it... I just worked with some code someone else posted for something else... added a little here and there...
Issues: I'm sure this could be done sweeter... like including the forum.... language... things like the table colors , connection string and so forth.. just my first effort.
also ... The current version displays member info even where there is no picture... If anyone has the time... you might want to correct that so that it skips the members that do not have a picture posted...
Let me know what you think...
CONCEP86





Concep86
Webmaster
http://www.coneciones.com


Edited by - concep86 on 03 July 2001 18:15:00

Edited by - concep86 on 04 July 2001 09:49:51

mfindlay
Junior Member

USA
144 Posts

Posted - 03 July 2001 :  14:37:21  Show Profile  Visit mfindlay's Homepage
Thanks, I was hoping a mod like this would come along! It would be nice however if you could incorporate the forum colors and general look and feel. This would make the mod complete.

By the way, If you want to exclude those profiles that do not have a photo, you could add a WHERE clause to your query so that it read:

WHERE M_PHOTO_URL <> ""



Edited by - mfindlay on 03 July 2001 16:46:15
Go to Top of Page

RDoGG™
Junior Member

USA
329 Posts

Posted - 03 July 2001 :  16:12:41  Show Profile  Visit RDoGG™'s Homepage  Send RDoGG™ an AOL message  Send RDoGG™ a Yahoo! Message
quote:

Thanks, I was hoping a mod like this would come along!

By the way, If you want to exclude those profiles that do not have a photo, you could add a WHERE clause to your query so that it read:

query = "SELECT FORUM_MEMBERS.MEMBER_ID, FORUM_MEMBERS.M_PHOTO_URL, FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_FIRSTNAME, FORUM_MEMBERS.M_LASTNAME, FORUM_MEMBERS.M_AGE FROM FORUM_MEMBERS WHERE M_PHOTO_URL <> ''"

Edited by - mfindlay on 03 July 2001 14:38:44



cool!

nice mod.

Go to Top of Page

concep86
Junior Member

USA
140 Posts

Posted - 03 July 2001 :  17:14:17  Show Profile  Visit concep86's Homepage
****... I did not think of that... Sometimes the simple ones get by us...

I will work on the colors and stuff...


quote:

Thanks, I was hoping a mod like this would come along! It would be nice however if you could incorporate the forum colors and general look and feel. This would make the mod complete.

By the way, If you want to exclude those profiles that do not have a photo, you could add a WHERE clause to your query so that it read:

WHERE M_PHOTO_URL <> ""



Edited by - mfindlay on 03 July 2001 16:46:15



Concep86
Webmaster
http://www.coneciones.com
Go to Top of Page

concep86
Junior Member

USA
140 Posts

Posted - 03 July 2001 :  18:16:17  Show Profile  Visit concep86's Homepage
I added the where clause so now only profiles with pictures are selected..

Thanks


quote:

Thanks, I was hoping a mod like this would come along! It would be nice however if you could incorporate the forum colors and general look and feel. This would make the mod complete.

By the way, If you want to exclude those profiles that do not have a photo, you could add a WHERE clause to your query so that it read:

WHERE M_PHOTO_URL <> ""



Edited by - mfindlay on 03 July 2001 16:46:15



Concep86
Webmaster
http://www.coneciones.com
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 03 July 2001 :  22:45:52  Show Profile  Visit dayve's Homepage
some members screwed up their profile by putting in a bad url but here's a demo of how I used this feature. I added it to the top of the members viewing page:

DEMO
http://www.nineinchnailz.com/forum/members.asp

you also need to check for FORUM_MEMBERS.M_PHOTO_URL<>'http://' because that is the default if no photo url is entered.

Dayve

Edited by - dayve on 04 July 2001 12:53:34

Edited by - dayve on 04 July 2001 12:55:23
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 04 July 2001 :  08:15:55  Show Profile
Excellent idea. Made a few changes and used the forum variables. Here is the script.


'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 " & strTablePrefix & "MEMBERS.M_PHOTO_URL" <> ""
rsMemInSpot.Open strSql, my_Conn,3,,adCmdText
Dim intRnd
Randomize Timer
intRnd = (Int(RND * rsMemInSpot.RecordCount))
rsMemInSpot.Move intRnd
Response.Write " <br><tr><td align=center bgcolor=""" & strForumCellColor & """>" & vbCrLf & _
" <font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strDefaultFontSize & """>member in spot</font><br><br>" & vbCrLf & _
" <a href=""pop_profile.asp?mode=display&id="& rsMemInSpot("member_id") & """> " & rsMemInSpot("M_NAME") & "</A><br>" & vbCrLf
if Trim(rsMemInSpot("M_PHOTO_URL")) <> "" and lcase(rsMemInSpot("M_PHOTO_URL")) <> "http://" then
Response.write " <a href=" & ChkString(rsMemInSpot("M_PHOTO_URL"), "display")& ">" & vbCrLf & _
" <img src=" & ChkString(rsMemInSpot("M_PHOTO_URL"), "display")& vbCrLf & _
" alt=" & ChkString(rsMemInSpot("M_NAME"),"display")& vbCrLf & _
" width=""150"" height=""150"" border=""0"" hspace=""0"" vspace=""0""></a><br>" & vbCrLf & _
" <font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strFooterFontSize & """>" & vbCrLf & _
" click image for full picture</font>" & vbCrLf
else
Response.Write " <img src=images/icon_photo_none.gif alt=""no photo available"" width=""100"" height=""100"" border=""0"" hspace=""0"" vspace=""0""><br>" & vbCrLf
end if
Response.Write " <font face=""" & strDefaultFontface & """ color=""" & strDefaultFontColor & """ size=""" & strDefaultFontSize & """>" & vbCrLf & _
" <br><font face=""" & strDefaultFontface & """ color=""" & strDefaultFontColor & """ size=""" & strFooterFontSize & """><center>click on member name for profile</center></font><BR>" & vbCrLf & _
" </td></tr><br>"
rsMemInSpot.Close
Set rsMemInSpot = Nothing
end function

'END MEMBER IN SPOTLITE SCRIPT



This will show nophoto.gif if no photo is available. Gives an equal opportunity for all members to be picked up to be shown as member in spot.

just a beginning... log in and click on members from the menu to see.

I included the script in my inc_top.asp

gauravbhabu

There is only one miracle...That is LIFE!

Edited by - GauravBhabu on 04 July 2001 09:05:26
Go to Top of Page

concep86
Junior Member

USA
140 Posts

Posted - 04 July 2001 :  09:50:13  Show Profile  Visit concep86's Homepage
DEmo posted

http://63.209.180.164/ms.asp

Concep86
Webmaster
http://www.coneciones.com
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 04 July 2001 :  12:58:26  Show Profile  Visit dayve's Homepage
I didn't force both width and height because images would show up really screwed up. I only forced a width so the height would remain proportional. soon I will add an upload feature for members photos like I have for my avatars, that way I can use a server side script for proportionizing the images to a certain ratio. this should be an easy mod..

Dayve
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 04 July 2001 :  22:25:14  Show Profile
quote:

I didn't force both width and height because images would show up really screwed up. I only forced a width so the height would remain proportional. soon I will add an upload feature for members photos like I have for my avatars, that way I can use a server side script for proportionizing the images to a certain ratio. this should be an easy mod..

Dayve



can your server side script generate thumnails as well? or a component.
thanks.



Edited by - bjlt on 04 July 2001 22:26:40
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 05 July 2001 :  10:47:01  Show Profile  Visit dayve's Homepage
quote:

quote:

I didn't force both width and height because images would show up really screwed up. I only forced a width so the height would remain proportional. soon I will add an upload feature for members photos like I have for my avatars, that way I can use a server side script for proportionizing the images to a certain ratio. this should be an easy mod..

Dayve



can your server side script generate thumnails as well? or a component.
thanks.



Edited by - bjlt on 04 July 2001 22:26:40



I presently have a server side routine to create thumbnails and it is quite easy, all you do is point to a directory full of images. I am going away for 2 weeks on vacation so try to remind me if you need help still before I get back.

Dayve
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 05 July 2001 :  14:25:12  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
hmm, didn't i post this code awhile back?

a few things concept. you don't need objConnection. i dimmed that because pages outside of my forum had differenct connection than my_Conn because Tuan used objConnection for other parts of the site, hence two connections which you don't really need objConnection since you're doing it by the recordset anyways "rspod.Open query, strConnString, 3, , adCmdText"

Another thing, i'm not sure if this is truely random enough. I don't believe it'll get the records near the end. Not sure if i'm right now. maybe it works.
quote:

Dim intRnd
Randomize Timer
intRnd = (Int(RND * rspod.RecordCount))

rspod.Move intRnd





- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page

concep86
Junior Member

USA
140 Posts

Posted - 05 July 2001 :  19:54:07  Show Profile  Visit concep86's Homepage
Alan, your right to an extent, This is your mostly your code... but for the members online piece you posted...

Like I said... I took no credit for the mod... I just took something and changed it a bit... added a little here and came up with this...

I will look at the code and see what your saying...

I am sure you are right on the money... with your comments..

I will take the comments and try to rework the mod..

Thanks Alan.



Concep86
Webmaster
http://www.coneciones.com
Go to Top of Page

RDoGG™
Junior Member

USA
329 Posts

Posted - 05 July 2001 :  20:00:24  Show Profile  Visit RDoGG™'s Homepage  Send RDoGG™ an AOL message  Send RDoGG™ a Yahoo! Message
quote:

DEmo posted

http://63.209.180.164/ms.asp

Concep86
Webmaster
http://www.coneciones.com




link not working

RDoGG™
Go to Top of Page

concep86
Junior Member

USA
140 Posts

Posted - 05 July 2001 :  20:58:01  Show Profile  Visit concep86's Homepage
Sorry, This is my development server and I am getting "THE BLUE SCREEN OF DEATH" you'd think Microsoft would have fixed that.... :)

It will be back up in a about an hour or so... I HOPE...

Concep86
Webmaster
http://www.coneciones.com
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 05 July 2001 :  23:12:37  Show Profile  Visit dayve's Homepage
quote:


Another thing, i'm not sure if this is truely random enough. I don't believe it'll get the records near the end. Not sure if i'm right now. maybe it works.

Dim intRnd
Randomize Timer
intRnd = (Int(RND * rspod.RecordCount))

rspod.Move intRnd


- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource



please elaborate??

Dayve
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.48 seconds. Powered By: Snitz Forums 2000 Version 3.4.07