it s easy, just change from 0 to 1
in includes/story.inc
$allow_vote = 1
in modules/photos
$this->allow_vote = 1;
and uncomment voting code in
modules/photos ( delete / / )
From :
[code]
if ($this->allow_vote && strlen($row['rating']) > 10) {
if ($client['id']) {
$res = sql_query("select * from ".tb()."votes where uid='{$client['id']}' and sid='{$sid}' limit 1");
if (sql_counts($res)) {
$vote_button = '';
$vote_disable = '$("input").rating("readOnly",true);';
}
else {
$vote_button = '<input type="button" style="font-size:10px" value="'.t('Submit').'" id="sendrate" />';
$vote_disable = '';
}
}
else {
$vote_button = '';
$vote_disable = '$("input").rating("readOnly",true);';
}
$story .= '<div id="rating_box">
<script src="'.uhome().'/js/starrating/jquery.MetaData.js" type="text/javascript" language="javascript"></script>
<script src="'.uhome().'/js/starrating/jquery.rating.js" type="text/javascript" language="javascript"></script>
<link href="'.uhome().'/js/starrating/jquery.rating.css" type="text/css" rel="stylesheet"/>
<form id="starrate">
<table border="0">
<td>';
$ratings = unserialize($row['rating']);
if (!is_array($ratings)) $ratings = array();
foreach ($ratings as $key=>$rating) {
$ratecheck = array();
if ($rating['users']) {
$rate = ceil($rating['score']/$rating['users']);
}
else {
$rate = 0;
}
$ratecheck[$rate] = 'checked';
$story .= '
<div style="width:100%;clear:both">'.$this->vote_options[$key].'</div>
<div style="width:100%;clear:both">
<input type="radio" class="star {split:2}" name="'.$key.'" value="1" '.$ratecheck['1'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="2" '.$ratecheck['2'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="3" '.$ratecheck['3'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="4" '.$ratecheck['4'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="5" '.$ratecheck['5'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="6" '.$ratecheck['6'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="7"/ '.$ratecheck['7'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="8"/ '.$ratecheck['8'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="9"/ '.$ratecheck['9'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="10"/ '.$ratecheck['10'].' >
</div>
';
}
$story .= '
</td>
<td>
<span id="sendbox">'.$vote_button.'</span>
<span id="votesnum" class="sub">'.$row['dugg'].'</span> <span class="sub">vote(s)</span>
</td>
</table>
<script>
$(document).ready( function(){
'.$vote_disable.'
$("#sendrate").click(function() {
$("#sendbox").html("<img src=\''.$uhome.'/files/loading.gif\' width=16 height=16 />");
$("input").rating("readOnly",true);
$.post("'.$uhome.'/index.php?p=jquery/ratestory",{
rate:$("form#starrate").serialize(),
sid:$("#story_id").val()},
function(data) {
$("#sendbox").html("sent");
$("#votesnum").html(data);
},\'html\');
return false;
});
});
</script>
';
$story .= '</div>';
}
if (is_array($this->story_opts)) {
$story .= '<script>
$(document).ready( function(){
$("#add_to_favorite").click(function() {
$("#add_to_favorite").replaceWith("<img id=\'add_to_favorite\' src=\''.$uhome.'/files/loading.gif\' width=16 height=16 />");
$.post("'.$uhome.'/index.php?p=jquery/favoriteadd",{sid:$("#story_id").val()},function(data) {
$("#add_to_favorite").replaceWith(data);
},\'html\');
});
});
</script>
<table border="0"><tr>';
$story .= '</tr></table>';
}
[/code]
that s all
you will see a rating satrs for albums, but [b] just new ones added after making the chnages[/b] , so you need to add an album for test. old album will not have this rating option.
|