From a36cc949a1d4c106cd02ec8386c24bf964369571 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 14 Sep 2013 16:11:15 -0700 Subject: this might fix "find channels" but I can't test the keyword search until this is running on a production site. --- mod/directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/directory.php') 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); -- cgit v1.2.3 From e4d2e2200e04c8df699d9a8efade661123ef7ac8 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 18 Sep 2013 17:47:26 -0700 Subject: add "tiered" access policy, add tagcloud to directory pages --- mod/directory.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod/directory.php') 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( -- cgit v1.2.3 From 49cfca4b4cc60f332024a048a80e61e1fb39eb0f Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 20 Sep 2013 02:38:59 +0100 Subject: Make $kw configurable. --- mod/directory.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mod/directory.php') diff --git a/mod/directory.php b/mod/directory.php index c4305dfde..c3c1a30d5 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -70,7 +70,10 @@ function directory_content(&$a) { if($url) { // We might want to make the tagadelic count (&kw=) configurable or turn it off completely. - $query = $url . '?f=&kw=24' ; + $numtags = $a->config['system']['directorytags']; + + $kw = ((intval($numtags)) ? $numtags : 24); + $query = $url . '?f=&kw=' . $kw; if($search) $query .= '&name=' . urlencode($search) . '&keywords=' . urlencode($search); if(strpos($search,'@')) -- cgit v1.2.3 From 30f85a19b1bee0ffaf2505db8d48f647dfee9ad1 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 20 Sep 2013 03:24:38 +0100 Subject: Use get_config --- mod/directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/directory.php') diff --git a/mod/directory.php b/mod/directory.php index c3c1a30d5..cc4e7e81f 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -70,7 +70,7 @@ function directory_content(&$a) { if($url) { // We might want to make the tagadelic count (&kw=) configurable or turn it off completely. - $numtags = $a->config['system']['directorytags']; + $numtags = get_config('system','directorytags'); $kw = ((intval($numtags)) ? $numtags : 24); $query = $url . '?f=&kw=' . $kw; -- cgit v1.2.3 From 977b350866f9abecf409fbf4556c1e1e3e288a14 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 19 Sep 2013 21:45:09 -0700 Subject: bring safe mode to the client side --- mod/directory.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mod/directory.php') diff --git a/mod/directory.php b/mod/directory.php index cc4e7e81f..dfc0efc88 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -24,6 +24,17 @@ function directory_content(&$a) { return; } + $safe_mode = 1; + + if(local_user()) { + $safe_mode = get_pconfig(local_user(),'directory','safe_mode'); + } + if($safe_mode === false) + $safe_mode = 1; + else + $safe_mode = intval($safe_mode); + + $o = ''; nav_set_selected('directory'); @@ -73,7 +84,7 @@ function directory_content(&$a) { $numtags = get_config('system','directorytags'); $kw = ((intval($numtags)) ? $numtags : 24); - $query = $url . '?f=&kw=' . $kw; + $query = $url . '?f=&kw=' . $kw . (($safe_mode != 1) ? '&safe=' . $safe_mode : ''); if($search) $query .= '&name=' . urlencode($search) . '&keywords=' . urlencode($search); if(strpos($search,'@')) -- cgit v1.2.3 From e81db4428d32839a7920f971f947757de64e0a9c Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 19 Sep 2013 21:48:55 -0700 Subject: now bring it to the url --- mod/directory.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/directory.php') diff --git a/mod/directory.php b/mod/directory.php index dfc0efc88..629174560 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -34,6 +34,8 @@ function directory_content(&$a) { else $safe_mode = intval($safe_mode); + if(x($_REQUEST,'safe') + $safe_mode = intval($_REQUEST['safe']); $o = ''; nav_set_selected('directory'); -- cgit v1.2.3 From 53de5f348a019d6a19ccca49a811c1985d094126 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 19 Sep 2013 21:51:52 -0700 Subject: typo --- mod/directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/directory.php') diff --git a/mod/directory.php b/mod/directory.php index 629174560..195ca993e 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -34,7 +34,7 @@ function directory_content(&$a) { else $safe_mode = intval($safe_mode); - if(x($_REQUEST,'safe') + if(x($_REQUEST,'safe')) $safe_mode = intval($_REQUEST['safe']); $o = ''; -- cgit v1.2.3