From 4e0c1576475390faa2f1fb4c4dc2902a953f440e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 25 Feb 2009 12:16:53 +0000 Subject: First commit --- actions/addalbum.php | 72 ++++++++++ actions/delete.php | 105 +++++++++++++++ actions/download.php | 43 ++++++ actions/edit_multi.php | 62 +++++++++ actions/editalbum.php | 91 +++++++++++++ actions/icon.php | 41 ++++++ actions/upload.php | 133 +++++++++++++++++++ contributions.txt | 170 ++++++++++++++++++++++++ edit.php | 46 +++++++ edit_multi.php | 33 +++++ friends.php | 43 ++++++ graphics/Thumbs.db | Bin 0 -> 18944 bytes graphics/arrow_next.gif | Bin 0 -> 304 bytes graphics/arrow_previous.gif | Bin 0 -> 306 bytes graphics/bl.gif | Bin 0 -> 215 bytes graphics/br.gif | Bin 0 -> 217 bytes graphics/btnClose.gif | Bin 0 -> 361 bytes graphics/btnContract.gif | Bin 0 -> 188 bytes graphics/btnExpand.gif | Bin 0 -> 192 bytes graphics/btnNext.gif | Bin 0 -> 308 bytes graphics/btnPrevious.gif | Bin 0 -> 317 bytes graphics/icons/Thumbs.db | Bin 0 -> 24064 bytes graphics/icons/album.gif | Bin 0 -> 1411 bytes graphics/icons/general.jpg | Bin 0 -> 7036 bytes graphics/icons/general.png | Bin 0 -> 7177 bytes graphics/icons/river_icon_album.gif | Bin 0 -> 398 bytes graphics/icons/river_icon_image.gif | Bin 0 -> 284 bytes graphics/img_error.jpg | Bin 0 -> 5864 bytes graphics/loader.gif | Bin 0 -> 2545 bytes graphics/tl.gif | Bin 0 -> 214 bytes graphics/tr.gif | Bin 0 -> 217 bytes graphics/ttl.gif | Bin 0 -> 288 bytes graphics/ttp.gif | Bin 0 -> 192 bytes graphics/ttr.gif | Bin 0 -> 288 bytes index.php | 45 +++++++ languages/de.php | 114 ++++++++++++++++ languages/en.php | 115 ++++++++++++++++ languages/es.php | 115 ++++++++++++++++ languages/pl.php | 115 ++++++++++++++++ manifest.xml | 9 ++ newalbum.php | 31 +++++ start.php | 174 +++++++++++++++++++++++++ tasks.txt | 66 ++++++++++ thumbnail.php | 55 ++++++++ tidypics_user_instructions_.txt | 71 ++++++++++ upload.php | 49 +++++++ view.php | 62 +++++++++ views/default/input/accessRead.php | 61 +++++++++ views/default/input/cover_checkbox.php | 45 +++++++ views/default/input/multi_radio.php | 42 ++++++ views/default/object/album.php | 137 +++++++++++++++++++ views/default/object/image.php | 130 ++++++++++++++++++ views/default/river/object/album/annotate.php | 13 ++ views/default/river/object/album/create.php | 13 ++ views/default/river/object/image/annotate.php | 13 ++ views/default/river/object/image/create.php | 13 ++ views/default/settings/tidypics/edit.php | 10 ++ views/default/tidypics/css.php | 128 ++++++++++++++++++ views/default/tidypics/forms/edit.php | 115 ++++++++++++++++ views/default/tidypics/forms/edit_multi.php | 44 +++++++ views/default/tidypics/forms/upload.php | 79 +++++++++++ views/default/tidypics/groupprofile_albums.php | 60 +++++++++ views/default/tidypics/icon.php | 41 ++++++ views/default/tidypics/menu.php | 16 +++ views/default/widgets/album_view/edit.php | 21 +++ views/default/widgets/album_view/view.php | 53 ++++++++ views/rss/object/file.php | 30 +++++ world.php | 37 ++++++ 68 files changed, 2961 insertions(+) create mode 100644 actions/addalbum.php create mode 100644 actions/delete.php create mode 100644 actions/download.php create mode 100644 actions/edit_multi.php create mode 100644 actions/editalbum.php create mode 100644 actions/icon.php create mode 100644 actions/upload.php create mode 100644 contributions.txt create mode 100644 edit.php create mode 100644 edit_multi.php create mode 100644 friends.php create mode 100644 graphics/Thumbs.db create mode 100644 graphics/arrow_next.gif create mode 100644 graphics/arrow_previous.gif create mode 100644 graphics/bl.gif create mode 100644 graphics/br.gif create mode 100644 graphics/btnClose.gif create mode 100644 graphics/btnContract.gif create mode 100644 graphics/btnExpand.gif create mode 100644 graphics/btnNext.gif create mode 100644 graphics/btnPrevious.gif create mode 100644 graphics/icons/Thumbs.db create mode 100644 graphics/icons/album.gif create mode 100644 graphics/icons/general.jpg create mode 100644 graphics/icons/general.png create mode 100644 graphics/icons/river_icon_album.gif create mode 100644 graphics/icons/river_icon_image.gif create mode 100644 graphics/img_error.jpg create mode 100644 graphics/loader.gif create mode 100644 graphics/tl.gif create mode 100644 graphics/tr.gif create mode 100644 graphics/ttl.gif create mode 100644 graphics/ttp.gif create mode 100644 graphics/ttr.gif create mode 100644 index.php create mode 100644 languages/de.php create mode 100644 languages/en.php create mode 100644 languages/es.php create mode 100644 languages/pl.php create mode 100644 manifest.xml create mode 100644 newalbum.php create mode 100644 start.php create mode 100644 tasks.txt create mode 100644 thumbnail.php create mode 100644 tidypics_user_instructions_.txt create mode 100644 upload.php create mode 100644 view.php create mode 100644 views/default/input/accessRead.php create mode 100644 views/default/input/cover_checkbox.php create mode 100644 views/default/input/multi_radio.php create mode 100644 views/default/object/album.php create mode 100644 views/default/object/image.php create mode 100644 views/default/river/object/album/annotate.php create mode 100644 views/default/river/object/album/create.php create mode 100644 views/default/river/object/image/annotate.php create mode 100644 views/default/river/object/image/create.php create mode 100644 views/default/settings/tidypics/edit.php create mode 100644 views/default/tidypics/css.php create mode 100644 views/default/tidypics/forms/edit.php create mode 100644 views/default/tidypics/forms/edit_multi.php create mode 100644 views/default/tidypics/forms/upload.php create mode 100644 views/default/tidypics/groupprofile_albums.php create mode 100644 views/default/tidypics/icon.php create mode 100644 views/default/tidypics/menu.php create mode 100644 views/default/widgets/album_view/edit.php create mode 100644 views/default/widgets/album_view/view.php create mode 100644 views/rss/object/file.php create mode 100644 world.php diff --git a/actions/addalbum.php b/actions/addalbum.php new file mode 100644 index 000000000..127885270 --- /dev/null +++ b/actions/addalbum.php @@ -0,0 +1,72 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + // Make sure we're logged in (send us to the front page if not) + if (!isloggedin()) forward(); + + // Get input data + $title = get_input('albumtitle'); + $body = get_input('albumbody'); + $tags = get_input('albumtags'); + $access = get_input('access_id'); + $container_guid = get_input('container_guid', $_SESSION['user']->getGUID()); + $back_url = 'pg/photos/new/' . get_entity($container_guid)->username; + + // Cache to the session + $_SESSION['albumtitle'] = $title; + $_SESSION['albumbody'] = $body; + $_SESSION['albumtags'] = $tags; + + // Convert string of tags into a preformatted array + $tagarray = string_to_tag_array($tags); + // Make sure the title / description aren't blank + if (empty($title) || empty($body)) { + register_error(elgg_echo("album:blank")); + forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); //failed, so forward to previous page + + // Otherwise, save the blog post + } else { + + // Initialise a new ElggObject + $album = new ElggObject(); + // Tell the system it's an album + $album->subtype = "album"; + + // Set its owner to the current user + $album->container_guid = $container_guid; + $album->owner_guid = $_SESSION['user']->getGUID(); + // For now, set its access to public (we'll add an access dropdown shortly) + $album->access_id = $access; + // Set its title and description appropriately + $album->title = $title; + $album->description = $body; + // Before we can set metadata, we need to save the blog post + if (!$album->save()) { + register_error(elgg_echo("album:error")); + forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); //failed, so forward to previous page + } + // Now let's add tags. We can pass an array directly to the object property! Easy. + if (is_array($tagarray)) { + $album->tags = $tagarray; + } + // Success message + system_message(elgg_echo("album:created")); + // Remove the blog post cache + unset($_SESSION['albumtitle']); + unset($_SESSION['albumbody']); + unset($_SESSION['albumtags']); + // Forward to the main blog page + + forward("pg/photos/upload/" . $album->guid); + + } + +?> \ No newline at end of file diff --git a/actions/delete.php b/actions/delete.php new file mode 100644 index 000000000..6b8789fb4 --- /dev/null +++ b/actions/delete.php @@ -0,0 +1,105 @@ +canEdit()) { + $subtype = $photoObject->getSubtype(); + $container = get_entity($photoObject->container_guid); + + if ($subtype!='image' && $subtype!='album') forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); //back off if not an album or image + + if ($subtype == 'image') { //deleting an image + $forward_url = $container->getURL(); //forward back to album after deleting pictures + $images = array($photoObject); + } else { //deleting an album + $forward_url = 'pg/photos/owned/' . $container->username; + $images = get_entities("object","image", $guid, '', 999); //get all the images from this album, or the image requested + } //end of subtype comparison + + //loop through all images and delete them + foreach($images as $im) { + $thumbnail = $im->thumbnail; + $smallthumb = $im->smallthumb; + $largethumb = $im->largethumb; + + if ($thumbnail) { //delete standard thumbnail image + $delfile = new ElggFile(); + $delfile->owner_guid = $im->getOwner(); + $delfile->setFilename($thumbnail); + $delfile->delete(); + } + if ($smallthumb) { //delete small thumbnail image + $delfile = new ElggFile(); + $delfile->owner_guid = $im->getOwner(); + $delfile->setFilename($smallthumb); + $delfile->delete(); + } + if ($largethumb) { //delete large thumbnail image + $delfile = new ElggFile(); + $delfile->owner_guid = $im->getOwner(); + $delfile->setFilename($largethumb); + $delfile->delete(); + } + if ($im) { //delete actual image file + $delfile = new ElggFile($im->getGUID()); + $delfile->owner_guid = $im->getOwner(); + //$delfile->setFilename($im->originalfilename); + if (!$delfile->delete()) { + if ($subtype=='image') register_error(elgg_echo("file:deletefailed")); //unable to delete object + } else { + if ($subtype=='image') system_message(elgg_echo("file:deleted")); //successfully deleted object + } + } //end delete actual image file + } //end looping through each image to delete it + + //now that all images have been deleted, delete the album + if ($subtype=='album') { + //delete the album's directory manually; first create a temp file to get the directory path + $tmpfile = new ElggFile(); + $tmpfile->setFilename('image/' . $guid . '/._tmp_del_tidypics_album_'); + $tmpfile->subtype = 'image'; + $tmpfile->container_guid = $guid; + $tmpfile->open("write"); + $tmpfile->write(''); + $tmpfile->close(); + $tmpfile->save(); + $albumdir = eregi_replace('/._tmp_del_tidypics_album_', '', $tmpfile->getFilenameOnFilestore()); + $tmpfile->delete(); + if (is_dir($albumdir)) + rmdir($albumdir); + + //delete object from database + if (!$photoObject->delete()) { + register_error(elgg_echo("file:deletefailed")); //unable to delete object + } else { + system_message(elgg_echo("file:deleted")); //successfully deleted object + } + } //end of delete album + + + } else { //user does not have permissions to delete this image or album + $container = $_SESSION['user']; + register_error(elgg_echo("file:deletefailed")); + } //end of canEdit() comparison + + } else { // unable to get Elgg entity + register_error(elgg_echo("file:deletefailed")); + } //end of get_entitty() + + forward($forward_url); + +?> \ No newline at end of file diff --git a/actions/download.php b/actions/download.php new file mode 100644 index 000000000..31f21f0f5 --- /dev/null +++ b/actions/download.php @@ -0,0 +1,43 @@ +originalfilename; + $mime = $file->mimetype; + + header("Content-type: $mime"); + if (strpos($mime, "image/")!==false) + header("Content-Disposition: inline; filename=\"$filename\""); + else + header("Content-Disposition: attachment; filename=\"$filename\""); + + + $readfile = new ElggFile($file_guid); + $readfile->owner_guid = $file->owner_guid; + //$readfile->setFilename($filename); + + $contents = $readfile->grabFile(); + + if (empty($contents)) + echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/icons/general.jpg" ); + else + echo $contents; + + exit; + } + else + register_error(elgg_echo("image:downloadfailed")); + +?> \ No newline at end of file diff --git a/actions/edit_multi.php b/actions/edit_multi.php new file mode 100644 index 000000000..9bb9c4eed --- /dev/null +++ b/actions/edit_multi.php @@ -0,0 +1,62 @@ + $im){ + $image = get_entity($im); + + if ($image->canEdit()){ + + // Convert string of tags into a preformatted array + $tagarray = string_to_tag_array($tags_array[$key]); + + //set description appropriately + $image->title = $title_array[$key]; + + //set description appropriately + $image->description = $caption_array[$key]; + + // Before we can set metadata, we need to save the image + if (!$image->save()) { + array_push($not_updated, $image->guid); + } + + // Now let's add tags. We can pass an array directly to the object property! Easy. + $image->clearMetadata('tags'); + if (is_array($tagarray)) { + $image->tags = $tagarray; + } + + //if cover meta is sent from image save as metadata + if($cover == $im){ + $album_entity->cover = $im; + } + } + } + // Success message + if (count($not_updated) > 0) { + register_error(elgg_echo("images:notedited")); + } else { + system_message(elgg_echo("images:edited")); + } + + // Forward to the main album page + forward($album_entity->getURL()); + + +?> \ No newline at end of file diff --git a/actions/editalbum.php b/actions/editalbum.php new file mode 100644 index 000000000..36b0f7379 --- /dev/null +++ b/actions/editalbum.php @@ -0,0 +1,91 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + // Make sure we're logged in (send us to the front page if not) + if (!isloggedin()) forward(); + + // Get input data + $guid = (int) get_input('albumpost'); + $title = get_input('albumtitle'); + $body = get_input('albumbody'); + $access = get_input('access_id'); + $tags = get_input('albumtags'); + $back_url = 'mod/tidypics/edit.php?file_guid=' . $guid; + + // Make sure we actually have permission to edit + $album = get_entity($guid); + if ($album->canEdit()) + { + + // Cache to the session + $_SESSION['albumtitle'] = $title; + $_SESSION['albumbody'] = $body; + $_SESSION['albumtags'] = $tags; + + // Convert string of tags into a preformatted array + $tagarray = string_to_tag_array($tags); + + // Get owning user + $owner = get_entity($album->getOwner()); + + // edit access only if access is different from current + + if($album->access_id != $access) + { + $album->access_id = $access; + + //get images from album and update access on image entities + $images = get_entities("object","image", $guid, '', 999, '', false); + foreach($images as $im){ + $im->access_id = $access; + $im->save(); + //new core updates all metadata access as well! + } + } + + + // Set its title and description appropriately + $album->title = $title; + $album->description = $body; + + // Before we can set metadata, we need to save the image + if (!$album->save()) { + register_error(elgg_echo("album:error")); + $album->delete(); + forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); //failed, so forward to previous page + } + + // Now let's add tags. We can pass an array directly to the object property! Easy. + $album->clearMetadata('tags'); + if (is_array($tagarray)) { + $album->tags = $tagarray; + } + + //if cover meta is sent from image save as metadata + if(get_input('cover') == elgg_echo('album:cover:yes')){ + $container = get_entity($album->container_guid); + $container->cover = $album->guid; + } + + // Success message + system_message(elgg_echo("album:edited")); + + // Remove the image cache + unset($_SESSION['albumtitle']); + unset($_SESSION['albumbody']); + unset($_SESSION['albumtags']); + + // Forward to the main blog page + forward($album->getURL()); + + } +?> \ No newline at end of file diff --git a/actions/icon.php b/actions/icon.php new file mode 100644 index 000000000..718425819 --- /dev/null +++ b/actions/icon.php @@ -0,0 +1,41 @@ +thumbnail; + $mime = $file->mimetype; + + header("Content-type: $mime"); + if (strpos($mime, "image/")!==false) + header("Content-Disposition: inline; filename=\"$filename\""); + else + header("Content-Disposition: attachment; filename=\"$filename\""); + + + $readfile = new ElggFile(); + $readfile->owner_guid = $file->owner_guid; + $readfile->setFilename($filename); + + $contents = $readfile->grabFile(); + + if (empty($contents)) + echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/icons/general.jpg" ); + else + echo $contents; + + exit; + } + else + register_error(elgg_echo("file:downloadfailed")); +?> \ No newline at end of file diff --git a/actions/upload.php b/actions/upload.php new file mode 100644 index 000000000..f969f6f40 --- /dev/null +++ b/actions/upload.php @@ -0,0 +1,133 @@ +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->setFilename($prefix.$filestorename); + $file->setMimeType($mime); + $file->originalfilename = $name; + $file->subtype="image"; + $file->access_id = $access_id; + if ($container_guid) { + $file->container_guid = $container_guid; + } + $file->open("write"); + $file->write(get_uploaded_file($key)); + $file->close(); + $result = $file->save(); + + if ($result) { //file was saved; now create some thumbnails + //get maximum file size from plugin settings + if (get_plugin_setting('maxfilesize','tidypics')) { + if (((int) get_plugin_setting('maxfilesize','tidypics')) < 1 || ((int) get_plugin_setting('maxfilesize','tidypics')) > 1048576) { + $maxfilesize = 10240; //if file size is less than 1KB or greater than 1GB, default to 10MB + } else { + $maxfilesize = (int) get_plugin_setting('maxfilesize','tidypics'); + } + } else { + $maxfilesize = 10240; //if the file size limit is not set, default to 10MB + } + $maxfilesize = 1024 * $maxfilesize; //convert to bytes + + //check file size and remove picture if it exceeds the maximum + if (filesize($file->getFilenameOnFilestore())<= $maxfilesize) { + 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 + if (filesize($file->getFilenameOnFilestore())<= 943718) { //create thumbnails if file size < 0.9MB + 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(); + $thumb->setMimeType($mime); + $thumb->setFilename($prefix."thumb".$filestorename); + $thumb->open("write"); + if ($thumb->write($thumbnail)) { + $file->thumbnail = $prefix."thumb".$filestorename; + } else { + $thumb->delete(); + } + $thumb->close(); + } + if ($thumbsmall) { + $thumb = new ElggFile(); + $thumb->setMimeType($mime); + $thumb->setFilename($prefix."smallthumb".$filestorename); + $thumb->open("write"); + if ($thumb->write($thumbsmall)) { + $file->smallthumb = $prefix."smallthumb".$filestorename; + } else { + $thumb->delete(); + } + $thumb->close(); + } + if ($thumblarge) { + $thumb = new ElggFile(); + $thumb->setMimeType($mime); + $thumb->setFilename($prefix."largethumb".$filestorename); + $thumb->open("write"); + if ($thumb->write($thumblarge)) { + $file->largethumb = $prefix."largethumb".$filestorename; + } else { + $thumb->delete(); + } + $thumb->close(); + } + } else { //file exceeds file size limit, so delete it + $file->delete(); + array_push($not_uploaded, $name); + } //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) { + system_message(elgg_echo("images:saved")); + } else { + $error = elgg_echo("image:uploadfailed") . '
'; + foreach($not_uploaded as $im_name){ + $error .= ' [' . $im_name . '] '; + } + $error .= ' ' . elgg_echo("image:notimage"); + register_error($error); + } //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 + } + +?> \ No newline at end of file diff --git a/contributions.txt b/contributions.txt new file mode 100644 index 000000000..ff014654c --- /dev/null +++ b/contributions.txt @@ -0,0 +1,170 @@ +Elgg community and users: + + The original author of Tidypics has not been active in the Elgg community lately. Therefore, I took on the task of improving his plug-in and maintaining a log of all changes in this file. If you contribute to this plug-in, please record your changes here and release them under a GPL license. + +Best regards, + +Gabriel Monge-Franco (gabrielinux) +http://gabriel.mongefranco.com + + +------------------------------------------------------------------------ +Version 1.08.2 Change List +Release Date: 02/13/2008 +Contributors: + * Gabriel Monge-Franco (http://gabriel.mongefranco.com) +------------------------------------------------------------------------ +BEGIN VERSION 1.08.2 CHANGES +------------------------------------------------------------------------ +* 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. +------------------------------------------------------------------------ +END VERSION 1.08.2 CHANGES +------------------------------------------------------------------------ + + +------------------------------------------------------------------------ +Version 1.08.1 Change List +Release Date: 02/13/2008 +Contributors: + * Gabriel Monge-Franco (http://gabriel.mongefranco.com) + * LKLaRose (http://community.elgg.org/pg/profile/lauren) + * Webgalli (http://community.elgg.org/pg/profile/webgalli) + * Karsten Schulze (http://ks.frinx.eu) + * Cash (http://community.elgg.org/pg/profile/costelloc) +------------------------------------------------------------------------ +BEGIN VERSION 1.08.1 CHANGES +------------------------------------------------------------------------ +* Fixed bug introduced in v1.08 that caused fake files to be created during thumbnail creation (thanks to Karsten Schulze). +* Reverted to old directory structure that saves pictures to /image/ALBUMGUID/picGUID (v1.08 saved to /image/ALBUMGUID__picGUID, thus keeping everything in one folder). +* Album directory is now deleted when the album is deleted (along with every picture inside of the album). +* Reverted thumbnail and small thumbnail to use picture cropping instead of scaling, so that sites that already use Tidypics can keep a consisting look and feel. +* Completed River integration by moving album and image directories to an "object" sub-directory (thanks to LKLaRose). +* Added status messages/graphics to give the user some feedback. +* Fixed bug in profile widget whereby the selected number of albums had no effect (thanks to @Webgalli and @cheltenham). +* Fixed bug introduced in v1.06 that prevented anonymous users from viewing a user's album (thanks to Karsten Schulze). +* Fixed more language file bugs (thanks to Karsten Schulze). +* Administrators can now set a file size limit from the plugin configuration (it has to be in Kilobytes). + +* JUST PLAIN WEIRD: Fixed Polish language file (thanks to @Vazco, Ian Medlock and Brett Profitt) and saved as UTF8 without BOM. However, it still doesn't work. Can somebody try saving it on a Polish box for me? :) + +* TODO: fix Polish language file -- it seems to break the whole Elgg site! Maybe it needs to use HTML codes in place of international characters? +* 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). + +* 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. +------------------------------------------------------------------------ +END VERSION 1.08.1 CHANGES +------------------------------------------------------------------------ + + +------------------------------------------------------------------------ +Version 1.08 Change List +Release Date: 02/08/2008 +Contributors: + * Gabriel Monge-Franco (http://gabriel.mongefranco.com) +------------------------------------------------------------------------ +BEGIN VERSION 1.08 CHANGES +------------------------------------------------------------------------ +* Merged most (safe) changes made by other contributors in v1.07. + - Did not include SWFuploader or JQuery due to the number of bugs reported. +* Changed ugly "new album" picture into something better looking. +* Fixed bug whereby image objects were deleted from the database, but they physical files remained on the server. + - Since deleting directories was not possible without the use of unsafe file operations, albums no longer create new directories. Instead, all pictures are saved as /image/ALBUMGUID__picturename. +* Fixed some bugs in the English, Spanish and German language files and added missing error messages. +* Thumbnails now display the default error image (same as new album) when the requested image cannot be found. +* Fixed a bug in the multi-edit form that did not allow image titles to be saved. +* Removed some customizations made to edit.php action in v1.07 since they removed the ability to add titles to images. +* Fixed bug introduced in v1.07 that prevented images from being set as album covers. +* Fixed miscellaneous bugs in group albums widget. +* Removed jQuery for now since it was making the albums too slow. In the future, we should look into replacing individual image views with lightbox2 or jQuery lightbox album views. + + +* TODO: fix Polish language file -- it seems to break the whole Elgg site! Maybe it needs to use HTML codes in place of international characters? +* TODO: Work around 0.9MB source file size limit when creating thumbnails (an Elgg limitation... can probably be fixed by using PHP GD functions directly) + - 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. + +* 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. +------------------------------------------------------------------------ +END VERSION 1.08 CHANGES +------------------------------------------------------------------------ + + +------------------------------------------------------------------------ +Version 1.07 Change List +Release Date: 02/03/2008 +Contributors: + * vazco (http://community.elgg.org/pg/profile/vazco) + * simophin (http://community.elgg.org/pg/profile/simophin) +------------------------------------------------------------------------ +BEGIN VERSION 1.07 CHANGES +------------------------------------------------------------------------ +* About 10 missing translations added +* Translated to polish +* When no album is present, user can add a new album straight from the widget if he has the required rights +* Added some missing

+* Changed some getFilename(), but would it be safe to execute shell commands directly??? +------------------------------------------------------------------------ +END VERSION 1.06 CHANGES +------------------------------------------------------------------------ + diff --git a/edit.php b/edit.php new file mode 100644 index 000000000..2c202e402 --- /dev/null +++ b/edit.php @@ -0,0 +1,46 @@ +canEdit()) + forward(); + + $subtype = $file->getSubtype(); + + if($subtype == 'album'){ + if($container = $file->container_guid) + set_page_owner($container); + + $area2 .= elgg_view_title($title = elgg_echo('album:edit')); + } + elseif($subtype == 'image'){ + if($container = get_entity($file->container_guid)->container_guid) + set_page_owner($container); + + $area2 .= elgg_view_title($title = elgg_echo('image:edit')); + } + else{ + forward(); + } + + $area2 .= elgg_view("tidypics/forms/edit",array('entity' => $file, 'subtype' => $subtype)); + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + page_draw(elgg_echo("edit"), $body); + + +?> \ No newline at end of file diff --git a/edit_multi.php b/edit_multi.php new file mode 100644 index 000000000..2fdc85e42 --- /dev/null +++ b/edit_multi.php @@ -0,0 +1,33 @@ +canEdit()){ + array_push($new_file_array, $file_guid); + } + if(!$album_guid) $album_guid = $entity->container_guid; + + } + } + + $area2 .= elgg_view_title($title = elgg_echo('image:edit')); + $area2 .= elgg_view("tidypics/forms/edit_multi", array('file_array' => $new_file_array, 'album_guid' => $album_guid)); + $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); + page_draw(elgg_echo("edit"), $body); +?> \ No newline at end of file diff --git a/friends.php b/friends.php new file mode 100644 index 000000000..61ed52380 --- /dev/null +++ b/friends.php @@ -0,0 +1,43 @@ +username); + } + } + + if (is_null(page_owner_entity()->name) || page_owner_entity()->name == '') { + $friendname = get_input('username'); + } else { + $friendname = page_owner_entity()->name; + }; + + if(isloggedin() && (page_owner() == $_SESSION['guid'])) { + $area2 = elgg_view_title($title = elgg_echo('album:yours:friends')); + } else { + $area2 = elgg_view_title($title = sprintf(elgg_echo('album:friends'), "$friendname")); + } + + set_context('search'); + set_input('search_viewtype', 'gallery'); + $area2 .= list_user_friends_objects(page_owner(), 'album'); + + set_context('photos'); + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + // Finally draw the page + page_draw(sprintf(elgg_echo("album:friends"),$_SESSION['user']->name), $body); +?> \ No newline at end of file diff --git a/graphics/Thumbs.db b/graphics/Thumbs.db new file mode 100644 index 000000000..46eac31d3 Binary files /dev/null and b/graphics/Thumbs.db differ diff --git a/graphics/arrow_next.gif b/graphics/arrow_next.gif new file mode 100644 index 000000000..6b3d8f829 Binary files /dev/null and b/graphics/arrow_next.gif differ diff --git a/graphics/arrow_previous.gif b/graphics/arrow_previous.gif new file mode 100644 index 000000000..e7ded54eb Binary files /dev/null and b/graphics/arrow_previous.gif differ diff --git a/graphics/bl.gif b/graphics/bl.gif new file mode 100644 index 000000000..735fcb582 Binary files /dev/null and b/graphics/bl.gif differ diff --git a/graphics/br.gif b/graphics/br.gif new file mode 100644 index 000000000..90cdccdcb Binary files /dev/null and b/graphics/br.gif differ diff --git a/graphics/btnClose.gif b/graphics/btnClose.gif new file mode 100644 index 000000000..b8ab4638d Binary files /dev/null and b/graphics/btnClose.gif differ diff --git a/graphics/btnContract.gif b/graphics/btnContract.gif new file mode 100644 index 000000000..9be301039 Binary files /dev/null and b/graphics/btnContract.gif differ diff --git a/graphics/btnExpand.gif b/graphics/btnExpand.gif new file mode 100644 index 000000000..72a8471b3 Binary files /dev/null and b/graphics/btnExpand.gif differ diff --git a/graphics/btnNext.gif b/graphics/btnNext.gif new file mode 100644 index 000000000..467f23246 Binary files /dev/null and b/graphics/btnNext.gif differ diff --git a/graphics/btnPrevious.gif b/graphics/btnPrevious.gif new file mode 100644 index 000000000..298c1e99c Binary files /dev/null and b/graphics/btnPrevious.gif differ diff --git a/graphics/icons/Thumbs.db b/graphics/icons/Thumbs.db new file mode 100644 index 000000000..fb5d56ed3 Binary files /dev/null and b/graphics/icons/Thumbs.db differ diff --git a/graphics/icons/album.gif b/graphics/icons/album.gif new file mode 100644 index 000000000..73ce91356 Binary files /dev/null and b/graphics/icons/album.gif differ diff --git a/graphics/icons/general.jpg b/graphics/icons/general.jpg new file mode 100644 index 000000000..23494eff2 Binary files /dev/null and b/graphics/icons/general.jpg differ diff --git a/graphics/icons/general.png b/graphics/icons/general.png new file mode 100644 index 000000000..267ae010c Binary files /dev/null and b/graphics/icons/general.png differ diff --git a/graphics/icons/river_icon_album.gif b/graphics/icons/river_icon_album.gif new file mode 100644 index 000000000..e1bbfedaa Binary files /dev/null and b/graphics/icons/river_icon_album.gif differ diff --git a/graphics/icons/river_icon_image.gif b/graphics/icons/river_icon_image.gif new file mode 100644 index 000000000..6f8bfd6af Binary files /dev/null and b/graphics/icons/river_icon_image.gif differ diff --git a/graphics/img_error.jpg b/graphics/img_error.jpg new file mode 100644 index 000000000..e3aad2aed Binary files /dev/null and b/graphics/img_error.jpg differ diff --git a/graphics/loader.gif b/graphics/loader.gif new file mode 100644 index 000000000..7ac990cf0 Binary files /dev/null and b/graphics/loader.gif differ diff --git a/graphics/tl.gif b/graphics/tl.gif new file mode 100644 index 000000000..ff93dadcc Binary files /dev/null and b/graphics/tl.gif differ diff --git a/graphics/tr.gif b/graphics/tr.gif new file mode 100644 index 000000000..8dc197272 Binary files /dev/null and b/graphics/tr.gif differ diff --git a/graphics/ttl.gif b/graphics/ttl.gif new file mode 100644 index 000000000..8e44c0374 Binary files /dev/null and b/graphics/ttl.gif differ diff --git a/graphics/ttp.gif b/graphics/ttp.gif new file mode 100644 index 000000000..36f7211c4 Binary files /dev/null and b/graphics/ttp.gif differ diff --git a/graphics/ttr.gif b/graphics/ttr.gif new file mode 100644 index 000000000..66d06941e Binary files /dev/null and b/graphics/ttr.gif differ diff --git a/index.php b/index.php new file mode 100644 index 000000000..00b09d14b --- /dev/null +++ b/index.php @@ -0,0 +1,45 @@ +username) || empty($owner->username)) { + //if not logged in, see world pictures instead + if (!isloggedin()) forward('pg/photos/world'); + forward('pg/photos/owned/' . $_SESSION['user']->username); + } + + //set the title + $area2 = elgg_view_title($title = sprintf(elgg_echo('album:user'), "$owner->name")); + + //allow new album creation + if(can_write_to_container($_SESSION['guid'], page_owner())){ + $area2 .= 'username.'">'.elgg_echo('album:create').'

'; + } + + // Get objects + set_context('search'); + set_input('search_viewtype', 'gallery'); + $area2 .= list_entities("object","album",page_owner(),10); + + set_context('photos'); + $body = elgg_view_layout('two_column_left_sidebar', '', $area2); + + // Finally draw the page + page_draw(sprintf(elgg_echo("album:user"),page_owner_entity()->name), $body); +?> \ No newline at end of file diff --git a/languages/de.php b/languages/de.php new file mode 100644 index 000000000..2d668f72f --- /dev/null +++ b/languages/de.php @@ -0,0 +1,114 @@ + "Bild", + 'images' => "Bilder", + 'caption' => "Untertitel", + 'photos' => "Photos", + 'images:upload' => "Bilder hochladen", + 'album' => "Fotoalbum", + 'albums' => "Fotoalben", + 'album:yours' => "Deine Fotoalben", + 'album:yours:friends' => "Fotoalben von Freunden", + 'album:user' => "Fotoalben von %s", + 'album:friends' => "Fotoalben von Freunden von %s", + 'album:all' => "Alle Fotoalben", + 'album:group' => "Alben der Gruppe", + 'item:object:image' => "Photos", + 'item:object:album' => "Alben", + 'tidypics:settings:maxfilesize' => "Maximale Dateigr鲞e in den Kilobytes (KB):", + + //actions + + 'album:create' => "Neues Album", + 'album:add' => "Fotoalbum hinzufügen", + 'album:addpix' => "Fotos hinzufügen", + 'album:edit' => "Album bearbeiten", + 'album:delete' => "Album löschen", + + 'image:edit' => "Bild bearbeiten", + 'image:delete' => "Bild löschen", + 'image:download' => "Download Bild", + + //forms + + 'album:title' => "Titel", + 'album:desc' => "Beschreibung", + 'album:tags' => "Stichwörter", + 'album:cover' => "Albumcover erstellen?", + 'album:cover:yes' => "Ja", + 'image:access:note' => "(Zugriffsberechtigung wird vom Album übernommen)", + + //views + + 'image:total' => "Bilder im Album:", + 'image:by' => "Bild hinzugefügt von", + 'album:by' => "Album erstellt von:", + 'album:created:on' => "Verursacht", + 'image:none' => "Noch keine Bilder hinzugefügt.", + 'image:back' => "Zurück", + 'image:next' => "Weiter", + + //widgets + + 'album:widget' => "Fotoalben", + 'album:more' => "Alle Alben ansehen", + 'album:widget:description' => "Zeige Deine neuesten Fotoalben", + 'album:display:number' => "Anzahl der Alben, die angezeigt werden sollen", + 'album:num_albums' => "Anzahl der anzuzeigenden Alben", + + // river + + //images + 'image:river:created' => "%s hat hochgeladen:", + 'image:river:item' => "ein Bild", + 'image:river:annotate' => "%s kommentierte", + + //albums + 'album:river:created' => "%s erstellte", + 'album:river:item' => "ein Album", + 'album:river:annotate' => "%s kommentierte", + + // Status messages + + 'image:saved' => "Dein Bild wurde gespeichert.", + 'images:saved' => "Alle Bilder wurden gespeichert.", + 'image:deleted' => "Dein Bild wurde gelöscht.", + 'image:delete:confirm' => "Willst Du das Bild wirklich löschen?", + + 'images:edited' => "Dein Bild wurde aktualisiert.", + 'album:edited' => "Dein Album wurde aktualisiert.", + 'album:saved' => "Dein Album wurde gespeichert.", + 'album:deleted' => "Dein Album wurde gelöscht.", + 'album:delete:confirm' => "Willst Du das Album wirklich löschen?", + 'album:created' => "Ihr neues Album ist hergestellt worden.", + 'tidypics:status:processing' => "Warten Sie bitte, w鋒rend wir verarbeiten Ihre Abbildung....", + + //Error messages + + 'image:none' => "Kein Bilder gefunden.", + 'image:uploadfailed' => "Dateien konnten nicht hochgeladen werden:", + 'image:deletefailed' => "Bild konnte nicht gelöscht werden.", + 'image:downloadfailed' => "Dieses Bild ist nicht diesmal vorhanden.", + + 'image:notimage' => 'Wir akzeptieren nur jpeg, gif, und png Dateien der erlaubten Dateigr鲞e an.', + 'images:notedited' => 'Nicht alle Bilder konnten hochgeladen werden', + + 'album:none' => "Keine Alben gefunden.", + 'album:uploadfailed' => "Sorry; Dein Album konnte nicht gespeichert werden.", + 'album:deletefailed' => "Dein Album konnte nicht gelöscht werden.", + 'album:blank' => "Geben Sie diesem Album einen Titel und eine Beschreibung bitte." + ); + + add_translation("de",$german); +?> diff --git a/languages/en.php b/languages/en.php new file mode 100644 index 000000000..2316a9e2f --- /dev/null +++ b/languages/en.php @@ -0,0 +1,115 @@ + "Image", + 'images' => "Images", + 'caption' => "Caption", + 'photos' => "Photos", + 'images:upload' => "Upload Images", + 'album' => "Photo Album", + 'albums' => "Photo Albums", + 'album:yours' => "Your photo albums", + 'album:yours:friends' => "Your friends' photo albums", + 'album:user' => "%s's photo albums", + 'album:friends' => "%s's friends' photo albums", + 'album:all' => "All site photo albums", + 'album:group' => "Group albums", + 'item:object:image' => "Photos", + 'item:object:album' => "Albums", + 'tidypics:settings:maxfilesize' => "Maximum file size in kilo bytes (KB):", + + //actions + + 'album:create' => "New Album", + 'album:add' => "Add Photo Album", + 'album:addpix' => "Add photos", + 'album:edit' => "Edit album", + 'album:delete' => "Delete album", + + 'image:edit' => "Edit image", + 'image:delete' => "Delete image", + 'image:download' => "Download image", + + //forms + + 'album:title' => "Title", + 'album:desc' => "Description", + 'album:tags' => "Tags", + 'album:cover' => "Make image album cover?", + 'album:cover:yes' => "Yes", + 'image:access:note' => "(view access is inherited from the album)", + + //views + + 'image:total' => "Images in album:", + 'image:by' => "Image added by", + 'album:by' => "Album created by", + 'album:created:on' => "Created", + 'image:none' => "No images have been added yet.", + 'image:back' => "Back", + 'image:next' => "Next", + + //widgets + + 'album:widget' => "Photo Albums", + 'album:more' => "View all albums", + 'album:widget:description' => "Showcase your latest photo albums", + 'album:display:number' => "Number of albums to display", + 'album:num_albums' => "Number of albums to display", + + // river + + //images + 'image:river:created' => "%s uploaded", + 'image:river:item' => "an image", + 'image:river:annotate' => "%s commented on", + + //albums + 'album:river:created' => "%s created", + 'album:river:item' => "an album", + 'album:river:annotate' => "%s commented on", + + // Status messages + + 'image:saved' => "Your image was successfully saved.", + 'images:saved' => "All images were successfully saved.", + 'image:deleted' => "Your image was successfully deleted.", + 'image:delete:confirm' => "Are you sure you want to delete this image?", + + 'images:edited' => "Your images were successfully updated.", + 'album:edited' => "Your album was successfully updated.", + 'album:saved' => "Your album was successfully saved.", + 'album:deleted' => "Your album was successfully deleted.", + 'album:delete:confirm' => "Are you sure you want to delete this album?", + 'album:created' => "Your new album has been created.", + 'tidypics:status:processing' => "Please wait while we process your picture....", + + //Error messages + + 'image:none' => "We could not find any images at the moment.", + 'image:uploadfailed' => "Files not uploaded:", + 'image:deletefailed' => "Your image could not be deleted at this time.", + 'image:downloadfailed' => "Sorry; this image is not available at this time.", + + 'image:notimage' => "We only accept jpeg, gif, or png images of the allowed file size.", + 'images:notedited' => "Not all images were successfully updated", + + 'album:none' => "We could not find any albums at the moment.", + 'album:uploadfailed' => "Sorry; we could not save your album.", + 'album:deletefailed' => "Your album could not be deleted at this time.", + 'album:blank' => "Please give this album a title and description." + ); + + add_translation("en",$english); +?> \ No newline at end of file diff --git a/languages/es.php b/languages/es.php new file mode 100644 index 000000000..babb87068 --- /dev/null +++ b/languages/es.php @@ -0,0 +1,115 @@ + "Imagen", + 'images' => "Imágenes", + 'caption' => "Leyenda", + 'photos' => "Fotos", + 'images:upload' => "Subir Imágenes", + 'album' => "Állbum de Fotos", + 'albums' => "Álbums de Fotos", + 'album:yours' => "Tus álbums de fotos", + 'album:yours:friends' => "Álbums de tus amigos", + 'album:user' => "Állbums de %s", + 'album:friends' => "Albums de los amigos de %s", + 'album:all' => "Todos los álbums", + 'album:group' => "Állbums del grupo", + 'item:object:image' => "Fotos", + 'item:object:album' => "Állbums", + 'tidypics:settings:maxfilesize' => "Tamaño máximo en kilo bytes (KB):", + + //actions + + 'album:create' => "Nuevo álbum", + 'album:add' => "Añadir álbum de fotos", + 'album:addpix' => "Añadir fotos", + 'album:edit' => "Modificar álbum", + 'album:delete' => "Eliminar álbum", + + 'image:edit' => "Modificar imagen", + 'image:delete' => "Eliminar imagen", + 'image:download' => "Descargar imagen", + + //forms + + 'album:title' => "Título", + 'album:desc' => "Descripción", + 'album:tags' => "Etiquetas", + 'album:cover' => "¿Hacer portada del álbum?", + 'album:cover:yes' => "Si", + 'image:access:note' => "(los permisos de acceso se heredan del álbum)", + + //views + + 'image:total' => "Imágenes en el álbum:", + 'image:by' => "Imagen añadida por", + 'album:by' => "Album creado por", + 'album:created:on' => "Creado", + 'image:none' => "Todavía no se han añadido imágenes.", + 'image:back' => "Anterior", + 'image:next' => "Siguiente", + + //widgets + + 'album:widget' => "Albums de Fotos", + 'album:more' => "Ver todos los albums", + 'album:widget:description' => "Muestra tus álbums de fotos más recientes", + 'album:display:number' => "Número de albums a mostrar", + 'album:num_albums' => "Número de albums a mostrar", + + // river + + //images + 'image:river:created' => "%s subió", + 'image:river:item' => "una imagen", + 'image:river:annotate' => "%s comentó en", + + //albums + 'album:river:created' => "%s creó", + 'album:river:item' => "un album", + 'album:river:annotate' => "%s comentó en", + + // Status messages + + 'image:saved' => "Tu imagen ha sido guardada.", + 'images:saved' => "Todas tus imágenes han sido guardadas.", + 'image:deleted' => "Tu imagen ha sido borrada.", + 'image:delete:confirm' => "¿Deseas borrar esta imagen?", + + 'images:edited' => "Tus imágenes han sido actualizadas.", + 'album:edited' => "Tu álbum ha sido actualizado.", + 'album:saved' => "Tu álbum ha sido guardado.", + 'album:deleted' => "Tu álbum ha sido borrado con éxito.", + 'album:delete:confirm' => "¿Deseas borrar este álbum?", + 'album:created' => "Tu nuevo álbum ha sido creado.", + 'tidypics:status:processing' => "Por favor espera mientras procesamos tu imagen....", + + //Error messages + + 'image:none' => "No ha sido psible encontrar ninguna imagen en este momento.", + 'image:uploadfailed' => "Algunos ficheros no se pudieron subir:", + 'image:deletefailed' => "Tu imagen no ha podido ser borrada en este momento.", + 'image:downloadfailed' => "Esta imagen no se encuentra disponible en este momento.", + + 'image:notimage' => "Sólo se aceptan imágenes jpeg, gif, o png del tamaño permitido.", + 'images:notedited' => "No se pudieron actualizar todas las imágenes.", + + 'album:none' => "Actualmente no hay ningún álbum de fotos.", + 'album:uploadfailed' => "No se ha podido guardar el álbum.", + 'album:deletefailed' => "En este momento no se ha podido borrar el álbum.", + 'album:blank' => "Por favor entra un título y descripción para tu nuevo álbum." + ); + + add_translation("es",$spanish); +?> \ No newline at end of file diff --git a/languages/pl.php b/languages/pl.php new file mode 100644 index 000000000..047b17220 --- /dev/null +++ b/languages/pl.php @@ -0,0 +1,115 @@ + "Obrazek", + 'images' => "Obrazki", + 'caption' => "Opis", + 'photos' => "Zdj臋cia", + 'images:upload' => "Dodaj obrazki", + 'album' => "Album zdj臋ciowy", + 'albums' => "Albumy zdj臋ciowe", + 'album:yours' => "Twoje albumy", + 'album:yours:friends' => "Albumy twoich znajomych", + 'album:user' => "Albumy u偶ytkownika %s", + 'album:friends' => "Albumy przyjaci贸艂 u偶ytkownika %s", + 'album:all' => "Wszystkie publiczne albumy", + 'album:group' => "Albumy rejsu", + 'item:object:image' => "Zdj臋cia", + 'item:object:album' => "Albumy", + 'tidypics:settings:maxfilesize' => "Maximum file size in kilo bytes (KB):", + + //actions + + 'album:create' => "Nowy album", + 'album:add' => "Dodaj album zdj臋ciowy", + 'album:addpix' => "Dodaj zdj臋cia", + 'album:edit' => "Edytuj album", + 'album:delete' => "Skasuj album", + + 'image:edit' => "Edytuj obrazek", + 'image:delete' => "Skasuj obrazek", + 'image:download' => "Pobierz obrazek", + + //forms + + 'album:title' => "Tytu艂 albumu", + 'album:desc' => "Opis (widoczny tylko dla tw贸rcy)", + 'album:tags' => "Tagi", + 'album:cover' => "Ustaw jako ok艂adk臋 albumu?", + 'album:cover:yes' => "Tak", + 'image:access:note' => "(prawa dost臋pu pobierane s膮 z ustawie艅 albumu)", + + //views + + 'image:total' => "Obrazki w albumie:", + 'image:by' => "Obrazek dodany przez", + 'album:by' => "Album stworzony przez", + 'album:created:on' => "Stworzono", + 'image:none' => "Nie dodano jeszcze 偶adnych obrazk贸w.", + 'image:back' => "Poprzednia", + 'image:next' => "Kolejna", + + //widgets + + 'album:widget' => "Albumy zdj臋ciowe", + 'album:more' => "Poka偶 wszystkie albumy", + 'album:widget:description' => "Pokazuje twoje ostatnie albumy zdj臋ciowe", + 'album:display:number' => "Liczba wy艣wietlanych album贸w", + 'album:num_albums' => "Liczba wy艣wietlanych album贸w", + + // river + + //images + 'image:river:created' => "wgrano %s", + 'image:river:item' => "obrazek", + 'image:river:annotate' => "%s skomentowa艂", + + //albums + 'album:river:created' => "Stworzono %s", + 'album:river:item' => "album", + 'album:river:annotate' => "%s skomentowa艂", + + // Status messages + + 'image:saved' => "Tw贸j obrazek zosta艂 pomy艣lnie zapisany.", + 'images:saved' => "Wszystkie obrazki zosta艂y pomy艣lnie zapisane.", + 'image:deleted' => "Tw贸j obrazek zosta艂 pomy艣lnie skasowany.", + 'image:delete:confirm' => "Czy jeste艣 pewien 偶e chcesz skasowa膰 ten obrazek?", + + 'images:edited' => "Twoje obrazki zosta艂y pomy艣lnie zapisane.", + 'album:edited' => "Tw贸j album zosta艂 pomy艣lnie zapisany.", + 'album:saved' => "Tw贸j album zosta艂 pomy艣lnie zapisany.", + 'album:deleted' => "Tw贸j album zosta艂 skasowany.", + 'album:delete:confirm' => "Na pewno chcesz skasowa膰 ten album?", + 'album:created' => "Stworzono nowy album.", + 'tidypics:status:processing' => "Please wait while we process your picture....", + + //Error messages + + 'image:none' => "Jeszcze nie dodano 偶adnych obrazk贸w.", + 'image:uploadfailed' => "Pliki nie zapisane:", + 'image:deletefailed' => "Nie uda艂o si臋 skasowa膰 obrazka.", + 'image:downloadfailed' => "Nie uda艂o si臋 艣ci膮gn膮膰 albumu.", + + 'image:notimage' => "Akceptowane formaty to tylko: jpeg, gif i png, and the allowed file size.", + 'images:notedited' => "Nie wszystkie obrazki zosta艂y zapisane", + + 'album:none' => "Jeszcze nie dodano 偶adnych album贸w.", + 'album:uploadfailed' => "Nie uda艂o si臋 zapisa膰 twojego albumu.", + 'album:deletefailed' => "Nie uda艂o si臋 usun膮膰 twojego albumu.", + 'album:blank' => "Please give this albumu a tytu艂 and opis." + ); + + add_translation("pl",$polish); +?> \ No newline at end of file diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 000000000..1dfd9b7a7 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/newalbum.php b/newalbum.php new file mode 100644 index 000000000..8df0ec019 --- /dev/null +++ b/newalbum.php @@ -0,0 +1,31 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + // Load Elgg engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + gatekeeper(); + + // Get the current page's owner + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($_SESSION['guid']); + } + + $area2 = elgg_view_title(elgg_echo('album:add')); + $area2 .= elgg_view("tidypics/forms/edit"); + + // Display page + page_draw(elgg_echo('album:add'),elgg_view_layout("two_column_left_sidebar", $area1, $area2, $area3 )); + + +?> \ No newline at end of file diff --git a/start.php b/start.php new file mode 100644 index 000000000..f3c675d52 --- /dev/null +++ b/start.php @@ -0,0 +1,174 @@ +wwwroot . "pg/photos/owned/" . $_SESSION['user']->username); + } + + // Extend CSS + extend_view('css', 'tidypics/css'); + + // Extend hover-over and profile menu + extend_view('profile/menu/links','tidypics/menu'); + + //group view ** psuedo widget view for group pages** + extend_view('groups/right_column','tidypics/groupprofile_albums'); + + // Register a page handler, so we can have nice URLs + register_page_handler('photos','tidypics_page_handler'); + + // Add a new tidypics widget + add_widget_type('album_view',elgg_echo("album:widget"),elgg_echo("album:widget:description"), 'profile'); + + // Register a URL handler for files + register_entity_url_handler('image_url','object','image'); + register_entity_url_handler('album_url','object','album'); + + // Register entity type + register_entity_type('object','image'); + register_entity_type('object','album'); + + } + + /** + * Sets up submenus for tidypics. Triggered on pagesetup. + */ + function tidypics_submenus() { + + global $CONFIG; + + $page_owner = page_owner_entity(); + + // General submenu options + if (get_context() == "photos") { + if (isloggedin() && (page_owner() == $_SESSION['guid'] || !page_owner())) { + add_submenu_item(sprintf(elgg_echo("album:yours"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/photos/owned/" . page_owner_entity()->username, '1view'); + add_submenu_item(sprintf(elgg_echo('album:yours:friends'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/photos/friends/". page_owner_entity()->username, '1view'); + add_submenu_item(sprintf(elgg_echo('album:all'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/photos/world/", '1view'); + } else if (page_owner() && $page_owner instanceof ElggUser) { + add_submenu_item(sprintf(elgg_echo('album:friends'),$page_owner->name), $CONFIG->wwwroot . "pg/photos/friends/". $page_owner->username,'1view'); + add_submenu_item(sprintf(elgg_echo('album:all'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/photos/world/", '1view'); + } + } + if (isloggedin() && ($page_owner instanceof ElggGroup)) { + add_submenu_item(sprintf(elgg_echo("album:user"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/photos/owned/" . page_owner_entity()->username, 'photo_albums'); + } + } + + /** + * tidypics page handler + * + * @param array $page Array of page elements, forwarded by the page handling mechanism + */ + function tidypics_page_handler($page) { + + global $CONFIG; + + if (isset($page[0])) + { + switch($page[0]) + { + case "owned": //view list of albums owned by container + if (isset($page[1])) set_input('username',$page[1]); + + /* if you want to put new album action in the submenu, just do it like this ---------> + if(can_write_to_container($_SESSION['guid'], page_owner())){ + add_submenu_item(elgg_echo('album:create'), $CONFIG->wwwroot . "pg/photos/new/". page_owner_entity()->username, 'pagesactions'); + } + */ + include($CONFIG->pluginspath . "tidypics/index.php"); + break; + + case "view": //view an image individually + set_input('guid',$page[1]); + include($CONFIG->pluginspath . "tidypics/view.php"); + break; + + case "album": //view an album individually + set_input('guid',$page[1]); + @include(dirname(dirname(dirname(__FILE__))) . "/entities/index.php"); + break; + + case "new": //create new album + if (isset($page[1])) set_input('username',$page[1]); + include($CONFIG->pluginspath . "tidypics/newalbum.php"); + break; + + case "upload": //upload images to album + if (isset($page[1])) set_input('container_guid',$page[1]); + include($CONFIG->pluginspath . "tidypics/upload.php"); + break; + + case "friends": + if (isset($page[1])) set_input('username',$page[1]); + include($CONFIG->pluginspath . "tidypics/friends.php"); + break; + + case "world": + include($CONFIG->pluginspath . "tidypics/world.php"); + break; + + } + } + else + { + // Include the standard profile index + if (isset($page[1])) set_input('username',$page[1]); + include($CONFIG->pluginspath . "tidypics/index.php"); + } + + } + + /** + * Populates the ->getUrl() method for file objects + * + * @param ElggEntity $entity album/image entity + * @return string File URL + */ + function image_url($entity) { + global $CONFIG; + $title = $entity->title; + $title = friendly_title($title); + return $CONFIG->url . "pg/photos/view/" . $entity->getGUID() . "/" . $title; + + } + + function album_url($entity) { + global $CONFIG; + $title = $entity->title; + $title = friendly_title($title); + return $CONFIG->url . "pg/photos/album/" . $entity->getGUID() . "/" . $title; + + } + + // Make sure tidypics_init is called on initialisation + register_elgg_event_handler('init','system','tidypics_init'); + register_elgg_event_handler('pagesetup','system','tidypics_submenus'); + + // Register actions + register_action("tidypics/upload", false, $CONFIG->pluginspath . "tidypics/actions/upload.php"); + register_action("tidypics/addalbum", false, $CONFIG->pluginspath. "tidypics/actions/addalbum.php"); + register_action("tidypics/editalbum", false, $CONFIG->pluginspath. "tidypics/actions/editalbum.php"); + register_action("tidypics/delete", false, $CONFIG->pluginspath. "tidypics/actions/delete.php"); + register_action("tidypics/icon", true, $CONFIG->pluginspath. "tidypics/actions/icon.php"); + register_action("tidypics/edit_multi", false, $CONFIG->pluginspath. "tidypics/actions/edit_multi.php"); + register_action("tidypics/download", true, $CONFIG->pluginspath . "tidypics/actions/download.php"); + +?> \ No newline at end of file diff --git a/tasks.txt b/tasks.txt new file mode 100644 index 000000000..879d8cb42 --- /dev/null +++ b/tasks.txt @@ -0,0 +1,66 @@ + +Tasks: + + -> DONE --clean up css + -> DONE -- test river views + -> DONE -- enable widget views + -> DONE -- multi image uploader form. + + -> DONE -- Album covers: implement cover option for NEW uploaded images @ upload.php action + i want to enable multi uploader so better to put it in there. + (radio box so only one image can be the cover) + + -> DONE -- /pg/photos/owned + Edit the way album list is presented (make it nicer) + -> DONE -- when adding or editing album -> + saving the album's view access should also edit + all containing image view access + if add new album + -> all image uploads default to albums current access + -> all image edits can not change access + if edit album + -> change access of album and cycle through all current images. + + -> DONE -- Album covers: implemented edit image screen to specify album cover + -> DONE -- allow photo albums for users + -> DONE -- internationalize all text + -> DONE -- clean up unecessary functions from file plugin + -> DONE -- limit uploader to image only mimetype + -> DONE -- (for now) see if i can get rid of any unecessary meta + -> DONE -- create friends views and world views + -> DONE -- add breadcrumb + -> DONE -- (but optimize) add thumbnail icons for listings + + + + --------- CAVEATS ----------- + + + -> SOLVED -- (just clear the pagination css class) problem: + when viewing an indie album, the images are floated. + if the pagination is enabled the bottom bar does not clear the + floated images + +Problem: +the delete action does not delete any actual images +the current method should work, but it doesnt +look for clues in engine/lib/filestore.php +when deleting an album, easy way to delete all images +is just to find the albums folder and delete it. + +Problem: +when defining covers for album , i need to edit the input/checkboxes view +in order submit correctly. Remove the [] as part of the name + +-------------------- +my differences due to theme +------------------------ +My customizations: + +in the controls i am added to submenu +edit this out when packaging + + -> if i add album actions to submenu i lose "js confirm" on delete + -> change the album access permissions for groups to have + only 3 choices (logged in , everyone, or group only) + \ No newline at end of file diff --git a/thumbnail.php b/thumbnail.php new file mode 100644 index 000000000..0e6142cbb --- /dev/null +++ b/thumbnail.php @@ -0,0 +1,55 @@ +getSubtype() == "image") { + // Get file thumbnail + if ($size == "small") { + $thumbfile = $file->smallthumb; + } else { + $thumbfile = $file->largethumb; + } + + // Grab the file + if ($thumbfile && !empty($thumbfile)) { + $readfile = new ElggFile(); + $readfile->owner_guid = $file->owner_guid; + $readfile->setFilename($thumbfile); + //$mime = $file->getMimeType(); + $contents = $readfile->grabFile(); + } + } //end subtype comparison + } //end get_entity + + // Open error image if file was not found + if (!isset($contents) || is_null($contents) || $file->getSubtype()!='image') { + //$vars['url'].'mod/tidypics/graphics/img_error.jpg + forward('mod/tidypics/graphics/img_error.jpg'); + } //end of default error image + + // Return the thumbnail and exit + header("Content-type: image"); + echo $contents; + exit; +?> \ No newline at end of file diff --git a/tidypics_user_instructions_.txt b/tidypics_user_instructions_.txt new file mode 100644 index 000000000..eb2c2a809 --- /dev/null +++ b/tidypics_user_instructions_.txt @@ -0,0 +1,71 @@ +-------------------------------------------- +Tidypics Photo Gallery plugin version 1.05 +Release #5. +Release Date: October 27, 2008 +-------------------------------------------- + +Installation +------------------ +1. Drop into root/mod/ +2. Enable plugin via admin panel. +3. Done + + + +Requirements +------------------------ +Will function with all versions of elgg, but current SVN build is needed +for consistency. +Reason: +Updating the album access persmissions will auto-update the access for all +images contained in the album, but when updating each image entity, +the metadata for that entity also needs to be updated. The function that accomplishes +this is only in the current SVN build. +If you do not use the current SVN build of elgg, you will likely get incorrectly +synced access permissions. Just wait for elg 1.1 and all will be dandy. +No changes need to be made to tidypics since the function is called via hook. + + + +Recorded problems: +---------------------------- +1. when viewing an individual album, the image gallery displayed is a collection + of floated divs. If pagination is enabled the bottom pagination bar does not + clear the floated images and you will get a messy display. I did not yet + research a better way to create a gallery view while being inline with elggs listing functions. + +2. The delete action does not delete any actual . + The current method should work, but it does not. + I am quite sure this is unintended, but we will have to wait till the core + gets updated. + Currently NO IMAGES will ever be deleted from your serverspace. + +3. The groups view is a little odd because all other content like blogs, pages, are in list view. + I refuse to put albums in list view, so if you want that, sorry! (just steal the list view from object/albums.php) + + +Cost to use this plugin: +---------------------------------- + + Participation in the tidypics group on community.elgg.org + + We need: + ------------------------ + 1. User testing + 2. Bug reports + 3. Functionality, usability, feature requests/discussions + 4. Developers: Feature enhancements. + + If you do not pay the advertised cost of tidypics, you are stealing this plugin! + Don't be a taker!! + + Bye! + + - Jade + + + + + + + \ No newline at end of file diff --git a/upload.php b/upload.php new file mode 100644 index 000000000..320c5ce6d --- /dev/null +++ b/upload.php @@ -0,0 +1,49 @@ +canEdit()) + forward('pg/photos/owned/'); + + //set group to "real" container + $container = $album_entity->container_guid; + set_page_owner($container); + } + else + forward('pg/photos/owned/'); + + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($page_owner->getGUID()); + } + + set_context('photos'); + $title = elgg_echo('album:addpix'); + $area2 .= elgg_view_title($title); + + $area2 .= '

