Author |
Message |
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Mon Sep 20, 2010 10:09 am 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: 729 Location: Texas
|
Posted: Mon Sep 20, 2010 6: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
|
Posted: Tue Sep 21, 2010 2: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: 729 Location: Texas
|
Posted: Tue Sep 21, 2010 8:06 am 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
|
Posted: Tue Sep 21, 2010 8:10 am Post subject: Re: Showing X random pics from a certain folder |
|
|
No, there is no counter. _________________ Love your data! Back it up! |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Thu Sep 23, 2010 2: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: 656 Location: North West UK
|
Posted: Thu Sep 23, 2010 3: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
|
Posted: Fri Sep 24, 2010 2: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
|
Posted: Thu Feb 23, 2012 12: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...
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
|
Posted: Fri Feb 24, 2012 3:10 pm Post subject: Re: Showing X random pics from a certain folder |
|
|
Citrix wrote: | I can write this as Mod. |
Sounds good!
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.. I can also try to dig that out if someone needs it. |
|
Back to top |
|
|
|