Page 3 of 4

PostPosted: Fri Jun 30, 2006 12:39 pm
Author: Dragonsys
"MrDSL";p="10599" wrote:Quick question.


I can't open your download cause its .rar but whats the purpose of the medalspr function since you are using a profilcp_medal.php file to display in the viewprofile section?


hmmmm good question. I just adapted what you had created a while back. Since the Medals aren't being displayed on the main profile page (I simply removed the code which display it, but it could be added back in), the functon probably isn't needed.

PostPosted: Mon Jul 17, 2006 9:53 am
Author: honie
I would love to install this one, but anytime I try to install a mod that requires changes to the profilcp/def files my site goes white. Does anyone else have this problem?

PostPosted: Tue Aug 22, 2006 7:15 am
Author: ayasha
well, i finally got this mod installed and working, but i cannot get the medal to show in the left panel on view topic.

even after going back and applying the new edits that Dragonsys posted.

can anyone help?

i have it set in the acp to show 1 medal, but all it does is put a link to view more.

Re: Roster/Medals Mod?

PostPosted: Wed Feb 07, 2007 11:13 am
Author: dan0042
medal system is workin perfectly fine but "left frame out size Author box

http://img387.imageshack.us/img387/6246 ... kkhro0.jpg

Re: Roster/Medals Mod?

PostPosted: Wed Feb 14, 2007 12:42 pm
Author: Pogue Moran
Here's what I have I don't know how it works with IM 141s version of PCP but this is what worked with the version I have. In your def_userfuncs_custom.php add:

Code: Select all
function pcp_output_medal_count_viewtopic($field_name, $view_userdata, $map_name='') {    global $db, $lang, $phpEx;      $res = $img = $txt = '';      // Medal MOD    $medal ='';    $sql = "SELECT m.medal_id, m.medal_name      FROM " . MEDAL_TABLE . " m, " . MEDAL_USER_TABLE . " mu      WHERE mu.user_id = '" . $view_userdata['user_id'] . "'      AND m.medal_id = mu.medal_id      ORDER BY m.medal_name";      if(!$result = $db->sql_query($sql))    {      message_die(GENERAL_ERROR, "Error getting medal information", "", __LINE__, __FILE__, $sql);    }      $medal_list = $db->sql_fetchrowset($result);    $medal_count = count($medal_list);      if ( $view_userdata['user_id'] == ANONYMOUS )    {      $medal_count = '';    }    else    {        $medal_count = ($medal_count) ? $lang['Medals'] . ': <a>' . $medal_count . '</a>' . ' (<a>' . $lang['View_More'] . '</a>)' : $lang['Medals'] . ': ' . $lang['None'];    }    $txt = $medal_count;    $res = pcp_output_format($field_name, $txt, $img, $map_name);    return $res; }  function pcp_output_medal_list_viewtopic($field_name, $view_userdata, $map_name='') {    global $db, $lang, $phpEx, $board_config, $template;      $res = $img = $txt = '';      //Medal MOD    if ( $board_config['allow_medal_display'] )    {       $order = ( $board_config['medal_display_order'] ) ? "RAND()" : "m.medal_name";             $sql = "SELECT m.medal_id, m.medal_name, m.medal_image          FROM " . MEDAL_TABLE . " m, " . MEDAL_USER_TABLE . " mu          WHERE mu.user_id = '" . $view_userdata['user_id'] . "'          AND m.medal_id = mu.medal_id          ORDER BY " . $order;           if ($result = $db->sql_query($sql))       {          $rowset = array();          while ($row = $db->sql_fetchrow($result))          {             $rowset[$row['medal_image']]['medal_name'] = $row['medal_name'];             if ($rowset[$row['medal_image']]['medal_name'] == $row['medal_name'])             $rowset[$row['medal_image']]['medal_count'] += 1;          }            // Check Medal config in ACP          $medal_rows = $board_config['medal_display_row'];          $medal_cols = $board_config['medal_display_col'];          $medal_width = ( $board_config['medal_display_width'] ) ? 'width="'.$board_config['medal_display_width'].'"' : '';          $medal_height = ( $board_config['medal_display_height'] ) ? 'height="'.$board_config['medal_display_height'].'"' : '';              if (!empty($rowset))          {             $split_row = $medal_cols - 1;               $s_colspan = 0;             $row = 0;             $col = 0;          $template->set_filenames(array('medal_topic' => 'medal_topic_body.tpl')); $template->assign_block_vars('medal', array());             while (list($medal_image, $medal) = @each($rowset))             {                if (!$col)                {                   $template->assign_block_vars('medal.medal_row', array());                }                  $template->assign_block_vars('medal.medal_row.medal_col', array(                   'MEDAL_IMAGE' => $phpbb_root_path . $medal_image,                   'MEDAL_WIDTH' => $medal_width,                   'MEDAL_HEIGHT' => $medal_height,                   'MEDAL_NAME' => $medal['medal_name'],                   'MEDAL_COUNT' => '('. $lang['Medal_amount'] . $medal['medal_count']. ')')                );                  $s_colspan = max($s_colspan, $col + 1);                  if ($col == $split_row)                {                   if ($row == $medal_rows - 1)                   {                      break;                   }                   $col = 0;                   $row++;                }                else                {                   $col++;                }             }          $db->sql_freeresult($result);          ob_start();          $template->pparse('medal_topic');          $txt = ob_get_contents();          ob_end_clean();            $template->_tpldata['medal.'] = '';          $template->_tpldata['medal.medal_row.'] = '';          $template->_tpldata['medal.medal_row.medal_col.'] = '';          }         }    }        $res = pcp_output_format($field_name, $txt, $img, $map_name);    return $res; }  


In def_usermaps.php:
Code: Select all
Find viewtopic.leftwherever you want to put the medals and the count put  'medal_count' => array(             'txt'          => true,             'style'        => '%s',             'dsp_func'     => 'pcp_medal_count_viewtopic',          ),          'medal_list' => array(             'txt'          => true,             'style'        => '%s',             'dsp_func'     => 'pcp_medal_list_viewtopic',          ),  


Attached are the files as well for making its own tab for medal display on the public part of the profile. I found it gets too cluttered if you put the medals on the main page. I have members with 8-10 medals a piece so listing them on the main profile would get cluttered.

[url=http]Medals Files[/url]

Also in language/lang_english/lang_extend_pcp_addons.php add the following two entries
Code: Select all
$lang['profilcp_medals_shortcut'] = 'Medal Case'; $lang['profilcp_medals_pagetitle'] = 'Medals';


I think those are the edits I have
Edited Feb 26th at 11:19 AM EST

PostPosted: Thu Feb 07, 2008 8:37 am
Author: krillmeed
My members are interested in having this mod added to our 1.41 version forum. Has anyone tried to install it on one? If not, were can i download the 1.40 version and test it if it is possible <img>

PostPosted: Sun Mar 16, 2008 11:14 am
Author: krillmeed
Seems its been a while for an answer for this. Does this mean that this mod is no longer available?

Re: Roster/Medals Mod?

PostPosted: Sun Mar 16, 2008 2:49 pm
Author: MWE_001
Dragonsys isnt around anymore. His site is gone as well except for his main site. I dont think he does phpBB anymore. I got ahold of him a while back but it was by chance is all.

If I can get a copy of the one MR DSL did for PCP im sure I could get it to work. May take a bit, but Im sure I can pull it off. If I do, I will post it in the PCP forum.

Unless someone has allready done it and will share <img>

PostPosted: Sun Mar 16, 2008 11:07 pm
Author: krillmeed
Thank you sir, really would be nice to have this Mod.

Re: Roster/Medals Mod?

PostPosted: Mon Mar 17, 2008 1:16 pm
Author: MWE_001
well, with some minor tweaking, I got award Icons mod working. Not sure if its the same or not. I have never used either of these 2 mods in question.

Ill have to see if I can get a copy of the medals mod and see how close it is to awards icons mod.

Re: Roster/Medals Mod?

PostPosted: Mon Mar 17, 2008 1:48 pm
Author: krillmeed
Here is were they downloaded the original phpbb2 one:

http://www.phpbb.com/community/viewtopic.php?t=148362

i noticed the edits you have to make are still in this topic <img>

Re: Roster/Medals Mod?

PostPosted: Mon Mar 17, 2008 3:38 pm
Author: MWE_001
Yeah I was going tot ry and adapt those edits to award icons as well in its won way to ad a tab for wards in profile instad of on the main profile page. As well, I think for awards icons a text link would be better in view topic left as well instead of each icon.

And thatnks for the link. Im gonna go and grab the file and check it out. <img>

PostPosted: Mon Mar 17, 2008 11:22 pm
Author: krillmeed
Makes sense MWE; Saves loading time i would think, less strain on the database:

PostPosted: Mon Mar 24, 2008 10:48 am
Author: krillmeed
Sorry to bug, but any updates or progress on this mod?

Re: Roster/Medals Mod?

PostPosted: Thu Mar 27, 2008 9:53 am
Author: MWE_001
I havent had any time to look any further into it. I started on building another website and it has consumed me entirely. I will be getting back to my test site real soon like as I have a few more mods I need to check out and test.

Hopefully if I cant get to it one will for sure.