2008-01-07, 08:40 PM
Pages: 1 2
2008-01-07, 09:50 PM
I have actually tried to figure this out but just couldn't. Would be nice it someone could figure it out and let the rest of us know. LOL
2008-01-07, 10:09 PM
2008-01-07, 11:02 PM
yayy! yes, that is exactly what I was looking for. Either in its own row or section like that one or where the Admin icons are under the stars.
2008-01-08, 02:00 AM
Hmm...leave it to Lex to have figured it out. Have you shared how to do it?
2008-01-08, 06:23 AM
Will show it when i get home from work, that's within 10hours =P
Open ./inc/plugins/medals.php
Find
Add below
Find
Add above
After saving and reuploading the file, you should be able to use {$medals} in your member_profile template to show the medals.
Open ./inc/plugins/medals.php
Find
$plugins->add_hook("postbit", "get_medals");
Add below
$plugins->add_hook("member_profile_end", "get_medals_mem");
Find
function get_medals($post)
Add above
function get_medals_mem()
{
global $db, $mybb,$config, $memprofile, $medals;
$uid=intval($memprofile['uid']);
// check Number of medals, exit if no medals
$query = $db->simple_select(TABLE_PREFIX.'medals_awarded', 'COUNT(*) AS count',"uid=".$uid);
$medal_count = $db->fetch_array($query);
if($medal_count['count'] > 0)
{
$medals = "<div style=\"white-space: normal; width:100%;\">";
$medals_query = $db->query("select `mid` from `". TABLE_PREFIX."medals_awarded` where `uid`='".$uid."'");
while($medals_list = $db->fetch_array($medals_query))
{
$medal_query = $db->query("select `mid`,`description` from `".TABLE_PREFIX."medals_list` where `mid` = '".$medals_list['mid']."'");
$medal = $db->fetch_array($medal_query);
$imgsrc = $mybb->settings['bburl']."/".$mybb->settings['uploadspath'].'/medals/'.$medal['mid'].'.jpg';
$medals .= " <img src=\"{$imgsrc}\" alt=\"{$medal['description']}\" title=\"{$medal['description']}\" border=\"0\" />";
}
$medals .= "</div>";
}
if(!$medals)
{
$medals = "No Medals";
}
}
After saving and reuploading the file, you should be able to use {$medals} in your member_profile template to show the medals.
2008-01-08, 10:07 PM
Works! Thanks for sharing.
2008-01-08, 11:08 PM
I dont know what I am doing wrong. I updated the medals template and uploaded.
I added this to member_profile:
Did I do something wrong?
I added this to member_profile:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->profile}</title>
{$headerinclude}
</head>
<body>
{$header}
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><img src="{$theme['imgdir']}/thead_l.png" alt="" /></td>
<td class="thead" style="white-space:nowrap">{$lang->profile}</td>
<td><img src="{$theme['imgdir']}/thead2.png" alt="" /></td>
<td class="thead2"></td>
<td><img src="{$theme['imgdir']}/thead_r.png" alt="" /></td>
</tr>
</table>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="trow1" width="75%">
<span class="largetext"><strong>{$formattedname}</strong></span><br />
<span class="smalltext">
({$usertitle})<br />
{$groupimage}
{$userstars}<br />
{$medals}<br />
<br />
Did I do something wrong?
2008-01-08, 11:10 PM
You need to make the edits to the actual plugin file, not the template. If you did, then maybe you did something wrong. Here's my edited file that you can try if you want.
2008-01-08, 11:12 PM
judel Wrote:You need to make the edits to the actual plugin file, not the template.
I'm sorry, that is what I meant to say. I did do the actual edit to the medals.php file.
Pages: 1 2