TinyPortal

Development => Block Codes => Topic started by: bluedevil on October 10, 2006, 11:20:26 PM

Title: TP Champ Block?
Post by: bluedevil on October 10, 2006, 11:20:26 PM
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.
Title: Re: TP Champ Block?
Post by: G6Cad on October 10, 2006, 11:23:32 PM
TP Champ block ??? Can you explain it a bit more please ?
Title: Re: TP Champ Block?
Post by: 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?
Title: Re: TP Champ Block?
Post by: 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;
Title: Re: TP Champ Block?
Post by: bluedevil on October 11, 2006, 04:24:21 AM
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.
Title: Re: TP Champ Block?
Post by: RoarinRow on October 11, 2006, 05:03:08 AM
No problemo, I should have said, put in a php block   :o
Title: Re: TP Champ Block?
Post by: Tron420 on April 30, 2007, 07:22:12 PM
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.
Title: Re: TP Champ Block?
Post by: JPDeni on April 30, 2007, 08:12:45 PM
Add


echo '
  <a href="http://url/to/your/link"><img src="path/to/arcade_block.gif"></a>
';
Title: Re: TP Champ Block?
Post by: joybreezy on July 23, 2007, 07:35:25 PM
Is there code available for SMF 1.1.3?
Title: Re: TP Champ Block?
Post by: G6Cad on July 23, 2007, 10:03:26 PM
www.smfarcade.info
Title: Re: TP Champ Block?
Post by: Jordan on July 24, 2007, 04:59:47 AM
just wondering, since tp is the 1s that own this program how come you are making ppl go to their site? why not just update the first post with the new code for the newest versions instead of wiggling people around to all diff sites? just wonderin
Title: Re: TP Champ Block?
Post by: G6Cad on July 24, 2007, 10:16:46 AM
Because we dont support any other mods on this site except tinyportal.
THe Arcade modification have it's own site for their development, and there for we send embers that have questions about other software to the forums that hold and have the support for what they ask.
Title: Re: TP Champ Block?
Post by: Assistance on August 02, 2007, 02:29:37 PM



//-------START-------------
/*
|----------------------------------
SMF ARCADE SCROLLING CHAMPS BLOCK for SMFARCADE V2
by Eric Lawson
|----------------------------------
Made for TinyPortal and SMF forum

*/
//Upload a pic called arcade_block.gif (you can use you own gif - just name it arcade_block.gif)
//to your Themes/<themename>/images/ folder

// -- SETUP EDITS ---

$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

global $scripturl,$sourcedir,$boardurl,$db_prefix,$modSettings;
require_once($sourcedir.'/ArcadeStats.php');

//Get newest champ or die
$sql = "SELECT game.ID_GAME, game.gameName, game.thumbnail, game.gameDirectory,
        IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem.realName,'') AS realName, score.score
        FROM {$db_prefix}arcade_scores AS score
        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = score.ID_MEMBER)
        JOIN {$db_prefix}arcade_games AS game ON (game.ID_GAME = score.ID_GAME)
        ORDER BY `championFrom` DESC
        LIMIT 0,1";
if(!($result = db_query($sql,__FILE__,__LINE__)))
{
die("Could not get the newest champ");
}
$row = mysql_fetch_assoc($result);
mysql_free_result($result);

if(isset($row['gameDirectory']))
{
$row['gameDirectory']=$row['gameDirectory']."/";
}

//newest champ details
$playerid = $row['ID_MEMBER'];
$player = $row['realName'];
$game_id = $row['ID_GAME'];
$game_name = $row['gameName'];
$score = $row['score'];
$game_pic = $modSettings['gamesUrl'].$row['gameDirectory'].$row['thumbnail'];

$bp=ArcadeStats_BestPlayers($no);

$score_poss=0; //players position

?>

<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scrollx=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeedx=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseitx=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeedx=marqueespeedx
var pausespeedx=(pauseitx==0)? copyspeedx: 0
var actualheightx=''

function scrollmarqueex(){
if (parseInt(cross_marqueex.style.top)>(actualheightx*(-1)+8))
cross_marqueex.style.top=parseInt(cross_marqueex.style.top)-copyspeedx+"px"
else
cross_marqueex.style.top=parseInt(marqueeheightx)+8+"px"
}

function initializemarqueex(){
cross_marqueex=document.getElementById("vmarqueex")
cross_marqueex.style.top=0
marqueeheightx=document.getElementById("marqueecontainerx").offsetHeight
actualheightx=cross_marqueex.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marqueex.style.height=marqueeheightx+"px"
cross_marqueex.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarqueex()",30)', delayb4scrollx)
}

if (window.addEventListener)
window.addEventListener("load", initializemarqueex, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarqueex)
else if (document.getElementById)
window.onload=initializemarqueex

</script>
<?php
echo '<table width="100%">
<tr>
<td align="center">
<br />
<a href="',$scripturl,'?action=arcade"><img src="',$settings['images_url'],'/gold.gif" border= "0" alt="Arcade" /></a>
<br /><br/>
</td>
</tr>
</table>
<div id="marqueecontainerx" style="position: relative; width: 95%; height:200px; overflow: hidden; border: 0px; padding: 2px; padding-left: 4px;" onmouseover="copyspeedx=pausespeedx" onmouseout="copyspeedx=marqueespeedx">
<div id="vmarqueex" style="position: absolute; width: 98%;">
<div align="center">
<a href="',$scripturl,'?action=arcade;sa=play;game=',$game_id,'"><img src="',$game_pic,'" border="0" alt="',$game_name,'" width="60" height="60"/></a>
<br />',$txtlate,'<br />
<a href="',$scripturl,'?action=profile;u=',$playerid,'">',$player,'</a>
<br/>',$txtwit,' ',$score,' ',$txton,'<br />',$game_name,'
<br />------------------<br />',$txtplay,'<br /><br />';
foreach ($bp as $out)
{
$score_poss++;
echo '',$score_poss,' - ',$out['link'],'<br />',$txtwin,' ',$out['champions'],'
     <br /><br />';
};
echo '</div>
</div>
</div>';

//---------END--------------


Title: Re: TP Champ Block?
Post by: cru on August 07, 2007, 02:30:28 PM
wow! thanks! this worked great! but i do not like it scrolling. is there a way to not make it scroll automatically? like the shoutbox?
Title: Re: TP Champ Block?
Post by: Assistance on August 17, 2007, 06:29:42 AM
remove <script type="text/javascript"> code </script>
Title: Re: TP Champ Block?
Post by: JustOneOldMan on November 18, 2007, 05:14:41 AM
@Assistance:  Quick question if you don't mind.  I just used your code above and it works great, except the game.thumbnail is not being picked up.  Just shows the red X.  I've been going through everything and I can't seem to find a problem with it.  The gamesURL and gameDirectory seem to be good.  I even tried hard coding just as a test and nothing.  Have you run into this?  Thanks...

/JOOM

#Edit:  Thanks, but I got it.  It was the gamesURL after all.  For some reason it wasn't picking up the "Games" folder and for some reason I couldn't make it do it.  Finally just hard coded the path for gamesURL and used gameDirectory and got it working.  Great mod, Assistance...
Title: Re: TP Champ Block?
Post by: jhall on January 14, 2008, 08:22:28 AM
Quote from: JustOneOldMan on November 18, 2007, 05:14:41 AM
@Assistance:  Quick question if you don't mind.  I just used your code above and it works great, except the game.thumbnail is not being picked up.  Just shows the red X.  I've been going through everything and I can't seem to find a problem with it.  The gamesURL and gameDirectory seem to be good.  I even tried hard coding just as a test and nothing.  Have you run into this?  Thanks...

/JOOM

#Edit:  Thanks, but I got it.  It was the gamesURL after all.  For some reason it wasn't picking up the "Games" folder and for some reason I couldn't make it do it.  Finally just hard coded the path for gamesURL and used gameDirectory and got it working.  Great mod, Assistance...
I added the "/" on this line and it fixed the same problem for me:
$game_pic = $modSettings['gamesUrl'].$row['gameDirectory'].$row['thumbnail'];
so now my line is:
$game_pic = $modSettings['gamesUrl']."/".$row['gameDirectory'].$row['thumbnail'];
Title: Re: TP Champ Block?
Post by: G6Cad on January 14, 2008, 08:28:37 AM
The reason the code doesent work properly is simply case the poster didnt use the codetags.'
When anyone post code with out them, the topic doesent parse the code with out adding things that doesent belong in it.
Title: Re: TP Champ Block?
Post by: alhaudhie on January 17, 2008, 02:18:58 AM
how can resize the text size....?