Last Game Section version: 1.2



Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[GS 1.2] Champ's avatar on high score
21-03-2009, 12:58 (This post was last modified: 21-03-2009 13:02 by Paretje.)
Post: #11
RE: Champ's avatar on high score
For the avatar at play page
Open games.php and find:
PHP Code:
        //Loading game
        
$query $db->query("SELECT DISTINCT g.gid, g.title, g.name, g.what, g.use_keys, g.bgcolor, g.width, g.height, c.username, c.score, s.score AS pscore
        FROM "
.TABLE_PREFIX."games g
        LEFT JOIN "
.TABLE_PREFIX."games_champions c ON (g.gid=c.gid)
        LEFT JOIN "
.TABLE_PREFIX."games_scores s ON (g.gid=s.gid AND s.uid='".$mybb->user['uid']."')
        WHERE g.gid='"
.$gid."' AND g.active='1'
        LIMIT 0,1"
); 

Replace with:
PHP Code:
        //Loading game
        
$query $db->query("SELECT DISTINCT g.gid, g.title, g.name, g.what, g.use_keys, g.bgcolor, g.width, g.height, c.username, c.score, s.score AS pscore, u.avatar
        FROM "
.TABLE_PREFIX."games g
        LEFT JOIN "
.TABLE_PREFIX."games_champions c ON (g.gid=c.gid)
        LEFT JOIN "
.TABLE_PREFIX."games_scores s ON (g.gid=s.gid AND s.uid='".$mybb->user['uid']."')
        LEFT JOIN "
.TABLE_PREFIX."users u ON (c.uid=u.uid)
        WHERE g.gid='"
.$gid."' AND g.active='1'
        LIMIT 0,1"
); 

In the same file find:
PHP Code:
        //Champion of game
        
if(!isset($game['username']))
        {
            
$game['username'] = "<strong>".$lang->na."</strong>";
            
$game['score'] = "<strong>".$lang->na."</strong>";
        }
        else
        {
            
$game['score'] = my_number_format(floatval($game['score']));
        }
        
        
$lang->champ $lang->sprintf($lang->champ$game['username'], $game['score']); 

After add:
PHP Code:
        //Champion of game
        
if(!empty($game['avatar']))
        {
            
$game['avatar'] = "<img src=\"".$game['avatar']."\" alt=\"\" /><br />";
        } 

Open the template games_play and find:
Code:
<tr>
<td class="trow2" align="center">
<img src="./games/{$theme_games['directory']}/champ.gif" alt="" /><br />
{$lang->champ}
</td>
</tr>

Replace with:
Code:
<tr>
<td class="trow2" align="center">
<img src="./games/{$theme_games['directory']}/champ.gif" alt="" /><br />
{$game['avatar']}
{$lang->champ}
</td>
</tr>

Online - Urbanus
Visit this user's website Find all posts by this user
Quote this message in a reply Firefox Linux Ubuntu
21-03-2009, 13:07
Post: #12
RE: Champ's avatar on high score
For the avatar for Best Players
Replace the template games_stats_bestplayers_bit with:
Code:
<td width="33%" valign="top">
<table width="100%">
<tr>
<td class="tcat" align="center">
<strong>{$bestplayers_place}:</strong>
</td>
</tr>
<tr>
<td class="trow2" align="center">
{$bestplayers_sen}
</td>
</tr>
</table>
<center>{$bestplayers_avatar}</center>
</td>

Online - Urbanus
Visit this user's website Find all posts by this user
Quote this message in a reply Firefox Linux Ubuntu
04-04-2009, 08:44
Post: #13
RE: Champ's avatar on high score
Thank you very much.... works fine
Visit this user's website Find all posts by this user
Quote this message in a reply Firefox Winows Vista
06-04-2009, 16:43
Post: #14
RE: Champ's avatar on high score
nice, great job
Find all posts by this user
Quote this message in a reply Safari Windows XP/2003
13-04-2009, 22:37
Post: #15
RE: Champ's avatar on high score
all these edits are different for the new version arent they ?? i tried em and i had to reinstall the whole thing again... is there a reason you dont include it in by default ?
Find all posts by this user
Quote this message in a reply Firefox Winows Vista
14-04-2009, 00:09
Post: #16
RE: Champ's avatar on high score
Well, I like the simple design like now, and this makes it so "huge". But, the changes should work, just use the last ones:
http://community.gamesection.org/thread-...ml#pid4542
http://community.gamesection.org/thread-...ml#pid4543

By the way: you shouldn't reinstall but just undo the changes Wink

