aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Connedit.php8
-rw-r--r--Zotlabs/Module/Directory.php2
-rw-r--r--Zotlabs/Module/Pubsites.php14
-rw-r--r--Zotlabs/Module/Rate.php10
-rw-r--r--Zotlabs/Module/Ratings.php14
-rw-r--r--include/channel.php4
-rw-r--r--include/conversation.php7
-rw-r--r--include/features.php2
-rw-r--r--include/widgets.php4
9 files changed, 28 insertions, 37 deletions
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 .= '<div class="generic-content-wrapper">';
$o .= '<div class="section-title-wrapper"><h2>' . t('Public Hubs') . '</h2></div>';
@@ -28,7 +30,10 @@ class Pubsites extends \Zotlabs\Web\Controller {
if($ret['success']) {
$j = json_decode($ret['body'],true);
if($j) {
- $o .= '<table class="table table-striped table-hover"><tr><td>' . t('Hub URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Stats') . '</td><td>' . t('Software') . '</td><td colspan="2">' . t('Ratings') . '</td></tr>';
+ $o .= '<table class="table table-striped table-hover"><tr><td>' . t('Hub URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Stats') . '</td><td>' . t('Software') . '</td>';
+ if($rating_enabled)
+ $o .= '<td colspan="2">' . t('Ratings') . '</td>';
+ $o .= '</tr>';
if($j['sites']) {
foreach($j['sites'] as $jj) {
$m = parse_url($jj['url']);
@@ -44,7 +49,10 @@ class Pubsites extends \Zotlabs\Web\Controller {
$location = '<br />&nbsp;';
}
$urltext = str_replace(array('https://'), '', $jj['url']);
- $o .= '<tr><td><a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" ><i class="fa fa-link"></i> ' . $urltext . '</a>' . $location . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . '<a target="stats" href="https://hubchart-tarine.rhcloud.com/hub.jsp?hubFqdn=' . $m['host'] . '"><i class="fa fa-area-chart"></i></a></td><td>' . ucwords($jj['project']) . '</td><td><a href="ratings/' . $host . '" class="btn-btn-default"><i class="fa fa-eye"></i> ' . t('View') . '</a></td>' . $rate_links . '</tr>';
+ $o .= '<tr><td><a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" ><i class="fa fa-link"></i> ' . $urltext . '</a>' . $location . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . '<a target="stats" href="https://hubchart-tarine.rhcloud.com/hub.jsp?hubFqdn=' . $m['host'] . '"><i class="fa fa-area-chart"></i></a></td><td>' . ucwords($jj['project']) . '</td>';
+ if($rating_enabled)
+ $o .= '<td><a href="ratings/' . $host . '" class="btn-btn-default"><i class="fa fa-eye"></i> ' . t('View') . '</a></td>' . $rate_links ;
+ $o .= '</tr>';
}
}
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'])) ?
diff --git a/include/channel.php b/include/channel.php
index 47db7e806..2c892dbb9 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1103,8 +1103,8 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa
require_once('include/widgets.php');
- if(! feature_enabled($profile['uid'],'hide_rating'))
- $z = widget_rating(array('target' => $profile['channel_hash']));
+// if(! feature_enabled($profile['uid'],'hide_rating'))
+ $z = widget_rating(array('target' => $profile['channel_hash']));
$o .= replace_macros($tpl, array(
'$zcard' => $zcard,
diff --git a/include/conversation.php b/include/conversation.php
index 637234bff..2e056b620 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -941,12 +941,9 @@ function item_photo_menu($item){
$clean_url = normalise_link($item['author-link']);
}
- $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');
- $ratings_url = (($poco_rating) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : '');
+ $ratings_url = (($rating_enabled) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : '');
$post_menu = Array(
t("View Source") => $vsrc_link,
diff --git a/include/features.php b/include/features.php
index a5baddf52..4e86b7881 100644
--- a/include/features.php
+++ b/include/features.php
@@ -55,7 +55,7 @@ function get_features($filtered = true) {
array('profile_export', t('Profile Import/Export'), t('Save and load profile details across sites/channels'),false,get_config('feature_lock','profile_export')),
array('webpages', t('Web Pages'), t('Provide managed web pages on your channel'),false,get_config('feature_lock','webpages')),
array('wiki', t('Wiki'), t('Provide a wiki for your channel'),(($server_role === 'basic') ? false : true),get_config('feature_lock','wiki')),
- array('hide_rating', t('Hide Rating'), t('Hide the rating buttons on your channel and profile pages. Note: People can still rate you somewhere else.'),false,get_config('feature_lock','hide_rating')),
+// array('hide_rating', t('Hide Rating'), t('Hide the rating buttons on your channel and profile pages. Note: People can still rate you somewhere else.'),false,get_config('feature_lock','hide_rating')),
array('private_notes', t('Private Notes'), t('Enables a tool to store notes and reminders (note: not encrypted)'),false,get_config('feature_lock','private_notes')),
array('nav_channel_select', t('Navigation Channel Select'), t('Change channels directly from within the navigation dropdown menu'),false,get_config('feature_lock','nav_channel_select')),
array('photo_location', t('Photo Location'), t('If location data is available on uploaded photos, link this to a map.'),false,get_config('feature_lock','photo_location')),
diff --git a/include/widgets.php b/include/widgets.php
index 68db74703..765cb4d42 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -1286,8 +1286,8 @@ function widget_random_block($arr) {
function widget_rating($arr) {
- $poco_rating = get_config('system','poco_rating_enable');
- if((! $poco_rating) && ($poco_rating !== false)) {
+ $rating_enabled = get_config('system','rating_enabled');
+ if(! $rating_enabled) {
return;
}