A user recently asked me how to retrieve a specific item from a collection in Clip-Bucket v2, so I went ahead and made a code for them. Here’s the code for all of you. Tested on v2.6.
1. Open ./includes/classes/collections.class.php
2. Find
function get_thumb($cdetails,$size=NULL,$return_c_thumb=false)
and replace it with
function get_thumb($cdetails,$size=NULL,$return_c_thumb=false,$number=1)
3. Find
$item = $this->get_collection_items($cid,'ci_id DESC',1);
and replace it with
$item = $this->get_collection_items($cid,'ci_id DESC',$number);
4. Find
$type = $item[0]['type'];
and replace it with
$type = $item[$number-1]['type'];
5. Find
$thumb = get_thumb($cbvideo->get_video_details($item[0]['object_id']));
and replace it with
$thumb = get_thumb($cbvideo->get_video_details($item[$number-1]['object_id']));
6. Find
$thumb = $cbphoto->get_image_file($cbphoto->get_photo($item[0]['object_id']));
and replace it with
$thumb = $cbphoto->get_image_file($cbphoto->get_photo($item[$number-1]['object_id']));
7. Save and upload
To get the second item, you should call it like:
{$cbcollection->get_thumb($collection,'small',2)}
For the third item:
{$cbcollection->get_thumb($collection,'small',3)}
and so on. The last parameter of the function determines the item number from the collection.
If you have any questions, please let me know. Moreover, if you’d like me to write about a certain thing, just leave a comment and I’ll do my best to have it written ASAP.
Best Regards,
Richi González