Random pic from the forum

Dweller

Inconspicuous Supporter
Joined
Apr 19, 2004
Messages
668
Reaction score
3
Location
Portland, Oregon
Can others edit my Photos
Photos OK to edit
I would like to see somewhere on here a "random pic" slideshow that would show a pic from one of the gallery threads. I think if it was on the front page it could help draw people in to post some of their own work. What I am visualizing is perhaps below the contest winners it could display some random pic

There is likely some coding involved and I do not know how much work it would be to make it happen but I think to that this could be leveraged into a TPF slideshow that people could pull up at any time to see some of whats been posted in the last few days.

Bonus points for making each pic a link to the thread it came from.
 
Yeah, it's not really feasable. Scraping image links from the threads would be pain because you wouldn't know which ones to use. Creating a list of links and randomly posting an image from it would be easy though. I suppose you could ask for submissions and update the list each month with new ones or ones people wanted removed.

Here's the code you could stick in the homepage or where ever you wanted it:

Code:
<?php

// list of image links each in quotes and separated by commas
$images = array (

'http://www.markcarpenter.com/albums/MC-LW-Panel2/WhyDoYouHesitateMyBrother.highlight.jpg',
'http://www.markcarpenter.com/albums/Portraits/K2730.highlight.jpg',
'http://www.markcarpenter.com/albums/Weddings/VowsTouch.highlight.jpg'

);

// uncomment the following line if using PHP before version 4.2.0
// srand((double)microtime()*1000000);
$random = rand(0,count($images)-1);
echo '<img src="'.$images[$random].'">';

?>

Here's a page with the above code in it: http://www.photogs.net/tpf/randomimage.php
 
Sounds tricky :scratch:

I did a little research as well. <<< read as very little

I found some vbulletin code that would allow for a slideshow, with clickable images as direct links. But....all of those images were in a specific gallery :( It really sounded like a lot of work to do it this way. Like Mark said, you would have to regularly update the code with direct image links. And then you run into the problem of users breaking their own links :er:
 
woodsac said:
And then you run into the problem of users breaking their own links :er:
Yup. I have one that also pulls images from a specific folder like you mentioned that would avoid that, but would require putting the images on the server. Either way it would take some upkeep.
 
Oh, and you'd also have to trust the people who's links you put in there. They could swap images to whatever they wanted whenever they wanted. Plus there's no size control as it is now.
 
I can probably code something up to mirror stuff we have in the gallery and may even be able to pull from images posted here.... hmmmmm..
 
there is already a simple hack for this on vbullet. It uses a random image from the gallery and displays it on your landing page. There is another one whcih displays three random pics which looks good too. they are easy to set up, i had them both on a vb forum i used to have, and i dont have a clue about coding.

Cant remember what they where called, but im pretty sure i got them from www.vbulletin.org . should be easy enough to find
 
Good info. I think the orginal idea was more around pulling images from posts, which would be much more difficult.

This may be something we end up looking more into down the road a bit, but I don't think we'll be implementing this idea in the near future.
 

Most reactions

New Topics

Back
Top