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/object/album.php | 192 ++++++++++++++-------------
views/default/object/image.php | 295 ++++++++++++++++++++---------------------
2 files changed, 244 insertions(+), 243 deletions(-)
(limited to 'views/default/object')
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 .= "' . 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;
+ }
+
?>
- $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)); ?>
-