Skip to Content Skip to Menu

Plugin - jAwards AutoReward

  • piersol
  • piersol
  • OFFLINE
  • Posts: 36
  • Thanks: 0
  • Karma: 5
16 years 1 month ago #76575 by piersol
Replied by piersol on topic Re:Plugin - jAwards AutoReward
to add a lil more info here, i installed a module and cb plugin for j 1.5 that i have attached that auto awards a medal to the user with the most profile views during a set period of time.

1.)perhaps you can compare code to see the difference between your plugin and this module, to see if that helps.

2.)when i tested this, i had one award for groups that are authors. as stated before, it displays this award if added manually but will not auto create the award for me. BUT, a 2nd award given for winning the popularity contest, which DOES get awarded automatically also appears in the same tab. In my case, thats no so bad. I just thought it was unique that it showed ALL awards in this tab, not just the one outlined in the plugin.

Ive attached these working modules and plugin for j1.5.

Attachment mod_cb_popularitycontestSUITE_J15_UNZIPFIRST.zip not found

Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
16 years 1 month ago #76580 by krileon
Replied by krileon on topic Re:Plugin - jAwards AutoReward
Sorry for the delay. Kids buggin' me all day, lol.

I've dug and dug and honestly I can not figure it out.

Have you tried any of the other awards to test and see if they automatically award?

I'm not sure if it's $user or maybe even strtolower.

It should work just fine, but something is causing it to go screwy.

Can you see if any of the other awards auto award for me? This way I can isolate it down.

Also are you making sure you log off then log back in? The awards are only auto-granted upon login. It also will not grant the award if you already have the award according the jawards database.

Try this..

Open cb.autoawards.php

Locate line 411
[code:1]
$mods = strtolower($user->usertype) == ''.$params->get('modsgroup','').'';
[/code:1]

Change it to:
[code:1]
$mods = (strtolower($user->usertype) == ''.$params->get('modsgroup','').'');
[/code:1]

THEN see if it works.

Post edited by: krileon, at: 2008/10/07 02:53


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • sunnyjey
  • sunnyjey
  • OFFLINE
  • Posts: 41
  • Thanks: 0
  • Karma: 4
16 years 1 month ago #76600 by sunnyjey
Replied by sunnyjey on topic Re:Plugin - jAwards AutoReward
Thank you Krileon,

It is working now. Thanks a lot for taking time and modifying plugin as per my request.

Sorry for my late reply. I was out of the town

Please Log in or Create an account to join the conversation.

  • piersol
  • piersol
  • OFFLINE
  • Posts: 36
  • Thanks: 0
  • Karma: 5
16 years 1 month ago #76643 by piersol
Replied by piersol on topic Re:Plugin - jAwards AutoReward
I will make the change you mentioned. before i do, as i mentioned in the previous post I am able to get the popularity contest module to work and autoaward the winner of the contest an award. so the concept does work.

I attached the module and plugin that is working to a previous post so you can compare the code.

Please Log in or Create an account to join the conversation.

  • piersol
  • piersol
  • OFFLINE
  • Posts: 36
  • Thanks: 0
  • Karma: 5
16 years 1 month ago #76656 by piersol
Replied by piersol on topic Re:Plugin - jAwards AutoReward
It seems you gave the same code twice for the find and then change.

[code:1]$mods = strtolower($user->usertype) == ''.$params->get('modsgroup','').'';[/code:1]

any other ideas?

just to bring focus, this issue seems related to moderator portion of the code below when using J1.5X:

[code:1]if ($params->get('mods','0') == 0) {
$admins = strtolower($user->usertype) == 'administrator' || strtolower($user->usertype) == 'super administrator';
$mods = strtolower($user->usertype) == ''.$params->get('modsgroup','').'';
if ($mods && $params->get('modsgroup','')!=""«») {
$modsgive = $params->get('modsid',''); $modsreason = $params->get('modsreason','');
}
elseif ($admins) {
$modsgive = $params->get('adminsid',''); $modsreason = $params->get('adminsreason','');
}
$query = "SELECT userid,award FROM #__jawards_awards WHERE award='".$modsgive."' AND userid=".$user->id;
$database->setQuery($query);
$check=$database->loadObjectList();
if (count($check)==0) {
getAutoAwardsTab::AddAwards(
$user->id
,$modsgive
,$modsreason
);
}
}
}[/code:1]

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
16 years 1 month ago #76660 by krileon
Replied by krileon on topic Re:Plugin - jAwards AutoReward
It's not the same code. Look again at the code I'm having you replace it with.

[code:1]
$mods = (strtolower($user->usertype) == ''.$params->get('modsgroup','').'');
[/code:1]

Post edited by: krileon, at: 2008/10/07 21:32


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum