phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Showing X random pics from a certain folder


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Mon Sep 20, 2010 2:09 pm 
Post subject: Showing X random pics from a certain folder

Hi!

I am using smartors portal and UploadPic by beehave.de
UploadPic is storing the pics in a certain folder.
I would like to show a certain number of pics from that folder on my portal-page, if possible as a link to the thread where the pic is used.

Is that possible?

/Holger

_________________
Love your data! Back it up!
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 656
Location: Texas


flag
PostPosted: Mon Sep 20, 2010 10:44 pm 
Post subject: Re: Showing X random pics from a certain folder

Are you retrieving the picture (file names) by scanning the directory? The easiest way I can think of to do this is retrieve all of the picture names into an array, determine the size of the array, and generate random keys into the array based on how many pictures you want to display.
_________________
phpBBDoctor Blog
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Tue Sep 21, 2010 6:41 am 
Post subject: Re: Showing X random pics from a certain folder

There is a HUGE bunch of pictures.
Do you think that it could turn into a performance problem?

_________________
Love your data! Back it up!
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 656
Location: Texas


flag
PostPosted: Tue Sep 21, 2010 12:06 pm 
Post subject: Re: Showing X random pics from a certain folder

Do you have stored somewhere how many pictures there are? You could retrieve that instead of counting files in the folder...
_________________
phpBBDoctor Blog
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Tue Sep 21, 2010 12:10 pm 
Post subject: Re: Showing X random pics from a certain folder

No, there is no counter. icon_cry.gif
_________________
Love your data! Back it up!
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Thu Sep 23, 2010 6:36 pm 
Post subject: Re: Showing X random pics from a certain folder

Hi, in ACP you have "UploadPic recent" that shows the last 10 uplaods and with pagination and more. Must be possible to adapt some of the code? The linking needs to be added though.
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 549
Location: North West UK


flag
PostPosted: Thu Sep 23, 2010 7:21 pm 
Post subject: Re: Showing X random pics from a certain folder

This may be worth taking a look at. It displays random images from an Album. I am not sure which album mod it is for. I did have one for the "Full album pack" so guess it and others will be on phpBBhacks.com

http://www.phpbbhacks.com/download/1352

Jim
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Sep 24, 2010 6:36 am 
Post subject: Re: Showing X random pics from a certain folder

It is for smartors photoalbum. I have the clown(=Volodymyr Skoryk)-addon installed.

Thank you for the suggestions!

Yeah, that UploadPic-thing is a very good start!

_________________
Love your data! Back it up!
Back to top
Citrix
Board Member



Joined: 19 Feb 2012

Posts: 42



PostPosted: Thu Feb 23, 2012 4:54 pm 
Post subject: Re: Showing X random pics from a certain folder

I am doing exactly this for my portal.. It's not a Released Mod... icon_smile.gif
I can write this as Mod. I have all the codes. Not just well organised for distribution, at this time.
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Fri Feb 24, 2012 7:10 pm 
Post subject: Re: Showing X random pics from a certain folder

Citrix wrote:
I can write this as Mod.

Sounds good! icon_smile.gif
I rented a coder to make the same thing but with the attachment mod. It was very heavy on my index so disabled it many years ago. It didnt make real thumbnails but scaled down the big image.. ugly i now. But i really miss it.. icon_wink.gif I can also try to dig that out if someone needs it.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0273 seconds using 15 queries. (SQL 0.0027 Parse 0.0009 Other 0.0237)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo