Sep 6th 2010, 4:41 am:
adil
Joined: May 9th 2010View Profile Send Message
User rating stars many of my members are asking for a member rating stars
I think you got the point but let me explain
1. the member of larger library of blogs gets star for every 20 blogs
2. the popular member of larger no of friends get star for every 50 friends
3. the member of other activities like adding music or videos get star for every 20 or 30 addings
or what ever the mean of rating and the star are placed under his/her photo in his/her profile !!! one rule ... no avatar no rating...
can some one build such a mod and place it on the new directory please
Adil
Sep 6th 2010, 7:28 am:
fashawn
Joined: Sep 1st 2010View Profile Send Message
re: adil Hi adil,
i thing i maybe got something for you in mind =)
I will try the next days to add a point system module for JCow.
The admin can decide what action on your network will give certain points and the user can level up. These points and level are displayed in the user profile and the user gets some sort of badges or awards. Like posting 50 comments, uploading a certain number of photos etc..
Just a small addition i kept in mind from working with an other community script ;)
Greetings
Sebastian
Sep 7th 2010, 6:48 pm:
jadem
Joined: Sep 1st 2010View Profile Send Message
r please.... I need the kind of module you mentioned ( point system/awarding points) my members will love that feature. This point system is available in ELGG and Buddypress so it must be also nice to have it in JCOW
Sep 8th 2010, 9:27 pm:
jumanji
Joined: Sep 2nd 2010View Profile Send Message
@fashawn that sounds great mate!
Oct 18th 2010, 6:15 pm:
adil
Joined: May 9th 2010View Profile Send Message
any ideas yet
Mar 18th 2011, 11:14 pm:
eliz
Joined: Nov 30th 2010View Profile Send Message
sombody knows something about this code ? there is also a votes table on database.is a about a rating pics system, but i dont know where to activate this?
i change var $allow_vote = 1; in story.inc and uncomment code rating (its commented ¡¡) , i have in js all files od straarting and css, but nothing changes in the website.
this is the file i am speaking about:
http://www.phpkode.com/source/p/jcow-sns/includes/libs/story.inc.php
and the same code is in modules/photos
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>';
}
Mar 21st 2011, 11:09 pm:
adil
Joined: May 9th 2010View Profile Send Message
re: eliz I think the code you are talking about is an old code from star system jcow haded very long time agoooo
Mar 22nd 2011, 1:03 am:
eliz
Joined: Nov 30th 2010View Profile Send Message
ok, it s done, i have activated the rating code starring, it works on albums (not pics) and blog posts.
Seems to be cool at the moment... wondering why it was "hidden"
Mar 22nd 2011, 11:46 am:
switch48
Joined: Sep 1st 2010View Profile Send Message
re: eliz Any chance of enlightening us on how you activated it mate..
Mar 22nd 2011, 6:51 pm:
eliz
Joined: Nov 30th 2010View Profile Send Message
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>';
}
that s all
you will see a rating satrs for albums, but just new ones added after making the chnages , so you need to add an album for test. old album will not have this rating option.
Mar 23rd 2011, 4:07 am:
switch48
Joined: Sep 1st 2010View Profile Send Message
re: eliz lol cheers mate that was to easy.
its abit of a ugly rater isnt it :( and it really isnt any use where it is ..
Mar 28th 2011, 2:49 am:
eliz
Joined: Nov 30th 2010View Profile Send Message
its also on blogs and events