Форуми / Cotonti / Extensions / Work in progress: Basic gallery with jQuery Lightbox


#16 11.08.2009 05:36
Download the Smart Image Resizer here.

Відредаговано: Koradhil (17.11.2010 21:44, 12 років тому)
#17 17.08.2009 20:14

I tried, but not succeded.

I was wondering, Slimbox+ImageScale plugin has the next and previous working.
Why? I'm not that good with code.

Added 2 minutes later:

Can you add a selection box about the order.
I want the newest gallery first.

Or can you tell me were to change the code?
... can we help you ...
#18 18.08.2009 04:09
You need to add an ORDER BY statement in the SQL, I guess it's in gallery.inc.php or something (working on another PC so I dont have the code here). I think the SQL looks like this
SELECT * FROM $db_pfs_folders WHERE pff_ispublic=1 AND pff_isgallery=1
You should add something like this:
ORDER BY pff_updated DESC
#19 29.09.2009 16:07
...it will be compatible with Cotonti 1.0.0 Renaissance (which will include the new PFS and dynamic thumbnail feature).

but this ticket says that the new PFS will be added in Siena 0.7... is it true?

And for me would be a grat feature to have it now, also in beta testing (if you could send me the revised PFS), cause my site development has really stopped due to the very poor actual PFS. I think this was the Achilles' heel of Sedtio and now of Cotonti...
in [color=#729FCF][b]BLUES[/b][/color] I trust
#20 29.09.2009 16:23
There was already a demo available:
See post http://www.cotonti.com/forums.php?m=posts&q=2657
Put it is an old one.
... can we help you ...
#21 05.11.2009 03:00
Thank you, this is my favorite gallery, its so simple and so clean, its great for a clean corporate website look that i was after.
#22 26.04.2010 03:35



Добавлено 5 Минут спустя:

and how to show icon instead of thumbnail?

Добавлено 42 Минуты спустя:

and another problem - {PLUGIN_RANDIMG} just show all pictures from folder... and lighbox doesn't work with that tag

Добавлено 9 Минут спустя:

think problem is somewhere with SQL request, because phpmyadmin returns a lot of files instead of one:

SELECT pfs.pfs_file, pff.pff_id, pff.pff_title FROM sed_pfs AS pfs INNER JOIN sed_pfs_folders AS pff ON pfs.pfs_folderid=pff.pff_id WHERE pff.pff_ispublic='1' AND pff.pff_isgallery='1' ORDER BY RAND() LIMIT 20

Добавлено 3 Минуты спустя:


this would be correct:

SELECT pfs.pfs_file, pff.pff_id, pff.pff_title FROM sed_pfs AS pfs INNER JOIN sed_pfs_folders AS pff ON pfs.pfs_folderid=pff.pff_id WHERE pff.pff_ispublic='1' AND pff.pff_isgallery='1' ORDER BY RAND() LIMIT 1

but I still have problem with light box here... it is ok on plugin page

Добавлено 27 Минут спустя:

so this is a working code (changed to footer.tags):


/* ====================
Cotonti - Content Management Framework
Copyright Cotonti Team

Description=Display a gallery of PFS images (marked 'public' and 'gallery')

==================== */

 * @package Cotonti
 * @version 0.0.2
 * @copyright Partial copyright (c) 2008 Cotonti Team
 * @license BSD License

if (!defined('SED_CODE')) { die('Wrong URL.'); }


//Link to gallery folder (without ID, for rewrite purposes)
$folderurl = 'plug.php?e=gallery&amp;f=';

$randimg ='
<link href="js/jquery.lightbox-0.5.css" type="text/css" rel="stylesheet" media="screen" />
<script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
<script type="text/javascript"> 
    $(function() {
        $(\'#gallery a\').lightBox();

$sql = sed_sql_query("SELECT pfs.pfs_file, pff.pff_id, pff.pff_title FROM $db_pfs AS pfs INNER JOIN $db_pfs_folders AS pff ON pfs.pfs_folderid=pff.pff_id WHERE pff.pff_ispublic='1' AND pff.pff_isgallery='1' ORDER BY RAND() LIMIT 1");
if (mysql_num_rows($sql)>0) {
	$randimg .= "<div style='text-align:left; width:100%;'>";
	while ($row = mysql_fetch_array($sql)) {
		$randimg .= '<div id=\'gallery\'><div id="image"><a href="datas/users/'.$row['pfs_file'].'"><img src="datas/thumbs/'.$row['pfs_file'].'" alt="" /></a></div></div>';
		$randimg .= $L['gal_from'].': <a href="'.$folderurl.$row['pff_id'].'">'.$img.$row['pff_title'].'</a><br /><br />';
	$randimg .= '</div>';
else {
	$randimg .= $L['gal_none'];

$t-> assign(array(
	"PLUGIN_FOOTER_RANDIMG_TITLE" => $L['gal_randimg'],


Добавлено 20 дней спустя:

I have 1 bug with random image:


2 images from the left... why? )

Відредаговано: booka (16.05.2010 05:55, 13 років тому)
The Stig
#23 16.11.2010 22:21
# Koradhil : Yesterday I've largely rewritten this plugin (again). It now uses template tags so it is skinnable, and it works with the new PFS' physical folder system.

Added 2 hours 31 minutes later:

Ok, here's the Gallery v2.0.
This uses folder storage mode in PFS config for switching between classic and physical folders mode.
You will probably need to add a DB table column in sed_pfs_folders, named 'pff_path' (varchar 256).
A preview of this plugin in action is here.

I would love to see this demo but i can't register on your site as it is asking for education as required element and as i studied in uk this is impossible.
#24 17.11.2010 21:42
Sorry, you shouldn't register at that site. The management has apparently restricted guest access to their gallery. I have no other site running it that I know of, so I can't provide another link.
#25 09.12.2010 06:37
Koradhil - is it dead now? I tried to run it but it shows me:

2010-12-08 22:36
Fatal error : SQL error : Unknown column 'pff.pff_path' in 'field list'
#26 09.12.2010 21:59
i "fixed" that thing on my own but i stoped @ pff_parentid
im not sure if i can say "Fixed" cuz its releated to Updated PFS Sytem?!

and IMO thats the rason why it wont work for now, we have to be patient, i gues.

I like this gal, its very simple (thats how i love things).

There is older version of it @ 1st page, it does work on cot 0.6.10(r1300), archiwe file name is gallery_2.rar

PS. A small tip that I'd do:

$t-> assign(array(
	"PLUGIN_GALLERY_TIP" => $L['help1']

$L['help1'] = "If you want to make your own gallery u have to go to your PFS (Personal File Space) and make new folder, name of it doesnt matter but it has to be Public and Gallery";

I know it might be silly but im helping as admin/mod @ huge site (~50k members) and there will be always some1 that will need a help how to make hes own gallery.
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl

Відредаговано: Dave (09.12.2010 22:05, 12 років тому)