Game Section Community Forums

Full Version: Code to make "best players" names into links to their stats page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Right now the names of the top 3 players are plain text. I'd like for the names to be links to the players' stats pages. Any help is appreciated.

Thanks.
You can do that in the language-file for the bestplayers system: games_bestplayers.lang.php
Could you provide the code please. I've tried doing it myself but I keep getting the user name as the user id. Not sure how to make it grab the user id for the link.
Anybody?
I'm sorry, my videocard was broken.

Open inc/languages/english/games_bestplayers.lang.php and find:
PHP Code:
$l['bestplayers_sen'] = "<strong>{1}</strong><br />with <strong>{2}</strong> wins."

Replace with
PHP Code:
$l['bestplayers_sen'] = "<strong><a href=\"member.php?action=profile&amp;uid={3}\">{1}</a></strong><br />with <strong>{2}</strong> wins."

Open inc/plugins/games_bestplayers.php and find:
PHP Code:
            $bestplayers_sen sprintf($lang->bestplayers_sen$bestplayers['username'], $bestplayers['champs']); 

Replace with:
PHP Code:
            $bestplayers_sen sprintf($lang->bestplayers_sen$bestplayers['username'], $bestplayers['champs'], $bestplayers['uid']); 
(03-06-2008, 22:19)Paretje Wrote: [ -> ]I'm sorry, my videocard was broken.

Open inc/languages/english/games_bestplayers.lang.php and find:
PHP Code:
$l['bestplayers_sen'] = \"<strong>{1}</strong><br />with <strong>{2}</strong> wins.\"; 

Replace with
PHP Code:
$l['bestplayers_sen'] = \"<strong><a href=\\"member.php?action=profile&amp;uid={3}\\">{1}</a></strong><br />with <strong>{2}</strong> wins.\"; 

Open inc/plugins/games_bestplayers.php and find:
PHP Code:
            $bestplayers_sen sprintf($lang->bestplayers_sen$bestplayers['username'], $bestplayers['champs']); 

Replace with:
PHP Code:
            $bestplayers_sen sprintf($lang->bestplayers_sen$bestplayers['username'], $bestplayers['champs'], $bestplayers['uid']); 
No problem, sorry to hear about your card. Thanks for the code Smile
Would you provide this code for the latest version please?
should work on the latest version
(15-12-2009, 23:19)Andii S. Wrote: [ -> ]should work on the latest version

Where is "inc/languages/english/games_bestplayers.lang.php" now?
inc/languages/english/games.lang.php since it's now part of the default Game Section package.
Pages: 1 2