Hello everyone,
if only I've found this plugin earlyer
It's so great and it still works with Joomla 1.5.23 and CB 1.4 Krileon, Thank you so much!
I'd like to share an additional rule, which I found very useful for my community. It awards a user for his/her positively voted comments made by JomComment.
1. Open file "cb.autoawardstab.php. Inser following code, for example after the last } in //Hits:
Code:
//JomComment
if ($params->get('jomcomment','0') == 0) {
$query = 'SELECT count(id) FROM #__jomcomment WHERE user_id="'.$user->id.'" AND published = 1 AND voted > 0';
$_CB_database->setQuery($query);
$numComments=$_CB_database->loadResult();
if ($numComments>=1) {
if ($numComments>=$jc1) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc1id
,$jc1reason
);
if ($numComments>=$jc2) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc2id
,$jc2reason
);
if ($numComments>=$jc3) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc3id
,$jc3reason
);
if ($numComments>=$jc4) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc4id
,$jc4reason
);
if ($numComments>=$jc5) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc5id
,$jc5reason
);
if ($numComments>=$jc6) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc6id
,$jc6reason
);
if ($numComments>=$jc7) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc7id
,$jc7reason
);
if ($numComments>=$jc8) {
getAutoAwardsTab::AddAwards(
$user->id
,$jc8id
,$jc8reason
);
}
}
}
}
}
}
}
}
}
}
There are 8 different awards. If you need only 5, then simply remove "jc6" - "jc8"
To get this award, the user must have at least one positive vote on one of his comments. If he has 5 comments with at least 1 positive vote, he'll get the next award, etc. You can make this award a little bit more challenging by changing the number of votes in the query from "> 0" to "> 2" then he will need more than 2 positive votes.
2. Open file cb.autoawardstab.xml and insert following code right after the last </param> (not params) tag:
Code:
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="jomcomment" type="radio" default='1' label="JomComment" description="Grants users awards based on the amount of their positive voted comments.">
<option value='0'>On</option>
<option value='1'>Off</option>
</param>
This will insert the on/off button in the plugin configuration.
3. Open file config.php and insert following code:
Code:
//Comments
$jc1id = "14";
$jc1reason = "Awarded for posting 1 comment with a positive score.";
$jc1 = "1";
$jc2id = "15";
$jc2reason = "Awarded for posting 5 comments with a positive score.";
$jc2 = "5";
$jc3id = "16";
$jc3reason = "Awarded for posting 10 comments with a positive score.";
$jc3 = "10";
$jc4id = "17";
$jc4reason = "Awarded for posting 20 comments with a positive score.";
$jc4 = "20";
$jc5id = "18";
$jc5reason = "Awarded for posting 40 comments with a positive score.";
$jc5 = "40";
$jc6id = "19";
$jc6reason = "Awarded for posting 80 comments with a positive score.";
$jc6 = "80";
$jc7id = "20";
$jc7reason = "Awarded for posting 160 comments with a positive score.";
$jc7 = "160";
$jc8id = "21";
$jc8reason = "Awarded for posting 320 comments with a positive score.";
$jc8 = "320";
Don't forget to replace the numbers in $jc1id - $jc8id with the id of your awards/medals.
Enjoy
And thanks again, Krileon