diff options
author | Thomas Willingham <founder@kakste.com> | 2013-06-16 14:59:17 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-06-16 14:59:17 +0100 |
commit | 33696cc8392daeb08d011aa3b1209f3b121898ea (patch) | |
tree | 466d48f5abc1a4ec1dbf83543471a8ac89428516 /mod | |
parent | 466a6d5227fbaf0a36cd76b5603cb42bb1b7462b (diff) | |
parent | c4c80a2e472173dfed9b982c6705ccfbb6e6cdab (diff) | |
download | volse-hubzilla-33696cc8392daeb08d011aa3b1209f3b121898ea.tar.gz volse-hubzilla-33696cc8392daeb08d011aa3b1209f3b121898ea.tar.bz2 volse-hubzilla-33696cc8392daeb08d011aa3b1209f3b121898ea.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod')
-rw-r--r-- | mod/acl.php | 21 | ||||
-rw-r--r-- | mod/dirsearch.php | 4 | ||||
-rw-r--r-- | mod/feed.php | 7 | ||||
-rw-r--r-- | mod/import.php | 9 | ||||
-rw-r--r-- | mod/item.php | 26 | ||||
-rw-r--r-- | mod/message.php | 9 |
6 files changed, 50 insertions, 26 deletions
diff --git a/mod/acl.php b/mod/acl.php index 2f1866f85..df6de13b2 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -123,7 +123,7 @@ function acl_init(&$a){ } if ($type=='' || $type=='c') { - $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick + $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2 order by xchan_name asc" , intval(local_user()), @@ -142,7 +142,7 @@ function acl_init(&$a){ ); } elseif($type == 'a') { - $r = q("SELECT abook_id as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag FROM abook left join xchan on abook_xchan = xchan_hash + $r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d $sql_extra3 ORDER BY xchan_name ASC ", @@ -196,13 +196,15 @@ function acl_init(&$a){ if(count($r)) { foreach($r as $g){ $contacts[] = array( - "type" => "c", - "photo" => $g['micro'], - "name" => $g['name'], - "id" => $g['id'], - "xid" => $g['hash'], - "link" => $g['nick'], - "nick" => substr($g['nick'],0,strpos($g['nick'],'@')) + "type" => "c", + "photo" => $g['micro'], + "name" => $g['name'], + "id" => $g['id'], + "xid" => $g['hash'], + "link" => $g['nick'], + "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), + "network" => '', + "taggable" => (($g['abook_their_perms'] & PERMS_W_TAGWALL) ? 'taggable' : '') ); } } @@ -251,6 +253,7 @@ function navbar_complete(&$a) { } if(! $url) { + require_once("include/dir_fns.php"); $directory = find_upstream_directory($dirmode); if($directory) { diff --git a/mod/dirsearch.php b/mod/dirsearch.php index c7fa8a9d8..5465e11ff 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -23,6 +23,7 @@ function dirsearch_content(&$a) { } $name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''); + $hub = ((x($_REQUEST,'hub')) ? $_REQUEST['hub'] : ''); $address = ((x($_REQUEST,'address')) ? $_REQUEST['address'] : ''); $locale = ((x($_REQUEST,'locale')) ? $_REQUEST['locale'] : ''); $region = ((x($_REQUEST,'region')) ? $_REQUEST['region'] : ''); @@ -38,6 +39,8 @@ function dirsearch_content(&$a) { if($name) $sql_extra .= " OR xchan_name like '" . protect_sprintf( '%' . dbesc($name) . '%' ) . "' "; + if($hub) + $sql_extra .= " OR xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') "; if($address) $sql_extra .= " OR xchan_addr like '" . protect_sprintf( '%' . dbesc($address) . '%' ) . "' "; if($city) @@ -96,7 +99,6 @@ function dirsearch_content(&$a) { $order = " ORDER BY `xchan_name` ASC "; - $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) $order $qlimit ", intval(XCHAN_FLAGS_HIDDEN) ); diff --git a/mod/feed.php b/mod/feed.php index a6adc620e..104208875 100644 --- a/mod/feed.php +++ b/mod/feed.php @@ -13,7 +13,7 @@ function feed_init(&$a) { $channel = ''; if(argc() > 1) { - $r = q("select * from channel where channel_address = '%s' limit 1", + $r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", dbesc(argv(1)) ); if(!($r && count($r))) @@ -21,11 +21,6 @@ function feed_init(&$a) { $channel = $r[0]; - // check site and channel permissions - - if(!($channel['channel_r_stream'] & PERMS_PUBLIC)) - killme(); - if((intval(get_config('system','block_public'))) && (! get_account_id())) killme(); diff --git a/mod/import.php b/mod/import.php index d1b3216d0..1bc61da43 100644 --- a/mod/import.php +++ b/mod/import.php @@ -5,9 +5,13 @@ require_once('include/Contact.php'); require_once('include/zot.php'); +require_once('include/identity.php'); function import_post(&$a) { + if(! $a->get_account()) { + return; + } $data = null; $seize = ((x($_REQUEST,'make_primary')) ? intval($_REQUEST['make_primary']) : 0); @@ -22,6 +26,7 @@ function import_post(&$a) { if($filesize) { $data = @file_get_contents($src); } + unlink($src); } if(! $src) { @@ -326,6 +331,10 @@ function import_post(&$a) { function import_content(&$a) { + if(! $a->get_account()) { + notice( t('You must be logged in to use this feature.')); + return ''; + } $o = replace_macros(get_markup_template('channel_import.tpl'),array( '$title' => t('Import Channel'), diff --git a/mod/item.php b/mod/item.php index b09ee06f3..ed5941d2a 100644 --- a/mod/item.php +++ b/mod/item.php @@ -799,15 +799,23 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { if(strpos($tag,'[zrl=')) //...do nothing return $replaced; - //base tag has the tags name only - $basetag = str_replace('_',' ',substr($tag,1)); - //create text for link - $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); - $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; - //replace tag by the link - $body = str_replace($tag, $newtag, $body); - $replaced = true; - + if($tag == '#getzot') { + $basetag = 'getzot'; + $url = 'http://getzot.com'; + $newtag = '#[zrl=' . $url . ']' . $basetag . '[/zrl]'; + $body = str_replace($tag,$newtag,$body); + $replace = true; + } + else { + //base tag has the tags name only + $basetag = str_replace('_',' ',substr($tag,1)); + //create text for link + $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); + $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; + //replace tag by the link + $body = str_replace($tag, $newtag, $body); + $replaced = true; + } //is the link already in str_tags? if(! stristr($str_tags,$newtag)) { //append or set str_tags diff --git a/mod/message.php b/mod/message.php index 93b5c2494..54615f081 100644 --- a/mod/message.php +++ b/mod/message.php @@ -9,13 +9,20 @@ require_once('include/Contact.php'); function message_aside(&$a) { - $a->set_widget('newmessage',replace_macros(get_markup_template('message_side.tpl'), array( + $a->set_widget('msgaside',replace_macros(get_markup_template('message_side.tpl'), array( '$tabs'=> array(), + + '$check'=>array( + 'label' => t('Check Mail'), + 'url' => $a->get_baseurl(true) . '/message', + 'sel' => (argv(1) == ''), + ), '$new'=>array( 'label' => t('New Message'), 'url' => $a->get_baseurl(true) . '/message/new', 'sel'=> (argv(1) == 'new'), ) + ))); } |