Online - Urbanus
Visit this user's website Find all posts by this user
Quote this message in a reply Firefox Linux Ubuntu
09-09-2009, 22:53 (This post was last modified: 09-09-2009 23:12 by rapid.)
Post: #17
RE: [GS 1.2] Champ's avatar on high score
Hi all, just like to say this is a great feature to my board, but I have made some edits to it.
You need to have what Paretje has written previously for this to work correctly - For the avatar at play page & For the avatar for Best Players

Out-come of my changes:
1. Game title is in bold
2. Your highest score:, The purpose of (game name here): and The keys: are now in bold and included ( : ) as well.
3. Back to the Game Section & View high scores now have alt and title fields. (hover over them to see)
4. Lastly I added the alt & title fields to the game thumbnail which now says the name of the game when you hover over it.

Copy and replace whole code inside the games_play template with what is written below:
PHP Code:
<html>
<
head>
<
title>{$mybb->settings['bbname']} - {$lang->gamesection} - {$game['title']}</title>
{
$headerinclude}
</
head>
<
body>
{
$header}
{
$games_menu}
<
br />
<
table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" width="100%">
<
tr>
<
td colspan="2" class="thead"><b>{$game['title']}</b></td>
</
tr>
<
tr>
<
td class="trow1" align="center">
<
object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="{$game['width']}" height="{$game['height']}">
    <
param name="movie" value="./games/{$game['name']}.swf?ibpro_gameid={$game['gid']}" />
    <
param name="type" value="application/x-shockwave-flash" />
    <
param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer/" />
    <
param name="bgcolor" value="#{$game['bgcolor']}" />
    <
param name="quality" value="high" />
    <
param name="menu" value="false" />
    <
param name="width" value="{$game['width']}" />
    <
param name="height" value="{$game['height']}" />
    <
embed src="./games/{$game['name']}.swf?ibpro_gameid={$game['gid']}" width="{$game['width']}" height="{$game['height']}" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" menu="false"></embed>
    <
noembed>{$lang->flashisntinstall}</noembed>
</
object>
</
td>
<
td class="trow1" valign="top" align="left" width="200">
<
table border="0" cellpadding="5" width="100%">
<
tr>
<
td class="trow1" align="center">
<
img src="./games/images/{$game['name']}1.gif" title="{$game['title']}" alt="{$game['title']}" />
</
td>
</
tr>
<
tr>
<
td class="trow2" align="center">
<
img src="./games/{$theme_games['directory']}/champ.gif" title="Champion" alt="Champion" /><br />
{
$game['avatar']}
{
$lang->champ}
</
td>
</
tr>
<
tr>
<
td class="trow1" align="center">
<
b>{$lang->yourhighscore}</b><br />
{
$game['pscore']}
</
td>
</
tr>
<
tr>
<
td class="trow2" align="center">
<
a href="games.php" title="Back to the Game Section" alt="Back to the Game Section">{$lang->back}</a><br />
<
a href="games.php?action=scores&amp;gid={$game['gid']}" title="View High Scores" alt="View High Scores">{$lang->viewhighscores}</a>
</
td>
</
tr>
<
tr>
<
td class="trow1" align="center">
<
b>{$lang->purpose} {$game['title']}:</b><br />
{
$game['what']}
</
td>
</
tr>
<
tr>
<
td class="trow2" align="center">
<
b>{$lang->keys}:</b><br />
{
$game['use_keys']}
</
td>
</
tr>
</
table>
</
td>
</
tr>
</
table>
{
$online}
{
$games_footer}
{
$footer}
</
body>
</
html

As I use Firefox 99% of the time I noticed that the alt field never pops up, so I have included both alt and title fields.

For me this emphasizes the game page more and I would like to see this included in the whole plugin if possible.

REMEMBER: Make a backup of the template before you edit.
Find all posts by this user
Quote this message in a reply Firefox Windows XP/2003
12-03-2010, 12:18
Post: #18
RE: [GS 1.2] Champ's avatar on high score
Hi guys
Where can I find this "Replace the template games_stats_bestplayers_bit"

Thanks
Graham
Find all posts by this user
Quote this message in a reply Firefox Windows 9x/NT/2000
12-03-2010, 15:53
Post: #19
RE: [GS 1.2] Champ's avatar on high score
Log into your MyBB admin area, click the "Game Section" link up in the main links, then click "Templates" on the left and select "Templates of Game Section Default". Scroll down the list a bit and you will see the games_stats_bestplayers_bit template.
Find all posts by this user
Quote this message in a reply Firefox Windows XP/2003
Post Reply 


Forum Jump: