]> git.mxchange.org Git - friendica.git/commitdiff
network view all item types by date
authorFriendika <info@friendika.com>
Thu, 20 Jan 2011 01:56:36 +0000 (17:56 -0800)
committerFriendika <info@friendika.com>
Thu, 20 Jan 2011 01:56:36 +0000 (17:56 -0800)
boot.php
mod/network.php
mod/search.php
util/strings.php
view/theme/default/style.css
view/theme/duepuntozero/style.css

index d7f32dbafe52bc64bdbc95d985ed12b55f8ad8ce..d458b8647c0d6a7e7f15169c653ce1314671c262 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -3,7 +3,7 @@
 set_time_limit(0);
 
 define ( 'BUILD_ID',               1033   );
-define ( 'FRIENDIKA_VERSION',      '2.01.1004' );
+define ( 'FRIENDIKA_VERSION',      '2.01.1005' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.0'  );
 
 define ( 'EOL',                    "<br />\r\n"     );
index c761af81041db633b262921c04ee4c94c13b4777..e0636f0f8779020408a6eece7ed472c630d8149f 100644 (file)
@@ -5,6 +5,16 @@ function network_init(&$a) {
        require_once('include/group.php');
        if(! x($a->page,'aside'))
                $a->page['aside'] = '';
+
+       $a->page['aside'] .= '<div id="network-new-link">';
+
+       if(($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new'))
+               $a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '">' . t('Normal View') . '</a>';
+       else 
+               $a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . $a->cmd . '/new' . '">' . t('New Item View') . '</a>';
+
+       $a->page['aside'] .= '</div>';
+
        $a->page['aside'] .= group_side('network','network');
 }
 
@@ -25,11 +35,21 @@ function network_content(&$a, $update = 0) {
        if(! $update) {
                $o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
 
+               $nouveau = false;
+
+               if(($a->argc > 2) && $a->argv[2] === 'new')
+                       $nouveau = true;
+
                        // pull out the group here because the updater might have different args
                if($a->argc > 1) {
-                       $group = intval($a->argv[1]);
-                       $group_acl = array('allow_gid' => '<' . $group . '>');
+                       if($a->argv[1] === 'new')
+                               $nouveau = true;
+                       else {
+                               $group = intval($a->argv[1]);
+                               $group_acl = array('allow_gid' => '<' . $group . '>');
+                       }
                }
+
                $_SESSION['return_url'] = $a->cmd;
 
                $geotag = (($a->user['allow_location']) ? load_view_file('view/jot_geotag.tpl') : '');
@@ -111,6 +131,7 @@ function network_content(&$a, $update = 0) {
                                $contact_str = ' 0 ';
                                notice( t('Group is empty'));
                }
+
                $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( $contact_str )) ";
                $o = '<h4>' . t('Group: ') . $r[0]['name'] . '</h4>' . $o;
        }
@@ -130,22 +151,39 @@ function network_content(&$a, $update = 0) {
        if(count($r))
                $a->set_pager_total($r[0]['total']);
 
-       $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
-               `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, 
-               `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
-               FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`,
-             `contact` 
-               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
-               AND `contact`.`id` = `item`.`contact-id`
-               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
-               AND `item`.`parent` = `parentitem`.`id`
-               $sql_extra
-               ORDER BY `parentitem`.`created`  DESC, `item`.`gravity` ASC, `item`.`created` ASC LIMIT %d ,%d ",
-               intval($_SESSION['uid']),
-               intval($a->pager['start']),
-               intval($a->pager['itemspage'])
-       );
+       if($nouveau) {
+               $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+                       `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, 
+                       `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+                       FROM `item`, `contact`
+                       WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+                       AND `contact`.`id` = `item`.`contact-id`
+                       AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                       $sql_extra
+                       ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
+                       intval($_SESSION['uid']),
+                       intval($a->pager['start']),
+                       intval($a->pager['itemspage'])
+               );
+       }
+       else {
+               $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+                       `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, 
+                       `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+                       FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`, `contact` 
+                       WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+                       AND `contact`.`id` = `item`.`contact-id`
+                       AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                       AND `item`.`parent` = `parentitem`.`id`
+                       $sql_extra
+                       ORDER BY `parentitem`.`created`  DESC, `item`.`gravity` ASC, `item`.`created` ASC LIMIT %d ,%d ",
+                       intval($_SESSION['uid']),
+                       intval($a->pager['start']),
+                       intval($a->pager['itemspage'])
+               );
+       }
 
 
        $cmnt_tpl = load_view_file('view/comment_item.tpl');
@@ -158,6 +196,64 @@ function network_content(&$a, $update = 0) {
        
        if(count($r)) {
 
+               if($nouveau) {
+
+                       $tpl = load_view_file('view/search_item.tpl');
+                       $droptpl = load_view_file('view/wall_fake_drop.tpl');
+
+                       foreach($r as $item) {
+
+                               $comment     = '';
+                               $owner_url   = '';
+                               $owner_photo = '';
+                               $owner_name  = '';
+                               $sparkle     = '';
+                       
+                               $profile_name   = ((strlen($item['author-name']))   ? $item['author-name']   : $item['name']);
+                               $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
+                               $profile_link   = ((strlen($item['author-link']))   ? $item['author-link']   : $item['url']);
+
+
+                               $location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
+                               $coord = (($item['coord']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
+                               if($coord) {
+                                       if($location)
+                                               $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
+                                       else
+                                               $location = '<span class="smalltext">' . $coord . '</span>';
+                               }
+
+                               $drop = replace_macros($droptpl,array('$id' => $item['id']));
+                               $lock = '<div class="wall-item-lock"></div>';
+
+                               $o .= replace_macros($tpl,array(
+                                       '$id' => $item['item_id'],
+                                       '$profile_url' => $profile_link,
+                                       '$name' => $profile_name,
+                                       '$sparkle' => $sparkle,
+                                       '$lock' => $lock,
+                                       '$thumb' => $profile_avatar,
+                                       '$title' => $item['title'],
+                                       '$body' => bbcode($item['body']),
+                                       '$ago' => relative_date($item['created']),
+                                       '$location' => $location,
+                                       '$indent' => '',
+                                       '$owner_url' => $owner_url,
+                                       '$owner_photo' => $owner_photo,
+                                       '$owner_name' => $owner_name,
+                                       '$drop' => $drop,
+                                       '$conv' => '<a href="' . $a->get_baseurl() . '/display/' . $item['nickname'] . '/' . $item['id'] . '">' . t('View in context') . '</a>'
+                               ));
+
+                       }
+                       $o .= paginate($a);
+
+                       return $o;
+
+               }
+
+
+
                foreach($r as $item) {
                        like_puller($a,$item,$alike,'like');
                        like_puller($a,$item,$dlike,'dislike');
index 20113e75bcf5c014b1f78d9b1ecb2061e4160f2a..a6a4b613fcb5b87a3cff55dce47f24e2f5ddc516 100644 (file)
@@ -81,6 +81,7 @@ function search_content(&$a) {
 
                foreach($r as $item) {
 
+                       $total       = 0;
                        $comment     = '';
                        $owner_url   = '';
                        $owner_photo = '';
@@ -91,6 +92,8 @@ function search_content(&$a) {
                                && ($item['id'] != $item['parent']))
                                continue;
 
+                       $total ++;
+
                        $profile_name   = ((strlen($item['author-name']))   ? $item['author-name']   : $item['name']);
                        $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
                        $profile_link   = ((strlen($item['author-link']))   ? $item['author-link']   : $item['url']);
@@ -130,6 +133,13 @@ function search_content(&$a) {
                }
        }
 
+
+       if(! $r[0]['total']) {
+               notice('No results.');
+               return $o;
+       }
+
+
        $o .= paginate($a);
 
        return $o;
index 3d75e675718e9f17d634b90590e6f335c5768e86..8b58a6b7a5c8014a046c498ee636ad151a4f22c2 100644 (file)
@@ -249,9 +249,12 @@ $a->strings['Delete conversation'] = 'Delete conversation';
 $a->strings['Message not available.'] = 'Message not available.';
 $a->strings['Delete message'] = 'Delete message';
 $a->strings['Send Reply'] = 'Send Reply';
+$a->strings['Normal View'] = 'Normal View';
+$a->strings['New Item View'] = 'New Item View';
 $a->strings['No such group'] = 'No such group';
 $a->strings['Group is empty'] = 'Group is empty';
 $a->strings['Group: '] = 'Group: ';
+$a->strings['View in context'] = 'View in context';
 $a->strings['Invalid request identifier.'] = 'Invalid request identifier.';
 $a->strings['Discard'] = 'Discard';
 $a->strings['Ignore'] = 'Ignore';
@@ -347,7 +350,6 @@ $a->strings['Register'] = 'Register';
 $a->strings['Please login.'] = 'Please login.';
 $a->strings['Registration revoked for '] = 'Registration revoked for ';
 $a->strings['Account approved.'] = 'Account approved.';
-$a->strings['View in context'] = 'View in context';
 $a->strings['Passwords do not match. Password unchanged.'] = 'Passwords do not match. Password unchanged.';
 $a->strings['Empty passwords are not allowed. Password unchanged.'] = 'Empty passwords are not allowed. Password unchanged.';
 $a->strings['Password changed.'] = 'Password changed.';
index 0457850dc4d0f5680b37d632a590be6a796ce91f..e34b622c65318427a6fa79d5a24f6e8c595febcb 100644 (file)
@@ -1989,3 +1989,10 @@ a.mail-list-link {
 #birthday-wrapper {
        margin-bottom: 20px;
 }
+
+
+#network-new-link {
+       margin-top: 15px;
+       margin-bottom: 15px;
+}
+
index ffe8b1df2ef201e86618ee8e73455b08ce8d0a33..b00f24cc28abb4e1134d515095b8059a1a4abaeb 100644 (file)
@@ -1873,3 +1873,10 @@ a.mail-list-link {
 #birthday-wrapper {
        margin-bottom: 20px;
 }
+
+#network-new-link {
+       margin-top: 15px;
+       margin-bottom: 15px;
+}
+
+