Member Awards (2.0 Compatible!)

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

Previous topic - Next topic

WishW

#2720
Hi.

I have such question/request:
in the previous version of my forum, in a memeber awards mod were made some modification, which display the awards (under avatar block) only after clicking on the word "Awards" - that was some kind of spoiler for the awards. Unfortunately the code has been lost with the old version of the forum and there is no way to contact the person who made this edits. I am writing to you in hopes that someone will be able to tell how to do this.

Thanks in advance.

PS: SMF 2.0.2

hcfwesker

Quote from: sildenafil on March 12, 2012, 05:53:56 AM
Hi, I have a problem. although i see the awards in the admin cpanel and create an award, upload images/badges, i cant see the awards if i look at a members profile and choose awards in the profile info. it shows: 

An Error Has Occurred!
Unable to load the 'awards' template.

Best guess I can make, is that you may be on a custom theme and that theme has it's own Profile.template.php ; which will require you to add the code to that theme's Profile.template.php

check on the SMF Default theme and see if the error happens, if not, then thats gonna be the issue.  If it does happen on the SMF default theme, then perhaps the edit is missing from default/Profile.template.php

Find ( at the very bottom of the file )
?>

Add Before
// This is the template for the awards
function template_awards(){
global $context, $modSettings, $txt, $settings;

echo '
<div class="cat_bar">
<h3 class="catbg">
' ,$txt['awards'], '
</h3>
</div>';

// Show the amount of awards that a member has
if (!empty($context['count_awards']))
echo '
<p class="description">
', sprintf($txt['awards_count_badges'], $context['count_awards']), '
</p>';

// Check if this member has any awards
if (empty($context['categories']))
echo '
<div class="error">
', $txt['awards_no_badges_member'], '
</div>';
else
{
foreach($context['categories'] as $category){
echo '
<div class="cat_bar">
<h3 class="catbg">
', $category['name'], '
</h3>
</div>
<table class="table_grid" width="100%">
<thead>
<tr class="catbg">
<th scope="col" class="first_th smalltext" width="15%">', $txt['awards_image'], '</th>
<th scope="col" class="smalltext" width="15%">', $txt['awards_mini'], '</th>
<th scope="col" class="smalltext" width="20%">', $txt['awards_name'], '</th>
<th scope="col" class="smalltext" width="45%">', $txt['awards_description'], '</th>
<th scope="col" class="last_th smalltext" align="center" width="5%">', $txt['awards_favorite2'], '</th>
</tr>
</thead>
<tbody>';

$which = true;

foreach ($category['awards'] as $award)
{
$which = !$which;

echo '
<tr class="windowbg', $which ? '2' : '', '">
<td align="center"><a href="', $award['more'], '"><img src="', $award['img'], '" alt="', $award['award_name'], '" /></a></td>
<td align="center"><a href="', $award['more'], '"><img src="', $award['mini'], '" alt="', $award['award_name'], '" /></a></td>
<td><strong>', $award['award_name'], '</strong></td>
<td><em>', $txt['months'][$award['time'][1]], ' ', $award['time'][2], ', ', $award['time'][0], '</em>: ', $award['description'], '</td>
<td align="center">', $context['allowed_fav'] ? '<a href="' . $award['favorite']['href'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $award['favorite']['img'] . '</a>' : '', '', ($award['favorite']['fav'] == 1 ? ' <img src="' . $settings['images_url'] . '/star.gif" alt="' . $txt['awards_favorite']. '" />' : ''), '</td>
</tr>';
}

echo '
</tbody>
</table>';
}

// Show the pages
echo '
<span class="smalltext">', $txt['pages'], ': ', $context['page_index'], '</span>';
}
}

