News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Member Awards (2.0 Compatible!)

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

Previous topic - Next topic

ladyshanae

None of my groups are based on post count.

JayBachatero

Umm weird.  Can you try it again and see what happens?  Try selecting another group.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

ladyshanae

Same error comes up.

I go to Awards --> Assign

Then the select membergroup screen comes up.  I click on the group I want, press next, and that is when the error generates.  It doesn't seem to matter if I choose one group or all of them, I still get the same error.

JayBachatero

Weird.  Try reuploading all of the files.  Source and template files.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

ladyshanae

I reuploaded all the files that came in the zip file and I'm still getting the same error.  *sigh*

I mean, it's not a HUGE deal . . . I'm going to go through one big awards dump and then I'll only be using it every month or so probably.  But it's just like . . . annoying, ya know?  lol  And if no one else is having the problem, then it could be me.  I do have a whole bunch of mods installed.

JayBachatero

What other mods do you have installed?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

ladyshanae

1.     SMF 1.0.9 and 1.1 RC3-1 Security Patch      1.0.8/1.1 RC3      
2.    Board Notes    1.0.5    
3.    SMFShop    2.3    
4.    Reason For Editing Mod    1.13    
5.    Enable/Disable Themes    1.0    
6.    Custom Action Mod    2.03    
7.    Enhanced Quick Reply for 1.1 RC3    
8.    Sticky First Post (extends sticky topic)    1.2.3    
9.    Show Multiple Badges (Aka Stars)    1.0    
10.    SMF Staff Page    1.3    
11.    Membergroup Color Legend    1.1    
12.    Global Announcements    1.0    
13.    Custom Profile Field Mod    3.15    
14.    PaypalDonations    1.6    
15.    Member Awards    1.0.2    
16.    Admin Modification Menu Section    1.0.2

Plus I manually installed Show Multiple Group Names and a Dice modification that never made it to a package but has been working for my board without error for about 2 years.

I'm not sure that any of these modifications would conflict and/or cause the problem I'm encountering.  The good thing is that the modification itself functions.  The bad news is just that little pesky error that pops up every time I go to add an award.

JayBachatero

I'm going to give you a modified file for testing.  It should help debug the problem.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

ladyshanae

That'd be great!  Thanks in advance :)

Fatherguido

Quote from: JayBachatero on October 31, 2006, 09:30:02 AM
In
File: Load.php
Code (find) Select

$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{
$new_loaded_ids[] = $row['ID_MEMBER'];
$loaded_ids[] = $row['ID_MEMBER'];
$row['options'] = array();
$user_profile[$row['ID_MEMBER']] = $row;
}
mysql_free_result($request);


Code (Add After) Select

// Load the awards
$request = db_query("
SELECT COUNT(*) AS awards, ID_MEMBER
FROM {$db_prefix}awards_members
WHERE ID_MEMBER IN ('" . implode("', '", $loaded_ids) . "')
GROUP BY ID_MEMBER", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$user_profile[$row['ID_MEMBER']]['awards'] = $row['awards'];
mysql_free_result($request);


Code (find) Select

'group_stars' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['stars'][1]) ? $settings['images_url'] . '/' . $profile['stars'][1] : '') . '" alt="*" border="0" />', empty($profile['stars'][0]) || empty($profile['stars'][1]) ? 0 : $profile['stars'][0]),
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),


Code (Add After) Select

'awards' => &$profile['awards'],


File: Display.template.php
Code (find) Select

// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';


Code (Add After) Select

// Show number of awards
echo '
', $txt['awards'], ': ', !empty($message['member']['awards']) ? $message['member']['awards'] : 0, '<br />
<br />';

where is "Load.php?" I can't find that anywhere

littleone

in the sources folder of your forum directory

Fatherguido


JayBachatero

ladyshanae use this file.  It will print out the $_POST data and use it for debug.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Fatherguido

Quote from: Fatherguido on November 29, 2006, 11:53:27 AM
Quote from: JayBachatero on October 31, 2006, 09:30:02 AM
In
File: Load.php
Code (find) Select

$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{
$new_loaded_ids[] = $row['ID_MEMBER'];
$loaded_ids[] = $row['ID_MEMBER'];
$row['options'] = array();
$user_profile[$row['ID_MEMBER']] = $row;
}
mysql_free_result($request);


Code (Add After) Select

// Load the awards
$request = db_query("
SELECT COUNT(*) AS awards, ID_MEMBER
FROM {$db_prefix}awards_members
WHERE ID_MEMBER IN ('" . implode("', '", $loaded_ids) . "')
GROUP BY ID_MEMBER", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$user_profile[$row['ID_MEMBER']]['awards'] = $row['awards'];
mysql_free_result($request);


Code (find) Select

'group_stars' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['stars'][1]) ? $settings['images_url'] . '/' . $profile['stars'][1] : '') . '" alt="*" border="0" />', empty($profile['stars'][0]) || empty($profile['stars'][1]) ? 0 : $profile['stars'][0]),
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),


Code (Add After) Select

'awards' => &$profile['awards'],


File: Display.template.php
Code (find) Select

// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';


Code (Add After) Select

// Show number of awards
echo '
', $txt['awards'], ': ', !empty($message['member']['awards']) ? $message['member']['awards'] : 0, '<br />
<br />';

where is "Load.php?" I can't find that anywhere
I posted this code and it appears to work except that the title "Awards" does not show up all I get is ":1" (with 1 being the correct number of awards) -

I have looked over all the code and I just can't find my error

JayBachatero

Missing the language string in the Modifications.english.php. Check to see if your theme has a custom one.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Fatherguido

Quote from: JayBachatero on November 29, 2006, 01:43:09 PM
Missing the language string in the Modifications.english.php. Check to see if your theme has a custom one.
Yes, that was missing - I installed it but I am still missing that text. I went back to make sure the other modifications were in place and everything appears good ........any ideas?

JayBachatero

Are you using a custom theme?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Fatherguido

Yes, but everything else works great. I manually installed everything and the mod itself is working - the only thing I am lacking is the word "Award" in the post. So basically, the mod is good, I am having difficulty with the additional code.

The numbers are posting (like :1  but it doesn't say award before the number)

Fatherguido

I think I may have figured it out ......... update soon

Fatherguido

Solved: In techodragon's modification it called out a text string of "Awards Total" and there was no string in the Modifications.english.php    I added one and it works great

Thanks Jay

Advertisement: