1
glennnphp
Random Member ... ?
  • 2006/9/4 14:05

  • glennnphp

  • Just popping in

  • Posts: 54

  • Since: 2006/8/30


i would like to display a random Member, or a Daily Member Spotlight would be better - anyone know of a module or capability?

thanks

2
[suspendTempri[suspended]
Re: Random Member ... ?

make a new block and select PHP Script as a type of block. enter this code into the content of the block:

$random_member mysql_fetch_assoc(mysql_query("SELECT uid, uname FROM xoops_users ORDER BY RAND() LIMIT 1"));

print 
"";
print 
"Random member:";
print 
"$random_member[uid]'>$random_member[uname]";
print 
"

"
;

3
glennnphp
Re: Random Member ... ?
  • 2006/9/4 15:03

  • glennnphp

  • Just popping in

  • Posts: 54

  • Since: 2006/8/30


awesome - instead of printing a link, can that query be made to just appear as Viewed Member on a timed interval? Just like a New Members block, but with just one...

4
[suspendTempri[suspended]
Re: Random Member ... ?

i don't understand ... explain what you mean

5
glennnphp
Re: Random Member ... ?
  • 2006/9/4 15:11

  • glennnphp

  • Just popping in

  • Posts: 54

  • Since: 2006/8/30


well, one of the blocks is New Members, and it shows a list of Members and their Avatars (if selected) - obviously the five (or however many i choose) newest ones.

i guess the code for these blocks is XML?

so instead of Listing x New Members, i'd like to list 1 Random member. our site is built around highlighting the members themselves (entertainers, etc).

6
glennnphp
Re: Random Member ... ?
  • 2006/9/4 15:18

  • glennnphp

  • Just popping in

  • Posts: 54

  • Since: 2006/8/30


i got it - i can just run that query and print the XML, right? save it as a php file...?

7
[suspendTempri[suspended]
Re: Random Member ... ?

$random_member mysql_fetch_assoc(mysql_query("SELECT uid, uname, user_avatar FROM xoops_users ORDER BY RAND() LIMIT 1"));

print 
"";
print 
"Random member:";
print 
"$random_member[uid]'>$random_member[uname]";
print 
"$random_member[user_avatar]' alt='avatar' />";
print 
"

"
;

8
glennnphp
Re: Random Member ... ?
  • 2006/9/4 15:27

  • glennnphp

  • Just popping in

  • Posts: 54

  • Since: 2006/8/30


thanks very much ---

i've tried to hire someone to help me "correct" a query i have running against another table to where it queries the xoops_avatars table instead. haven't had anyluck with someone who knows MySQL real well. i wonder if you'd be willing to look at the (short) script? i can pay a little.

can i PM it to you?

9
glennnphp
Re: Random Member ... ?
  • 2006/9/4 15:42

  • glennnphp

  • Just popping in

  • Posts: 54

  • Since: 2006/8/30


thanks that worked well...

10
[suspendTempri[suspended]
Re: Random Member ... ?

Quote:

glennnphp wrote:
thanks very much ---

i've tried to hire someone to help me "correct" a query i have running against another table to where it queries the xoops_avatars table instead. haven't had anyluck with someone who knows MySQL real well. i wonder if you'd be willing to look at the (short) script? i can pay a little.

can i PM it to you?


sure. i will answer you in one hour because i have to do something now.

Login

Who's Online

313 user(s) are online (209 user(s) are browsing Support Forums)


Members: 0


Guests: 313


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits