ratings - mopping up, most everything but directory sync implemented
This commit is contained in:
parent
5cb2f55dbb
commit
17ffe122b3
@ -16,6 +16,9 @@ function js_strings() {
|
|||||||
'$permschange' => t('Notice: Permissions have changed but have not yet been submitted.'),
|
'$permschange' => t('Notice: Permissions have changed but have not yet been submitted.'),
|
||||||
'$closeAll' => t('close all'),
|
'$closeAll' => t('close all'),
|
||||||
'$nothingnew' => t('Nothing new here'),
|
'$nothingnew' => t('Nothing new here'),
|
||||||
|
'$rating_desc' => t('Rate This Channel (this is public)'),
|
||||||
|
'$rating_val' => t('Rating'),
|
||||||
|
'$rating_text' => t('Describe (optional)'),
|
||||||
|
|
||||||
'$t01' => ((t('timeago.prefixAgo') != 'timeago.prefixAgo') ? t('timeago.prefixAgo') : ''),
|
'$t01' => ((t('timeago.prefixAgo') != 'timeago.prefixAgo') ? t('timeago.prefixAgo') : ''),
|
||||||
'$t02' => ((t('timeago.prefixFromNow') != 'timeago.prefixFromNow') ? t('timeago.prefixFromNow') : ''),
|
'$t02' => ((t('timeago.prefixFromNow') != 'timeago.prefixFromNow') ? t('timeago.prefixFromNow') : ''),
|
||||||
|
@ -180,13 +180,11 @@ function connedit_post(&$a) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$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
|
$r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, 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_channel())
|
intval(local_channel())
|
||||||
@ -324,6 +322,7 @@ function connedit_content(&$a) {
|
|||||||
return login();
|
return login();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$channel = $a->get_channel();
|
||||||
$my_perms = get_channel_default_perms(local_channel());
|
$my_perms = get_channel_default_perms(local_channel());
|
||||||
$role = get_pconfig(local_channel(),'system','permissions_role');
|
$role = get_pconfig(local_channel(),'system','permissions_role');
|
||||||
if($role) {
|
if($role) {
|
||||||
@ -572,6 +571,21 @@ function connedit_content(&$a) {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rating_val = 0;
|
||||||
|
$rating_text = '';
|
||||||
|
|
||||||
|
dbg(1);
|
||||||
|
$xl = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1",
|
||||||
|
dbesc($channel['channel_hash']),
|
||||||
|
dbesc($contact['xchan_hash'])
|
||||||
|
);
|
||||||
|
dbg(0);
|
||||||
|
if($xl) {
|
||||||
|
$rating_val = intval($xl[0]['xlink_rating']);
|
||||||
|
$rating_text = $xl[0]['xlink_rating_text'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$poco_rating = get_config('system','poco_rating_enable');
|
$poco_rating = get_config('system','poco_rating_enable');
|
||||||
|
|
||||||
// if unset default to enabled
|
// if unset default to enabled
|
||||||
@ -581,7 +595,7 @@ function connedit_content(&$a) {
|
|||||||
if($poco_rating) {
|
if($poco_rating) {
|
||||||
$rating = replace_macros(get_markup_template('rating_slider.tpl'),array(
|
$rating = replace_macros(get_markup_template('rating_slider.tpl'),array(
|
||||||
'$min' => -10,
|
'$min' => -10,
|
||||||
'$val' => (($contact['abook_rating']) ? $contact['abook_rating'] : 0),
|
'$val' => $rating_val
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -621,11 +635,11 @@ function connedit_content(&$a) {
|
|||||||
'$viewprof' => t('View Profile'),
|
'$viewprof' => t('View Profile'),
|
||||||
'$clickme' => t('Click to open/close'),
|
'$clickme' => t('Click to open/close'),
|
||||||
'$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 may be public)'),
|
'$lbl_rating' => t('Rating (this information is public)'),
|
||||||
'$lbl_rating_txt' => t('Optionally explain your rating (this information may be public)'),
|
'$lbl_rating_txt' => t('Optionally explain your rating (this information is public)'),
|
||||||
'$rating_txt' => $contact['abook_rating_text'],
|
'$rating_txt' => $rating_text,
|
||||||
'$rating' => $rating,
|
'$rating' => $rating,
|
||||||
'$rating_val' => $contact['abook_rating'],
|
'$rating_val' => $rating_val,
|
||||||
'$slide' => $slide,
|
'$slide' => $slide,
|
||||||
'$tabs' => $t,
|
'$tabs' => $t,
|
||||||
'$tab_str' => $tab_str,
|
'$tab_str' => $tab_str,
|
||||||
|
@ -261,6 +261,8 @@ function directory_content(&$a) {
|
|||||||
'location' => $location,
|
'location' => $location,
|
||||||
'gender' => $gender,
|
'gender' => $gender,
|
||||||
'total_ratings' => $total_ratings,
|
'total_ratings' => $total_ratings,
|
||||||
|
'viewrate' => true,
|
||||||
|
'canrate' => ((local_channel()) ? true : false),
|
||||||
'pdesc' => $pdesc,
|
'pdesc' => $pdesc,
|
||||||
'marital' => $marital,
|
'marital' => $marital,
|
||||||
'homepage' => $homepage,
|
'homepage' => $homepage,
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
function prate_post(&$a) {
|
function prate_post(&$a) {
|
||||||
|
|
||||||
logger('request: ' . print_r($_REQUEST,true));
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(! local_channel())
|
if(! local_channel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -68,28 +63,6 @@ return;
|
|||||||
proc_run('php','include/ratenotif.php','rating',$record);
|
proc_run('php','include/ratenotif.php','rating',$record);
|
||||||
}
|
}
|
||||||
|
|
||||||
$x = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
|
|
||||||
dbesc($target),
|
|
||||||
intval($local_channel())
|
|
||||||
);
|
|
||||||
if($x) {
|
|
||||||
$w = q("update abook set abook_rating = %d, abook_rating_text = '%s' where abook_xchan = '%s' and abook_channel = %d",
|
|
||||||
intval($rating),
|
|
||||||
dbesc($rating_text),
|
|
||||||
dbesc($target),
|
|
||||||
intval(local_channel())
|
|
||||||
);
|
|
||||||
$x = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
|
|
||||||
dbesc($target),
|
|
||||||
intval($local_channel())
|
|
||||||
);
|
|
||||||
if($x) {
|
|
||||||
unset($x[0]['abook_id']);
|
|
||||||
unset($x[0]['abook_account']);
|
|
||||||
unset($x[0]['abook_channel']);
|
|
||||||
build_sync_packet(0, array('abook' => array($x[0])));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,14 +10,24 @@
|
|||||||
float: right;
|
float: right;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
.directory-slider {
|
|
||||||
|
.slider-container {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
width: 100px;
|
|
||||||
}
|
}
|
||||||
.directory-rating-text {
|
|
||||||
|
.rating-text {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.directory-rating-text {
|
||||||
|
width: 90%;
|
||||||
|
margin-left: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.directory-rating-submit {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.directory-photo {
|
.directory-photo {
|
||||||
margin-left: 25px;
|
margin-left: 25px;
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,9 @@ function dirdetails(hash) {
|
|||||||
|
|
||||||
function doRatings(hash) {
|
function doRatings(hash) {
|
||||||
|
|
||||||
var html = '<form action="prate" method="post"><input type="hidden" name="target" value="'+hash+'" /><input id="dir-rating-range" class="directory-slider" type="text" value="0" name="rating" style="display: none;" /><input type="text" name="rating-text" class="directory-rating-text" /><input name="submit" type="submit" value="submit" ></form><div class="clear"></div><script>$("#dir-rating-range").jRange({ from: -10, to: 10, step: 1, width:"100%", showLabels: false, showScale: true, scale : [ "-10","-5","0","5","10" ], onstatechange: function(v) { $("#dir-rating-range").val(v); } });</script>';
|
var html = '<form action="prate" method="post"><input type="hidden" name="target" value="'+hash+'" /><div class="rating-desc">'+aStr['rating_desc']+'</div><input id="dir-rating-range" class="directory-slider" type="text" value="0" name="rating" style="display: none;" /><div class="rating-text">'+aStr['rating_text']+'<input type="text" name="rating-text" class="directory-rating-text" /><br /><input name="submit" class="directory-rating-submit" type="submit" value="submit" ></form><div class="clear"></div><script>$("#dir-rating-range").jRange({ from: -10, to: 10, step: 1, showLabels: false, showScale: true, scale : [ "-10","-5","0","5","10" ], onstatechange: function(v) { $("#dir-rating-range").val(v); } });</script>';
|
||||||
|
|
||||||
$.colorbox({maxwidth: "50%", maxHeight: "50%", html: html });
|
$.colorbox({maxwidth: "50%", maxHeight: "50%", html: html, close: 'X' });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,6 +575,15 @@ footer {
|
|||||||
|
|
||||||
#cboxContent {
|
#cboxContent {
|
||||||
color: $dirpopup_txtcol;
|
color: $dirpopup_txtcol;
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cboxClose {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#colorbox {
|
||||||
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cboxContent a {
|
#cboxContent a {
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
<div class='contact-info'>
|
<div class='contact-info'>
|
||||||
<div class="contact-name" id="directory-name-{{$entry.id}}" ><a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</div>
|
<div class="contact-name" id="directory-name-{{$entry.id}}" ><a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</div>
|
||||||
|
|
||||||
{{*if $entry.rateme*}}
|
{{if $entry.viewrate}}
|
||||||
<div id="dir-rating-wrapper-{{$entry.id}}" class="directory-rating" >{{if $entry.total_ratings}}<a href="ratings/{{$entry.hash}}"><button class="btn btn-default">{{$entry.total_ratings}}</button></a>{{/if}}
|
<div id="dir-rating-wrapper-{{$entry.id}}" class="directory-rating" >{{if $entry.total_ratings}}<a href="ratings/{{$entry.hash}}"><button class="btn btn-default">{{$entry.total_ratings}}</button></a>{{/if}}
|
||||||
<button class="btn btn-default" onclick="doRatings('{{$entry.hash}}'); return false;" ><i class="icon-pencil"></i></button>
|
{{if $entry.canrate}}<button class="btn btn-default" onclick="doRatings('{{$entry.hash}}'); return false;" ><i class="icon-pencil"></i></button>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{*/if*}}
|
{{/if}}
|
||||||
{{if $entry.public_forum}}
|
{{if $entry.public_forum}}
|
||||||
<div class="contact-forum">
|
<div class="contact-forum">
|
||||||
{{$entry.forum_label}} @{{$entry.nickname}}+
|
{{$entry.forum_label}} @{{$entry.nickname}}+
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
'permschange' : "{{$permschange}}",
|
'permschange' : "{{$permschange}}",
|
||||||
'closeAll' : "{{$closeAll}}",
|
'closeAll' : "{{$closeAll}}",
|
||||||
'nothingnew' : "{{$nothingnew}}",
|
'nothingnew' : "{{$nothingnew}}",
|
||||||
|
'rating_desc' : "{{$rating_desc}}",
|
||||||
|
'rating_val' : "{{$rating_val}}",
|
||||||
|
'rating_text' : "{{$rating_text}}",
|
||||||
|
|
||||||
't01' : "{{$t01}}",
|
't01' : "{{$t01}}",
|
||||||
't02' : "{{$t02}}",
|
't02' : "{{$t02}}",
|
||||||
|
Reference in New Issue
Block a user