Member Awards (2.0 Compatible!)

Started by Spuds, September 18, 2006, 03:14:03 PM

Previous topic - Next topic

hcfwesker

You can make those on your own, but they won't be auto received.  Remedy to this is have a topic somewhere that members can post in to alert award staff when they have earned an award.  Example of ours .. http://www.smashdomain.net/index.php?topic=5811.msg115168#msg115168

So if, say like,  a member reaches 1000 posts, they'll ask for their 1000 post award in that topic

Skaty


m0ss

Hi, I just re-installed this mod, and now it will only display one award, even if that user has multiple assigned. Anyone know how to fix this?

Skaty

Hi, is it possible to do something like this and how ?

Some topic is gonna shown just for members who receive award i determine. when regular member try to enter this post there should have warning like ''to enter this topic (or board) you have to receive blabla award.

hcfwesker

Quote from: m0ss on January 15, 2013, 09:53:33 PM
Hi, I just re-installed this mod, and now it will only display one award, even if that user has multiple assigned. Anyone know how to fix this?

goto awards settings in admin panel, should be a new option to display more than 1 award.

hcfwesker

Quote from: Skaty on January 16, 2013, 10:38:44 AM
Hi, is it possible to do something like this and how ?

Some topic is gonna shown just for members who receive award i determine. when regular member try to enter this post there should have warning like ''to enter this topic (or board) you have to receive blabla award.

a board/sub-board would be ideal for this.  create a membergroup like 'awarded members'.  Modify/create the board you wanna use, then in board settings only give access to that new group.  as a member gets an award, add the membergroup to their Seconadry Membergroup on their account settings.  which will then give them access.

the topic thing would require extensive code and even im not sure if its possible. go the board/sub-board route.

Skaty

i'm not expert but just an idea. is it too hard to entegrate this feature to this mod ? is this mod can check ''permission to enter'' and ''the spesific award''.



board/subboard is okay but i want the regular member can see the topic title etc. and don't wanna limit these kind topics just in one board.

shadowandlight

0/

I am having an issue with the award that I assigned showing up underneath the profile avatar.

http://i.imgur.com/ZmyfcGU.png

There is a screen shot of the avatar in a thread...

and the award is assigned to that profile

http://i.imgur.com/FwEOSR8.png

shouldnt it load underneath the avatar?? 

hcfwesker

Quote from: shadowandlight on January 28, 2013, 12:27:01 PMshouldnt it load underneath the avatar??

Everyone always misses this step ...

Admin > Awards > Settings

Awards in Post:
How many awards should be shown under a user's avatar? Set to 0 to show none.


might be 0 by default.


Though, more awards in that section will make it look clutered, you can try this custom code so they appear in member's signatures http://www.simplemachines.org/community/index.php?topic=114701.msg2934038;topicseen#msg2934038  Preview in my sig in this link  http://www.smashdomain.net/index.php?topic=5811.msg115168#msg115168

shadowandlight

I have tried changing that setting a few times..

http://i.imgur.com/rJ0iv4A.png

i cant get it to work

hcfwesker

Check Display.template.php amd see if this edit got added.  sometimes it doesn't cause it's not set to install if it gives errors.  On the parse page that edit has this This operation isn't vital to the installation of this mod.  meaning if there is an error with that addition it won't force an install error, but instead it'll just skip that edit.  so any changes to something like IM messengers you've made may have thrown off that edit.

Themes/default/Display.template.php

Find
// This shows the popular messaging icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li class="im_icons">
<ul>
', !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
', !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', '
', !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
', !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
</ul>
</li>';


Add BEFORE

// Show their awards?
if (!empty($message['member']['awards']) && $modSettings['awards_in_post'] > 0){
echo '
<li>
<fieldset style="border: 1px solid black; padding: 5px;">
<legend>', $txt['awards'], '</legend>';

// Couldn't limit it in Load.php, so let's do it here.
$awards = 0;
foreach ($message['member']['awards'] as $award){
if($awards < $modSettings['awards_in_post'])
echo '
<a href="', $scripturl, $award['more'], '"><img src="', dirname($scripturl), $award['img'], '" alt="', $award['description'], '" title="', $award['description'], '" /></a> ';
$awards++;
}

echo '
</fieldset>
</li>';
}



If you're not comfortable with doing it yourself, then attach your Display.template.php  file in the post attachment option here and I'll help ya put.


