From ada8bee70e89c34afa53eff9ad70315cfcd34c6d Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 27 Aug 2011 18:09:43 -0700 Subject: remove public disclosure risk --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 05b74b50a..54fb2a0a4 100644 --- a/mod/network.php +++ b/mod/network.php @@ -188,7 +188,7 @@ function network_content(&$a, $update = 0) { if(count($r)) { $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND `contact-id` IN ( " . intval($cid) . " )) "; $o = '

' . t('Contact: ') . $r[0]['name'] . '

' . $o; - if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['network'] !== NETWORK_FACEBOOK && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { + if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['network'] !== NETWORK_FACEBOOK && $r[0]['network'] !== NETWORK_DIASPORA && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { notice( t('Private messages to this person are at risk of public disclosure.') . EOL); } -- cgit v1.2.3 From 481853d2cc44a4bf6c540e72c741ff453305a925 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 4 Sep 2011 17:35:06 -0700 Subject: saved searches on network page --- mod/network.php | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 54fb2a0a4..663814ab7 100644 --- a/mod/network.php +++ b/mod/network.php @@ -16,8 +16,26 @@ function network_init(&$a) { $search = ((x($_GET,'search')) ? escape_tags($_GET['search']) : ''); $srchurl = '/network' . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : ''); + if(x($_GET,'save')) { + $r = q("select * from `search` where `uid` = %d and `term` = '%s' limit 1", + intval(local_user()), + dbesc($search) + ); + if(! count($r)) { + q("insert into `search` ( `uid`,`term` ) values ( %d, '%s') ", + intval(local_user()), + dbesc($search) + ); + } + } + if(x($_GET,'remove')) { + q("delete from `search` where `uid` = %d and `term` = '%s' limit 1", + intval(local_user()), + dbesc($search) + ); + } - $a->page['aside'] .= search($search,'netsearch-box',$srchurl); + $a->page['aside'] .= search($search,'netsearch-box',$srchurl,true); $a->page['aside'] .= ''; $a->page['aside'] .= group_side('network','network',true,$group_id); + + $a->page['aside'] .= saved_searches(); + +} + +function saved_searches() { + + $o = ''; + + $r = q("select `term` from `search` WHERE `uid` = %d", + intval(local_user()) + ); + + if(count($r)) { + $o .= '

' . t('Saved Searches') . '

' . "\r\n"; + $o .= '
' . "\r\n"; + } + + return $o; + } + + function network_content(&$a, $update = 0) { require_once('include/conversation.php'); -- cgit v1.2.3 From 82f7f33cf58774ac6b07acd64fe0b49cd5b0aa30 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 4 Sep 2011 19:58:03 -0700 Subject: bookmarks + bug #140 --- mod/network.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 663814ab7..1434f5d31 100644 --- a/mod/network.php +++ b/mod/network.php @@ -14,7 +14,10 @@ function network_init(&$a) { $a->page['aside'] = ''; $search = ((x($_GET,'search')) ? escape_tags($_GET['search']) : ''); - $srchurl = '/network' . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : ''); + $srchurl = '/network' + . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') + . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '') + . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : ''); if(x($_GET,'save')) { $r = q("select * from `search` where `uid` = %d and `term` = '%s' limit 1", @@ -114,6 +117,7 @@ function network_content(&$a, $update = 0) { $cid = ((x($_GET['cid'])) ? intval($_GET['cid']) : 0); $star = ((x($_GET['star'])) ? intval($_GET['star']) : 0); + $bmark = ((x($_GET['bmark'])) ? intval($_GET['bmark']) : 0); if(($a->argc > 2) && $a->argv[2] === 'new') $nouveau = true; @@ -174,6 +178,7 @@ function network_content(&$a, $update = 0) { . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') + . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') . "'; var profile_page = " . $a->pager['page'] . "; \r\n"; } @@ -195,6 +200,9 @@ function network_content(&$a, $update = 0) { $star_sql = (($star) ? " AND `starred` = 1 " : ''); + if($bmark) + $star_sql .= " AND `bookmark` = 1 "; + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql ) "; if($group) { -- cgit v1.2.3