coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: die2nite on July 09, 2007, 05:44:07 AM

Title: Show Media X - X
Post by: die2nite on July 09, 2007, 05:44:07 AM
Hey,
Sorry for yet another question.  However, is it possible to call let's say file numbers 3-20 for a certain album.  I imagine this would be done by using LastAddedMediaFrom, however I'm not sure what parameter to set.  I'm asking this because I wish to basically reshow an entire album on my webpage however I do not want a page that is going to be extremely long and would like to divide it into a few pages.  So for instance the first page would show files 1-20, the second page 21-40, and so on.  Is this possible?

Thanks,
Title: Re: Show Media X - X
Post by: vuud on July 09, 2007, 10:41:24 PM
Quote from: die2nite on July 09, 2007, 05:44:07 AM
Hey,
Sorry for yet another question.  However, is it possible to call let's say file numbers 3-20 for a certain album.  I imagine this would be done by using LastAddedMediaFrom, however I'm not sure what parameter to set.  I'm asking this because I wish to basically reshow an entire album on my webpage however I do not want a page that is going to be extremely long and would like to divide it into a few pages.  So for instance the first page would show files 1-20, the second page 21-40, and so on.  Is this possible?

Thanks,

I don't think there is anything built into cpmfetch that will let you do that.

If you have a good level of PHP experience I can tell you what I think the best way to craft a request like that would be...

Title: Re: Show Media X - X
Post by: die2nite on July 09, 2007, 11:44:50 PM
Quote from: vuud on July 09, 2007, 10:41:24 PM
I don't think there is anything built into cpmfetch that will let you do that.

If you have a good level of PHP experience I can tell you what I think the best way to craft a request like that would be...



Would you mind doing that?
Title: Re: Show Media X - X
Post by: die2nite on July 20, 2007, 06:29:42 AM
Hey Vuud, any luck on this?
Title: Re: Show Media X - X
Post by: vuud on July 20, 2007, 08:42:05 PM
Quote from: die2nite on July 20, 2007, 06:29:42 AM
Hey Vuud, any luck on this?

I've not done anything with it yet - to be honest it slipped my mind in all the chaos besieging my meager existence.

But okay, here is what I would do...

Create a new php class by extending cpmfetch.php

Duplicate the cpmfetch function that you call normally (but change the name a bit)

Duplicate the cpmfetch_dao function that the above function calls.

Add parameters for start and count

Modify the functions to take those, then add them into the SQL crafted in the function

Does this make sense?