]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed display of some album pages - caused a cascade of changes required
authorCash Costello <cash.costello@gmail.com>
Sun, 13 Dec 2009 02:03:17 +0000 (02:03 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 13 Dec 2009 02:03:17 +0000 (02:03 +0000)
12 files changed:
lib/tidypics.php
pages/friends.php
pages/lists/mostrecentimages.php
pages/ownedalbums.php
pages/world.php
start.php
views/default/object/album.php
views/default/tidypics/content_wrapper.php
views/default/tidypics/css.php
views/default/tidypics/gallery.php
views/rss/object/album.php
views/rss/tidypics/content_wrapper.php [new file with mode: 0644]

index b0a8a70d2eff524c373c0fd33378495acad90e1b..f2a1ccce491b82fd6164fb23b4e712d01e0887ee 100644 (file)
@@ -33,7 +33,7 @@
        function tp_get_latest_photos($num_images, $owner_guid = 0)
        {
                $prev_context = set_context('front');
-               $image_html = tp_list_entities('object', 'image', $owner_guid, $num_images, false, false, false);  
+               $image_html = tp_list_entities('object', 'image', $owner_guid, 0, $num_images, false, false, false);  
                set_context($prev_context);
                return $image_html;
        }
                foreach ($where as $w)
                        $query .= " $w and ";
                $query .= get_access_sql_suffix(); // Add access controls
+
                if (!$count) {
                        $query .= " order by $order_by";
                        if ($limit) $query .= " limit $offset, $limit"; // Add order and limit
                }
        }
 
-       function tp_list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) {
+       function tp_list_entities($type= "", $subtype = "", $owner_guid = 0, $container_guid = null, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) {
                
                $offset = (int) get_input('offset');
-               $count = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true);
-               $entities = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset);
+               $count = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true, 0, $container_guid);
+               
+               $entities = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, false, 0, $container_guid);
 
                return tp_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);
        }
index e35adce0471627e37c852e82ffa9f58c89c3b6b8..03ae1300ac022b6e5eb8510b49a9cb53d37e6951 100644 (file)
        
        $area2 = elgg_view_title($title);
        
+       $albums = get_user_friends_objects($user->guid, 'album', 12);
+       
        // get html for viewing list of photo albums
        set_context('search');
        set_input('search_viewtype', 'gallery'); // need to force gallery view
-       $area2 .= list_user_friends_objects($user->guid, 'album', 10, true, false);
+       $content = tp_view_entity_list($albums, count($albums), 0, 12, false, false, true);
        
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $content,));
        
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
        
index 99dfeb4c9d0b3a2f39592ed5ef2ff35074f85602..178e3c722b32aaecc3d31521e8ccf4d12edfbeaa 100644 (file)
@@ -43,7 +43,7 @@
        $max = 12;
        
        // grab the html to display the images
-       $images = tp_list_entities("object", "image", $user_id, $max, false, false, true);
+       $images = tp_list_entities("object", "image", $user_id, null, $max, false, false, true);
        
        
        // this view takes care of the title on the main column and the content wrapper
index f43c2c5eb5a1848d4dc58d44a0571f1adf9f3d04..d22c6d44ab785e3fab12339ad57d8be21f19c6f9 100644 (file)
        set_context('search');
        set_input('search_viewtype', 'gallery');
        if ($owner instanceof ElggGroup)
-               $area2 .= list_entities("object", "album", $owner->guid, 12, false);
+               $content .= tp_list_entities("object", "album", 0, $owner->guid, 12, false);
        else
-               $area2 .= list_entities("object", "album", $owner->guid, 12, false);
+               $content .= tp_list_entities("object", "album", $owner->guid, $owner->guid, 12, false);
+       
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $content,));
        
        set_context('photos');
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
index 9488f2620eba83d5f0bb63117e8405f20d53c261..48a3345d4f2698e2481d25d7a92edca3b500375b 100644 (file)
        $num_albums = 16;
        
        $title = elgg_echo('album:all');
-       
-       set_context('photos');
        $area2 = elgg_view_title($title);
        
        set_context('search');
        set_input('search_viewtype', 'gallery');
-       $albums_html .= list_entities('object','album', 0, $num_albums, false);
+       $content .= tp_list_entities('object','album', 0, null, $num_albums, false);
+       set_context('photos');
 
-       
-       $area2 .= $albums_html;
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $content,));
        
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
 
index 7b6e46805b83746018bf744a326a28ff93ed1a90..2c605763582bd8d0c7dcdae4fe41974042ad2af1 100644 (file)
--- a/start.php
+++ b/start.php
@@ -97,7 +97,7 @@
                        
                        $view_count = get_plugin_setting('view_count', 'tidypics');
                        
-                       // owner gets "your albumn", "your friends albums", "your most viewed", "your most recent"
+                       // owner gets "your albumn", "your friends albums", "your most recent", "your most viewed"
                        if (get_loggedin_userid() && get_loggedin_userid() == $page_owner->guid) {
                                                                
                                add_submenu_item(       elgg_echo('album:create'), 
                                                                        $CONFIG->wwwroot . "pg/photos/friends/{$page_owner->username}/", 
                                                                        'tidypics-a');
                                
+                               add_submenu_item(       elgg_echo('tidypics:yourmostrecent'),
+                                                                       $CONFIG->wwwroot . "pg/photos/mostrecent/{$page_owner->username}/",
+                                                                       'tidypics-a');
+                               
                                if ($view_count != 'disabled') {
                                        add_submenu_item(       elgg_echo('tidypics:yourmostviewed'),
                                                                                $CONFIG->wwwroot . "pg/photos/mostviewed/{$page_owner->username}/",
                                                                                'tidypics-a');
                                }
                                
-                               add_submenu_item(       elgg_echo('tidypics:yourmostrecent'),
-                                                                       $CONFIG->wwwroot . "pg/photos/mostrecent/{$page_owner->username}/",
-                                                                       'tidypics-a');
                        } else if (isloggedin()) {
                                
                                $user = get_loggedin_user();
                                
                                // logged in not owner gets "page owners albums", "page owner's friends albums", "page owner's most viewed", "page owner's most recent"
-                               // and then "your albums", "your most viewed", "your most recent"
+                               // and then "your albums", "your most recent", "your most viewed"
                                add_submenu_item(       elgg_echo("album:yours"), 
                                                                        $CONFIG->wwwroot . "pg/photos/owned/{$user->username}/", 
                                                                        'tidypics-b' );
-                               
+                                                               
+                               add_submenu_item(       elgg_echo('tidypics:yourmostrecent'),
+                                                                       $CONFIG->wwwroot . "pg/photos/mostrecent/{$user->username}/",
+                                                                       'tidypics-b');
+                                                                       
                                if ($view_count != 'disabled') {
                                        add_submenu_item(       elgg_echo('tidypics:yourmostviewed'),
                                                                                $CONFIG->wwwroot . "pg/photos/mostviewed/{$user->username}/",
                                                                                'tidypics-b');
                                }
                                
-                               add_submenu_item(       elgg_echo('tidypics:yourmostrecent'),
-                                                                       $CONFIG->wwwroot . "pg/photos/mostrecent/{$user->username}/",
-                                                                       'tidypics-b');
-                                                                       
-                               if($page_owner->name) { // check to make sure the owner set their display name
+                               if ($page_owner->name) { // check to make sure the owner set their display name
                                        add_submenu_item(       sprintf(elgg_echo("album:user"), $page_owner->name), 
                                                                                $CONFIG->wwwroot . "pg/photos/owned/{$page_owner->username}/", 
                                                                                'tidypics-a' );
index 6ef6bc356093bab02c997f70959e5222a37fb004..31e46d46da390b2a6de701f502ad4fe9ed692485 100644 (file)
  *
  *  Gallery view of an album object
  * 
- *  This is called when looking at page of albums (index.php).
+ *  This is called when looking at page of albums
  *
  *
  *****************************************************************************/
 
                        //get album cover if one was set 
                        if ($album->cover)
-                               $album_cover = '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=small" class="tidypics_album_cover" alt="thumbnail"/>';
+                               $album_cover = '<img src="' . $vars['url'] . 'pg/photos/thumbnail/' . $album->cover . '/small/" class="tidypics_album_cover" alt="' . $title . '"/>';
                        else
                                $album_cover = '<img src="' . $vars['url'] . 'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="new album">';
 
 ?>
 <div class="tidypics_album_gallery_item">
-       <a href="<?php echo $album->getURL();?>"><?php echo $title;?></a><br>
+       <div class="tidypics_gallery_title">
+               <a href="<?php echo $album->getURL();?>"><?php echo $title;?></a>
+       </div>
        <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a><br>
        <small><a href="<?php echo $vars['url'];?>pg/profile/<?php echo $owner->username;?>"><?php echo $owner->name;?></a> <?php echo $friendlytime;?><br>
 <?php
index 08fd74aff6a400406bb0bd1583ffdfef1d617e89..757d069bbba79768245c4dad4651f16887d540c1 100644 (file)
@@ -2,7 +2,9 @@
        echo elgg_view_title($vars['title']);
 ?>
 <div class="contentWrapper">
+<div class="clearfloat"></div>
 <?php
        echo $vars['content'];
 ?>
+<div class="clearfloat"></div>
 </div>
\ No newline at end of file
index b65d73789556b6ce5e9d43b9d4359258dd44f49e..556787da7cd5977b733ae567a8973bed3641116b 100644 (file)
@@ -80,7 +80,7 @@ text-align:center;
 .tidypics_album_cover {
 padding:2px;
 border:1px solid #dedede;
-margin:8px 0;
+margin:5px 0;
 }
 
 .tidypics_album_widget_single_item {
@@ -88,9 +88,16 @@ margin-bottom:8px;
 }
 
 .tidypics_album_gallery_item {
+float:left;
+margin-bottom:20px;
+padding: 4px;
 text-align:center;
 }
 
+.tidypics_gallery_title {
+font-weight:bold;
+}
+
 .tidypics_popup {
 border:1px solid #3B5999; 
 width:200px; 
index dd7c1cdcf3e6ec0dff9f13dabc21a62289daa339..b9a50bdabef1c462d288b1a22e543970e55a238d 100644 (file)
@@ -43,15 +43,9 @@ if ($pagination) {
 }
 
 $html .= $nav;
-if ($viewtype == 'list') {
-       if (is_array($entities) && sizeof($entities) > 0) {
-               foreach($entities as $entity) {
-                       $html .= elgg_view_entity($entity, $fullview);
-               }
-       }
-} else {
-       if (is_array($entities) && sizeof($entities) > 0) {
-               $html .= elgg_view('entities/gallery', array('entities' => $entities));
+if (is_array($entities) && sizeof($entities) > 0) {
+       foreach($entities as $entity) {
+               $html .= elgg_view_entity($entity, $fullview);
        }
 }
 
index 2ad4ed9f73f60fde5b1ff0f9ccdc3738c5ecf5df..9c037b20f9a470fd02eb9ad9a8b5046a72a73963 100644 (file)
@@ -5,7 +5,16 @@
 
 // for now catch the albums view and ignore it
 if (get_context() == "search" && get_input('search_viewtype') == "gallery") {
+?>
+       <item>
+         <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
+         <pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
+         <link><?php echo $vars['entity']->getURL(); ?></link>
+         <title><![CDATA[<?php echo $$vars['entity']->title; ?>]]></title>
+         <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
+       </item>
 
+<?php
 } else {
 
        $album = $vars['entity'];
diff --git a/views/rss/tidypics/content_wrapper.php b/views/rss/tidypics/content_wrapper.php
new file mode 100644 (file)
index 0000000..20d9886
--- /dev/null
@@ -0,0 +1,2 @@
+<?php\r
+echo $vars['content'];\r