0 Members and 1 Guest are viewing this topic.
global $db_prefix, $scripturl, $modSettings, $smcFunc, $txt;$limit=5; $results = $smcFunc['db_query']('', ' SELECT id_game, internal_name, game_name, game_directory, thumbnail, enabled FROM {db_prefix}arcade_games WHERE enabled=1 ORDER BY id_game DESC LIMIT 0,{int:num}', array( 'num' => $limit, ) );while ($newest_game = mysql_fetch_assoc($results)){ $newgam .= ' <td width="20%"><center><a href="'.$scripturl.'?action=arcade;sa=play;game='.$newest_game['id_game'].'"><img src="'.$modSettings['gamesUrl'].'/'.$newest_game['game_directory'].'/'.$newest_game['thumbnail'].'" width="100" height="100" alt="Play '.$newest_game['game_name'].'" title="Play '.$newest_game['game_name'].'" /><br />'.$newest_game['game_name'].'</a></center></td>';} empty($newgam) ? $newgam = $txt['arcade_no_games'] : ''; $smcFunc['db_free_result']($results); echo '<table width="100%"><tr>'.$newgam.'</tr></table>';
global $db_prefix, $scripturl, $modSettings, $smcFunc, $txt;$limit=5;$results = $smcFunc['db_query']('', ' SELECT id_game, game_directory, thumbnail, game_name, enabled FROM {db_prefix}arcade_games WHERE enabled = 1 ORDER BY RAND() LIMIT {int:num}', array( 'num' => $limit, ));while ($rg = mysql_fetch_assoc($results)){ $random .= '<td width="20%"><center><a href="'.$scripturl.'?action=arcade;sa=play;game='.$rg['id_game'].'"><img class="imgBorder" src="'.$modSettings['gamesUrl'].'/'.$rg['game_directory'].'/'.$rg['thumbnail'].'" width="100" height="100" alt="'.$rg['game_name'].'" title="Play '.$rg['game_name'].'" /></a><br /><a href="'.$scripturl.'?action=arcade;sa=play;game='.$rg['id_game'].'">'.$rg['game_name'].'</a></center></td>';}empty($random) ? $random = '<div class="smalltext centertext">'. $txt['arcade_no_games'] .'</div>' : '';$smcFunc['db_free_result']($results);echo '<table width="100%"><tr>'.$random.'</tr></table>';
// Returns most played gamesglobal $db_prefix, $scripturl, $context, $modSettings, $smcFunc, $txt;$count = 5;$results = $smcFunc['db_query']('', ' SELECT id_game, game_name, game_directory, thumbnail, enabled, num_plays FROM {db_prefix}arcade_games WHERE num_plays != 0 AND enabled = 1 ORDER BY num_plays DESC LIMIT {int:num}', array( 'num' => $count, ));while ($score = mysql_fetch_assoc($results)){ $pop .= '<td width="20%"><center><img src="'.$modSettings['gamesUrl'].'/'.$score['game_directory'].'/'.$score['thumbnail'].'" width="100" height="100" alt="Play '.$score['game_name'].'" title="Play '.$score['game_name'].'" /></a><br /><a href="'.$scripturl.'?action=arcade;sa=play;game='.$score['id_game'].'">'.$score['game_name'].'</a></center></td>';}$smcFunc['db_free_result']($results);empty($pop) ? $pop = $txt['arcade_popular_none'] : '';echo '<table width="100%"><tr>'.$pop.'</tr></table>';
global $smcFunc, $db_prefix, $scripturl, $txt, $modSettings, $context;$count = 5; $request = $smcFunc['db_query']('', ' SELECT game.id_game, game.game_name, game.game_directory, game.thumbnail, score.score, score.position, score.end_time, IFNULL(mem.id_member, 0) AS id_member, IFNULL(mem.real_name, score.player_name) AS real_name FROM ({db_prefix}arcade_scores AS score, {db_prefix}arcade_games AS game) LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = score.id_member) WHERE score.position = 1 AND game.id_game = score.id_game ORDER BY end_time DESC LIMIT {int:count}', array( 'count' => $count, 'empty' => '' ) );while ($row = $smcFunc['db_fetch_assoc']($request)){ $code .= '<td width="20%"><center><a href="'.$scripturl.'?action=arcade;sa=play;game='.$row['id_game'].'"><img src="'.$modSettings['gamesUrl'] .'/'.$row['game_directory'].'/'.$row['thumbnail'].'" border="0" alt="'.$row['game_name'].'" title="'.$row['game_name'].'" width="100" height="100" /></a><br /><a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a><br /><a href="'.$scripturl.'?action=arcade;sa=play;game='.$row['id_game'].'">'.$row['game_name'].'</a></center></td>';}$smcFunc['db_free_result']($results);echo '<table width="100%"><tr>'.$code.'</tr></table>';
global $smcFunc, $db_prefix, $context, $scripturl, $txt;$result = $smcFunc['db_query']('', ' SELECT cat_name, id_cat FROM {db_prefix}arcade_categories ORDER BY cat_order');while ($cat = $smcFunc['db_fetch_assoc']($result)) { echo ' <a href="'.$scripturl.'?action=arcade;category='.$cat['id_cat'].'"><b>'.$cat['cat_name'].'</b></a><br />';}$smcFunc['db_free_result']($result);
Thanks i have kinda worked that out now as i say i brand new to all this and it all trial and error and im experimenting as i go,my next thing is to work out what all other funtions do ..namely single page thing etc and how to intergrate it all.......i've looked around the site (albeit blindly) for guides but to no avail,could u point me towards any helpful tutorials ? please..
btw i set up a trial site on xampp so i dont break my own whilst experimenting