function template_awards_members()
{
global $context, $scripturl, $txt;

// Open the form
echo '
<div class="cat_bar">
<h3 class="catbg">
', $txt['awards_members_with'], ': ', $context['award']['name'], '
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content" align="center">
<img src="', $context['award']['img'], '" alt="', $context['award']['name'], '" /><br />
<strong>', $context['award']['name'], '</strong><br />
', $context['award']['description'], '
</div>
<span class="botslice"><span></span></span>
</div>
<div class="cat_bar">
<h3 class="catbg">
', $txt['members'], '
</h3>
</div>';

// Check if there are assigned members
if (empty($context['award']['members']))
echo '
<p class="description">
', $txt['awards_no_assigned_members2'], '
</p>';
else {
$which = true;
$counter = 0;

echo '
<table class="table_grid" width="100%">
<tbody>';

// Loop through the members
foreach($context['award']['members'] as $member){
if ($counter < 1)
echo '
<tr class="windowbg', $which ? '2' : '', '">';

echo '
<td width="*">', $member, '</td>';

$counter++;

if ($counter == $context['columns']){
echo '
</tr>';

$counter = 0;
$which = !$which;
}
}

// If $counter is not = 0 then we must close the last tr
if ($counter != 0)
echo '
<td colspan="', ($context['columns'] - $counter), '">&nbsp;</td>
</tr>';
}

echo '
</tbody>
</table>';

}

function template_awards_list(){
global $context, $modSettings, $txt, $settings;

echo '
<div class="cat_bar">
<h3 class="catbg">
', $txt['awards_title'], '
</h3>
</div>';

// Check if there are any awards
if (empty($context['categories']))
echo '
<p class="description>
', $txt['awards_error_no_badges'], '
</p>';
else
{
foreach($context['categories'] as $key => $category)
{
echo '
<div class="title_bar">
<h3 class="titlebg">
<a href="', $category['view'], '">', $category['name'], '</a>
</h3>
</div>
<table class="table_grid" width="100%">
<thead>
<tr class="catbg">
<th scope="col" class="first_th smalltext" width="15%">', $txt['awards_image'], '</th>
<th scope="col" class="smalltext" width="15%">', $txt['awards_mini'], '</th>
<th scope="col" class="smalltext" width="25%">', $txt['awards_name'], '</th>
<th scope="col" class="smalltext" width="40%">', $txt['awards_description'], '</th>
<th scope="col" class="last_th smalltext" width="5%">&nbsp;</th>
</tr>
</thead>
<tbody>';

$which = false;

foreach ($category['awards'] as $award)
{
$which = !$which;

echo '
<tr class="windowbg', $which ? '2' : '', '">
<td align="center"><img src="', $award['img'], '" alt="', $award['award_name'], '" /></td>
<td align="center"><img src="', $award['small'], '" alt="', $award['award_name'], '" /></td>
<td>', $award['award_name'], '</td>
<td>', $award['description'], '</td>
<td class="smalltext">
<a href="', $award['view_assigned'], '"><img src="', $settings['images_url'], '/awards/user.png" title="', $txt['awards_button_members'], '" alt="" /></a>
</td>
</tr>';
}

echo '
</tbody>
</table>';
}

// Show the pages
echo '
<span class="smalltext">', $txt['pages'], ': ', $context['page_index'], '</span>';
}
}

Melissa524

Hi, I was wondering if someone could help me. I am hoping to take out the two different images for the Member Awards so I can just go with the Mini-Award picture.

Anyone know how to do that?
In case, I forget to say.  I am using 2.0.2

danchamp

Quote from: Xarwin on September 18, 2011, 10:45:10 AM
It bugs when I want to change an icon its image:

An Error Has Occurred!
"You must select a file to upload!"

This was bugging me too, you need to edit ManageAwards.php to fix it. Find this around line 214:

// Now add the new one.
AwardsUpload($id_award);


Replace with:


// Now add the new one.
AwardsUpload($id);

popdailynet

Hi

I am constantly encountering problem with trying to install this mod.

I am using SMF 2.0.2, I didn't upgrade, it was my first installed version. Whenever I try to install mod, it tells me that it failed to update admin.php file.

