Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 09:58 am EDT

Geeklog Forums

New PHP Block: Member of the Moment


Status: offline

maran

Forum User
Junior
Registered: 07/17/02
Posts: 18
Hello,

I just created a new block for my site, which pulls a random member from the database (assuming they have an image uploaded) and displays it in a block with a link through to their profile.

If you're interested, you are welcome to use it. You can download the zip with the function and install instructions.

The function allows you to set the bounds the picture size shouldn't exceed, and php will resize the picture proportionally to fit within those bounds. GD libraries ARE NOT required for this to work.

Member of the Moment (Random Member Block)

Enjoy, and feel free to send any comments.

Benjamin
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
A link to a site using this would help immensely. Also, you should add this to our download section by clicking "Downloads" above. --Tony---The reason people blame things on previous generations is that there's only one other choice.
The reason people blame things on previous generations is that there's only one other choice.
 Quote

Status: offline

maran

Forum User
Junior
Registered: 07/17/02
Posts: 18
Sorry, you can see it on my site (there is a link at the bottom which isn't part of the block available for download).

http://chilax.com/

(left side - 3rd or so down)
 Quote

Anonymous

Anonymous
Hey ChilaX what did you use for the wallpaper depot? Looks pretty slick..
 Quote

Status: offline

maran

Forum User
Junior
Registered: 07/17/02
Posts: 18
I wrote the wallpaper outpost app from scratch. I did integrate it with Geeklog just enough to use the standard header/footer, as well as tap into _CONF settings (like site_url), etc.. Thanks for the comments. Smile Benjamin
 Quote

Status: offline

maran

Forum User
Junior
Registered: 07/17/02
Posts: 18
PLEASE NOTE

For those of you who may have already downloaded this block, I made a much needed improvement (albeit simple). You should go in and make this change:

ORDER BY RAND() LIMIT 1

to

ORDER BY RAND(NOW()+0) LIMIT 1

Apparently, in 3.23.5x anyhow, mySQL rand, without some kind of seeding is not so random, and the first record that met the where criteria in the database comes up 75% of the time.

With this change, it seems to change every time. Sorry about not realizing that when I first wrote it.

Can someone email me and tell me how to update the version in the downloads section? (It wasn't obvious to me) - thanks Smile
 Quote

All times are EDT. The time is now 09:58 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content