TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 394
  • Total: 394

TP Champ Block?

Started by bluedevil, October 10, 2006, 11:20:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bluedevil

I wasnt sure where to post this.

I thought i saw a Tp Champ Block download once somewhere in there but i cant find it. Anyone know a link to dload it?



Thnx,BD.

G6Cad

TP Champ block ??? Can you explain it a bit more please ?

bluedevil

Quote from: Mrs G6 on October 10, 2006, 11:23:32 PM
TP Champ block ??? Can you explain it a bit more please ?

Im sorry. I thought i saw a download for arcade champ block mod(scrolling up) for TP somewhere in this site,but i cant find it know. Any ideas?

RoarinRow

Quote from: bluedevil on October 10, 2006, 11:42:47 PM
Quote from: Mrs G6 on October 10, 2006, 11:23:32 PM
TP Champ block ??? Can you explain it a bit more please ?

Im sorry. I thought i saw a download for arcade champ block mod(scrolling up) for TP somewhere in this site,but i cant find it know. Any ideas?

I use this one in a right block -

global $scripturl;
/*
|----------------------------------
      SMF ARCADE CHAMPS BLOCK
      by Eric Lawson
|----------------------------------
      Made for

      TinyPortal
      SMF SMF forum 1.1RC1/RC2
      SMF Arcade_1.2.4b (1.2.4 should be ok :) )
      And Works with Beta Arcade


*/


// -- SETUP EDITS ---

$db_prefix = 'smf_'; //edit this to your your database prefix - usually smf_
$no = 10; //number of top players to show

// --LANGUAGE EDITS --
$txtplay = "The Top Players"; // change "The Top Players" to your language
$txtwin = "Number Of Wins :";// change "Number Of Wins :" to your language
$txtlate = "Latest High Score by ";// change "Latest High Score set by" to your language
$txtwit = "with ";// change "with" to your language
$txton = "on ";// change "on" to your language

require('./Settings.php');


$link = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name, $link);

// --START BLOCK CODE --
$content = "";  //set blank for a start

//Get newest champ or die
$sql = "SELECT m.ID_MEMBER,m.realName,g.id, g.game, g.name,g.champion_score "
. "FROM {$db_prefix}members m , {$db_prefix}games g "
. "WHERE g.champion_score > 0 AND m.ID_MEMBER=g.champion_member "
. "ORDER BY g.champion_time DESC LIMIT 0,1";

if(!($result = mysql_query($sql,$link)))
{
die("Could not get the newest champ");
}
$row = mysql_fetch_assoc($result);
mysql_free_result($result);

//newest champ details
$playerid = $row['ID_MEMBER'];
$player = $row['realName'];
$game_id = $row['id'];
$game_name = $row['name'];
$score = $row['champion_score'];

//now get the pic for the game
$ext = array('gif','GIF','png','PNG','jpg','JPG',);
$game_pic = ""; // No thumbnail for default
foreach($ext as $ex)
{
if(file_exists($boarddir. "/Games/".$row['game'].".".$ex))
{
$game_pic = $boardurl."/Games/".$row['game'].".".$ex;
}
}


//Get the 10 best players or die
$sql = "SELECT m.ID_MEMBER, m.realName, count(g.id) As cnt"
. " FROM {$db_prefix}games g, {$db_prefix}members m"
. " WHERE m.ID_MEMBER=g.champion_member"
. " GROUP BY realName "
. " ORDER BY cnt DESC LIMIT 0,{$no}";
if(!($result = db_query($sql,__FILE__,__LINE__)))
{
die("Could not get the best players");
}

$row = mysql_fetch_assoc($result);

$score_poss=0; //players position

//make the block content
$content .= "<table width=\"100%\" ><tr>
</tr>";

$content .= "
<tr>
<td>
<marquee behavior='scroll' align='center' direction='up' height='160' scrollamount='1' scrolldelay='50' onmouseover='this.stop()' onmouseout='this.start()'>
<br />
<div align=\"center\"><a href=\"{$scripturl}?action=arcade;sa=play;game={$game_id}\"><img src=\"{$game_pic}\" border= \"0\" /></a>
<br />{$txtlate}<br />
<a href=\"{$scripturl}?action=profile;u=$playerid\">{$player}</a><br />{$txtwit} {$score} {$txton} {$game_name}
<br />------------------<br />{$txtplay}
<br /> ";
do
{
$score_poss++;
$content .= "
$score_poss -
<a href=\"{$scripturl}?action=profile;u=".$row['ID_MEMBER']."\"> ".$row['realName']."</a>
<br /> $txtwin ".$row['cnt']."
<br /><br />";
}  while ($row = mysql_fetch_assoc($result));

mysql_free_result($result);
$content .= "</marquee></div></td></tr></table>" ;

echo $content;

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

bluedevil

Quote from: RoarinRow on October 10, 2006, 11:45:39 PM
Quote from: bluedevil on October 10, 2006, 11:42:47 PM
Quote from: Mrs G6 on October 10, 2006, 11:23:32 PM
TP Champ block ??? Can you explain it a bit more please ?

Im sorry. I thought i saw a download for arcade champ block mod(scrolling up) for TP somewhere in this site,but i cant find it know. Any ideas?

I use this one in a right block -

global $scripturl;
/*
|----------------------------------
      SMF ARCADE CHAMPS BLOCK
      by Eric Lawson
|----------------------------------
      Made for

      TinyPortal
      SMF SMF forum 1.1RC1/RC2
      SMF Arcade_1.2.4b (1.2.4 should be ok :) )
      And Works with Beta Arcade


*/


// -- SETUP EDITS ---

$db_prefix = 'smf_'; //edit this to your your database prefix - usually smf_
$no = 10; //number of top players to show

// --LANGUAGE EDITS --
$txtplay = "The Top Players"; // change "The Top Players" to your language
$txtwin = "Number Of Wins :";// change "Number Of Wins :" to your language
$txtlate = "Latest High Score by ";// change "Latest High Score set by" to your language
$txtwit = "with ";// change "with" to your language
$txton = "on ";// change "on" to your language

require('./Settings.php');


$link = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name, $link);

// --START BLOCK CODE --
$content = "";  //set blank for a start

//Get newest champ or die
$sql = "SELECT m.ID_MEMBER,m.realName,g.id, g.game, g.name,g.champion_score "
. "FROM {$db_prefix}members m , {$db_prefix}games g "
. "WHERE g.champion_score > 0 AND m.ID_MEMBER=g.champion_member "
. "ORDER BY g.champion_time DESC LIMIT 0,1";

if(!($result = mysql_query($sql,$link)))
{
die("Could not get the newest champ");
}
$row = mysql_fetch_assoc($result);
mysql_free_result($result);

//newest champ details
$playerid = $row['ID_MEMBER'];
$player = $row['realName'];
$game_id = $row['id'];
$game_name = $row['name'];
$score = $row['champion_score'];

//now get the pic for the game
$ext = array('gif','GIF','png','PNG','jpg','JPG',);
$game_pic = ""; // No thumbnail for default
foreach($ext as $ex)
{
if(file_exists($boarddir. "/Games/".$row['game'].".".$ex))
{
$game_pic = $boardurl."/Games/".$row['game'].".".$ex;
}
}


//Get the 10 best players or die
$sql = "SELECT m.ID_MEMBER, m.realName, count(g.id) As cnt"
. " FROM {$db_prefix}games g, {$db_prefix}members m"
. " WHERE m.ID_MEMBER=g.champion_member"
. " GROUP BY realName "
. " ORDER BY cnt DESC LIMIT 0,{$no}";
if(!($result = db_query($sql,__FILE__,__LINE__)))
{
die("Could not get the best players");
}

$row = mysql_fetch_assoc($result);

$score_poss=0; //players position

//make the block content
$content .= "<table width=\"100%\" ><tr>
</tr>";

$content .= "
<tr>
<td>
<marquee behavior='scroll' align='center' direction='up' height='160' scrollamount='1' scrolldelay='50' onmouseover='this.stop()' onmouseout='this.start()'>
<br />
<div align=\"center\"><a href=\"{$scripturl}?action=arcade;sa=play;game={$game_id}\"><img src=\"{$game_pic}\" border= \"0\" /></a>
<br />{$txtlate}<br />
<a href=\"{$scripturl}?action=profile;u=$playerid\">{$player}</a><br />{$txtwit} {$score} {$txton} {$game_name}
<br />------------------<br />{$txtplay}
<br /> ";
do
{
$score_poss++;
$content .= "
$score_poss -
<a href=\"{$scripturl}?action=profile;u=".$row['ID_MEMBER']."\"> ".$row['realName']."</a>
<br /> $txtwin ".$row['cnt']."
<br /><br />";
}  while ($row = mysql_fetch_assoc($result));

mysql_free_result($result);
$content .= "</marquee></div></td></tr></table>" ;

echo $content;


Thnx Ro!..........It worked. I was using SSI instead if php.

RoarinRow

No problemo, I should have said, put in a php block   :o

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Tron420

how can i add the "arcade_block.gif" to the top of this block? so it will have the arcade_block pic at the top that u can click to go to the arcade and the scolling champs right under it ?? every time i try i get errors and the block dont work.

JPDeni

Add


echo '
  <a href="http://url/to/your/link"><img src="path/to/arcade_block.gif"></a>
';

joybreezy

Is there code available for SMF 1.1.3?

G6Cad


This website is proudly hosted on Crocweb Cloud Website Hosting.