Once it's installed, it exists on the forum but is unavailable. I installed 2.0.0 version on other webhost and it worked fine, so I copy-pasted links to award system from its admin control panel and I got into it on my own, but that's it. I can't do anything with it, when I manage to add an award it duplicates in postbit.

Are there any plans of making this compatible with 2.0.2 or is there a way to bypass this and solve the issue?

Kindred

it installed just fine on 2.0.2

If you got an error on install, then you will have to manually apply the changes to that file. Without the manual changes, the mod won't be fully installed and may not work
Сл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."

Fed Drago

There appears to be allot of tweaking being done for this mod. The question remains unanswered weather or not the code writers of this Mod will consider doing a upgrade and updated version. This is a great Mod and there is a need for it but it is a shame that it has a fair amount of manual code writing that has to come along with the success of using it.

Cheers

Kindred

Quote from: Kindred on April 14, 2012, 06:09:37 PM
it installed just fine on 2.0.2

not sure what you mean by a lot of tweaking...  some people have tweaked it to do things other than originally intended, but - as written, it works just fine.
Сл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."

Fed Drago

I will try to install this Mod again, as it is NOT installing just fine for me. I am using 2.0.2 with only a handful of other Mods. Quick question I am also using simple Easy portal (Latest version) I wonder if Simple portals is the issue?

Kindred

are you using SimplePortal or EZPortal?   I have it installed in EZPortal.
Сл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."

sharks

Please fix a bug in the SMF 1.1.x version... Whenever members who have been assigned awards are deleted (for whatever reason), when visiting the awards list in the admin panel, there are blanks where these deleted members' usernames should be. I think there should be a maintenance option in the "Settings" tab so that any awards assigned to a non-existing member can be cleaned.

Ascot

Hi there! Awesome mod.

I'm having just a little issue. I want it to show under user avatar. So i cut the code

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

// 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>';


And move it up to // Show how many posts they have made.
<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';


and what happen?, when user is awared i can see all his data below awards, but when he's not it doesn't show.
I mean, there's a function on prevent loading if they haven't awards.

How can i fix this?

FireDitto

I have no problems at all with the mod; However, what I would like to do is reset the award IDs to start at 1 again.

Is it possible to do this?
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Kindred

only if you truncate the awards table...
Сл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."

Fed Drago

Quote from: Kindred on April 18, 2012, 01:55:00 PM
are you using SimplePortal or EZPortal?   I have it installed in EZPortal.

Simple Portal

Kindred

well, then you may have to manually install the failed parts
Сл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."

Ascot

Quote from: Ascot on April 20, 2012, 01:30:57 PM
Hi there! Awesome mod.

I'm having just a little issue. I want it to show under user avatar. So i cut the code

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

// 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>';


And move it up to // Show how many posts they have made.
<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';


and what happen?, when user is awared i can see all his data below awards, but when he's not it doesn't show.
I mean, there's a function on prevent loading if they haven't awards.

How can i fix this?

Please help. :'(

Kindred

you need to provide more code.

Please include the 5 lines of code before, the code you inserted and 5 lines of code after.
Сл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."

sharks

Hi guys, i need help with some SQL query code for this award on SMF 1.1.16: I want to search for all members who have between 200 and 299 posts (inclusive) and then assign them to the awards id 5. It's a bit of an auto-award manual manipulation, as i need an easy way to assign awards to my thousands of members without having to edit each of their profiles one by one, which can be very painful work! I also want to do the same for other ranges, for example, members from 300 posts to 399 posts should be assigned the award id 6, etc.

Cereus

Member Awards em Português - PT-PT ou PT-BR UTF-8
Member Awards in Portuguese - PT-PT or PT-BR UTF-8

Anexo.


Adicionado o pacote completo com o MOD em PT-BR UTF-8.
Add original pack with complete MOD in PT-BR UTF-8.

Advertisement: