Here's what I did:
-------------------------------------------
in block_mostplayed.html---------------------------------
basicly modified it so that it has the proper tags to display the images. Most of the code is taken from
block_catgame.html but I kept the <ul> tag in the hope that it's still gonna work when I will display the game with thumbs images. It didn't, it just shows me one game(the last game from the list).
<h2>Hot Games</h2>
<div class="GamesRow">
<div class="leftgame">
<ul>
<div class="Thumb"><a href="!GAMEURL!">
<img class="Thumb" src="!IMG!" alt="Play !GAMETITLE!" />
<span class="mask"></span>
</a>
<div class="!PLAYS! plays"></div>
</div>
<p class="Title"><a href="!GAMEURL!">!GAMETITLE!</a></p>
<p class="Desc">!DESCRIPTION!</p>
</ul>
</div>
<!-- END DYNAMIC BLOCK: dynGamesRow -->
</div>
<br class="Clear"/>
<div class="BoxFooter"></div>
--------------------------------
in block_mostplayed.php---------------------------------------------
I added the neede functionality to the query search and assign_array such as IMG, Description....
<?php
/*******************************************************************
/ ProArcadeScript version: 1.3.2
/ File description:
/ The "Most Played" shows the game that were played more times
/ than the others
/
/ © 2007, ProArcadeScript. All rights reserved.
/*******************************************************************/
// find out which script call this block
$sScript = substr(strrchr($_SERVER['SCRIPT_NAME'], "/"), 1);
$tpl->define( "tplBMostPlayed", "block_mostplayed.html" );
$tpl->define_dynamic( "dynGame", "tplBMostPlayed" );
if( $sScript == "cat.php" )
$query = "SELECT id, category_id, title, latin_title,thumbnail, plays_total,description, active FROM " . $cMain["dbPrefix"] . "games
WHERE active=1 AND category_id=". $nCategory ." ORDER BY plays_total DESC LIMIT " . $cB["MOSTPLAYED"]["max"];
else
$query = "SELECT id, title, latin_title,thumbnail, plays_total,description,active FROM " . $cMain["dbPrefix"] . "games WHERE active=1
ORDER BY plays_total DESC LIMIT " . $cB["MOSTPLAYED"]["max"];
$res = $db->super_query( $query, true );
$tpl->define_dynamic( "dynGamesRow", "tplBGame" );
if( $res[0]["plays_total"] > 0 )
{
foreach($res as $i => $values)
if( $values["plays_total"] > 0 )
{
$sThumb = "content/thumbs/".$values["thumbnail"];
if( file_exists($sThumb) )
$sThumb = $cSite["sSiteRoot"].$sThumb;
else
$sThumb = $cSite["sSiteRoot"]."templates/".$cSite["sTemplate"]."/images/no_image.gif";
$tpl->assign(array(
"GAMEURL" => GameURL( $values["id"], $values["latin_title"] ),
"IMG"=> $sThumb,
"GAMETITLE" => $values["title"],
"PLAYS" => $values["plays_total"],
"DESCRIPTION" => $values["description"]
));
$tpl->parse( "MOSTPLAYED", ".dynGame" );
$tpl->parse( "DYNGAMES", ".dynGamesRow" );
}
$tpl->parse( "MOSTPLAYED", "tplBMostPlayed" );
}
else
$tpl->assign( "MOSTPLAYED", "" );
?>
Problem: it shows only one game. What I want it to be able to show them as a block of games like in categories or one beneath the other as a list.
Thanks