editing stuff for poco reputation
This commit is contained in:
parent
1c9299ed42
commit
e7932d97a2
@ -107,6 +107,14 @@ function connedit_post(&$a) {
|
|||||||
if($closeness < 0)
|
if($closeness < 0)
|
||||||
$closeness = 99;
|
$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;
|
$abook_my_perms = 0;
|
||||||
|
|
||||||
foreach($_POST as $k => $v) {
|
foreach($_POST as $k => $v) {
|
||||||
@ -125,11 +133,13 @@ function connedit_post(&$a) {
|
|||||||
$new_friend = true;
|
$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",
|
where abook_id = %d AND abook_channel = %d",
|
||||||
dbesc($profile_id),
|
dbesc($profile_id),
|
||||||
intval($abook_my_perms),
|
intval($abook_my_perms),
|
||||||
intval($closeness),
|
intval($closeness),
|
||||||
|
intval($rating),
|
||||||
|
dbesc($rating_text),
|
||||||
intval($abook_flags),
|
intval($abook_flags),
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
@ -561,8 +571,11 @@ function connedit_content(&$a) {
|
|||||||
'$buttons' => (($self) ? '' : $buttons),
|
'$buttons' => (($self) ? '' : $buttons),
|
||||||
'$viewprof' => t('View Profile'),
|
'$viewprof' => t('View Profile'),
|
||||||
'$lbl_slider' => t('Slide to adjust your degree of friendship'),
|
'$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' => $rating,
|
||||||
|
'$rating_val' => $contact['abook_rating'],
|
||||||
'$slide' => $slide,
|
'$slide' => $slide,
|
||||||
'$tabs' => $t,
|
'$tabs' => $t,
|
||||||
'$tab_str' => $tab_str,
|
'$tab_str' => $tab_str,
|
||||||
|
@ -52,6 +52,15 @@
|
|||||||
width: 600px !important;
|
width: 600px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#rating-slider {
|
||||||
|
width: 600px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rating-text {
|
||||||
|
width: 400px;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
.abook-edit-them, .abook-edit-me {
|
.abook-edit-them, .abook-edit-me {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
{{$rating}}
|
{{$rating}}
|
||||||
|
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -65,6 +66,7 @@
|
|||||||
|
|
||||||
<input type="hidden" name="contact_id" value="{{$contact_id}}">
|
<input type="hidden" name="contact_id" value="{{$contact_id}}">
|
||||||
<input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" />
|
<input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" />
|
||||||
|
<input id="contact-rating-mirror" type="hidden" name="rating" value="{{$rating_val}}" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -74,6 +76,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $notself}}
|
||||||
|
<h3 class="abook-rating-text-desc">{{$lbl_rating_txt}}</h3>
|
||||||
|
<textarea name="rating_text" id="rating-text" >{{$rating_txt}}</textarea>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
{{if $multiprofs }}
|
{{if $multiprofs }}
|
||||||
<div>
|
<div>
|
||||||
<h3>{{$lbl_vis1}}</h3>
|
<h3>{{$lbl_vis1}}</h3>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div id="rating-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="rating-range" type="text" name="fake-rating" value="{{$val}}" /></div>
|
<div id="rating-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="rating-range" type="text" name="fake-rating" value="{{$val}}" /></div>
|
||||||
<script>
|
<script>
|
||||||
$("#rating-range").jRange({ from: {{$min|default:'-10'}}, to: 10, step: 1, width:'100%', showLabels: false, onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
|
$("#rating-range").jRange({ from: -10, to: 10, step: 1, width:'100%', showLabels: false, showScale: true, scale : [ '-10','-8','-6','-4','-2','0','2','4','6','8','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user