From e7932d97a25bf621082e93f47816a2a107a6d05f Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 Jan 2015 16:37:47 -0800 Subject: editing stuff for poco reputation --- mod/connedit.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index cf6ff6aad..87d5e9eca 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -107,6 +107,14 @@ function connedit_post(&$a) { if($closeness < 0) $closeness = 99; + $rating = intval($_POST['rating']); + if($rating < (-10)) + $rating = (-10); + if($rating > 10) + $rating = 10; + + $rating_text = escape_tags($_REQUEST['rating_text']); + $abook_my_perms = 0; foreach($_POST as $k => $v) { @@ -125,11 +133,13 @@ function connedit_post(&$a) { $new_friend = true; } - $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_flags = %d + $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_rating = %d, abook_rating_text = '%s', abook_flags = %d where abook_id = %d AND abook_channel = %d", dbesc($profile_id), intval($abook_my_perms), intval($closeness), + intval($rating), + dbesc($rating_text), intval($abook_flags), intval($contact_id), intval(local_user()) @@ -561,8 +571,11 @@ function connedit_content(&$a) { '$buttons' => (($self) ? '' : $buttons), '$viewprof' => t('View Profile'), '$lbl_slider' => t('Slide to adjust your degree of friendship'), - '$lbl_rating' => t('Rating (this information is public)'), + '$lbl_rating' => t('Rating (this information may be public)'), + '$lbl_rating_txt' => t('Optionally explain your rating (this information may be public)'), + '$rating_txt' => $contact['abook_rating_text'], '$rating' => $rating, + '$rating_val' => $contact['abook_rating'], '$slide' => $slide, '$tabs' => $t, '$tab_str' => $tab_str, -- cgit v1.2.3