Member Awards (2.0 Compatible!)

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

Previous topic - Next topic

tom333

hello, everything work on my custom theme.
But i get this errors when I want to edit awards:
.php?action=awards;sa=modify
8: Undefined index: awardsDir
/Sources/ManageAwards.php
378

second error:
8: Undefined variable:
356

third error:
Undefined variable: boarddir
356

Thank in advance for help.

matute2004

Quote from: Marquis12 on November 18, 2008, 06:35:20 AM
Quote from: arendedwinter on November 16, 2008, 12:24:44 AM
Hello all.

Having some issues with this mod.  It's throwing off the 'every so lovely' 406 error...  Wasn't sure whether to post this here or in the other threads regarding this error.  I realise most of the time this a mod_security issue, but I checked with my hosting and apparently they don't use it.

I thought it might have been a conflict with another mod, but I installed 1.1.7 as a vanilla test forum, and it still happens on that.  The mod sort of works (for example, if I add a new award, it will throw this error at me, but if I go back and refresh the page, the award is there.  It's just very frustrating since it does it when adding, deleting, modifying, even viewing an award).  Anyone have any ideas?

I have the exact same problem, and no idea how to fix it. Install went fine, not one problem... but as mentioned above when adding/deleting/modifying/viewing I get a 406 error. To help, I've attached the exact error bellow.

Any idea on a fix?



I passed the same, someone can help me?

HR

#1002
Quote from: Mr_JimWest on November 29, 2008, 10:58:26 PM
I just want it to work with 1.1.7  ::)

Works fine in 1.1.7 for me, drop me a line and I'll help where I can. Im trying to get this to display as part of the ultimate profile mod (as a part of the table.) getting a bit rough to get done though.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

HR

OK, here is what I am trying to do.. in profile around gender and what not Im adding an additional link to the awards page.

// Awards display field
echo ' <tr>
<td width="40%">
<b>', $txt['pa_view_album'], ': </b>
</td><td>
<a href="', $scripturl, '?action=profile;sa=awards;u=', $context['member']['id'], '"><img src="', $settings['default_theme_url'], '/images/award.gif" alt="', $txt['awards'], '"> ', $txt['awards'], '</a>
</td>
</tr>';
// End Awards Display


What Id like to do is to away with the icon (conditional) so it displays similar to the awards template.
ergo 'View this members badge album.: (this member has no awards OR # Awards'
With number of awards acting as a link to the awards page.

Assist?

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

Fustrate

Are you good with mysql queries? If so, do something like

$request = db_query("
  SELECT *
  FROM {$db_prefix}awards_members
  WHERE ID_MEMBER = {$context['member']['id']}", __FILE__, __LINE);

$context['num_awards'] = mysql_num_rows($request);

in Profile.php and then use a ternary operator in Profile.template.php, like

// Awards display field
echo '                     <tr>
                        <td width="40%">
                           <b>', $txt['pa_view_album'], ': </b>
                        </td><td>
                           ', (!empty($context['num_awards']) ? '<img src="' . $settings['default_theme_url'] . '/images/award.gif" alt="' . $txt['awards'] . '">This member has <a href="' . $scripturl . '?action=profile;sa=awards;u=' . $context['member']['id'] . '">' . $context['num_awards'] . ' ' . $txt['awards'] . '</a>.' : 'This member has no awards.', '
                        </td>
                     </tr>';
// End Awards Display


I'm pretty sure that'll get you where you want to be.

As for the other problem people are having... I have no clue why that would occur, and this is the first I've heard of it. I'm still trying to think of why it would happen.
Steven Hoffman
Former Team Member, 2009-2012

HR

#1005
Thanks for the reply.. will have to hunt around where to place in profile.php I think..

Oddly enough this (or similar) is in function awards($memID) in profile.php already

$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}awards_members
WHERE ID_MEMBER = $memID", __FILE__, __LINE__);
list ($countAM) = mysql_fetch_row($request);
mysql_free_result($request);

// The count of awards per member
$context['countAwards'] = $countAM;


I went for the hell of it and changed the alteration to reflect $context['count_Awards'] however that didnt work. So, I guess I'll have to have the same query elsewhere in the profile.php file or figure out how to call this function from the display profile area (as soon as I determine where that is in profile.php)

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

Fustrate

awards() is used for the awards page in people's profiles, not the main page.
Steven Hoffman
Former Team Member, 2009-2012

HR

Resolved (thanks for support)
In profile.php:

// Attempt to load the member's profile data.
if (!loadMemberContext($memID) || !isset($memberContext[$memID]))
fatal_error($txt[453] . ' - ' . $memID, false);

// Adding for Awards tweaks
// Count the number of items in the database for create index
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}awards_members
WHERE ID_MEMBER = $memID", __FILE__, __LINE__);
list ($countAM) = mysql_fetch_row($request);
mysql_free_result($request);

// The count of awards per member
$context['countAwards'] = $countAM;
// End Awards Tweak Addition


In UltimateProfile.template.php:

<tr>
<td><b>', $txt['lastLoggedIn'], ': </b></td>
<td>', $context['member']['last_login'], '</td>
</tr>';
// Awards display field
echo ' <tr>
<td width="40%">
<b>', $txt['pa_view_album'], ': </b>
</td><td>
                           ', (!empty($context['countAwards'])) ? '<img src="' . $settings['default_theme_url'] . '/images/award.gif" alt="' . $txt['awards'] . '">This member has <a href="' . $scripturl . '?action=profile;sa=awards;u=' . $context['member']['id'] . '">' . $context['countAwards'] . ' ' . $txt['awards'] . '</a>.' : 'This member has no awards.', '
                        </td>
</tr>';
// End Awards Display
echo '

Results:

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

Fustrate

Steven Hoffman
Former Team Member, 2009-2012

HR

Couldnt have done it without the help ;)

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

Mr_JimWest

how can I get it to work in 1.1.7 ?  :(

HR

Quote from: Mr_JimWest on December 22, 2008, 10:18:36 PM
how can I get it to work in 1.1.7 ?  :(
Its working in 1.1.7. Drop me a PM and get me your URL etc. and I'll help where I can.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

ictus

#1012
I'm using SMF 1.1.7, but since I upgraded to that version I am getting error log messages, after looking through these forums I disable the 'templateEval' and found the error was with Members Award.

It isn't breaking the forum, but does slow it down sometimes, has anyone else had this problem, and if so did you find a fix?

this is the error:

8: Undefined index: pa_favorite
File: /home/ridgway/public_html/rmsmf/Themes/default/Display.template.php
Line: 51

and boy is it a lot of errors, I reset them yesterday and now have 1135 pages worth....

ictus

sorry....found the fix on this board.....thanks

imno007

I had this installed with 1.17, testing it out, but decided I don't really need it. I uninstalled it but it's still showing in my admin, 'Awards' under the 'Mods'  category it creates, and the options there still appear to work. Any advice on how to really uninstall it?

TIA!

Fustrate

You'll have to uninstall it manually... ya, it sucks :( Go to http://mods.simplemachines.org/index.php?mod=475 and choose the box on the right of "MemberAwards_1-0-2.zip (19KB) [11493]", select 1.1.6 from the dropdown box, and click Submit.

Follow the instructions, but in reverse. If it tells you to, for example, look for

'pm' => array('PersonalMessage.php', 'MessageMain'),

and add this after it

'awards' => array('ManageAwards.php', 'Awards'),


you look for the 'awards' => one and just remove it.
Steven Hoffman
Former Team Member, 2009-2012

Mick.



Wow,very cool.    All i had was a link to members awards just like in default profile.


Care to post how you did this?  Maybe in the Ultimate Profile thread?

Thanx.

HR

How I did it is a bit up on the page..

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

mrmiyagi

Hi my member awards not working.

I downloaded the file and uploaded the package in admin panel and installed

now I just get this

http://welikeabet.com/forum2

the little orange icon is there but nothing happens?

imno007

Quote from: YodaOfDarkness on December 24, 2008, 09:25:45 PM
You'll have to uninstall it manually... ya, it sucks :( Go to http://mods.simplemachines.org/index.php?mod=475 and choose the box on the right of "MemberAwards_1-0-2.zip (19KB) [11493]", select 1.1.6 from the dropdown box, and click Submit.

Follow the instructions, but in reverse. If it tells you to, for example, look for



Thanks very much, YodaOfDarkness, much appreciated.
'pm' => array('PersonalMessage.php', 'MessageMain'),

and add this after it

'awards' => array('ManageAwards.php', 'Awards'),


you look for the 'awards' => one and just remove it.

Advertisement: