From 38ea8bee935181220e89fd22120865ab63af9da6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 25 Aug 2016 17:43:07 -0700 Subject: ratings are gone. They can be enabled, but there is no UI for doing so at this time; and will likely only be available in a 'pro' configuration once the new implementation details have been hashed out. This appears to require a mechanism for rebuttal before it can again be opened to the public. There are also some synchronisation issues to contend with; as ratings are currently only distributed to active directory servers. There is no reliable mechanism for a new directory server to fetch existing ratings. --- Zotlabs/Module/Connedit.php | 8 ++------ Zotlabs/Module/Directory.php | 2 +- Zotlabs/Module/Pubsites.php | 14 +++++++++++--- Zotlabs/Module/Rate.php | 10 +++------- Zotlabs/Module/Ratings.php | 14 ++++---------- 5 files changed, 21 insertions(+), 27 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 217249469..43feac189 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -663,13 +663,9 @@ class Connedit extends \Zotlabs\Web\Controller { $rating_text = $xl[0]['xlink_rating_text']; } - $poco_rating = get_config('system','poco_rating_enable'); + $rating_enabled = get_config('system','rating_enabled'); - // if unset default to enabled - if($poco_rating === false) - $poco_rating = true; - - if($poco_rating) { + if($rating_enabled) { $rating = replace_macros(get_markup_template('rating_slider.tpl'),array( '$min' => -10, '$val' => $rating_val diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index 560038ffc..84d40a166 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -239,7 +239,7 @@ class Directory extends \Zotlabs\Web\Controller { $page_type = ''; - if($rr['total_ratings']) + if($rr['total_ratings'] && get_config('system','rating_enabled')) $total_ratings = sprintf( tt("%d rating", "%d ratings", $rr['total_ratings']), $rr['total_ratings']); else $total_ratings = ''; diff --git a/Zotlabs/Module/Pubsites.php b/Zotlabs/Module/Pubsites.php index 0dda08e6d..35a305130 100644 --- a/Zotlabs/Module/Pubsites.php +++ b/Zotlabs/Module/Pubsites.php @@ -16,7 +16,9 @@ class Pubsites extends \Zotlabs\Web\Controller { $url = $directory['url'] . '/dirsearch'; } $url .= '/sites'; - + + $rating_enabled = get_config('system','rating_enabled'); + $o .= '
'; $o .= '

' . t('Public Hubs') . '

'; @@ -28,7 +30,10 @@ class Pubsites extends \Zotlabs\Web\Controller { if($ret['success']) { $j = json_decode($ret['body'],true); if($j) { - $o .= ''; + $o .= '
' . t('Hub URL') . '' . t('Access Type') . '' . t('Registration Policy') . '' . t('Stats') . '' . t('Software') . '' . t('Ratings') . '
'; + if($rating_enabled) + $o .= ''; + $o .= ''; if($j['sites']) { foreach($j['sites'] as $jj) { $m = parse_url($jj['url']); @@ -44,7 +49,10 @@ class Pubsites extends \Zotlabs\Web\Controller { $location = '
 '; } $urltext = str_replace(array('https://'), '', $jj['url']); - $o .= '' . $rate_links . ''; + $o .= ''; + if($rating_enabled) + $o .= '' . $rate_links ; + $o .= ''; } } diff --git a/Zotlabs/Module/Rate.php b/Zotlabs/Module/Rate.php index 2f769b36b..c03aaa54f 100644 --- a/Zotlabs/Module/Rate.php +++ b/Zotlabs/Module/Rate.php @@ -119,8 +119,8 @@ class Rate extends \Zotlabs\Web\Controller { // return; // } - $poco_rating = get_config('system','poco_rating_enable'); - if((! $poco_rating) && ($poco_rating !== false)) { + $rating_enabled = get_config('system','rating_enabled'); + if(! $rating_enabled) { notice('Ratings are disabled on this site.'); return; } @@ -141,11 +141,7 @@ class Rate extends \Zotlabs\Web\Controller { $rating_text = ''; } - // if unset default to enabled - if($poco_rating === false) - $poco_rating = true; - - if($poco_rating) { + if($rating_enabled) { $rating = replace_macros(get_markup_template('rating_slider.tpl'),array( '$min' => -10, '$val' => $rating_val diff --git a/Zotlabs/Module/Ratings.php b/Zotlabs/Module/Ratings.php index 969fb5015..055b16ca3 100644 --- a/Zotlabs/Module/Ratings.php +++ b/Zotlabs/Module/Ratings.php @@ -21,12 +21,9 @@ class Ratings extends \Zotlabs\Web\Controller { if($x) $url = $x['url']; - $poco_rating = get_config('system','poco_rating_enable'); - // if unset default to enabled - if($poco_rating === false) - $poco_rating = true; + $rating_enabled = get_config('system','rating_enabled'); - if(! $poco_rating) + if(! $rating_enabled) return; if(argc() > 1) @@ -87,12 +84,9 @@ class Ratings extends \Zotlabs\Web\Controller { return; } - $poco_rating = get_config('system','poco_rating_enable'); - // if unset default to enabled - if($poco_rating === false) - $poco_rating = true; + $rating_enabled = get_config('system','rating_enabled'); - if(! $poco_rating) + if(! $rating_enabled) return; $site_target = ((array_key_exists('target',\App::$data) && array_key_exists('site_url',\App::$data['target'])) ? -- cgit v1.2.3
' . t('Hub URL') . '' . t('Access Type') . '' . t('Registration Policy') . '' . t('Stats') . '' . t('Software') . '' . t('Ratings') . '
' . $urltext . '' . $location . '' . $jj['access'] . '' . $jj['register'] . '' . '' . ucwords($jj['project']) . ' ' . t('View') . '
' . $urltext . '' . $location . '' . $jj['access'] . '' . $jj['register'] . '' . '' . ucwords($jj['project']) . ' ' . t('View') . '