diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/admin.php | 16 | ||||
-rw-r--r-- | mod/channel.php | 23 | ||||
-rw-r--r-- | mod/directory.php | 2 | ||||
-rw-r--r-- | mod/dirfind.php | 68 | ||||
-rw-r--r-- | mod/dirsearch.php | 19 | ||||
-rw-r--r-- | mod/editblock.php | 1 | ||||
-rw-r--r-- | mod/editlayout.php | 1 | ||||
-rw-r--r-- | mod/editwebpage.php | 1 | ||||
-rw-r--r-- | mod/fbrowser.php | 3 | ||||
-rw-r--r-- | mod/photos.php | 5 | ||||
-rw-r--r-- | mod/zfinger.php | 11 |
11 files changed, 57 insertions, 93 deletions
diff --git a/mod/admin.php b/mod/admin.php index fb1a9ab53..455897f6f 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -54,6 +54,9 @@ function admin_post(&$a){ case 'logs': admin_page_logs_post($a); break; + case 'hubloc': + admin_page_hubloc_post($a); + break; case 'dbsync': admin_page_dbsync_post($a); break; @@ -84,6 +87,7 @@ function admin_content(&$a) { 'users' => Array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"), 'plugins'=> Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"), 'themes' => Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"), + 'hubloc' => Array($a->get_baseurl(true)."/admin/hubloc/", t("Server") , "server"), 'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync") ); @@ -132,6 +136,9 @@ function admin_content(&$a) { case 'themes': $o = admin_page_themes($a); break; + case 'hubloc': + $o = admin_page_hubloc($a); + break; case 'logs': $o = admin_page_logs($a); break; @@ -443,6 +450,15 @@ function admin_page_site(&$a) { )); } +function admin_page_hubloc_post(&$a){ + check_form_security_token_redirectOnErr('/admin/hubloc', 'hubloc'); + return; +} + +function admin_page_hubloc(&$a) { + $o = ''; + return $o; +} function admin_page_dbsync(&$a) { diff --git a/mod/channel.php b/mod/channel.php index 652084cf0..5a66f5e07 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -64,17 +64,18 @@ function channel_content(&$a, $update = 0, $load = false) { $category = $datequery = $datequery2 = ''; - if(argc() > 2) { - for($x = 2; $x < argc(); $x ++) { - if(is_a_date_arg(argv($x))) { - if($datequery) - $datequery2 = escape_tags(argv($x)); - else - $datequery = escape_tags(argv($x)); - } - } - } - + // if(argc() > 2) { + // for($x = 2; $x < argc(); $x ++) { + // if(is_a_date_arg(argv($x))) { + // if($datequery) + // $datequery2 = escape_tags(argv($x)); + // else + // $datequery = escape_tags(argv($x)); + // } + // } + // } + $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : ''); + $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : ''); if(get_config('system','block_public') && (! get_account_id()) && (! remote_user())) { return login(); diff --git a/mod/directory.php b/mod/directory.php index b7cdaffe7..823c33cf7 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -70,7 +70,7 @@ function directory_content(&$a) { if($url) { $query = $url . '?f=' ; if($search) - $query .= '&name=' . urlencode($search); + $query .= '&name=' . urlencode($search) . '&keywords=' . urlencode($search); if(strpos($search,'@')) $query .= '&address=' . urlencode($search); diff --git a/mod/dirfind.php b/mod/dirfind.php deleted file mode 100644 index 54bbf31af..000000000 --- a/mod/dirfind.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -function dirfind_init(&$a) { - - require_once('include/contact_widgets.php'); - - if(! x($a->page,'aside')) - $a->page['aside'] = ''; - - $a->page['aside'] .= follow_widget(); - - $a->page['aside'] .= findpeople_widget(); -} - - - -function dirfind_content(&$a) { - - $search = notags(trim($_REQUEST['search'])); - - if(strpos($search,'@') === 0) - $search = substr($search,1); - - $o = ''; - - $o .= '<h2>' . t('People Search') . ' - ' . $search . '</h2>'; - - if($search) { - - $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : ''); - - if(strlen(get_config('system','directory_submit_url'))) - $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p . '&search=' . urlencode($search)); - -//TODO fallback local search if global dir not available. -// else -// $x = post_url($a->get_baseurl() . '/lsearch', $params); - - $j = json_decode($x); - - if($j->total) { - $a->set_pager_total($j->total); - $a->set_pager_itemspage($j->items_page); - } - - if(count($j->results)) { - - $tpl = get_markup_template('match.tpl'); - foreach($j->results as $jj) { - - $o .= replace_macros($tpl,array( - '$url' => zid($jj->url), - '$name' => $jj->name, - '$photo' => $jj->photo, - '$tags' => $jj->tags - )); - } - } - else { - info( t('No matches') . EOL); - } - - } - - $o .= '<div class="clear"></div>'; - $o .= paginate($a); - return $o; -} diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 6034fdc12..04d77a298 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -41,6 +41,7 @@ function dirsearch_content(&$a) { $agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 ); $agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 ); + $sync = ((x($_REQUEST,'sync')) ? datetime_convert('UTC','UTC',$_REQUEST['sync']) : ''); $sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : ''); // TODO - a meta search which joins all of these things to one search string @@ -82,6 +83,7 @@ function dirsearch_content(&$a) { $limit = (($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 0); $return_total = ((x($_REQUEST,'return_total')) ? intval($_REQUEST['return_total']) : 0); + // mtime is not currently working $mtime = ((x($_REQUEST,'mtime')) ? datetime_convert('UTC','UTC',$_REQUEST['mtime']) : ''); @@ -124,11 +126,19 @@ function dirsearch_content(&$a) { $order = " order by xchan_name asc "; + if($sync) { - $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $order $qlimit ", - intval(XCHAN_FLAGS_HIDDEN), - intval(XCHAN_FLAGS_ORPHAN) - ); + $r = q("select xchan.*, updates.* from xchan left join updates on ud_hash = xchan_hash where ud_date >= '%s' and ud_guid != '' order by ud_date desc", + dbesc($sync) + ); + + } + else { + $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $order $qlimit ", + intval(XCHAN_FLAGS_HIDDEN), + intval(XCHAN_FLAGS_ORPHAN) + ); + } $ret['page'] = $page + 1; $ret['records'] = count($r); @@ -145,6 +155,7 @@ function dirsearch_content(&$a) { $entry['hash'] = $rr['xchan_hash']; $entry['updated'] = (($rr['ud_date']) ? $rr['ud_date'] : '0000-00-00 00:00:00'); + $entry['update_guid'] = (($rr['ud_guid']) ? $rr['ud_guid'] : ''); $entry['url'] = $rr['xchan_url']; $entry['photo'] = $rr['xchan_photo_m']; $entry['address'] = $rr['xchan_addr']; diff --git a/mod/editblock.php b/mod/editblock.php index 48136b126..a111f6666 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -1,4 +1,3 @@ - <?php // What is this here for? I think it's cruft, but comment out for now in case it's here for a reason diff --git a/mod/editlayout.php b/mod/editlayout.php index 474244653..7bcd02512 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -1,4 +1,3 @@ - <?php // What is this here for? I think it's cruft, but comment out for now in case it's here for a reason diff --git a/mod/editwebpage.php b/mod/editwebpage.php index ea07a3758..44ac0bc85 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -1,4 +1,3 @@ - <?php // Required for setting permissions. (FIXME) diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 31004c0d8..baacfe56b 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -53,7 +53,8 @@ function fbrowser_content($a){ function files1($rr){ global $a; - $types = Photo::supportedTypes(); + $ph = photo_factory(''); + $types = $ph->supportedTypes(); $ext = $types[$rr['type']]; if($a->get_template_engine() === 'internal') { diff --git a/mod/photos.php b/mod/photos.php index d60029688..217f9785f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1064,6 +1064,7 @@ function photos_content(&$a) { if($can_post || $a->data['perms']['post_comments']) { $comments .= replace_macros($cmnt_tpl,array( '$return_path' => '', + '$mode' => 'photos', '$jsreload' => $return_url, '$type' => 'wall-comment', '$id' => $link_item['id'], @@ -1127,10 +1128,12 @@ function photos_content(&$a) { $name_e = $profile_name; $title_e = $item['title']; - $body_e = bbcode($item['body']); + unobscure($item); + $body_e = prepare_text($item['body'],$item['mimetype']); $comments .= replace_macros($template,array( '$id' => $item['item_id'], + '$mode' => 'photos', '$profile_url' => $profile_link, '$name' => $name_e, '$thumb' => $profile_avatar, diff --git a/mod/zfinger.php b/mod/zfinger.php index 36c1cc493..70e3bdca6 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -106,10 +106,13 @@ function zfinger_init(&$a) { if($p[0]['keywords']) { $tags = array(); $k = explode(' ',$p[0]['keywords']); - if($k) - foreach($k as $kk) - if(trim($kk)) - $tags[] = trim($kk); + if($k) { + foreach($k as $kk) { + if(trim($kk)) { + $tags[] = trim($kk," \t\n\r\0\x0B,"); + } + } + } if($tags) $profile['keywords'] = $tags; } |