From 73403645808a81425381f43c25e0ea2c92705312 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 25 Jul 2010 02:01:36 +0000
Subject: first go at brining tidypics up to code standards
---
views/default/annotation/annotate.php | 31 ++-
views/default/object/album.php | 192 +++++++-------
views/default/object/image.php | 295 +++++++++++-----------
views/default/river/object/album/create.php | 65 +++--
views/default/river/object/image/create.php | 38 ++-
views/default/river/object/image/tag.php | 39 ++-
views/default/settings/tidypics/edit.php | 6 +-
views/default/tidypics/admin/imagelib.php | 88 +++----
views/default/tidypics/admin/settings.php | 36 +--
views/default/tidypics/admin/stats.php | 51 ++--
views/default/tidypics/admin/tidypics.php | 58 ++---
views/default/tidypics/albums.php | 74 +++---
views/default/tidypics/breadcrumbs.php | 33 +--
views/default/tidypics/exif.php | 20 +-
views/default/tidypics/forms/edit.php | 145 ++++++-----
views/default/tidypics/forms/edit_multi.php | 12 +-
views/default/tidypics/forms/settings.php | 336 +++++++++++++------------
views/default/tidypics/forms/setupFlickr.php | 1 -
views/default/tidypics/forms/upload.php | 123 ++++-----
views/default/tidypics/groupprofile_albums.php | 1 -
views/default/tidypics/image_menu.php | 77 +++---
views/default/tidypics/tagging.php | 57 +++--
views/default/widgets/album_view/edit.php | 11 +-
views/default/widgets/album_view/view.php | 13 +-
views/default/widgets/latest_photos/edit.php | 8 +-
views/default/widgets/latest_photos/view.php | 17 +-
views/rss/object/album.php | 1 -
views/rss/object/file.php | 18 +-
views/rss/tidypics/gallery.php | 8 +-
29 files changed, 940 insertions(+), 914 deletions(-)
(limited to 'views')
diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php
index 8156a4bb4..f81f2b55c 100644
--- a/views/default/annotation/annotate.php
+++ b/views/default/annotation/annotate.php
@@ -1,21 +1,20 @@
subject_guid);
- $object = get_entity($vars['item']->object_guid);
- $url = $object->getURL();
- $subtype = get_subtype_from_id($object->subtype);
- $title = $object->title;
- if (!$title)
- $title = elgg_echo('untitled');
+$performed_by = get_entity($vars['item']->subject_guid);
+$object = get_entity($vars['item']->object_guid);
+$url = $object->getURL();
+$subtype = get_subtype_from_id($object->subtype);
+$title = $object->title;
+if (!$title) {
+ $title = elgg_echo('untitled');
+}
- $url = "getURL()}\">{$performed_by->name} ";
- $string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
- $string .= elgg_echo("{$subtype}:river:annotate") . " getURL() . "\">" . $title . " ";
+$url = "getURL()}\">{$performed_by->name} ";
+$string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
+$string .= elgg_echo("{$subtype}:river:annotate") . " getURL() . "\">" . $title . " ";
-?>
-
-
\ No newline at end of file
+echo $string;
diff --git a/views/default/object/album.php b/views/default/object/album.php
index 85dd69ac9..0db0d3e49 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -1,22 +1,22 @@
getGUID();
- $owner = $album->getOwnerEntity();
- $tags = $album->tags;
- $title = $album->title;
- $desc = $album->description;
- $friendlytime = friendly_time($album->time_created);
- $mime = $album->mimetype;
+global $CONFIG;
- if (get_context() == "search") {
+$album = $vars['entity'];
+$album_guid = $album->getGUID();
+$owner = $album->getOwnerEntity();
+$tags = $album->tags;
+$title = $album->title;
+$desc = $album->description;
+$friendlytime = friendly_time($album->time_created);
+$mime = $album->mimetype;
- if (get_input('search_viewtype') == "gallery") {
+if (get_context() == "search") {
+
+ if (get_input('search_viewtype') == "gallery") {
/******************************************************************************
*
@@ -27,30 +27,31 @@
*
*****************************************************************************/
- //get album cover if one was set
- if ($album->cover)
- $album_cover = ' ';
- else
- $album_cover = ' ';
-
+ //get album cover if one was set
+ if ($album->cover) {
+ $album_cover = ' ';
+ } else {
+ $album_cover = ' ';
+ }
?>
-
name;?>
-
-getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")";
+ name;?>
+
+ getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")";
+ }
?>
' . $title . '
';
- $info .= "username}\">{$owner->name} {$friendlytime}";
- $numcomments = elgg_count_comments($album);
- if ($numcomments)
- $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ") ";
- $info .= "
";
-
- //get album cover if one was set
- if ($album->cover)
- $icon = "getURL()}\">" . ' ';
- else
- $icon = "getURL()}\">" . ' ';
-
- echo elgg_view_listing($icon, $info);
+ $info = '' . $title . '
';
+ $info .= "username}\">{$owner->name} {$friendlytime}";
+ $numcomments = elgg_count_comments($album);
+ if ($numcomments) {
+ $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ") ";
}
- } else {
+ $info .= "
";
+
+ //get album cover if one was set
+ if ($album->cover) {
+ $icon = "getURL()}\">" . ' ';
+ } else {
+ $icon = "getURL()}\">" . ' ';
+ }
+ echo elgg_view_listing($icon, $info);
+ }
+} else {
/******************************************************************************
*
@@ -86,76 +88,76 @@
*
*****************************************************************************/
- $page = get_input("page");
- list($album_placeholder, $album_id, $album_title) = split("/", $page);
-
- $photo_ratings = get_plugin_setting('photo_ratings', 'tidypics');
- if ($photo_ratings == "enabled")
- add_submenu_item( elgg_echo("tidypics:highestrated"),
- $CONFIG->wwwroot . "pg/photos/highestrated/group:" . $album_id,
- 'photos');
-
- echo elgg_view_title($title);
+ $page = get_input("page");
+ list($album_placeholder, $album_id, $album_title) = split("/", $page);
+
+ $photo_ratings = get_plugin_setting('photo_ratings', 'tidypics');
+ if ($photo_ratings == "enabled") {
+ add_submenu_item( elgg_echo("tidypics:highestrated"),
+ $CONFIG->wwwroot . "pg/photos/highestrated/group:" . $album_id,
+ 'photos');
+ }
+ echo elgg_view_title($title);
?>
-
+
-' . autop($desc) . '
';
-
- $images = get_entities("object", "image", $album_guid, '', 999);
-
- //build array for back | next links
- $_SESSION['image_sort'] = array();
-
- if (is_array($images)) {
- foreach ($images as $image) {
- array_push($_SESSION['image_sort'], $image->guid);
- }
-
- // display the simple image views. Uses 'object/image' view
- echo list_entities("object", "image", $album_guid, 24, false);
-
- $num_images = count($images);
- } else {
- echo '' . elgg_echo('image:none') . '
';
- $num_images = 0;
+' . autop($desc) . '';
+
+ $images = get_entities("object", "image", $album_guid, '', 999);
+
+ //build array for back | next links
+ $_SESSION['image_sort'] = array();
+
+ if (is_array($images)) {
+ foreach ($images as $image) {
+ array_push($_SESSION['image_sort'], $image->guid);
}
-
+
+ // display the simple image views. Uses 'object/image' view
+ echo list_entities("object", "image", $album_guid, 24, false);
+
+ $num_images = count($images);
+ } else {
+ echo '' . elgg_echo('image:none') . '
';
+ $num_images = 0;
+ }
+
?>
';
- } // end of individual album view
-?>
+ if ($vars['full']) {
+ echo elgg_view_comments($album);
+ }
+
+ echo '';
+} // end of individual album view
+
diff --git a/views/default/object/image.php b/views/default/object/image.php
index ee81d800f..cd53120de 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -1,19 +1,19 @@
getGUID();
- $tags = $image->tags;
- $title = $image->title;
- $desc = $image->description;
- $owner = $image->getOwnerEntity();
- $friendlytime = friendly_time($image->time_created);
+$image = $vars['entity'];
+$image_guid = $image->getGUID();
+$tags = $image->tags;
+$title = $image->title;
+$desc = $image->description;
+$owner = $image->getOwnerEntity();
+$friendlytime = friendly_time($image->time_created);
/********************************************************************
@@ -21,69 +21,65 @@
* search view of an image
*
********************************************************************/
- if (get_context() == "search") {
+if (get_context() == "search") {
- // gallery view is a matrix view showing just the image - size: small
- if (get_input('search_viewtype') == "gallery") {
- ?>
-
-
-
- '.$title.' ';
- $info .= "username}\">{$owner->name} {$friendlytime}";
- $numcomments = elgg_count_comments($image);
- if ($numcomments)
- $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ") ";
- $info .= "
";
- $icon = "getURL()}\">" . ' ';
-
- echo elgg_view_listing($icon, $info);
+ // gallery view is a matrix view showing just the image - size: small
+ if (get_input('search_viewtype') == "gallery") {
+?>
+
+
+
+'.$title.' ';
+ $info .= "username}\">{$owner->name} {$friendlytime}";
+ $numcomments = elgg_count_comments($image);
+ if ($numcomments) {
+ $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ") ";
}
+ $info .= "
";
+ $icon = "getURL()}\">" . ' ';
+
+ echo elgg_view_listing($icon, $info);
+ }
/***************************************************************
*
* front page view
*
****************************************************************/
- } else if (get_context() == "front") {
- // the front page view is a clikcable thumbnail of the image
+} else if (get_context() == "front") {
+ // the front page view is a clickable thumbnail of the image
?>
-
+
-
- $image), $image_html);
-
- if ($image_html) {
- echo $image_html;
- } else {
- // default link to image if no one overrides
-?>
-
-
-
- $image), $image_html);
+
+ if ($image_html) {
+ echo $image_html;
+ } else {
+ // default link to image if no one overrides
?>
+
+
+
container_guid);
- $current = array_search($image_guid, $_SESSION['image_sort']);
+ // Build back and next links
+ $back = '';
+ $next = '';
- if (!$current) { // means we are no longer using the correct album array
+ $album = get_entity($image->container_guid);
- //rebuild the array
- $count = get_entities("object","image", $album->guid, '', 999);
- $_SESSION['image_sort'] = array();
+ $current = array_search($image_guid, $_SESSION['image_sort']);
- foreach ($count as $img) {
- array_push($_SESSION['image_sort'], $img->guid);
- }
+ if (!$current) { // means we are no longer using the correct album array
- if ($_SESSION['image_sort'])
- $current = array_search($image_guid, $_SESSION['image_sort']);
+ //rebuild the array
+ $count = get_entities("object","image", $album->guid, '', 999);
+ $_SESSION['image_sort'] = array();
+
+ foreach ($count as $img) {
+ array_push($_SESSION['image_sort'], $img->guid);
}
- if ($current != 0)
- $back = '« ' . elgg_echo('image:back') . ' ';
+ if ($_SESSION['image_sort']) {
+ $current = array_search($image_guid, $_SESSION['image_sort']);
+ }
+ }
- if (sizeof($_SESSION['image_sort']) > $current + 1)
- $next = '' . elgg_echo('image:next') . ' » ';
+ if ($current != 0) {
+ $back = '« ' . elgg_echo('image:back') . ' ';
+ }
+ if (sizeof($_SESSION['image_sort']) > $current + 1) {
+ $next = '' . elgg_echo('image:next') . ' » ';
+ }
?>
- $album,) ); ?>
- addView($viewer->guid);
- $views = $image->getViews($viewer->guid);
- if (is_array($views)) {
- echo sprintf(elgg_echo("tidypics:views"), $views['total']);
- if ($owner->guid == $viewer->guid) {
- echo ' ' . sprintf(elgg_echo("tidypics:viewsbyowner"), $views['unique']);
- }
- else {
- if ($views['mine'])
- echo ' ' . sprintf(elgg_echo("tidypics:viewsbyothers"), $views['mine']);
+ $album,) ); ?>
+addView($viewer->guid);
+ $views = $image->getViews($viewer->guid);
+ if (is_array($views)) {
+ echo sprintf(elgg_echo("tidypics:views"), $views['total']);
+ if ($owner->guid == $viewer->guid) {
+ echo ' ' . sprintf(elgg_echo("tidypics:viewsbyowner"), $views['unique']);
+ } else {
+ if ($views['mine']) {
+ echo ' ' . sprintf(elgg_echo("tidypics:viewsbyothers"), $views['mine']);
+ }
+ }
}
}
- }
- ?>
+?>
-
+
- ";
- $image_html .= "
";
- $image_html .= "";
- } else {
- $image_html = "
";
- }
- // does any plugin want to override the link
- $image_html = trigger_plugin_hook('tp_thumbnail_link', 'image', array('image' => $image), $image_html);
- echo $image_html;
- ?>
+ ";
+ $image_html .= "
";
+ $image_html .= "";
+ } else {
+ $image_html = "
";
+ }
+ // does any plugin want to override the link
+ $image_html = trigger_plugin_hook('tp_thumbnail_link', 'image', array('image' => $image), $image_html);
+ echo $image_html;
+ ?>
-
';
- echo elgg_view('tidypics/image_menu', array('image_guid' => $image_guid,
- 'viewer' => $viewer,
- 'owner' => $owner,
- 'anytags' => $image->isPhotoTagged(),
- 'album' => $album, ) );
- echo ' ';
-
- // tagging code - photo tags on images, photo tag listing and hidden divs used in tagging
- if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
- echo elgg_view('tidypics/tagging', array( 'image' => $image,
- 'viewer' => $viewer,
- 'owner' => $owner, ) );
- }
-
-
- if (get_plugin_setting('exif', 'tidypics') == "enabled") {
+
';
+ echo elgg_view('tidypics/image_menu', array(
+ 'image_guid' => $image_guid,
+ 'viewer' => $viewer,
+ 'owner' => $owner,
+ 'anytags' => $image->isPhotoTagged(),
+ 'album' => $album, ) );
+ echo ' ';
+
+ // tagging code - photo tags on images, photo tag listing and hidden divs used in tagging
+ if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+ echo elgg_view('tidypics/tagging', array(
+ 'image' => $image,
+ 'viewer' => $viewer,
+ 'owner' => $owner, ) );
+ }
+
+
+ if (get_plugin_setting('exif', 'tidypics') == "enabled") {
+ echo elgg_view('tidypics/exif', array('guid'=> $image_guid));
+ }
?>
- $image_guid)); ?>
-
-
+
$tags));?>
-
- $vars['entity'])); ?>
-
+ $vars['entity'])); ?>
+
name; ?> name; ?>
';
-
- echo ''; // content wrapper
+ echo elgg_view_comments($image);
- } // end of individual image display
+ echo '
';
- }
-
-?>
+ echo ''; // content wrapper
+ } // end of individual image display
+}
diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php
index 20f9293d7..ef50f9988 100644
--- a/views/default/river/object/album/create.php
+++ b/views/default/river/object/album/create.php
@@ -1,42 +1,41 @@
subject_guid);
- $album = get_entity($vars['item']->object_guid);
-
- $group_album = ($album->owner_guid != $album->container_guid);
- if ($group_album) {
- $group = get_entity($album->container_guid);
- $group_name = $group->name;
- $group_link = $group->getURL();
+$performed_by = get_entity($vars['item']->subject_guid);
+$album = get_entity($vars['item']->object_guid);
+
+$group_album = ($album->owner_guid != $album->container_guid);
+if ($group_album) {
+ $group = get_entity($album->container_guid);
+ $group_name = $group->name;
+ $group_link = $group->getURL();
+}
+
+$url = "getURL()}\">{$performed_by->name} ";
+$string = sprintf(elgg_echo("album:river:created"), $url) . " ";
+$string .= "getURL() . "\">" . $album->title . " ";
+if ($group_album) {
+ $string .= ' ' . elgg_echo('album:river:group') . ' ' . "{$group_name} ";
+}
+
+$album_river_view = get_plugin_setting('album_river_view', 'tidypics');
+
+if ($album_river_view == "cover") {
+ if ($album->cover) {
+ $string .= " wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "
";
}
-
- $url = "getURL()}\">{$performed_by->name} ";
- $string = sprintf(elgg_echo("album:river:created"),$url) . " ";
- $string .= "getURL() . "\">" . $album->title . " ";
- if ($group_album)
- $string .= ' ' . elgg_echo('album:river:group') . ' ' . "{$group_name} ";
-
- $album_river_view = get_plugin_setting('album_river_view', 'tidypics');
-
- if ($album_river_view == "cover") {
- if ($album->cover) {
- $string .= " wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "
";
- }
- } else {
+} else {
- $string .= "";
-
- $images = get_entities("object", "image", $album->guid, 'time_created desc', 7);
+ $string .= "
";
- if (count($images)) {
- foreach($images as $image){
- $string .= "
getURL() . "\"> wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> ';
- }
- }
+ $images = get_entities("object", "image", $album->guid, 'time_created desc', 7);
- $string .= "
";
+ if (count($images)) {
+ foreach($images as $image) {
+ $string .= "
getURL() . "\"> wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> ';
+ }
}
-echo $string;
+ $string .= "
";
+}
-?>
+echo $string;
diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php
index cd2351a2e..188fc6ff1 100644
--- a/views/default/river/object/image/create.php
+++ b/views/default/river/object/image/create.php
@@ -1,29 +1,27 @@
subject_guid);
- $image = get_entity($vars['item']->object_guid);
- if($image->title) {
- $title = $image->title;
- } else {
- $title = "untitled";
- }
+$performed_by = get_entity($vars['item']->subject_guid);
+$image = get_entity($vars['item']->object_guid);
+if ($image->title) {
+ $title = $image->title;
+} else {
+ $title = "untitled";
+}
- $url = "getURL()}\">{$performed_by->name} ";
- $album = get_entity($image->container_guid);
+$url = "getURL()}\">{$performed_by->name} ";
+$album = get_entity($image->container_guid);
- $album_link = "" . $album->title . " ";
- $image_link = "getURL() . "\">" . $title . " ";
-
- $string = sprintf(elgg_echo("image:river:created"), $url, $image_link, $album_link);
-
- $string .= "";
+$album_link = "
" . $album->title . " ";
+$image_link = "
getURL() . "\">" . $title . " ";
+
+$string = sprintf(elgg_echo("image:river:created"), $url, $image_link, $album_link);
+
+$string .= "
";
-
- echo $string;
+$string .= "
getURL() . "\"> wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> ';
+$string .= "
";
-?>
\ No newline at end of file
+echo $string;
diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php
index 1b3589afb..961761c99 100644
--- a/views/default/river/object/image/tag.php
+++ b/views/default/river/object/image/tag.php
@@ -1,23 +1,22 @@
subject_guid);
- $person_tagged = get_entity($vars['item']->object_guid);
- if($image->title) {
- $title = $image->title;
- } else {
- $title = "untitled";
- }
-
- // viewer may not have permission to view image
- if (!$image)
- return;
-
-
- $image_url = "getURL()}\">{$title} ";
- $person_url = "getURL()}\">{$person_tagged->name} ";
-
- $string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url;
-
- echo $string;
+$image = get_entity($vars['item']->subject_guid);
+$person_tagged = get_entity($vars['item']->object_guid);
+if ($image->title) {
+ $title = $image->title;
+} else {
+ $title = "untitled";
+}
-?>
\ No newline at end of file
+// viewer may not have permission to view image
+if (!$image) {
+ return;
+}
+
+
+$image_url = "getURL()}\">{$title} ";
+$person_url = "getURL()}\">{$person_tagged->name} ";
+
+$string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url;
+
+echo $string;
diff --git a/views/default/settings/tidypics/edit.php b/views/default/settings/tidypics/edit.php
index eb391c8bc..a6b2c2d0c 100644
--- a/views/default/settings/tidypics/edit.php
+++ b/views/default/settings/tidypics/edit.php
@@ -1,7 +1,7 @@
wwwroot . 'mod/tidypics/pages/server_analysis.php';
- $settings_url = $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php';
+global $CONFIG;
+$system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
+$settings_url = $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php';
?>
diff --git a/views/default/tidypics/admin/imagelib.php b/views/default/tidypics/admin/imagelib.php
index b4656afe1..a0d0c19e7 100644
--- a/views/default/tidypics/admin/imagelib.php
+++ b/views/default/tidypics/admin/imagelib.php
@@ -1,62 +1,62 @@
dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_images = $total->total;
-
- $img_type = get_subtype_id('object', 'album');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_albums = $total->total;
+$img_type = get_subtype_id('object', 'image');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_images = $total->total;
- $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
- $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
-
- $num_views = count_annotations(0, 'object', 'image', 'tp_view');
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled")
- $num_tags = count_annotations(0, 'object', 'image', 'phototag');
+$img_type = get_subtype_id('object', 'album');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_albums = $total->total;
+
+$num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
+$num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
+
+$num_views = count_annotations(0, 'object', 'image', 'tp_view');
+
+if (get_plugin_setting('tagging', 'tidypics') != "disabled")
+ $num_tags = count_annotations(0, 'object', 'image', 'phototag');
?>
Overview
-An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping.
-There are three image library options with Tidypics: PHP extension GD ,
-ImageMagick called via a system call, and the PHP extension
-imagick . GD is the most common of the three on hosted servers but suffers
-from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the
-PHP extension), we recommend that you use that.
+ An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping.
+ There are three image library options with Tidypics: PHP extension GD ,
+ ImageMagick called via a system call, and the PHP extension
+ imagick . GD is the most common of the three on hosted servers but suffers
+ from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the
+ PHP extension), we recommend that you use that.
Testing ImageMagick Commandline
-To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our
-server analysis page to find out the
-configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should
-be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of
-ImageMagick installed on your server.
+ To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our
+ server analysis page to find out the
+ configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should
+ be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of
+ ImageMagick installed on your server.
-
-
-
+
+
+
\ No newline at end of file
diff --git a/views/default/tidypics/admin/settings.php b/views/default/tidypics/admin/settings.php
index ce5652c16..bc0befa16 100644
--- a/views/default/tidypics/admin/settings.php
+++ b/views/default/tidypics/admin/settings.php
@@ -1,26 +1,26 @@
elgg_echo("tidypics:admin:instructions")));
-
- global $CONFIG;
- $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
- $upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php';
- $upgrade_url = elgg_add_action_tokens_to_url($upgrade_url);
-
- $upgrade = false;
- if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album'))
- $upgrade = true;
+echo elgg_view('output/longtext', array('value' => elgg_echo("tidypics:admin:instructions")));
+
+global $CONFIG;
+$system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
+$upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php';
+$upgrade_url = elgg_add_action_tokens_to_url($upgrade_url);
+
+$upgrade = false;
+if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {
+ $upgrade = true;
+}
?>
-
-Upgrade
-
+ Upgrade
+
-Run Server Analysis
+ ?>
+ Run Server Analysis
\ No newline at end of file
+echo elgg_view("tidypics/forms/settings");
diff --git a/views/default/tidypics/admin/stats.php b/views/default/tidypics/admin/stats.php
index aea5e75ba..0b088dc2e 100644
--- a/views/default/tidypics/admin/stats.php
+++ b/views/default/tidypics/admin/stats.php
@@ -1,35 +1,36 @@
dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_images = $total->total;
-
- $img_type = get_subtype_id('object', 'album');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_albums = $total->total;
+$img_type = get_subtype_id('object', 'image');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_images = $total->total;
- $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
- $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
-
- $num_views = count_annotations(0, 'object', 'image', 'tp_view');
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled")
- $num_tags = count_annotations(0, 'object', 'image', 'phototag');
+$img_type = get_subtype_id('object', 'album');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_albums = $total->total;
+
+$num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
+$num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
+
+$num_views = count_annotations(0, 'object', 'image', 'tp_view');
+
+if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+ $num_tags = count_annotations(0, 'object', 'image', 'phototag');
+}
?>
-
-Photos:
-Albums:
-Comments on photos:
-Comments on albums:
-Total views:
+
+ Photos:
+ Albums:
+ Comments on photos:
+ Comments on albums:
+ Total views:
-Photo tags:
+ Photo tags:
\ No newline at end of file
diff --git a/views/default/tidypics/admin/tidypics.php b/views/default/tidypics/admin/tidypics.php
index fa518156c..a46781c2a 100644
--- a/views/default/tidypics/admin/tidypics.php
+++ b/views/default/tidypics/admin/tidypics.php
@@ -1,32 +1,32 @@
diff --git a/views/default/tidypics/albums.php b/views/default/tidypics/albums.php
index 42ac15afe..a4b2ee906 100644
--- a/views/default/tidypics/albums.php
+++ b/views/default/tidypics/albums.php
@@ -1,51 +1,53 @@
';
+echo '
+ username) || empty($owner->username)) {
+ echo '' . elgg_echo('album:all') . '
';
+ } else {
+ echo '' . elgg_echo('album:more') . '
';
}
- if (can_write_to_container(0, $owner->guid)) {
- echo 'username . '>' . elgg_echo("album:create") . '
';
- }
+}
+
+if (can_write_to_container(0, $owner->guid)) {
+ echo 'username . '>' . elgg_echo("album:create") . '
';
+}
- //close album_widget_container div
- echo "";
-?>
\ No newline at end of file
+//close album_widget_container div
+echo "";
diff --git a/views/default/tidypics/breadcrumbs.php b/views/default/tidypics/breadcrumbs.php
index c4d347e6e..e9f491b38 100644
--- a/views/default/tidypics/breadcrumbs.php
+++ b/views/default/tidypics/breadcrumbs.php
@@ -1,22 +1,23 @@
wwwroot . "pg/photos/owned/" . $page_owner->username;
- if (get_loggedin_userid() == $page_owner->guid)
- $first_level_text = elgg_echo('album:yours');
- else
- $first_level_text = sprintf(elgg_echo('album:user'), $page_owner->name);
+$first_level_text = '';
+$first_level_link = $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username;
+if (get_loggedin_userid() == $page_owner->guid) {
+ $first_level_text = elgg_echo('album:yours');
+} else {
+ $first_level_text = sprintf(elgg_echo('album:user'), $page_owner->name);
+}
?>
title;
- $second_level_link = $vars['album']->getURL();
-?>
+$second_level_text = '';
+if (isset($vars['album'])) {
+ $second_level_text = $vars['album']->title;
+ $second_level_link = $vars['album']->getURL();
+ ?>
>>
-
+ ';
- foreach ($exif as $name => $value) {
- echo $name . ': ' . $value . ' ';
- }
- echo '';
+$guid = $vars['guid'];
+
+$exif = tp_exif_formatted($guid);
+if ($exif) {
+ echo '';
+ foreach ($exif as $name => $value) {
+ echo $name . ': ' . $value . ' ';
}
-
+ echo '
';
+}
+
?>
\ No newline at end of file
diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php
index 1758d14f4..74d8e85ec 100644
--- a/views/default/tidypics/forms/edit.php
+++ b/views/default/tidypics/forms/edit.php
@@ -1,45 +1,42 @@
title;
- $body = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $subtype = $vars['subtype'];
+/**
+ * Tidypics images edit/add form
+ * This form is used to:
+ * - create albums
+ * - edit albums
+ * - edit images
+ */
+
+//set stuff if we are editing existing album or image
+if (isset($vars['entity'])) {
+ $action = "tidypics/edit";
+ $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 {
- $action = "tidypics/addalbum";
- $tags = "";
- $title = "";
- $body = "";
- if (defined('ACCESS_DEFAULT'))
- $access_id = ACCESS_DEFAULT;
- else
- $access_id = 1; // logged_in by default
- $subtype = 'album';
-
- $title = $_SESSION['tidypicstitle'];
- $body = $_SESSION['tidypicsbody'];
- $tags = $_SESSION['tidypicstags'];
-
- unset($_SESSION['tidypicstitle']);
- unset($_SESSION['tidypicsbody']);
- unset($_SESSION['tidypicstags']);
- }
-
- // group or individual
- $container_guid = page_owner();
+} else {
+ $action = "tidypics/addalbum";
+ $tags = "";
+ $title = "";
+ $body = "";
+ $access_id = ACCESS_DEFAULT;
+ $subtype = 'album';
+
+ $title = $_SESSION['tidypicstitle'];
+ $body = $_SESSION['tidypicsbody'];
+ $tags = $_SESSION['tidypicstags'];
+
+ unset($_SESSION['tidypicstitle']);
+ unset($_SESSION['tidypicsbody']);
+ unset($_SESSION['tidypicstags']);
+}
+
+// group or individual
+$container_guid = page_owner();
?>
@@ -48,79 +45,79 @@
"tidypicstitle", "value" => $title,)); ?>
-
+ ?>
- "tidypicsbody","value" => $body,)); ?>
+ "tidypicsbody","value" => $body,)); ?>
-
+ ?>
- "tidypicsbody","value" => $body,"class" => 'tidypics_caption_input')); ?>
+ "tidypicsbody","value" => $body,"class" => 'tidypics_caption_input')); ?>
-
+
"tidypicstags","value" => $tags,)); ?>
-container_guid;
-
+
// should this image be the cover for the album - only ask for non-cover photos
// determine if it is already the cover
$img_guid = $vars['entity']->guid;
$album = get_entity($container_guid);
$cover_guid = $album->cover;
-
- if ($cover_guid != $img_guid) {
-
-?>
+
+ if ($cover_guid != $img_guid) {
+
+ ?>
- "cover",
- 'options' => array(elgg_echo("album:cover")),
- ));
-?>
+ "cover",
+ 'options' => array(elgg_echo("album:cover")),
+ ));
+ ?>
-
+ ?>
-
+
-
-
-
+
+
+
'access_id','value' => $access_id)); ?>
-
+
-
-
-
+
+
+ ?>
diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php
index 4031b7968..c16c8eea9 100644
--- a/views/default/tidypics/forms/edit_multi.php
+++ b/views/default/tidypics/forms/edit_multi.php
@@ -1,7 +1,7 @@
';
}
-?>
\ No newline at end of file
diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php
index 498cfe724..50ada2193 100644
--- a/views/default/tidypics/image_menu.php
+++ b/views/default/tidypics/image_menu.php
@@ -1,51 +1,50 @@
container_guid);
- if ($container instanceof ElggGroup) {
- $can_tag = $viewer && $container->isMember($viewer);
- } else {
- $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
- }
-
- // only owner and friends of owner can tag
- if ($can_tag) {
+/**************************************************************************
+ *
+ * Tidypics Image Menu
+ *
+ * This is the menu that appears below an image. Admins can override the
+ * menu with a different view to provide a look and feel that matches
+ * their themes. The view can be extended to provide additional controls.
+ *
+ **************************************************************************/
+
+$image_guid = $vars['image_guid'];
+$viewer = $vars['viewer'];
+$owner = $vars['owner'];
+$anytags = $vars['anytags'];
+$album = $vars['album'];
+
+if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+
+ $can_tag = false;
+
+ $container = get_entity($album->container_guid);
+ if ($container instanceof ElggGroup) {
+ $can_tag = $viewer && $container->isMember($viewer);
+ } else {
+ $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
+ }
+
+ // only owner and friends of owner can tag
+ if ($can_tag) {
?>
guid == $owner->guid) {
+ }
+
+ // only owner can delete tags
+ if ($anytags && $viewer && $viewer->guid == $owner->guid) {
?>
\ No newline at end of file
+}
diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php
index 251534b80..2993fe71b 100644
--- a/views/default/tidypics/tagging.php
+++ b/views/default/tidypics/tagging.php
@@ -1,32 +1,32 @@
getPhotoTags();
+// get photo tags
+$tag_info = $image->getPhotoTags();
- // defining json text as "" makes sure the tagging javascript code doesn't throw errors if no tags
- $photo_tags_json = "\"\"";
- if ($tag_info) {
- $photo_tags_json = $tag_info['json'];
- }
-
- if ($tag_info) {
+// defining json text as "" makes sure the tagging javascript code doesn't throw errors if no tags
+$photo_tags_json = "\"\"";
+if ($tag_info) {
+ $photo_tags_json = $tag_info['json'];
+}
+
+if ($tag_info) {
?>
";
-
+
$content .= "";
-
+
echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'tidypics_phototag_form', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'method' => 'post', 'body' => $content));
}
-?>
-
+ ?>
+
$photo_tags_json,) );
-?>
\ No newline at end of file
+echo elgg_view('tidypics/js/tagging', array('photo_tags_json' => $photo_tags_json,) );
diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php
index 992699cb0..9068ffe17 100644
--- a/views/default/widgets/album_view/edit.php
+++ b/views/default/widgets/album_view/edit.php
@@ -1,11 +1,12 @@
num_display == '') $vars['entity']->num_display = 5;
-
+echo elgg_echo("tidypics:widget:num_albums") . ": ";
+
+
+if ($vars['entity']->num_display == '') {
+ $vars['entity']->num_display = 5;
+}
?>
num_display == 1) echo "SELECTED"; ?>>1
diff --git a/views/default/widgets/album_view/view.php b/views/default/widgets/album_view/view.php
index b4248df35..1b980aa8b 100644
--- a/views/default/widgets/album_view/view.php
+++ b/views/default/widgets/album_view/view.php
@@ -1,13 +1,14 @@
num_display;
- //if no number has been set, default to 5
- if (!$number)
- $number = 5;
+//the number of files to display
+$number = (int) $vars['entity']->num_display;
+//if no number has been set, default to 5
+if (!$number) {
+ $number = 5;
+}
- echo elgg_view('tidypics/albums', array('num_albums' => $number));
+echo elgg_view('tidypics/albums', array('num_albums' => $number));
?>
\ No newline at end of file
diff --git a/views/default/widgets/latest_photos/edit.php b/views/default/widgets/latest_photos/edit.php
index 3b334d722..06693648d 100644
--- a/views/default/widgets/latest_photos/edit.php
+++ b/views/default/widgets/latest_photos/edit.php
@@ -1,9 +1,11 @@
num_display == '') {
+ $vars['entity']->num_display = 6;
+}
- if($vars['entity']->num_display == '') $vars['entity']->num_display = 6;
-
?>
num_display == 6) echo "SELECTED"; ?>>6
diff --git a/views/default/widgets/latest_photos/view.php b/views/default/widgets/latest_photos/view.php
index 0c3193907..d6bc4a0df 100644
--- a/views/default/widgets/latest_photos/view.php
+++ b/views/default/widgets/latest_photos/view.php
@@ -1,15 +1,16 @@
num_display;
- //if no number has been set, default to 6
- if (!$number)
- $number = 6;
+//the number of files to display
+$number = (int) $vars['entity']->num_display;
+//if no number has been set, default to 6
+if (!$number) {
+ $number = 6;
+}
- echo '
';
- echo tp_get_latest_photos($number, page_owner());
- echo '
';
+echo '
';
+echo tp_get_latest_photos($number, page_owner());
+echo '
';
?>
\ No newline at end of file
diff --git a/views/rss/object/album.php b/views/rss/object/album.php
index 8542b95f4..34cf58395 100644
--- a/views/rss/object/album.php
+++ b/views/rss/object/album.php
@@ -51,4 +51,3 @@ if (get_context() == "search" && get_input('search_viewtype') == "gallery") {
}
}
-?>
\ No newline at end of file
diff --git a/views/rss/object/file.php b/views/rss/object/file.php
index 36740f003..1ede661ad 100644
--- a/views/rss/object/file.php
+++ b/views/rss/object/file.php
@@ -1,16 +1,16 @@
title;
- if (empty($title)) {
- $title = substr($vars['entity']->description,0,32);
- if (strlen($vars['entity']->description) > 32)
- $title .= " ...";
+$title = $vars['entity']->title;
+if (empty($title)) {
+ $title = substr($vars['entity']->description,0,32);
+ if (strlen($vars['entity']->description) > 32) {
+ $title .= " ...";
}
-
+}
?>
-
diff --git a/views/rss/tidypics/gallery.php b/views/rss/tidypics/gallery.php
index 2c285fca5..0e90a8c44 100644
--- a/views/rss/tidypics/gallery.php
+++ b/views/rss/tidypics/gallery.php
@@ -1,7 +1,7 @@
0) {
echo elgg_view_entity($entity);
}
}
-
-?>
\ No newline at end of file
--
cgit v1.2.3