Page 1 of 1

Show multiple images from imageid's list

Posted: 31 Aug 2009, 11:54
by webcreatives
Would like to share this little modification.

I modified the plugin to make it show multiple images from a comma seperated id list.

In plugins/content/phocagallery.php I changed:

Code: Select all

// Only one image
				if ($imageid > 0) {		
					//$where = ' AND id = '. $imageid;
				}
to

Code: Select all

// Only one image
				if ($imageid > 0) {
					$ids = explode(",",$imageid);
					//$where = ' AND id = '. $imageid;
					$where = ' AND id IN(';
					foreach ($ids as $idvalue) {
							$where .= $idvalue . ',';
					}
					$where = rtrim($where,",") . ")";
				}

Now you can use the plugin like this:

{phocagallery view=category|categoryid=8|imageid=18,20,21}

We needed this feature for one of our customers.

Re: Show multiple images from imageid's list

Posted: 31 Aug 2009, 13:28
by caro84g
Hi,

thank you for sharing :)

Regards, Carolien

Re: Show multiple images from imageid's list

Posted: 12 Feb 2017, 02:46
by xcitan
Perfect, exactly what i needed, and still works fine.

The only thing you meanwhile have to change is from this

Code: Select all

$where = ' AND id IN(';
to this

Code: Select all

  $where = ' AND a.id IN(';
Thanks
Chris

Re: Show multiple images from imageid's list

Posted: 16 Feb 2017, 18:53
by Jan
Ok

Re: Show multiple images from imageid's list

Posted: 20 Jan 2018, 22:37
by clogg
Great hack - simple, safe and makes the gallery plugin even more usefull - I was missing it a lot!
Big thanks to 'webcreatives' for sharing the solution and to Jan for all the work in the project!!