'. $album_entity->title. '

'; + + $area2 .= elgg_view("tidypics/forms/upload", array('album' => $album ) ); + $body = elgg_view_layout('two_column_left_sidebar', '', $area2, $area3); + + page_draw($title, $body); +?> \ No newline at end of file diff --git a/view.php b/view.php new file mode 100644 index 000000000..e0121baae --- /dev/null +++ b/view.php @@ -0,0 +1,62 @@ +container_guid)->container_guid; + + if ($top_container) { + set_page_owner($top_container); + } else { + set_page_owner($entity->owner_guid); + } + + // Set the body to be the full view of the entity, and the title to be its title + $area2 = elgg_view_entity($entity,true); + if ($shell) { + $body = elgg_view_layout('two_column_left_sidebar', '', $area1 . $area2); + } else { + $body = $area2; + } + + } else { + $body = elgg_echo('notfound'); + } + + // Display the page + if ($shell) { + page_draw("", $body); + } else { + header("Content-type: text/html; charset=UTF-8"); + echo $body; + } + +?> \ No newline at end of file diff --git a/views/default/input/accessRead.php b/views/default/input/accessRead.php new file mode 100644 index 000000000..81392b19f --- /dev/null +++ b/views/default/input/accessRead.php @@ -0,0 +1,61 @@ + 0) + { + + /* my hacks (pay no attention please =D ) + //allow showing of group for write access + if($vars['group_write']) $vars['options'] = trigger_plugin_hook('access:collections:write','user',array('user_id' => $_SESSION['guid'], 'site_id' => 0),$vars['options']); + */ + + //developer check - to check the value being sent initially + //echo 'given value: '.$vars['value'].'
'; + + //if no value currently set - specify default + if (empty($vars['value']) && $vars['value'] != '0') + $vars['value'] = 2; + + + foreach($vars['options'] as $key => $option) { + if ($key == $vars['value']) { +?> + + class=""> + + \ No newline at end of file diff --git a/views/default/input/cover_checkbox.php b/views/default/input/cover_checkbox.php new file mode 100644 index 000000000..48c7d51cc --- /dev/null +++ b/views/default/input/cover_checkbox.php @@ -0,0 +1,45 @@ + $option) { + + if ($option != $vars['value']) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } + + $labelint = (int) $label; + if ("{$label}" == "{$labelint}") { + $label = $option; + } + + $disabled = ""; + if ($vars['disabled']) $disabled = ' disabled="yes" '; + echo "
"; + } + +?> \ No newline at end of file diff --git a/views/default/input/multi_radio.php b/views/default/input/multi_radio.php new file mode 100644 index 000000000..11f4c13b8 --- /dev/null +++ b/views/default/input/multi_radio.php @@ -0,0 +1,42 @@ + $option) { + + if ($vars['set'] != $vars['value']) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } + + $labelint = (int) $label; + if ("{$label}" == "{$labelint}") { + $label = $option; + } + + $disabled = ""; + if ($vars['disabled']) $disabled = ' disabled="yes" '; + echo "
"; + } + +?> \ No newline at end of file diff --git a/views/default/object/album.php b/views/default/object/album.php new file mode 100644 index 000000000..b95d55eed --- /dev/null +++ b/views/default/object/album.php @@ -0,0 +1,137 @@ +getGUID(); + $tags = $file->tags; + $title = $file->title; + $desc = $file->description; + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + $mime = $file->mimetype; + + if (get_context() == "search") { + + if (get_input('search_viewtype') == "gallery") { + //default gallery view for album listing @ /photos/owned/ + + //get album cover if one was set + if($file->cover) + $album_cover = 'thumbnail'; + else + $album_cover = 'new album'; + + ?> + + + '.$title.'

'; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $numcomments = elgg_count_comments($file); + if ($numcomments) + $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")"; + $info .= "

"; + + $icon = "getURL()}\">" . elgg_view("tidypics/icon", array('album' => true, 'size' => 'small')) . ""; + + echo elgg_view_listing($icon, $info); + + } + + } else { + // individual album view +?> +
+username) || empty(page_owner_entity()->username)) { //when no owner available, link to world photos +?> +  >  + + name); ?> >  + + +
+ +'.$title.''; + echo '
'.autop($desc).'
'; + + if ($file->canEdit()) { // add edits + // specific to my theme only + //add_submenu_item(elgg_echo('album:addpix'), $vars['url'] . "pg/photos/upload/". $file_guid , '', 'jade'); + //add_submenu_item(elgg_echo('album:edit'), $vars['url'] . "mod/tidypics/edit.php?file_guid=". $file_guid , '', 'jade'); + //add_submenu_item(elgg_echo('album:delete'), $vars['url'] . "action/tidypics/delete?file=". $file_guid , '', 'jade'); + +?> +
+ "> +   + + $vars['url'] . "action/tidypics/delete?file=" . $file->getGUID(), + 'text' => elgg_echo("album:delete"), + 'confirm' => elgg_echo("album:delete:confirm"), + )); + ?> +
+guid); + } + + if(count($count) > 0) + echo list_entities("object","image", $file_guid, 24, false); + else + echo elgg_echo('image:none'); + +?> +
+
+
$tags));?>
+ name; ?>
+
+
+ + diff --git a/views/default/object/image.php b/views/default/object/image.php new file mode 100644 index 000000000..063ad09cb --- /dev/null +++ b/views/default/object/image.php @@ -0,0 +1,130 @@ +getGUID(); + $tags = $file->tags; + $title = $file->title; + $desc = $file->description; + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + + $mime = $file->mimetype; + +if (get_context() == "search") { //if this is the search view + + + if (get_input('search_viewtype') == "gallery") { + ?> +
+ thumbnail +
+ '.$title.'

'; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $numcomments = elgg_count_comments($file); + if ($numcomments) + $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")"; + $info .= "

"; + $icon = "getURL()}\">" . elgg_view("tidypics/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . ""; + + echo elgg_view_listing($icon, $info); + } +} +else { //tidypics image display + + if (!$vars['full']) { //simple gallery view + +?> +
+ thumbnail +
+container_guid); + + //compile back | next links + $current = array_search($file_guid, $_SESSION['image_sort']); + + if(!$current){ // means we are no longer using the correct album array + + //rebuild the array -> + $count = get_entities("object","image", $album->guid, '', 999); + $_SESSION['image_sort'] = array(); + + foreach($count as $image){ + array_push($_SESSION['image_sort'], $image->guid); + } + + $current = array_search($file_guid, $_SESSION['image_sort']); + } + + if(!$current == 0) + $back = '<<' . elgg_echo('image:back') . '  '; + + if(array_key_exists(($current+1), $_SESSION['image_sort'])) + $next = '  ' . elgg_echo('image:next') . '>>'; + +?> +
+username) || empty(page_owner_entity()->username)) { //when no owner available, link to world photos +?> +  >  + + name); ?> >  + + title; ?> >  + +
+' . $title . ''; + echo '
' . autop($desc) . '
'; + echo '
'; + echo '
' . $back . $next . '
'; + if($next) echo ''; + echo '' . $title . ''; + if($next) echo ''; + echo '
'; +?> +
+   +canEdit()) { // add edit controls +?> +   + $vars['url'] . "action/tidypics/delete?file=" . $file->getGUID(), + 'text' => elgg_echo("image:delete"), + 'confirm' => elgg_echo("image:delete:confirm"), + )); + } + ?> +
+ +
+
$tags));?>
+ name; ?>
+
+ \ No newline at end of file diff --git a/views/default/river/object/album/annotate.php b/views/default/river/object/album/annotate.php new file mode 100644 index 000000000..691b0c7ec --- /dev/null +++ b/views/default/river/object/album/annotate.php @@ -0,0 +1,13 @@ +getSubject(); + $object = $statement->getObject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("album:river:annotate"),$url) . " "; + $string .= "getURL() . "\">" . elgg_echo("album:river:item") . ""; + + echo $string; + +?> \ No newline at end of file diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php new file mode 100644 index 000000000..68553309c --- /dev/null +++ b/views/default/river/object/album/create.php @@ -0,0 +1,13 @@ +getSubject(); + $object = $statement->getObject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("album:river:created"),$url) . " "; + $string .= "getURL() . "\">" . elgg_echo("album:river:item") . ""; + + echo $string; + +?> \ No newline at end of file diff --git a/views/default/river/object/image/annotate.php b/views/default/river/object/image/annotate.php new file mode 100644 index 000000000..b0b1b8719 --- /dev/null +++ b/views/default/river/object/image/annotate.php @@ -0,0 +1,13 @@ +getSubject(); + $object = $statement->getObject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("image:river:annotate"),$url) . " "; + $string .= "getURL() . "\">" . elgg_echo("image:river:item") . ""; + + echo $string; + +?> \ No newline at end of file diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php new file mode 100644 index 000000000..3f5bbb5e8 --- /dev/null +++ b/views/default/river/object/image/create.php @@ -0,0 +1,13 @@ +getSubject(); + $object = $statement->getObject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("image:river:created"),$url) . " "; + $string .= "getURL() . "\">" . elgg_echo("image:river:item") . ""; + + echo $string; + +?> \ No newline at end of file diff --git a/views/default/settings/tidypics/edit.php b/views/default/settings/tidypics/edit.php new file mode 100644 index 000000000..2c63edff8 --- /dev/null +++ b/views/default/settings/tidypics/edit.php @@ -0,0 +1,10 @@ +maxfilesize; + if (!$maxfilesize) $maxfilesize = (int) 10240; //set the default maximum file size to 10MB (1024KB * 10 = 10240KB = 10MB) + +?> +

+ + + 'params[maxfilesize]', 'value' => $maxfilesize)); ?> +

\ No newline at end of file diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php new file mode 100644 index 000000000..f9f5b09e6 --- /dev/null +++ b/views/default/tidypics/css.php @@ -0,0 +1,128 @@ + + /* --- independent view for image/album SHARED --- */ + +#tidypics_title{ + font-size:1.2em; + font-weight:bold; +} +#tidypics_desc{ + padding:0 20px; + font-style:italic; +} +#tidypics_info{ + padding:20px; + line-height:1.5em; +} + +#tidypics_controls{ + text-align:center; + margin-bottom:10px; +} + +#tidypics_controls a{ + margin:10px; +} + + /* independent album view only */ + +.album_images{ + float:left; + width:160px; + height:160px; + margin:4px; + padding:5px; + border:1px solid #ccc; + text-align:center; +} + + /* independent image view only */ + +#image_full{ + text-align:center; + margin:10px; +} +#image_full img{ + padding:5px; + border:1px solid #ccc; + margin:7px 0; +} + +/* --- albums gallery view --- */ + +.album_cover{ + padding:2px; + border:1px solid #ccc; + margin:8px 0; +} + + +/* ------ album WIDGET VIEW ------ */ + +#album_widget_container{ + text-align:center; +} + +.album_widget_single_item{ + +} +.album_widget_title{ + +} +.album_widget_timestamp { + color:#666666; + margin:0; +} +.collapsable_box #album_widget_layout { + margin:0; +} + +/* --------- image upload/edit forms ------------ */ + +#image_upload_list li{ + margin:3px 0; +} +.edit_image_container{ + padding:5px; + margin:5px 0; + overflow:auto; +} +.edit_images{ + float:right; + width:160px; + height:160px; + margin:4px; + padding:5px; + border:1px solid #ccc; + text-align:center; +} +.image_info{ + float:left; + width:60%; +} +.image_info label{ + font-size:1em; +} +.edit_image{ + float:right; + border:1px solid #ccc; + width:153px; + height:153px; +} + +/* --------- tidypics river items ------------ */ + +.river_image_create { + background: url(mod/tidypics/graphics/icons/river_icon_image.gif) no-repeat left -1px; +} +.river_album_create { + background: url(mod/tidypics/graphics/icons/river_icon_album.gif) no-repeat left -1px; +} + +.pagination { + clear:both !important; +} + \ No newline at end of file diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php new file mode 100644 index 000000000..efe4aa508 --- /dev/null +++ b/views/default/tidypics/forms/edit.php @@ -0,0 +1,115 @@ +title); + $action = "tidypics/editalbum"; + $title = $vars['entity']->title; + $body = $vars['entity']->description; + $tags = $vars['entity']->tags; + $access_id = $vars['entity']->access_id; + $subtype = $vars['subtype']; + + // if nothing is sent, create new, but only new albums are sent here + // new images are sent to upload.php + } else { + $title = elgg_echo("album:add"); + $action = "tidypics/addalbum"; + $tags = ""; + $title = ""; + $description = ""; + } + + // in case we have some cached details + if (isset($vars['albumtitle'])) { + $title = $vars['albumtitle']; + $body = $vars['albumbody']; + $tags = $vars['albumtags']; + } + + $container_guid = get_input('container_guid'); + if (!$container_guid) $container_guid = page_owner(); + +?> +
+

+ + "albumtitle", "value" => $title,)); ?> +

+ +

+ + "albumbody","value" => $body,)); ?> +

+ +

+ + "albumbody","value" => $body,)); ?> +

+ +

+ + "albumtags","value" => $tags,)); ?> +

+ + guid; + $container_guid = $vars['entity']->container_guid; + $cover_guid = get_entity($container_guid)->cover; + + if($cover_guid == $vars['entity']->guid) + $cover = 'yes'; + + ?> +

+ + "cover", "value" => $cover, 'options' => array(elgg_echo('album:cover:yes')))); ?> +

+

+ + 'access_id','value' => $access_id)); ?> +

+ + +

+ + 'access_id','value' => $access_id)); ?> +

+ + + + + +

+
\ No newline at end of file diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php new file mode 100644 index 000000000..252a660bd --- /dev/null +++ b/views/default/tidypics/forms/edit_multi.php @@ -0,0 +1,44 @@ + +
+cover) $no_cover = true; + + foreach($file_array as $key => $file_guid){ + $entity = get_entity($file_guid); + $guid = $entity->guid; + $body = $entity->description; + $tags = $entity->tags; + $container_guid = $entity->container_guid; + if($no_cover && !$cover) $cover = $guid; + + echo '
'; + echo '' . $title . ''; + echo '
'; + echo '

'; + echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n"; + echo '

'; + echo '

"; + echo elgg_view("input/text",array("internalname" => "caption[$key]", "value" => $body,)) . "\n"; + echo "

"; + echo '

\n"; + echo elgg_view("input/tags", array( "internalname" => "tags[$key]","value" => $tags)) . "\n"; + echo '

'; + echo '' . "\n"; + echo ''; + echo elgg_view("input/multi_radio", array( "internalname" => "cover", "value" => $guid, 'options' => array('yes'), 'set' => $cover)); + echo '
'; + echo '
'; + + } + echo elgg_echo('image:access:note'); +?> + +

+
\ No newline at end of file diff --git a/views/default/tidypics/forms/upload.php b/views/default/tidypics/forms/upload.php new file mode 100644 index 000000000..35768f64c --- /dev/null +++ b/views/default/tidypics/forms/upload.php @@ -0,0 +1,79 @@ +access_id; + if (get_plugin_setting('maxfilesize','tidypics')) { + if (((int) get_plugin_setting('maxfilesize','tidypics')) < 1 || ((int) get_plugin_setting('maxfilesize','tidypics')) > 1048576) { + $maxfilesize = 10240; //if file size is less than 1KB or greater than 1GB, default to 10MB + } else { + $maxfilesize = (int) get_plugin_setting('maxfilesize','tidypics'); + } + } else { + $maxfilesize = 10240; //if the file size limit is not set, default to 10MB + } + +?> + +
+

+
+
+

+
    +' . elgg_view("input/file",array('internalname' => "upload_$x")) . "\n"; + } +?> +
+

+ + + 'access_id','value' => $access_id)); ?> + +

+ '; + + ?> + " onclick="showhide('tidypics_loader');" /> +

+ +
\ No newline at end of file diff --git a/views/default/tidypics/groupprofile_albums.php b/views/default/tidypics/groupprofile_albums.php new file mode 100644 index 000000000..ea11006fa --- /dev/null +++ b/views/default/tidypics/groupprofile_albums.php @@ -0,0 +1,60 @@ +num_display; + //if no number has been set, default to 5 + if (!$number) + $number = 5; + + $owner = page_owner_entity(); + $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false); + + echo '
'; + echo '

' . elgg_echo('albums') . '

'; + + if ($owner_albums) { + echo '
'; + foreach($owner_albums as $album){ + + //get album cover if one was set + if($album->cover) + $album_cover = 'album cover'; + else + $album_cover = 'new album'; + + ?> +
+ +
time_created);?>
+ getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")
"; + ?> + +
+ username) || empty($owner->username)) { + echo '' . elgg_echo('album:all') . ''; + } else { + echo '' . elgg_echo('album:more') . ''; + } + + //close album_widget_container div + echo "
"; + } else { + + echo '
'; + echo '

'.elgg_echo("album:none").'

'; + if ($owner && ($owner->canWriteToContainer($_SESSION['user']))){ + echo 'username.'>'.elgg_echo("album:add").''; + echo '
'; + } + + } + //close group_albums_widget div + echo "
"; +?> \ No newline at end of file diff --git a/views/default/tidypics/icon.php b/views/default/tidypics/icon.php new file mode 100644 index 000000000..614fa3ad0 --- /dev/null +++ b/views/default/tidypics/icon.php @@ -0,0 +1,41 @@ +wwwroot}mod/tidypics/graphics/icons/album.gif\" border=\"0\" />"; +} +else{ + + $mime = $vars['mimetype']; + if (isset($vars['thumbnail'])) { + $thumbnail = $vars['thumbnail']; + } else { + $thumbnail = false; + } + + $size = $vars['size']; + if ($size != 'large') { + $size = 'small'; + } + + if ($thumbnail && strpos($mime, "image/")!==false) + echo ""; + else + { + if ($size == 'large') + echo "wwwroot}mod/tidypics/graphics/icons/general_lrg.gif\" border=\"0\" />"; + else + echo "wwwroot}mod/tidypics/graphics/icons/general.gif\" border=\"0\" />"; + } +} +?> \ No newline at end of file diff --git a/views/default/tidypics/menu.php b/views/default/tidypics/menu.php new file mode 100644 index 000000000..4368993dd --- /dev/null +++ b/views/default/tidypics/menu.php @@ -0,0 +1,16 @@ + + +

+ +

\ No newline at end of file diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php new file mode 100644 index 000000000..2d7c7708f --- /dev/null +++ b/views/default/widgets/album_view/edit.php @@ -0,0 +1,21 @@ +

+ : + + num_display == '') $vars['entity']->num_display = 5; + ?> + +

\ No newline at end of file diff --git a/views/default/widgets/album_view/view.php b/views/default/widgets/album_view/view.php new file mode 100644 index 000000000..347332971 --- /dev/null +++ b/views/default/widgets/album_view/view.php @@ -0,0 +1,53 @@ +num_display; + //if no number has been set, default to 5 + if (!$number) + $number = 5; + + $owner = page_owner_entity(); + $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false); + + if ($owner_albums) { + echo '
'; + + foreach($owner_albums as $album){ + + //get album cover if one was set + if($album->cover) + $album_cover = '' . $album->title . ''; + else + $album_cover = '' . $album->title . ''; + ?> +
+ +
time_created);?>
+ getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")
"; + ?> + +
+ username; + echo "" . elgg_echo('album:more') . ""; + echo "
"; + + } else { + + echo '

'.elgg_echo("album:none").'

'; + + //check if owner has write rights. If so, let him edit the album + $container_guid = get_input('container_guid', $_SESSION['user']->getGUID()); + + if ($owner->username == get_entity($container_guid)->username){ + echo '

username.'>'.elgg_echo("album:create").'

'; + } + + } +?> \ No newline at end of file diff --git a/views/rss/object/file.php b/views/rss/object/file.php new file mode 100644 index 000000000..3bd84d076 --- /dev/null +++ b/views/rss/object/file.php @@ -0,0 +1,30 @@ +title; + if (empty($title)) { + $title = substr($vars['entity']->description,0,32); + if (strlen($vars['entity']->description) > 32) + $title .= " ..."; + } + +?> + + + getURL(); ?> + time_created) ?> + getURL(); ?> + <![CDATA[<?php echo $title; ?>]]> + description)); ?>]]> + + diff --git a/world.php b/world.php new file mode 100644 index 000000000..2e80f5393 --- /dev/null +++ b/world.php @@ -0,0 +1,37 @@ +name), $body); +?> \ No newline at end of file -- cgit v1.2.3