News:

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

Main Menu

Member Awards (2.0 Compatible!)

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

Previous topic - Next topic

Fustrate

And these strings will need to be translated and added to the end of their respective files (right before the ?> and on their own lines)

Modifications.spanish.php
// Pogo Awards adminIndex text strings.
$txt['awards'] = 'Awards';
$txt['pa_view_album'] = 'View member\'s badge album.';
$txt['pa_mods'] = 'Mods';
$txt['whoallow_pogoawards'] = 'Managing <a href="' . $scripturl . '?action=awards">Awards</a>.';


ManagePermissions.spanish.php
// Pogo Awards permissions.
$txt['permissionname_manage_awards'] = 'Manage Awards';
$txt['permissionhelp_manage_awards'] = 'This will allow users add. edit and assign new awards';


Errors.spanish.php
$txt['cannot_manage_awards'] = 'You are not allowed to manage Awards.';

I can't recall if Latin Spanish uses a different filename like (filename).spanish_es.php
Steven Hoffman
Former Team Member, 2009-2012

Fievel Lee

Quote from: NIBOGO on September 02, 2008, 06:05:06 PM
Quote from: Fievel Lee on September 02, 2008, 04:36:13 PM

how can i use this mod on a 1.1.4 forum with spanish latin language ?  :-\



maybe in the spanish forum:

http://www.simplemachines.org/community/index.php?topic=252307.msg1680680#msg1680680

;)

thanks man  ;D

Quote from: YodaOfDarkness on September 02, 2008, 06:15:15 PM
And these strings will need to be translated and added to the end of their respective files (right before the ?> and on their own lines)

Modifications.spanish.php
// Pogo Awards adminIndex text strings.
$txt['awards'] = 'Awards';
$txt['pa_view_album'] = 'View member\'s badge album.';
$txt['pa_mods'] = 'Mods';
$txt['whoallow_pogoawards'] = 'Managing <a href="' . $scripturl . '?action=awards">Awards</a>.';


ManagePermissions.spanish.php
// Pogo Awards permissions.
$txt['permissionname_manage_awards'] = 'Manage Awards';
$txt['permissionhelp_manage_awards'] = 'This will allow users add. edit and assign new awards';


Errors.spanish.php
$txt['cannot_manage_awards'] = 'You are not allowed to manage Awards.';

I can't recall if Latin Spanish uses a different filename like (filename).spanish_es.php

thank you very much....everything is working fine now  :D

thanks for all your help guys.....and sorry for my bad english  :P


Later  :)

Fievel Lee

#762
Quote from: YodaOfDarkness on June 29, 2007, 11:25:59 PM
EDIT: I just figured it out :) Here's how to display (#) awards under a person's avatar. It's a modification of code found in... whichever file has the awards() function :D

All in Display.template.php (it all works the same anyways...)
find:
function template_main()
and add before (this is right at the top):
function show_awards_in_message($memID)
{
global $context, $db_prefix, $txt, $scripturl, $modSettings, $settings;

// How many awards to pull up?
$maxAwards = 4;

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

// Load the awards
$awardsSelect = db_query("
SELECT
aw.ID_AWARD, aw.awardName, aw.gameName, aw.filename, aw.width, aw.height,
am.ID_MEMBER, am.dateReceived, am.favorite
FROM {$db_prefix}awards AS aw
LEFT JOIN {$db_prefix}awards_members AS am ON (am.ID_AWARD = aw.ID_AWARD)
WHERE am.ID_MEMBER = $memID
ORDER BY am.favorite DESC, am.dateReceived DESC
LIMIT 0, $maxAwards", __FILE__, __LINE__);

// Set the $context['awards'] var
$context['awards'] = array();

// Fetch the award info just once
while ($row = mysql_fetch_assoc($awardsSelect))
{
$context['awards'][$row['ID_AWARD']] = array(
'id' => $row['ID_AWARD'],
'awardName' => $row['awardName'],
'gameName' => $row['gameName'],
'more' => $scripturl . '?action=profile;sa=awardsMembers;id=' . $row['ID_AWARD'],
'favorite' => array(
'fav' => $row['favorite'],
'href' => $scripturl . '?action=profile;sa=awards;id=' . $row['ID_AWARD'] . ';makeFavorite=' . ($row['favorite'] == 1 ? '0' : '1') . (isset($_REQUEST['u']) ? ';u=' . $_REQUEST['u'] : ''),
'img' => '<img src="' . $settings['images_url'] . '/' . ($row['favorite'] == 1 ? 'collapse' : 'expand') . '.gif" alt="' . $txt['pa_favorite'] . '" />',
),
'filename' => $row['filename'],
'width' => $row['width'],
'height' => $row['height'],
'time' => list ($year, $month, $day) = sscanf($row['dateReceived'], '%d-%d-%d'),
'img' => dirname($scripturl) . '/' . $modSettings['pa_awardsDir'] . '/' . $row['filename'],
);
}
mysql_free_result($awardsSelect);

if (!empty($context['awards'])){
foreach ($context['awards'] as $award){
echo '<a href="', $award['more'], '"><img src="', $award['img'], '" width="', $award['width'], '" height="', $award['height'], '" alt="', $award['awardName'], '" title="', $award['awardName'], '" /></a> ';
}
echo '<br />
<br />';
}
}


then go down a bit farther, find:
// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
', $message['member']['blurb'], '<br />
<br />';

add after:
show_awards_in_message($message['member']['id']);

You can actually put the second part wherever you like, but I personally like how the personal text seperates the avatar from the awards. It's also possible to make them stand out using a fieldset and a legend, which is what I did with mine.

This is why I love SMF... I get to learn while I tinker with things :D

EDIT: Fixed the error I was having with second/third/etc. pages - it was using $context['start'] when it should have used 0, and I condensed the code :)

thanx.....just what i need  ;D

just 1 questions

is it possible to put the name of the award right below the image of the award??


thanx again

Mother Goose

Congratulations on your award Yoda!
   

dreama.nana2

Does this mod work in the classic theme?

Fustrate

Yes it does, you'd just need to make a few theme edits yourself. Use the instructions provided right under the Downloads section on this mod's page.

And if anyone has noticed, this modification has now been transferred over to my name, including the first post (which now looks like I posted before I ever registered here ;)). The 2.0 version of this modification has been uploaded, and I'm working on cleaning up the 1.1.x version (but no new code will be added, so you won't need to upgrade at all).
Steven Hoffman
Former Team Member, 2009-2012

Mother Goose

   

Fustrate

thank you, and thank you again :D

Things are gonna get pretty busy for me once 2.0 gets to release candidates, and then when it gets out of RC... people are gonna want to use reputation and referrals for sure, and this one ain't too far behind in terms of how many people would install it. This was truly the first mod that I rewrote from scratch, as opposed to creating it myself or just re-releasing one that someone else couldn't support any longer.

It was fun to see how JayBachatero had written this two years ago, and then figuring out how I could optimize and improve upon his code.
Steven Hoffman
Former Team Member, 2009-2012

Kimmie

Yoda, is there any update/fix yet on this issue that I mentioned a while back: getting this error in my log when ever I click on View Assigned from the admin area:

8: Undefined variable: badge
File: /home//public_html/Themes/default/ManageAwards.template.php (view_assigned sub template - eval?)
Line: 421


thanks

Fustrate

attach your ManageAwards.template.php to a message
Steven Hoffman
Former Team Member, 2009-2012

Kimmie


Fustrate

That error's been in there for 2 years, it looks like ;)

attached
Steven Hoffman
Former Team Member, 2009-2012

Mother Goose

Quote from: YodaOfDarkness on September 04, 2008, 11:11:27 PM
thank you, and thank you again :D

Things are gonna get pretty busy for me once 2.0 gets to release candidates, and then when it gets out of RC... people are gonna want to use reputation and referrals for sure, and this one ain't too far behind in terms of how many people would install it. This was truly the first mod that I rewrote from scratch, as opposed to creating it myself or just re-releasing one that someone else couldn't support any longer.

It was fun to see how JayBachatero had written this two years ago, and then figuring out how I could optimize and improve upon his code.

Oh I can just imagine how many changes there have been sense then! It's a delight to see you so dedicated to the mod and still truly excited about it.

I'm still working on some new awards too, in between life's crazies!
   

Sudhakar Arjunan

Hi i have installed it on 1.1.5.

Installation went fine then default/index.template.

I manually edited this, when i went through the main tab,

Showed me this error,

Database Error
Unknown column 'awardName' in 'field list'
File: /home/itacumen/public_html/forum/Sources/ManageAwards.php
Line: 193

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.5, while your database is at version 1.1.1. The above error might possibly go away if you execute the latest version of upgrade.php.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Sudhakar Arjunan

Fatal error: Cannot redeclare awards() (previously declared in /home/itacumen/public_html/forum/Sources/Profile.php:3839) in /home/itacumen/public_html/forum/Sources/Profile.php on line 4190

Profile page does not shows
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Fustrate

1. attach your ManageAwards.php file to a post... I'll see if there are any errors.

2. Look in Profile.template.php and find this line:
function awards()
Delete the whole duplicate code that you find there (you'll find that line twice)
Steven Hoffman
Former Team Member, 2009-2012

Sudhakar Arjunan

I have uninstalled it since i had issue with the profile. And that to you are offline.

Will reinstall and attach the manageawards.php file. and remove the duplicate in profile.template.php file.

But i use ultimate profile mod.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Sudhakar Arjunan

I have installed it,

Checked the profile page, thave three instance like function template_awards() .

So i have attached the profile template and manage award . php files.

Kindly help me YodaofDarkness.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Fustrate

new Profile.template.php is attached.

can you check your database to see if smf_awards has a row named "awardName" in it?
Steven Hoffman
Former Team Member, 2009-2012

Sudhakar Arjunan

Quote from: YodaOfDarkness on September 05, 2008, 10:23:15 AM
new Profile.template.php is attached.

can you check your database to see if smf_awards has a row named "awardName" in it?

Will Attach and will do it now YodaofDarkness.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Advertisement: