coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: levy on March 21, 2007, 03:24:24 AM

Title: Function to get a random file from an album
Post by: levy on March 21, 2007, 03:24:24 AM
Can anybody help me to write a function which get a random file from the id of an album? (include function to connect to db)
Example:

function get_random($album_id){
....
}

Thank you very much!

Title: Re: Function to get a random file from an album
Post by: vuud on March 21, 2007, 03:41:28 AM
Quote from: levy on March 21, 2007, 03:24:24 AM
Can anybody help me to write a function which get a random file from the id of an album? (include function to connect to db)
Example:

function get_random($album_id){
....
}

Thank you very much!




This are is for CpmFetch - which does what you want... without needing to write a function.

http://cpmfetch.fistfullofcode.com

Otherwise, you are in the wrong forum.


Title: Re: Function to get a random file from an album
Post by: levy on March 21, 2007, 05:56:46 AM
I need only a function to get only 1 file. cpmFetch is so complex, i cannot get 1 random file from an album by cpmFetch.
Title: Re: Function to get a random file from an album
Post by: Joachim Müller on March 21, 2007, 09:03:23 AM
If you don't have a question on cpmFetch but want to come up with a custom script then you're on the wrong sub-board. You shouldn't have posted here in the first place.
If you need that particular function, then just write the code - don't expect to be spoon-fed. If you can't code, then use cpmFetch. That's all we could say.
Title: Re: Function to get a random file from an album
Post by: vuud on March 21, 2007, 02:43:47 PM
Quote from: levy on March 21, 2007, 05:56:46 AM
I need only a function to get only 1 file. cpmFetch is so complex, i cannot get 1 random file from an album by cpmFetch.

Yes cpmfetch can give you one image

You say its too complex, but you come here asking for someone to write the code for you??  *beep* is CpmFetch??

The code written for you.  That's what it is.

I absolutely guarantee you, using cpmfetch will take less lines of code that coding it yourself.  Or anyone else coding it for you.