News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Simple Awards System

Started by Windy, November 14, 2006, 09:01:54 PM

Previous topic - Next topic

WolfJ

Quote from: Arantor on September 17, 2013, 10:20:41 AM
Quote from: Ventic on September 17, 2013, 07:31:06 AMYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE = MYISAM' at line 9
File: C:\Xampp\htdocs\forum2\Packages\temp\AwardSystemdb2.php
Line: 187

any idea what to do,to solve this?

Change the AwardSystemdb2.php file to use ENGINE=MYISAM instead of TYPE=MYISAM. Or better still the mod author should have used the proper methods in the first place.

Now I've slept and scrolling through I see this which fixed the problem. Many thanks!

Chewing on Cyanide


Melonking

A quick round up of How to install this on SMF 2.0.19

I just got this working! Here are a few tips for anyone trying!

1. Download the latest "SimpleAwardSystem_2_1.zip" and unzip it.

2. Find open the "modifications2.xml" and find line 42 - replace this:
<search position="after"><![CDATA[$memberContext[$message['id_member']]['can_see_warning'] = !isset($context['disabled_fields']['warning_status']) && $memberContext[$message['id_member']]['warning_status'] && (($context['user']['can_mod'] || !empty($modSettings['warning_show'])) || ($memberContext[$message['id_member']]['id'] == $context['user']['id'] && !empty($modSettings['warning_show']) && $modSettings['warning_show'] == 1));]]></search>With this:
<search position="after"><![CDATA[$memberContext[$message['id_member']]['can_see_warning'] = !isset($context['disabled_fields']['warning_status']) && $memberContext[$message['id_member']]['warning_status'] && ($context['user']['can_mod'] || (!$user_info['is_guest'] && !empty($modSettings['warning_show']) && ($modSettings['warning_show'] > 1 || $message['id_member'] == $user_info['id'])));]]></search>Save and close!

3. Now do the change to "AwardSystemdb2.php" line 172 - described here - https://www.simplemachines.org/community/index.php?topic=127054.msg3609699#msg3609699

4. Next open "package-info.xml" and change "2.0 RC2" to "SMF 2.0.19" on lines 26 and 32.

Save - Rezip- and you should now be able to install without any issues  :)

Next here is an extra modification (optional) I recommend after installing - it adds links & award descriptions to awards in posts; it also fixes an odd spacing bug.

1. Open "Load.php" in your Sources - find and replace this:
SELECT a.ID_AWARD, a.title, a.fileNameWith this:
SELECT a.ID_AWARD, a.title, a.fileName, a.memberName
2. Open "Display.php" in your Sources - find and replace this:
$award_str .= '<img alt="' . stripslashes($award['title']) . '" src="' . $boardurl . '/awards/' . stripslashes($award['fileName']) . '" title="' . stripslashes($award['title']) . '" />';With this:
$award_str .= '<a href="' . $scripturl . '?action=profile;area=awards;u=' . $message['id_member'] . '"><img alt="' . stripslashes($award['title']) . '" src="' . $boardurl . '/awards/' . stripslashes($award['fileName']) . '" title="' . stripslashes($award['title']) . ' given by ' . stripslashes($award['memberName']) . '" /></a>';
3. A few lines down find this:
'value' => '<span class="awards">' . $award_str . '</span>',And replace with this:
'value' => '<br/><span class="awards">' . $award_str . '</span>',
4. Thats it your mostly done! The only other thing I recommend is looking in "Themes/default/languages/Modifications.english.php" and correcting some of the language errors with this mod!

Otherwise your all good! Enjoy  ;D

Melonking

Its me again with another fix to add! This fix will correct the links on the Awards list page - without this fix when you click on the name of the person who gave you an award it will take you to your profile - this fix makes you go to their profile!

Open Sources/Profile-View.php and find this block: (its in the given_by -> data section of awards() function)
'format' => '<a href="' . $scripturl . '?action=profile;u=' . $memID. '">%1$s</a>',
  'params' => array(
    'name' => true,
  ),
Replace it with this:
'format' => '<a href="' . $scripturl . '?action=profile;u=%1$s">%2$s</a>',
  'params' => array(
    'id_member' => true,
    'name' => true,
  ),

Advertisement: