A mini hack to have the trophies displayed in two columns. With more and more games added, the forum members who have a lot of trophies can cause plenty of vertical space in the post header area, especially for forums using the new postbit. This mini-hack will display the trophies in two columns, put into consideration of even or odd number of trophies.
includes/functions_showthread.php
Find this
PHP Code:
if ($arcadegeneral['awardson']==1) {
foreach ($awards as $key => $award) {
if ($award['userid']==$post['userid']) {
eval('$post[\'arcadeawards\'] .= "' . fetch_template('arcade_awards_bit') . '";');
}
}
}
Above code was inserted as the standard installation, replace it with
PHP Code:
if ($arcadegeneral['awardson']==1) {
if (!empty($awards))
{
$c = 1;
$post['arcadeawards'] = '<td width="100%"><table>';
foreach ($awards as $key => $award) {
if ($award['userid']==$post['userid']) {
eval('$post[\'arcadeawards\'] .= "' . fetch_template('arcade_awards_bit') . '";');
$c++;
}
}
$c++;
if ($c % 2) {
$post['arcadeawards'] .= "<td> </td></tr>";
}
$post['arcadeawards'] = $post['arcadeawards'] . "</table></td>";
}
}
(note the above code includes html tags, they should really be put into a template. So please regard this mini-hack as the quick and dirty hack)
Change arcade_awards_bit template to:
PHP Code:
<if condition="$c % 2"><tr>
<td><if condition="$award[icon]!=''"><a href="arcade.php?do=play&gameid=$award[gameid]"><img src="$stylevar[imgdir_arcade]/$award[icon]" alt="High Score: $award[highscore]" align="absmiddle" border=0></a> </if><span class="smallfont">$award[gametitle] Champion!</span></td>
<else />
<td><if condition="$award[icon]!=''"><a href="arcade.php?do=play&gameid=$award[gameid]"><img src="$stylevar[imgdir_arcade]/$award[icon]" alt="High Score: $award[highscore]" align="absmiddle" border=0></a> </if><span class="smallfont">$award[gametitle] Champion!</span></td></tr></if>
Have I missed anything? I forgot about the way I implemented originally after upgrading to v3.0.3, so I had to restart again. Above are the notes I put down. I hope I have not missed anything.