personal tab on network page

This commit is contained in:
friendica 2011-11-29 14:35:20 -08:00
parent 3bf192ba08
commit 7b9ba3bb03
4 changed files with 39 additions and 5 deletions

View File

@ -9,9 +9,9 @@ require_once('include/nav.php');
require_once('include/cache.php'); require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1179' ); define ( 'FRIENDICA_VERSION', '2.3.1180' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1106 ); define ( 'DB_UPDATE_VERSION', 1107 );
define ( 'EOL', "<br />\r\n" ); define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View File

@ -248,6 +248,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `last-child` (`last-child`), KEY `last-child` (`last-child`),
KEY `unseen` (`unseen`), KEY `unseen` (`unseen`),
KEY `wall` (`wall`), KEY `wall` (`wall`),
KEY `author-link` (`author-link`),
FULLTEXT KEY `title` (`title`), FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`), FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `tag` (`tag`), FULLTEXT KEY `tag` (`tag`),

View File

@ -63,7 +63,8 @@ function saved_searches($search) {
$srchurl = '/network' $srchurl = '/network'
. ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '')
. ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '') . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '')
. ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : ''); . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '')
. ((x($_GET,'conv')) ? '?conv=' . $_GET['conv'] : '');
$o = ''; $o = '';
@ -118,6 +119,7 @@ function network_content(&$a, $update = 0) {
$bookmarked_active = ''; $bookmarked_active = '';
$all_active = ''; $all_active = '';
$search_active = ''; $search_active = '';
$conv_active = '';
if(($a->argc > 1 && $a->argv[1] === 'new') if(($a->argc > 1 && $a->argv[1] === 'new')
|| ($a->argc > 2 && $a->argv[2] === 'new')) { || ($a->argc > 2 && $a->argv[2] === 'new')) {
@ -136,12 +138,20 @@ function network_content(&$a, $update = 0) {
$bookmarked_active = 'active'; $bookmarked_active = 'active';
} }
if($_GET['conv']) {
$conv_active = 'active';
}
if (($new_active == '') if (($new_active == '')
&& ($starred_active == '') && ($starred_active == '')
&& ($bookmarked_active == '') && ($bookmarked_active == '')
&& ($conv_active == '')
&& ($search_active == '')) { && ($search_active == '')) {
$all_active = 'active'; $all_active = 'active';
} }
$postord_active = ''; $postord_active = '';
if($all_active && x($_GET,'order') && $_GET['order'] !== 'comment') { if($all_active && x($_GET,'order') && $_GET['order'] !== 'comment') {
@ -164,6 +174,11 @@ function network_content(&$a, $update = 0) {
'sel'=>$postord_active, 'sel'=>$postord_active,
), ),
array(
'label' => t('Personal'),
'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&conv=1',
'sel' => $conv_active,
),
array( array(
'label' => t('New'), 'label' => t('New'),
'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''), 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''),
@ -200,6 +215,7 @@ function network_content(&$a, $update = 0) {
$bmark = ((x($_GET,'bmark')) ? intval($_GET['bmark']) : 0); $bmark = ((x($_GET,'bmark')) ? intval($_GET['bmark']) : 0);
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment'); $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment');
$liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0); $liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
$conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
if(($a->argc > 2) && $a->argv[2] === 'new') if(($a->argc > 2) && $a->argv[2] === 'new')
@ -340,6 +356,7 @@ function network_content(&$a, $update = 0) {
. ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '')
. ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
. ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '')
. ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '')
. "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
} }
@ -353,6 +370,17 @@ function network_content(&$a, $update = 0) {
); );
} }
if($conv) {
$myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
$myurl = substr($myurl,strpos($myurl,'://')+3);
$myurl = str_replace('www.','',$myurl);
$sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where `author-link` regexp '%s') ",
dbesc($myurl)
);
}
$r = q("SELECT COUNT(*) AS `total` $r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0

View File

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1106 ); define( 'UPDATE_VERSION' , 1107 );
/** /**
* *
@ -913,4 +913,9 @@ function update_1105() {
} }
function update_1106() {
q("ALTER TABLE `item` ADD INDEX ( `author-link` ) ");
}