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 +++++++++++++++++++++-------------------- 1 file changed, 97 insertions(+), 95 deletions(-) (limited to 'views/default/object/album.php') 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 = '' . $title . ''; - else - $album_cover = 'new album'; - + //get album cover if one was set + if ($album->cover) { + $album_cover = '' . $title . ''; + } else { + $album_cover = 'new album'; + } ?> ' . $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()}\">" . 'thumbnail'; - else - $icon = "getURL()}\">" . 'new album'; - - 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()}\">" . 'thumbnail'; + } else { + $icon = "getURL()}\">" . 'new album'; + } + 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; + } + ?>
-
$tags));?>
- - name; ?>
-
+ name; ?>
+

-: - : +
'; - } // end of individual album view -?> + if ($vars['full']) { + echo elgg_view_comments($album); + } + + echo ''; +} // end of individual album view + -- cgit v1.2.3