aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-18 17:47:26 -0700
committerfriendica <info@friendica.com>2013-09-18 17:47:26 -0700
commite4d2e2200e04c8df699d9a8efade661123ef7ac8 (patch)
treeeb97cdeb19f72ef9dbddf5074510bf9f82f50632 /mod
parente06b4c6dfc0b3419f35dd8d42770d1c983523830 (diff)
downloadvolse-hubzilla-e4d2e2200e04c8df699d9a8efade661123ef7ac8.tar.gz
volse-hubzilla-e4d2e2200e04c8df699d9a8efade661123ef7ac8.tar.bz2
volse-hubzilla-e4d2e2200e04c8df699d9a8efade661123ef7ac8.zip
add "tiered" access policy, add tagcloud to directory pages
Diffstat (limited to 'mod')
-rw-r--r--mod/directory.php10
-rw-r--r--mod/dirsearch.php9
-rw-r--r--mod/zfinger.php2
3 files changed, 17 insertions, 4 deletions
diff --git a/mod/directory.php b/mod/directory.php
index 823c33cf7..c4305dfde 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -32,6 +32,7 @@ function directory_content(&$a) {
else
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
+ $keywords = (($_GET['keywords']) ? $_GET['keywords'] : '');
$tpl = get_markup_template('directory_header.tpl');
@@ -68,11 +69,14 @@ function directory_content(&$a) {
if($url) {
- $query = $url . '?f=' ;
+ // We might want to make the tagadelic count (&kw=) configurable or turn it off completely.
+ $query = $url . '?f=&kw=24' ;
if($search)
$query .= '&name=' . urlencode($search) . '&keywords=' . urlencode($search);
if(strpos($search,'@'))
$query .= '&address=' . urlencode($search);
+ if($keywords)
+ $query .= '&keywords=' . urlencode($keywords);
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
if($sort_order)
@@ -175,6 +179,10 @@ function directory_content(&$a) {
}
+ if($j['keywords']) {
+ $a->set_widget('dirtagblock',dir_tagblock(z_root() . '/directory',$j['keywords']));
+ }
+
// logger('mod_directory: entries: ' . print_r($entries,true), LOGGER_DATA);
$o .= replace_macros($tpl, array(
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 0a4d0ed2b..a522cd541 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -40,6 +40,7 @@ function dirsearch_content(&$a) {
$keywords = ((x($_REQUEST,'keywords')) ? $_REQUEST['keywords'] : '');
$agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 );
$agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 );
+ $kw = ((x($_REQUEST,'kw')) ? intval($_REQUEST['kw']) : 0 );
$sync = ((x($_REQUEST,'sync')) ? datetime_convert('UTC','UTC',$_REQUEST['sync']) : '');
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
@@ -175,12 +176,12 @@ function dirsearch_content(&$a) {
}
$ret['results'] = $entries;
- if(! $sync) {
- $k = dir_tagadelic(24);
+ if(($kw) && (! $sync)) {
+ $k = dir_tagadelic($kw);
if($k) {
$ret['keywords'] = array();
foreach($k as $kv) {
- $ret['keywords'][] = array('term' => $kv[0],'weight' => $kv[1]);
+ $ret['keywords'][] = array('term' => $kv[0],'weight' => $kv[1], 'normalise' => $kv[2]);
}
}
}
@@ -203,6 +204,8 @@ function list_public_sites() {
$access = 'free';
elseif($rr['site_access'] == ACCESS_PAID)
$access = 'paid';
+ elseif($rr['site_access'] == ACCESS_TIERED)
+ $access = 'tiered';
else
$access = 'private';
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 675b31b1e..e1e19054e 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -226,6 +226,8 @@ function zfinger_init(&$a) {
$ret['site']['access_policy'] = 'paid';
if($access_policy == ACCESS_FREE)
$ret['site']['access_policy'] = 'free';
+ if($access_policy == ACCESS_TIERED)
+ $ret['site']['access_policy'] = 'tiered';
require_once('include/account.php');
$ret['site']['accounts'] = account_total();