Member Awards (2.0 Compatible!)

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

Previous topic - Next topic

digitalmikey

Sorry to both Spuds or wesker again but I have one last question. I am using weskers code to place the awards above the signature. Now I got it to work in Display.template.php but now I am trying to put it at the exact same location in a users profile page (just above the signature). I tried posting:

  // Show their awards?
if (!empty($message['member']['awards']) && $modSettings['awards_in_post'] > 0){
echo '<br/><div class="awards_bar">';
// 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 '
</div>';
}





right above

// Show the users signature.
if ($context['signature_enabled'] && !empty($context['member']['signature']))
echo '
<div class="signature">
<h5>', $txt['signature'], ':</h5>
', $context['member']['signature'], '
</div>';

echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div class="clear"></div>
</div>';


but that didn't work at all. If someone could please offer me a suggestion or look at my code (files attached) I would greatly appreciate it. Thanks again!

bigjoe11a

I just installed the awards mod and my question is that I don't have any images for the awards. Does any one have a collection of images that I can use for the awards.

Thanks
Joe
SMF Forums http://www.df-barracks.com Where gamers go.

digitalmikey


Maxtor

i get this:


Unknown column 'a.id_category' in 'on clause'
File: /home/mxlis4/public_html/forum/Sources/ManageAwards.php
Line: 100

hcfwesker

Quote from: digitalmikey on August 23, 2011, 04:08:05 PM
Sorry to both Spuds or wesker again but I have one last question. I am using weskers code to place the awards above the signature. Now I got it to work in Display.template.php but now I am trying to put it at the exact same location in a users profile page (just above the signature).

I actually wanted to try this, myself.  I ran into a few bumps during the time.  I'll look into it when i get a chance, just can't give an estimate time.

Do you use Ultimate Profiles mod on your forum?

angellionel

The mod installed without errors in SMF 2.0 using the default theme, and assigning awards as designed is working fine. Nice mod!

The only thing I have noticed is that there is an undefined error listed in the log sheets. The error appears to be generated only when electing to view the Awards List under my (and presumably other member's) profile info. See attachment below.

These are the details of the undefined error message. Any thoughts as to which file and what line should be edited to eliminate the error?  Thanks!

Type of error: Undefined

forum/index.php?action=profile;area=listAwards;u=1
8: Undefined index: view
Themes/default/languages/ManageAwards.english.php (awards_list sub template - eval?)
Line: 3150







Hotman

so , by choosing the default theme , this mod works great in 2.0 version?  :)

digitalmikey

Quote from: hcfwesker on August 26, 2011, 07:20:57 PM
Quote from: digitalmikey on August 23, 2011, 04:08:05 PM
Sorry to both Spuds or wesker again but I have one last question. I am using weskers code to place the awards above the signature. Now I got it to work in Display.template.php but now I am trying to put it at the exact same location in a users profile page (just above the signature).

I actually wanted to try this, myself.  I ran into a few bumps during the time.  I'll look into it when i get a chance, just can't give an estimate time.

Do you use Ultimate Profiles mod on your forum?

No I do not. Thanks wesker I appreciate your help. Keep me updated. :)

Archype

Hey!

I installed the mod on SMF 2.0 but for some reason the settings dont show under the admin panel. The awards part shows on the profiles tho. I tried re-installing it via package manager and also doing all file edits manually but to no avail. I dont get any errors, just the settings dont show up.
Any advice?

treehugger

I used the
// Show their awards?
if (!empty($message['member']['awards']) && $modSettings['awards_in_post'] > 0){
echo '<fieldset><legend><a href="', $scripturl, '?action=profile;area=showAwards;u=', $message['member']['id'], '" title="', $txt['awards'], '">View Awards/Achievements</a></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>';
}


code because the awards weren't showing beside posts. On my test site it worked great and they now show under the signatures but the same alts don't do anything on the main site. The display.template file is the same on both sites and I have the same mods installed - although perhaps they weren't installed in the same order.

Can anyone suggest which file I need to look at next please?

hcfwesker

#2450
Quote from: digitalmikey on August 27, 2011, 11:27:18 AM
No I do not. Thanks wesker I appreciate your help. Keep me updated. :)

Sorry, I took a few stabs at it, on both regular profiles and tested ultimate profiles, nothing seemed to work for me, maybe spuds could take a stab at it.


Quote from: angellionel on August 26, 2011, 09:53:29 PM
The mod installed without errors in SMF 2.0 using the default theme, and assigning awards as designed is working fine. Nice mod!

The only thing I have noticed is that there is an undefined error listed in the log sheets. The error appears to be generated only when electing to view the Awards List under my (and presumably other member's) profile info. See attachment below.

These are the details of the undefined error message. Any thoughts as to which file and what line should be edited to eliminate the error?  Thanks!

Type of error: Undefined

forum/index.php?action=profile;area=listAwards;u=1
8: Undefined index: view
Themes/default/languages/ManageAwards.english.php (awards_list sub template - eval?)
Line: 3150

Whenever you have an error in your error log, one tip I can give you to speed things up a tad, is copy the error it produces, in this case
8: Undefined index: view

^ use that line and use the  'search in this topic' option at the top.  Would have brought you to a post that would fix this, i posted it below ;)

http://www.simplemachines.org/community/index.php?topic=114701.msg3116828;topicseen#msg3116828

hcfwesker

#2451
Quote from: treehugger on August 27, 2011, 03:51:19 PMCan anyone suggest which file I need to look at next please?

Admin > Awards >  Settings > Awards in Post:

^ that's usually the most overlooked setting when members can't get awards to show.  Set it to a number like 10, or however many awards you want shown.  You may have done the setting on your test site, but it may have been overlooked on your main site.

digitalmikey

Quote from: hcfwesker on August 28, 2011, 01:18:28 PM
Quote from: digitalmikey on August 27, 2011, 11:27:18 AM
No I do not. Thanks wesker I appreciate your help. Keep me updated. :)

Sorry, I took a few stabs at it, on both regular profiles and tested ultimate profiles, nothing seemed to work for me, maybe spuds could take a stab at it.


Yeah same with me. Nothing I tried seemed to work and I'm no expert programmer or anything. How about it Spuds, can you give me a hand?

angellionel

Quote from: hcfwesker on July 22, 2011, 11:07:20 PM
Quote from: Eclipse16V on July 22, 2011, 04:20:10 AM
Works nice on SMF 2.0

2. Error
On the Award List
Quotehttp://smf-2.0.xyz.de/index.php?action=profile;area=listAwards;u=1
8: Undefined index: view

Sources/Profile-View.php

Find
         $context['categories'][$row['id_category']] = array(
            'name' => $row['category_name'],
            'awards' => array(),
         );


Replace With
         $context['categories'][$row['id_category']] = array(
            'name' => $row['category_name'],
            'view' => $scripturl . '?action=admin;area=awards;sa=viewcategory;id=' . $row['id_category'],
            'awards' => array(),
         );


That code is listed twice, but you'll notice on the 2nd one of them, the 'view' line didn't get readded.

Awesome! There are no further errors being generated. Thank you! And thank you for the tip as well.     ;)    Very helpful information.

treehugger

Doh - I thought that setting only came into play when you wanted the awards to show under the avatar. :-[ Working fine now - many thanks Hcfwesker. :D

hcfwesker

Quote from: angellionel on August 28, 2011, 04:29:27 PM
Awesome! There are no further errors being generated. Thank you! And thank you for the tip as well.     ;)    Very helpful information.

Your welcome.  :)

Quote from: treehugger on August 28, 2011, 05:32:13 PM
Doh - I thought that setting only came into play when you wanted the awards to show under the avatar. :-[ Working fine now - many thanks Hcfwesker. :D

Well, true, but since we're mimicking that code, sorta, and replacing the code it calls for in mini profiles, but under sigs, it still needs to be set ;)  Glad it worked, and first guess was correct lol


treehugger

Another question please. Am running SMF 2.0 and Awards 2.2.3 - now that Awards are showing fine I've been trying to let one of the kids manage them for me. I did what I did for the Arcade and made a membergroup with the Manage Awards box ticked. Added Awards Manager to her [show additional membergroups] but nothing is happening.

When I try it with the test account it shows the Admin button but when clicked it shows the An Error Has Occurred! You are not allowed to access this section. message. Reading through this thread lots of people seem to have ad a similar problem but I can't figure out if it was resolved?

hcfwesker

Quote from: treehugger on August 30, 2011, 07:57:30 AM
Another question please. Am running SMF 2.0 and Awards 2.2.3 - now that Awards are showing fine I've been trying to let one of the kids manage them for me. I did what I did for the Arcade and made a membergroup with the Manage Awards box ticked. Added Awards Manager to her [show additional membergroups] but nothing is happening.

When I try it with the test account it shows the Admin button but when clicked it shows the An Error Has Occurred! You are not allowed to access this section. message. Reading through this thread lots of people seem to have ad a similar problem but I can't figure out if it was resolved?

Try this, this is how i have access for mods to the awards page

Sources/Subs.php

Find
'mlist' => array(
'title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
'sub_buttons' => array(
'mlist_view' => array(
'title' => $txt['mlist_menu_view'],
'href' => $scripturl . '?action=mlist',
'show' => true,
),
'mlist_search' => array(
'title' => $txt['mlist_search'],
'href' => $scripturl . '?action=mlist;sa=search',
'show' => true,
'is_last' => true,
),
),
),



Replace with
'mlist' => array(
'title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
'sub_buttons' => array(
'mlist_view' => array(
'title' => $txt['mlist_menu_view'],
'href' => $scripturl . '?action=mlist',
'show' => true,
),
'mlist_search' => array(
'title' => $txt['mlist_search'],
'href' => $scripturl . '?action=mlist;sa=search',
'show' => true,
),
'awards' => array(
'title' => $txt['permissionname_manage_awards'],
'href' => $scripturl . '?action=admin;area=awards',
'show' => allowedTo('manage_awards'),
'is_last' => true,
),
),
),



Then, goto

Themes/default/languages/Modifications.english.php
 

Add this somewhere

$txt['permissionname_manage_awards'] = 'Manage Awards';


This will open a new sub-menu link directly under the 'Members' menu tab, for those with permissions to manage awards, and should take them directly there.


treehugger

Thanks you Hcfwesker. Have put in the code and added the line in Modifications.english - so now we have both an Admin link showing and the Manage Awards in the Member dropdown - but both of them just show the An Error Has Occurred! You are not allowed to access this section. message on my test permission account.

The girl I'm trying to give the Manage Award permission too already has the Manage Arcade permission and can get to them via the Admin link and now also via the Members/Manage Awards link - but Arcade is all she can access.

Deadfire

#2459
Quote from: Sci-Fi_Fan on August 17, 2011, 08:30:30 PM
Additionally, is there a way to extend the length of the award description? The current length seems very short.

Quoted for a bump of a idea, Changing varchar(80) is to short and having the description being a textarea rather then just text would help this. (course it seems I'm to tired to remember how to do this with my own install)

Advertisement: