[Elgg 1.5-1.12 & 2.X: Tidypics] v1.8.1beta11

Release Notes

Changelog:

  • Some general code cleanup,
  • Fix of river entries appearing twice on image uploads in case the Flash uploader is used and the plugin option is set to create separate entries for each uploaded image (issue introduced in beta10),
  • Added TidypicsBatch class (that extends ElggObject class) used for creation of objects of subtype "tidypics_batch" (used for handling "batches" of uploaded images) instead of creation the objects as ElggObject and assinging the subtype,

Improvements on slideshow:

  • a slideshow can be started on all pages that display a suitable list of images (but the slideshow feature is only available if the slideshow plugin option introduced in beta10 is enabled in the plugin settings),
  • start of slideshow via title menu button,
  • slideshow will include the next 64 images (i.e. 5 pages of images) of the current displayed image list taking into account the current page offset (i.e. on page 1 the slideshow will display pages 1-5 while on page 10 it will display the images of pages 10-14 etc.). (Longtime goal for future Tidypics versions: no limitation of number of images in slideshow and most likely replacing the PicLensLite slideshow by something else / something better. Currently, the number of images to be included in a slideshow is somewhat limited by avoiding running into memory issues. Also, the PicLensLite slideshow library requires the Flash plugin on client browsers which is annoying and the 3D wall feature does no longer work),

Improvements on image orientation correction at image uploading:

  • using best methods available depending on image library selected,
  • update orientation information saved in image file after a change of image orientation if the image library used supports this (GD library unfortunately does not support it but the exif info saved in the image file is lost on image orientation correction anyway),
  • support of orientation correction not only of rotated but also of mirrowed (and possibly additionally rotated) images,

Some remarks regarding which image library to use for Tidypics:

  • if possible and available on your server use the "ImageMagick executable". Generally, this library has a much smaller memory requirement compared to the GD library both for image resizing (i.e. creation of thumbnail preview images) and orientation correction of images. Additionally, the exif information saved in an image file will be preserved both during resizing and orientation correction processing,
  • next best choice after "ImageMagick executable" is the "imagick PHP extension". It also has a low memory consumption compared to the GD library but you might lose exif information during image processing,
  • the GD library should be available on any server (as Elgg core requires it anyway). The memory requirement of the GD library can be quite high both for creation of thumbnails and image orientation corrections. The memory requirement is depending not on the image file size in the first place but on image resolution, color depth per pixel and color channels per pixel (so even a small sized image file might require more memory than available on the server). If you use the GD library for Tidypics on your server, your users might not be able to upload larger images. Additionaly, exif information saved in the image files might get lost during image orientation correction.
  • Gr8 advice IIonly, didn't try that. I disabled some plugins one by one, and when I disabled hypeFramework V1.8.5. and re-enabled it, my comments were back in TidyPICS !

    So many thanks!

    Do you know where to find that Container_guid in the DB? I  wasn't able to find it.

  • You need to find the row of the album entity in the entities table in the database of your site. You can find the album entity by the album guid (the number in the url of the album). Within this row there's the container_guid entry of this album and you would need to change this value to match the group guid you want the album to belong to.

  • i've noticed that when i edit an already existing image album, the notification that is displayed afterwards is for the album creation event.

    i also haven't gotten the slideshow link to render at all (and thus haven't seen the slideshow functioning) and the flash uploader is not working here (although that doesn't bother me as i prefer not to use flash anyway).

  • oh and also the categories are not being rendered for outputted individual images.. they do appear for albums, just not the images.

  • "edit album" message: yep, confirmed. Currently, there's no check if the album is new or not when outputting this message. I'll have to keep that in mind for the next version.

    image categories: that's not included in the image edit form so it's not surprising that it is not possible... I might add this at a later time (but it's currently not a top priority to me).

    slideshow / flash uploader: do you have any flash plugin installed in your browser used for testing? If not, it can't work. If yes: what exactly fails to work? Does the slideshow window open (any maybe stays blank) or does it not open at all? For me the slideshow works on Elgg 1.8 but fails to work on Elgg 1.9 (so I will have to replace the Piclens slideshow script soon anyway). Does the flash uploader fails to work at all or does it at least work partly (and what would be the error then)?

  • Hi, Just to add some more detail on my finding above about hypeFramework affecting the Tidypics comments, I found that hyperAlive (V1.8.5) which is an ajaxed search feature, is the cause.

    I need to leave that plugin disabled in order to have the comments in Tidypics.

    Cheers

  • the image categories became noticable after i installed hypecategories which allows selection of which entities will support categories and after i chose to add the category selector to the image input form. its not a big issue for me either presently.

    the flash plugin is the lastest version here (for linux 32/64bit).

    the flash uploader has issues with the interface - i click the 'choose images' button and the 'file open' upload box/window at first did not show up.. i then found it was behind the browser window (after i thought the browser had crashed because i couldn't use it (modal locking). when i located the 'file open' window, chose a .png file and pressed 'upload images', the progress bar rendered, moved to 100% and then a label appeared saying IO error.

    the slideshow is unusable since there is no button to launch it.. i see 'make cover' and other options, yet no 'slideshow' or 'launch slideshow'..

  • Hi IIonly

    One more thing, thanks for explaining about the container_ID, that worked !

    So to come back to my earlier question about the new pop-up for uploading photo's.

    Ever since the upgrade of Tidypics to V1.8.1beta11, every album shows the upload button (like before) but also a second one, which loads a pop-up and asks to select the album name or to create a new one.

    Is there a way to disable this new Upload pop-up? Once again, I don't want the users to be able to create albums.

    Thanks

  • Hi agina IIonly,

    I tried to make some changes to the tidypics code as you suggested earlier (to only allow admin to create albums), but didn't have much luck.

    To me, a good step to gain that control measure is to disable the ajax uploader if possible. That leaves the user only the basic uploader, where they don't get the choice to create an album. So could you please instruct me how to do that?

    Second thing is the removal of the "Create Album" on the main page if the user is not admin. Need some suggestions here too, please. I know my guid is 35 but I'm not that familiar with the Elgg code...

    Cheers

  • @ura: if you don't see a button to start the slideshow you most likely don't have the slideshow feature enabled. There's a slideshow plugin setting on the Tidypics plugin settings page.

    The issue of the file selection dialog window of the Flash uploader opening in the background is known to me. I believe it's an issue of the Uploadify script the Flash uploader is based on. I want to replace the Uploadify uploader by something else anyway when I have the time to work on it. I don't think the issue can't be fixed but is rather a limitation of the Uploadify script. The IO error should not occur though but it might be caused by the Uploadify script (maybe when switching the directory in the file selection window). Generally, speaking I'm not fond of the Uploadify script at all but rather tried to get it working as best as possible (as it had already been implemented). I hope by replacing it for example with the Plupload script the issues can be sorted out (and the dependency on flash, too).

    @Daniel: which uploader you use does not matter. The "Create album" button will be displayed for both. If you want to restrict this button to admins only, you would need to modify mod/tidypics/pages/photos/all.php & friend.php & owner.php. The line with elgg_register_title_button() does at the button. With

    if (elgg_is_admin_logged_in()) {

    elgg_register_title_button();

    }

    the button will only be shown to admins. The "Upload photos" button is created by

    if (elgg_is_logged_in()) {
            $logged_in_guid = elgg_get_logged_in_user_guid();
            elgg_register_menu_item('title', array('name' => 'addphotos',
                                                   'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_guid,
                                                   'text' => elgg_echo("photos:addphotos"),
                                                   'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
    }

    These lines are included in many files within the pages folder. You would either need to comment out these lines, change "if (elgg_is_logged_in()) {" to "if (elgg_is_admin_logged_in()) {" to disable the button completely or make it only visible to admins or you can modify mod/tidypics/views/default/photos/selectalbum.php. The line "$album_options[-1] = elgg_echo('album:create');" will add the option to create a new album in the dropdown input field. Again, either comment out this line or include it in a "if (elgg_is_admin_logged_in()) {"-clause.

  • i am aware of the slideshow button in the admin panel.. i am setting it to 'on' and still not seeing a slideshow button being rendered.

  • @ura: well, what should I say? Did you remove the old Tidypics files when upgrading to the latest version? There might be a conflict caused by outdated files remaining if not. If you did that (or do it now) and it does not solve the missing slideshow button issue there might be a conflict with another plugin / your theme.

  • no shoulds! :)

    i just removed the tidypics plugin completely and replaced it with a new 'copy' from the community here in the recommended way.
    the slideshow button is not rendered in the html at all.. so its not a css issue.

    as far as i am aware no other plugins i am using would remove this button. i do have matt's entity drop-down menu plugin, which is the only one that effects that part of the page - however, i just disabled it and that did not resolve the issue.

  • Hi IIonly,

    Your statement that the "Create album" choice will be displayed with the basic uploader is not true, at least in my present configuration. So, that's why I'm asking, is how to disable the ajax upload form.

    In two of the three files you mentioned above to modify, already had this setting:

    if (elgg_is_admin_logged_in()) {

    elgg_register_title_button();

    }

    So, I only changed the 3rd file and saw no progression. Both upload buttons lead to the same upload page in my case, while the basic uploader does not ask for a category or new album.

    Appreciate your comment.

  • @ura: if there's no sign of the slideshow button code in the html source of the site either the slideshow option is not enabled in the plugin settings or there's some issue with the cache of your site not getting properly refreshed on changing plugin settings (or enabling/disabling/upgrading plugins in general) or there's a conflict with another plugin.

    @Daniel: I've just re-checked what title buttons show up depending on what uploader is used and it confirmed what I said: for me the type of uploader in use does not have any effect on the "Create album" button to show or not. This button is not depending on the uploader but simply opens the album creation form/page. The "Upload photos to this album" and "Upload photos" buttons do open the uploader form.

    If you made any changes in the code (like adding the check if an admin is logged in) and you have the caching enabled on your site, you need to flush the cache from the admin section dashboard for the changes to take effect. If it still has no effect then check if you really made the correct modication as I had outlined in my earlier posting.

  • Hi IIonly,

    We have a little misunderstanding here I think. Within each album page I get 2 Photo upload buttons.

    The left one loads the Ajax-uploader and the right one the basic uploader.
    I've been able to disable the Ajax uploader, but can't find where to disable the button on each album.

    About the "Create Album" function, I tried that, as stated earlier. Is there a possible simple workaround to only show that button while the Admin is logged in? Sorry for asking again..:)

  • The "Upload photos", "Upload photos to this album" and "Create album" buttons are not directly connected to the uploader in use. You will have the same buttons both with the basic uploader and the Flash uploader visible. The "Upload photos" button only uses a lightbox to display the album selection but this has nothing to do with the Flash uploader.

    I guess you don't want to modify the "Upload photos to this album" button (it will only show up if the user is allowed to add photos to an already existing album).

    The "Create album" button is shown on the album pages ("All", "Mine", "Friends" tabs). To display this button only to admins you would have to modify:

    • pages/photos/all.php,
    • pages/photos/owner.php and
    • pages/photos/friends.php,

    Encapsule the elgg_register_title_button() function within an if-clause like:

    if (elgg_is_admin_logged_in()) {
        elgg_register_title_button('photos');
    }

    Additionally, you would need to modify views/default/photos/group_module.php:

    if (elgg_is_admin_logged_in()) {

    $new_link = elgg_view('output/url', array(
        'href' => "photos/add/$group->guid",
        'text' => elgg_echo('photos:add'),
        'is_trusted' => true,
    ));

    }

    and views/default/widgets/groups_latest_albums/content.php:

    if (elgg_is_admin_logged_in()) {

    $image_html .= elgg_view('output/url', array(
                                  'href' => "photos/add/" . elgg_get_page_owner_guid(),
                                  'text' => elgg_echo('photos:add'),
                                  'is_trusted' => true,
    ));

    }

    for the link for creating a new album to be only visible to admins on the group profile pages (the change in views/default/widgets/groups_latest_albums/content.php is only necessary if you use the Widget Manager plugin).

    The "Upload photos" button is added to the various pages by various files within the pages subfolder in the Tidypics plugin directory. You will have to search for the lines

    elgg_register_menu_item('title', array('name' => 'addphotos',
                                                   'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_guid,
                                                   'text' => elgg_echo("photos:addphotos"),
                                                   'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));

    Sometimes these lines are already within an if-clause that checks if a user is logged in or not (I don't know if this is always the case in all files). If such a if-clause is already there you can simply change the elgg_is_logged_in() check to a elgg_is_admin_logged_in() check, i.e. it should look like this:

    if (elgg_is_admin_logged_in()) {
            $logged_in_guid = elgg_get_logged_in_user_guid();
            elgg_register_menu_item('title', array('name' => 'addphotos',
                                                   'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_guid,
                                                   'text' => elgg_echo("photos:addphotos"),
                                                   'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
    }

    You will have to modify ALL files where this button is added with the above code. Alternatively, you can keep the button for all users but only remove the "Create album" item from the dropdown selection in the lightbox dialog for regular users. Then you would only need to modify views/default/photos/selectalbum.php. In this file embed the line $album_options[-1] = elgg_echo('album:create'); into an if-clause that checks if an admin is logged in:

    if (elgg_is_admin_logged_in()) {

    $album_options[-1] = elgg_echo('album:create');

    }

    After you changed any file you will have to flush the Elgg site cache for your changes to take effect. Or you can disable the caching in the advanced site settings while modifying the files to see the changes immediately.

  • hi all.... i just upgraded from 1.8.14 (where tidypics worked fine for personal photos/albums, but not for group) to 1.8.16. I removed the older version of tidypics and installed 1.8.1beta11 (as was recommended on the boards).  I am able to select photo's, upload them (flash), but i am not automatically redirected to step 3- adding information.  The screen stays locked after step 2.  when i back out, the albums are still there but there are no photos listed.  any suggestions? thanks so much for any help.

  • This version still suffers from the hidden groups issue.

    To reproduce:

    1. Create a hidden group

    2. Create an album in that group

    3. Set the access of the album to public

    4. Save the album, add images

    5. view photos/all with a non-admin user who's not in the group

     

    At step 5 you'll get a wsod - this is due to calling $album->getContainerEntity() and then using that entity when the user can't see the entity.  If you are going to allow public albums in hidden groups you need to check for that in the views.

  • @wohpe: when you say "no photos listed" does this also include photos that you have uploaded before and showed before but not anymore now? Or do you only refer to the new "uploaded" photos not showing?

    The forwarding to the "edit image details" failing is most likely because the photos fail to upload, i.e. there are no photos available to edit. Now the question is why the photos fail to upload;

    • can you try the basic uploader to check if the problem only occurs with the Flash uploader? If the basic uploader works but the Flash uploader fails your server config might have been changed by the hoster at updating your site to Elgg 1.8.16.
    • please try uploading a single, small image (small both in size and image resolution). If the small image can be uploaded but larger images fail to upload then it's due to memory limitations on your server (I've made the check of memory necessary for image resizing stricter in the recent versions of Tidypics to avoid faulty image entries but the check can only roughly estimate the memory requirement). If the upload fails due to memory restrictions try increasing the memory_limit in Elgg's .htaccess file or switch to the ImageMagick or Imagick image library for image resizing in Tidypic's plugin settings if these tools are available on your server (ask your hoster if they can install them if not). The memory requirements are much smaller with the other libraries compared to the default GD library.
    • If no image can be uploaded at all (and also if images formerly uploaded fail to show) I suspect the permissions issue with the data directory. If the permissions are set wrong no new files can be saved and possibly not even existing files read. You can check if you are able to upload avatar images or files to the files section of your site (best would be to test with uploading an image to the files section). If the upload fails also for other files and not only for Tidypics images the reasons is most likely a problem with the data directory. If other files work to be added then we have to think again what could be the problem within Tidypics.

     

    @Matt: thanks. Confirmed! Though Tidypics is not the only plugin that has this problem. I've just check what happens with a blog posting with access level "public" added to a hidden group: exactly the same WSOD problem... I wonder if it wouldn't be better / possibile within Elgg core to override any permission setting for content of hidden groups and set the access level to this group forcefully. After all the intention of a hidden group is to make the content hidden (or not?) and group members should not be able to mistakenly make any content visible (or even accessible) by non-members.

  • Hi IIonly,

    Cool ! You produced avery exhaustive instruction, so many thanks for that.

    Following your instruction, I got the "Create album" button on the main Albums page to only show for admin. That's gr8 !

    On the "Upload photo's" on all Album pages:

    • I want to disable the "Lightbox". In my view that's only an extra (confusing) dialogue which I don't need. The basic uploader is fine for my audience.
    • On the main Album page, I still have a "Photo upload" button, which I want to remove, since it's not related to any existing album. I think this piece of programming was meant for users to create a new album, and then add photo's to it. This is precisely what I don't want ! Well, that is unless it would list existing Albums only to choose from, not the option to create a new Album.

    In short, we are getting there. Your response is much appreciated.

    I surely hope that this may be of value for further TidyPics releases.

    Kind regards

     

  • If you don't want the lightbox dialog (or the "Upload photos" button respectively) at all, then simply comment out the code that adds this button. Do a "grep" (i.e. search the content of the Tidypics files) for the term "selectalbum" and you will get all places where the "Upload photos" button is added.

    If you only want to remove the option to create a new album from the lightbox dropdown selection then do as I described in my earlier posting, i.e. editing views/default/photos/selectalbum.php.

    I've added the "Upload photos" album rather to reduce any possible confusion (you can also see it as a "shortcut") as I found it rather complicated to navigate to the album page first before being able to uploading images. Having a button to initiate the photo upload on all Tidypics pages seemed to make it easier rather than confusing...

  • thanks for the prompt responses... it's really a bit over my head, but i'm trying to hang in there... (this much coding is really new to me so i appreciate the help more than you know). 

    It's hard to tell about the previous pictures loading still or not since i deleted the old version and the pictures before reinstalling the new tidypics.  I wrote to hostpapa tech today asking if they will provide the imagemagick since they don't seem to have it.  But while waiting i tried some more album creating and uploads.

    Tonight i tried using the basic uploader for one 2.5mb photo and got a message saying that the failure was do to too many pixels. (i'll try to make a smaller pic tomorrow and see if i can get it down in resolution and see how that goes).

    I can not find any "files" folder.... would you give me a general idea where this might be in my Cpanel?

    also, would you suggest "a number" to increase the memory_limit in Elgg's htaccess file to?

    thanks :)

  • Hi IIonly,

    We still have a misunderstanding, you may have programmed or verified the Photo Upload function and new lightbox, but as stated earlier i had two buttons. The first opens a lightbox, but lands on the same upload page as the second button direct loads.

    Also since I use groupalbums, the lightbox only shows the album loaded, or the choice to create one.
    I guess that you didn't realize that. In my case the lightbox adds no value, as the user can only select the single album name.

    Since I started to modify the code, I now don't have that second button anymore, which I think was due to pieces of earlier code. I just want to get rid of the lightbox, and I think I will need an alternative to the Selectalbum being called in a lot of files:

    if (elgg_is_logged_in()) {
            $logged_in_guid = elgg_get_logged_in_user_guid();
            elgg_register_menu_item('title', array('name' => 'addphotos',
                                                   'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_guid,
                                                   'text' => elgg_echo("photos:addphotos"),
                                                   'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
    }

    If I would comment these out, I don't have any upload function any longer, right? I know that now, since I commented out in /pages/photos/all.php

    I've been looking thru some older versions of Tidypics (not build by you I think), but did not find out yet where the Upload button gets registered. Disabling Uploadify doesn't seems to help I guess.

    Cheers

Stats

  • Category: Photos and Images
  • License: GNU General Public License (GPL) version 2
  • Updated: 2018-9-16
  • Downloads: 131014
  • Recommendations: 262

Other Projects

View iionly's plugins