shadowandlight


hcfwesker

Nahh, I'm nothing lol.  But I appreciate it, and glad you got it to working :)

joshs.tern

Howdy!

I did some scouring to see if this had been answered yet but didn't see that it had.

I know the mod doesn't have a setting to automatically send the recipient a PM when an award is received, but is there a way to mod the process? I'm not too familiar with coding new PHP, only editing it, so I would have no clue where to begin.

Any help is appreciated!
Josh

hcfwesker

#2954
**

Auto PM Members their assigned Awards

I took a shot at this, and seems to work perfectly.  I'm not gonna go all out with personlizing it lol.  But this is the result I got.  Once the award is assigned, the PM is automatically sent to that member, the sender is the member that assigned the award.



It'll have a message ( which title and message can be edited.  With the Award image, title, and description


Sources/ManageAwards.php

Find
// Insert the data
$smcFunc['db_insert']('ignore',
'{db_prefix}awards_members',
array('id_award' => 'int', 'id_member' => 'int', 'date_received' => 'string'),
$values,
array('id_member', 'id_award')
);


Add AFTER

        SendAwardPMByID();



Find
function AwardsViewAssigned()

Add BEFORE
function SendAwardPMByID()
{
global $smcFunc, $sourcedir, $txt;

$request = $smcFunc['db_query']('', "
SELECT
a.id_award, a.award_name, a.description, a.filename, m.uniq_id, m.id_award, m.id_member, m.date_received
FROM
({db_prefix}awards AS a)

LEFT JOIN {db_prefix}awards_members as m ON (a.id_award = m.id_award)
                ORDER BY m.uniq_id DESC LIMIT 1");


$row = $smcFunc['db_fetch_assoc']($request);

$smcFunc['db_free_result']($request);

                $image = $row['filename'];
                $awardname = $row['award_name'];
                $description = $row['description'];

$pm_register_recipients = array(
'to' => array($row['id_member']),
'bcc' => array(),
);

require_once($sourcedir . '/Subs-Post.php');

sendpm($pm_register_recipients, sprintf($txt['award_pm_subject'],$row['id_member']),
sprintf($txt['award_pm_body'],$image,$awardname,$description));

}



languages/Modifications.english.php

Add
$txt['award_pm_subject'] ='You Have Received an Award';
$txt['award_pm_body'] ='Congratulations!  You have received the following award:
[img]FORUM ROOT PATH/awards/%s[/img]
[b]Award Title: [/b]%s
[b]Award Description: [/b]%s';


^^  where you see FORUM ROOT PATH  replace with your own forum root URL.  Not index URL, but root to your files
Ex.  SMF's is http://www.simplemachines.org/community      just remove the /index.php on the end of your forum home page link, basically


enen92

Dear all,
Thanks for your good work with this mod. I've however a simple question or a request.
Is it possible to modify the box that appears in the user profile? Instead of having it with a black border, is it possible to have it without any border at all (just Awards and the images)?

Thanks in advance

enen92

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

hcfwesker

Quote from: enen92 on February 07, 2013, 05:35:18 PMInstead of having it with a black border, is it possible to have it without any border at all (just Awards and the images)?

Display.template.php


// Show their awards?
if (!empty($message['member']['awards']) && $modSettings['awards_in_post'] > 0){
echo '
<li>
<fieldset style="border: 1px solid black; padding: 5px;">
<legend>', $txt['awards'], '</legend>';

// Couldn't limit it in Load.php, so let's do it here.
$awards = 0;
foreach ($message['member']['awards'] as $award){
if($awards < $modSettings['awards_in_post'])
echo '
<a href="', $scripturl, $award['more'], '"><img src="', dirname($scripturl), $award['img'], '" alt="', $award['description'], '" title="', $award['description'], '" /></a> ';
$awards++;
}

echo '
</fieldset>
</li>';
}


<fieldset style="border: 1px solid black; padding: 5px;">

^^ That line controls the border, so you change the 1px to 0px for no border, or change the color.


shadowedfoe

Is this mod compatible with 2.0.4? Will I have to manually install it?

SD-X

Quote from: shadowedfoe on February 08, 2013, 03:04:10 PM
Is this mod compatible with 2.0.4? Will I have to manually install it?
It's completely compatible with the Package Manager.

Advertisement: