Tidypics Photo Gallery Plugin v1.08.2

Release Notes

Tidypics Photo Gallery

For Elgg 1.2+

Tidypics Photo Gallery is an Elgg plug-in that provides a very simple to use photo gallery.  It provides photo albums for both users and groups.  If you would like to see this plug-in in action, visit: http://oakpages.com.


Your contributions are always welcome!!!  If you wish to contribute to this plug-in, please release all your changes under a GPL-compatible license, upload your plug-in to the Tidypics group, and update the contributions.txt file with your changes.


Version 1.08.2 Change List
Release Date: 02/13/2008
  * Gabriel Monge-Franco (http://gabriel.mongefranco.com)
* Fixed bug introduced in v1.08.1 that broke the picture upload (thanks to Karsten Schulze).
* Fixed empty variables in several files that were supposed to send the user back to the previous page, but didn't.
* Cleaned up change log (contributions.txt).
* Finally fixed the Polish language file!!! Yay!! :)

* TODO: Work around large image (high resolution) limit when creating thumbnails (an Elgg limitation... can probably be fixed by using PHP GD functions directly or ImageMagic if available)
  - The problem is with get_resized_image_from_existing_file().  Submitted a ticket to the Elgg tracking bug system.
  - Edit actions/upload.php when done. There is a dirty hack in place for now that needs to be removed once the above bug is fixed.
* TODO: disable public by default (input/accessRead.php) -- add setting to admin page that lets the site admin decide whether pictures can be public or not.
* TODO: allow group members to add pictures to group photo albums
* TODO: implement photo anotations
* TODO: look into replacing individual image views with lightbox2 or jQuery lightbox album views.
* TODO: create a new widget to show pictures (in slideshow) in a user's profile.
* TODO: add settings for group albums so that the group owner can select the number of albums to show.
* TODO: implement a way to move pictures from one album to another (should be pretty easy).
* TODO: add an "Add Photos" option to the user widget similar to the one in the group widget.
* TODO: implement automagic file resizing to meet the admin's maximum resolution and file size.

* OF NOTE: It is currently not possible to allow group members to edit an album created by another group member.  This is a bug with group permissions and it will probably not be fixed until [at least] Elgg v1.5 comes out.

  • Great :-))

    Just at the moment i found the bug with the broken picture upload in line 20 of /actions/upload.php ( echo something and not close the page that forwarding with header() will not work ) you have released this update.

    best regards,

  • Thanks Gabriel and to all the contributers, We can make this the best plugin!

  • Works great Gabriel! Hopefully soon this plugin will have photo tagging and a flash photo viewer! So we don't have to refresh pages when we browse through photo's! Only time will tell! Awesome Plugin!!!!

  • Cool beans.

    Photo tagging and an AJAX-based viewer are both great features... but I think we should focus on the upload problem right now.  Finding a way to create thumbnails for high-resolution pictures with ImageMagick (when available) and GD is very important.  I think we should start borrowing code from GPL'ed PHP photo albums. :)

  • I want to contribute code to make this an even better solution/plugin. Could you send me or post code to go through all member photos and place all public and group photos into an array? Contact me if you would like to see a demo slideshow of what I have written with Perl for one of my sites.

  • Can we have a tiny/small/large thumbnail option when viewing albums??

  • You can go though member photos pretty easily using the functions in world.php.  You just have to make sure you pick the "image" subtype, otherwise you will get albums and files too.

  • Gabriel, downloading of a picture returns a nice little picture of a camera but not the one wanted? (Found this bug while trying to embed a picture link in a longtext field)

  • Gabriel,
    Having the same problem here.  When trying to upload photos all I get is the image of the camera.

  • @gabriel, @mommyoftwins

    This camera picture only appears with pictures previously uploaded with Tidypics v1.05, create a new album with v1.08_2, upload some pictures and the download link works correctly.

  • I'm not sure why you guys have that problem.  I have pictures uploaded with v1.05, and the "download" button works fine for them.

    Speaking of which... does anyone know what CSS code I need to make the "download" link look like one in the file plugin (a blue button)?

  • Hy,

    Its nice plugin, doe I dont know is it meant that tumbnails are shown in vertical way and without spaces.

  • and its not showing in all files activity?

  • Gregor - pictures uploaded with Tidypics are not part of the files activity, since "file" is a different plugin.  You will see them as "image" or "album" activity instead.  Regarding the vertical thumbnails -- are you talking about the album view, or the group/profile widgets?  Because they come up side-by-side when in album view on my site (http://oakpages.com/pg/photos/album/330/resource-pictures).

  • Wow -- cool plugin -- thank you, thank you

    one problem ....

    I installed the previous version 1.08 -- and created a test album and uploaded a few photos in jpg

    because it was showing in the front page under New Files, with a blank sqaure as thumbnails,  Ideleted each individual image within the album ..... but

    now that I installed version 1.08.2 -- I see that the OLD Albums STILL show when all site albums is listed

    HOW can I manually delete those OLD albums?

    which directory? which files? etc...

    will appreciate any asistance in this matter

    thanks again

  • and yes,, i deleted the previous tinypics folder within the mod directory -- then uploaded a fresh tinypics version 1.08.2

    cant find the text file that contains the old album details -- or whatever type of file i need to delete

    help ... please

  • wow -- I got it -- how dumb of me, lol --

    I clicked on the old album - then i saw the DELETE option

    but I had to clear cache for this to display

    all works well now


  • I had a problem that i tried uploading a file of size 4.65mb, but was unable to upload it, i saw the image of a camera. later i edited the upload.php file and removed the maximum file size checker and was able to upload the same file

    Here is that edited upload.php



    * Elgg multi-image uploader action

    * This will upload up to 10 images at at time to an album



    global $CONFIG;

    // Get common variables

    $access_id = (int) get_input("access_id");

    $container_guid = (int) get_input('container_guid', 0);

    if (!$container_guid)

    $container_guid == $_SESSION['user']->getGUID();

    $not_uploaded = array();

    $uploaded_images = array();


    foreach($_FILES as $key => $sent_file) {

    if(!empty($sent_file['name'])) {

    $name = $_FILES[$key]['name'];

    $mime = $_FILES[$key]['type'];

     //make sure file is an image

     if($mime == 'image/jpeg' || $mime == 'image/gif' || $mime == 'image/png' || $mime == 'image/pjpeg') {

    //this will save to users folder in /image/ and organize by photo album

    $prefix = "image/" . $container_guid . "/";

    $file = new ElggFile();

    $filestorename = strtolower(time().$name);



    $file->originalfilename = $name;


    $file->access_id = $access_id;




    if ($container_guid) {

    $file->container_guid = $container_guid;


    $result = $file->save();


    if ($result) { //file was saved; now create some thumbnails

    //get maximum file size from plugin settings (REMOVED)

    //check file size and remove picture if it exceeds the maximum

    array_push($uploaded_images, $file->guid);

    // Generate thumbnail

    //TODO: REMOVE THE BELOW IF STATEMENT ONCE get_resized_image_from_existing_file() ACCEPTS IMAGES OVER 0.9MB IN SIZE

    try {$thumblarge = get_resized_image_from_existing_file($file->getFilenameOnFilestore(),600,600, false); } catch (Exception $e) { $thumblarge = false; }

    try {$thumbsmall = get_resized_image_from_existing_file($file->getFilenameOnFilestore(),153,153, true); } catch (Exception $e) { $thumbsmall = false; }

    try {$thumbnail = get_resized_image_from_existing_file($file->getFilenameOnFilestore(),60,60, true); } catch (Exception $e) { $thumbnail = false; }

    if ($thumbnail) {

    $thumb = new ElggFile();




    if ($thumb->write($thumbnail)) {

    $file->thumbnail = $prefix."thumb".$filestorename;

    } else {





    if ($thumbsmall) {

    $thumb = new ElggFile();




    if ($thumb->write($thumbsmall)) {

    $file->smallthumb = $prefix."smallthumb".$filestorename;

    } else {





    if ($thumblarge) {

    $thumb = new ElggFile();




    if ($thumb->write($thumblarge)) {

    $file->largethumb = $prefix."largethumb".$filestorename;

    } else {





    //end of file size check

    } else { //file was not saved for some unknown reason

    array_push($not_uploaded, $name);

    } //end of file saved check and thumbnail creation

     } else { // file is not a supported image type 

    array_push($not_uploaded, $name);

     } //end of mimetype block

    } //end of file name empty check

    } //end of loop

    if (count($not_uploaded) == 0) {


    } else {

    $error = elgg_echo("image:uploadfailed") . '<br />';

    foreach($not_uploaded as $im_name){

    $error .= ' [' . $im_name . ']  ';


    $error .= '  ' . elgg_echo("image:notimage");


    } //end of upload check

    if (count($uploaded_images)>0) {

    forward($CONFIG->wwwroot . 'mod/tidypics/edit_multi.php?files=' . implode('-', $uploaded_images)); //forward to multi-image edit page

    } else {

    forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); //upload failed, so forward to previous page






    but after editing also i had a problem that when the total file size is > 10MB i am not able to upload,.



  • you can get that original image from here 

  • That's why we need Quotas - it seems to be not possible for users of a community to resize images before uploading ;-))

  • hy,

    its intresting next day the pictures were alighn OK. I wonder how would you call to show new albums or pictures on frontpage, like for example for newest groups:

    //newest groups
        $groups = list_entities('group','',0,4,false, false, false);

    as I am using custom index plugin.

    Thanks, Gregor

  • Hm, I think we could add two nice additions to the plugin:

    - the latest photos of your friends for dashboard and profile. It shows the set of first pictures of an album of a specific user, that was changed lately. This means that if user changed 5 pictures in an album, or 5 pictures in 5 different albums, still only one picture that he edited as the last one will show up (with a link to an edited album). If 5 users edited their albums, 5 pictures will be shown on the widget - each for a different user.

    - the same feature, only for the groups you belong to

    This functionality is on a polish site nasza-klasa.pl (with 11 million users), and works really well, generating a lot of traffic on the site. I didn't analize how hard it will be to implement it though, and how high will be the stress on the database.


    Sorry for my english :]

  • @Gregor:


        $photos = list_entities('object','image',0,4,false, false, false);
        $albums = list_entities('object','album',0,4,false, false, false);
        $body = elgg_view_layout('new_index',$blogs, $files, $newest_members, $login, $groups, $pages, $photos, $albums);
            <!-- display latest photos -->
        <div id="index_box">
                <h2><?php echo elgg_echo("latest photos"); ?></h2>
                    if (!empty($vars['area7'])) {
                        echo $vars['area7'];//this will display photos
                        echo "<p>" . elgg_echo("No photos available") . "</p>";
            <!-- display latest albums -->
        <div id="index_box">
                <h2><?php echo elgg_echo("latest albums"); ?></h2>
                    if (!empty($vars['area8'])) {
                        echo $vars['area8'];//this will display albums
                        echo "<p>" . elgg_echo("No albums available") . "</p>";

    I'm a little bit tired but hope that i still have no errors in this code snippets :-))

  • Heya, I'm using the latest svn in prod (a little foolish isn't it, but who cares :) ), and I spotted a bug in group album render today due to tidypics.

    Here is the tidypics affected file and modifications :


    line 54, the div should be closed after the:

    if ($owner && ($owner->canWriteToContainer($_SESSION['user']))){ ...   }

    else it causes render probs if you see the page without being a member of a group.

    That's all, thanks for the wonderful work :)


Gabriel Monge-Franco

Gabriel Monge-Franco is an open source developer, hacker, poet, musician and robotics experimenter.


  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 3
  • Updated: 2014-11-17
  • Downloads: 11208
  • Recommendations: 2

Other Projects

View Gabriel Monge-Franco's plugins