Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Chen Zhen

571
Horizontal javascript marquee: Latest Scores

Download the attached file. Copy its contents into a php portal block.

572
SMF Arcade Block Codes / High Scores/Stats Block
July 06, 2013, 03:09:31 PM
PHP Portal Block Code For SMF Arcade 2.5

Download the attached zip archive named block_pics.zip
...and using your FTP platform - add the graphic files contained in it to:
Themes / default / images / arc_icons


<<<<<<<<<<>>>>>>>>>>

High Scores/Stats PHP Block:

There is an adjustable setting near the start of the block to select if you want to display high scores only:

$mydisplays = true;  /* True = Show random display prior to scores, False = Show high scores and only show random display if playing game  */


PHP Block Code:

/* High score/stats block for SMF 2.0 Rcx and SMF Arcade v2.5
   Upload a pic called arcade_block.gif (you can use you own gif - just name it arcade_block.gif)
   and upload cup pics... 1.gif, 2.gif, 3.gif, 4.gif, 5.gif, 6.gif, 7.gif, 8.gif, 9.gif, 10.gif
   to your /Themes/default/images/arc_icons/

   -- SETUP EDITS ---   */

$no = 10; /* number of top players to show  */
$no_games = 8; /* Set total number of games to display  */
$icons_per_row = 4;  /*  Set games per row  */
$mydisplays = true;  /* True = Show random display prior to scores, False = Only show random display if playing game  */

/*  If playing a game... Display more game icons while not displaying marquee to improve performance */
$check_game = !empty($_REQUEST['game']) ? (int) $_REQUEST['game'] : 0;
if ($check_game == true) {$no_games = 28;}

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

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


$gamesUrl = (str_replace($boardurl . '/', '', $modSettings['gamesUrl'])) . '/';     

/* Get newest champ or die */
$sql = "SELECT  game.id_game, game.game_name, game.thumbnail, game.game_directory,
             IFNULL(mem.id_member, 0) AS id_member, IFNULL(mem.real_name,'') AS real_name, 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 `champion_from` DESC
        LIMIT 0,1";
if(!($request = $smcFunc['db_query']('', $sql)))
{
   die("Could not get the newest champ");
}
$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);

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

//newest champ details
$playerid = $row['id_member'];
$player = $row['real_name'];
$game_id = $row['id_game'];
$game_name = $row['game_name'];
$score = $row['score'];
$game_pic = $boardurl.'/'.$gamesUrl.$row['game_directory'].$row['thumbnail'];
if ($score == 1e+06)
{ $score = 1000000; }
$bp=ArcadeStats_BestPlayers($no);
if ($check_game == false)
{
$trophy[1] = '<img src="'.$boardurl. '/Themes/default/images/arc_icons/1.gif" border= "0" alt="Gold" />';
$trophy[2]= '<img src="'.$boardurl.'/Themes/default/images/arc_icons/2.gif" border= "0" alt="Silver" />';
$trophy[3] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/3.gif" border= "0" alt="Bronze" />';
$trophy[4] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/4.gif" border= "0" alt="Fourth Place" />';
$trophy[5] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/5.gif" border= "0" alt="Fifth Place" />';
$trophy[6] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/6.gif" border= "0" alt="Sixth Place" />';
$trophy[7] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/7.gif" border= "0" alt="Seventh Place" />';
$trophy[8] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/8.gif" border= "0" alt="Eighth Place" />';
$trophy[9] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/9.gif" border= "0" alt="Ninth Place" />';
$trophy[10] = '<img src="'.$boardurl.'/Themes/default/images/arc_icons/10.gif" border= "0" alt="Tenth Place" />';
$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 summary="arcspblock1" width="100%"><tr><td align="center"><a href="',$scripturl,'?action=arcade"><img src="',$boardurl,'/Themes/default/images/arc_icons/arcade_block.gif" border= "0" alt="Arcade" /></a>
               <br />
            </td>
         </tr>
      </table>'
;

if (
$mydisplays == true || $check_game == true)
{
/* Start 1 of 4 random stats display above top 10 marquee  */
$random_games_choice rand(1,4);
$games_choice 'games'.$random_games_choice;
$curr_position 0;
$games_choice($no_games,$curr_position,$icons_per_row$gamesUrl,$no);
/* END random stats display */ 
}
if (
$check_game == false)
{
echo 
'

      <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++;
                 if (
$score_poss 10)
                    {               
                       
$trophy[$score_poss] ='['.$score_poss.']';
                    }
                  echo 
''.$trophy[$score_poss].'<br />'.$out['link'].'<br />'.$txtwin.' '.$out['champions'].'
                       <br /><br />'
;
               };
   echo 
'</div>
         </div>
      </div>'
;
}
/* START - Display Functions */
Function games3($no_games,$curr_position,$icons_per_row$gamesUrl,$no)
{
   global 
$smcFunc$scripturl;
   
//show the latest games
   
echo '<div align="center">Latest Games<br />
   <table cellpadding="2" cellspacing="5">
   <tr>'
;
   
      
$result $smcFunc['db_query']('''
      SELECT id_game, game_name, thumbnail, game_directory
      FROM {db_prefix}arcade_games
      ORDER BY id_game DESC, game_name DESC
      LIMIT 0,{int:no}'
,
         array(
         
'no' => $no_games,
         )
      );
      
      while (
$game $smcFunc['db_fetch_assoc']($result))
      {

      
$game_thumb $boardurl '/' $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
      if(
$curr_position == $icons_per_row)
      {
         echo 
'</tr><tr>';
         
$curr_position=0;
      }
      echo
'
      <td>
      <a href="'
.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
      <img src="'
.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'" /></a>
      </td>'
;
      
$curr_position++;
   }
   
$smcFunc['db_free_result']($result);

   echo 
'
   </tr>
   </table></div>'
;
}

Function 
games1($no_games,$curr_position,$icons_per_row$gamesUrl,$no)
{
   
//show most played games (one score version only)
    
global $smcFunc$scripturl;

   echo 
'<div align="center">Most Played<br />
   <table cellpadding="2" cellspacing="5">
   <tr>'
;

    
$result $smcFunc['db_query']('''
      SELECT id_game, game_name, thumbnail, game_directory, num_plays
      FROM {db_prefix}arcade_games
      ORDER BY num_plays DESC , game_name ASC
      LIMIT 0,{int:no}'
,
         array(
         
'no' => $no_games,
         )
      );
      
      while (
$game $smcFunc['db_fetch_assoc']($result))
      {
      
$game_thumb $boardurl '/' $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
      if(
$curr_position == $icons_per_row)
      {
         echo 
'</tr><tr>';
         
$curr_position=0;
      }
      echo
'
      <td>
      <a href="'
.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
      <img src="'
.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'" /></a>
      </td>'
;
      
$curr_position++;
   }
   
$smcFunc['db_free_result']($result);

   echo 
'
   </tr>
   </table></div>'
;
}


Function 
games4($no_games,$curr_position,$icons_per_row$gamesUrl,$no)
{
   
//show least played games (one score version only)
   
global $smcFunc$scripturl;
   echo 
'<div align="center">Least Played<br />
   <table cellpadding="2" cellspacing="5">
   <tr>'
;

    
$result $smcFunc['db_query']('''
      SELECT id_game, game_name, thumbnail, game_directory, num_plays
      FROM {db_prefix}arcade_games
      ORDER BY num_plays ASC , game_name ASC
      LIMIT 0,{int:no}'
,
         array(
         
'no' => $no_games,
         )
      );
      
      while (
$game $smcFunc['db_fetch_assoc']($result))
      {
      
$game_thumb $boardurl '/' $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
      if(
$curr_position == $icons_per_row)
      {
         echo 
'</tr><tr>';
         
$curr_position=0;
      }
      echo
'
      <td>
      <a href="'
.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
      <img src="'
.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'" /></a>
      </td>'
;
      
$curr_position++;
   }
     
$smcFunc['db_free_result']($result);

   echo 
'
   </tr>
   </table></div>'
;
}


Function 
games2($no_games,$curr_position,$icons_per_row$gamesUrl,$no)
{
   
//show best rated games
    
global $smcFunc$scripturl;
   echo 
'<div align="center">Top Rated<br />
   <table cellpadding="2" cellspacing="5">
   <tr>'
;

    
$result $smcFunc['db_query']('''
      SELECT id_game, game_name, thumbnail, game_directory, game_rating
      FROM {db_prefix}arcade_games
      ORDER BY game_rating DESC , game_name ASC
      LIMIT 0,{int:no}'
,
         array(
         
'no' => $no_games,
         )
      );
      
      while (
$game $smcFunc['db_fetch_assoc']($result))
      {
      
$game_thumb $boardurl '/' $gamesUrl.$game['game_directory']."/".$game['thumbnail'];
      if(
$curr_position == $icons_per_row)
      {
         echo 
'</tr><tr>';
         
$curr_position=0;
      }
      echo
'
      <td>
      <a href="'
.$scripturl.'?action=arcade;sa=play;game='.$game['id_game'].'">
      <img src="'
.$game_thumb.'" border="0" alt="'.$game['game_name'].'" width="30" height="30" title="Play '.$game['game_name'].'" /></a>
      </td>'
;
      
$curr_position++;
   }
   
$smcFunc['db_free_result']($result);

   echo 
'
   </tr>
   </table></div>'
;
}
/* END - Display Functions  */      
/* END - High Score/Stats Block For SMF 2.0 Rcx */


If there is an issue with the block code provided in the code tags shown above, download the block code text file & use its contents.
573
SMF Arcade Block Codes / PDL Block
July 06, 2013, 03:02:51 PM
This block is specifically for use with the PDL/Skin combo plugin.

PHP Block Code -
$gameid - represents the game ID.
To select a game, choose:   game name, game file name or the game id number.
Entering a number less than 1, RAND or a name that isn't in the database plays a random game.
               

global $scripturl, $boardurl, $txt;
/* Change this gameid to a another game id, random (0 or RAND), or a game name  */
$gameid = 'RAND';
$ranum = (RAND(1,1255));
$id = 'x'.$gameid.$ranum.'x';
echo  '<center><a href="'.$scripturl.'?action=arcade;sa=popup;game='.$gameid.'" target="'.$id.'"><img src="'.$boardurl.'/Themes/default/images/arc_icons/popup_play_btn.gif"></img></a></center>
<center><p><!--[if IE]>
<iframe id="'.$id.'" name="'.$id.'" style="display:inherit;background-color:#000000;" src="'.$scripturl.'?action=arcade;sa=popup;game=PLAY" scrolling="no" frameborder="0" width="790" height="590">
<![endif]--><!--[if !IE]><!-->
<iframe id="'.$id.'" name="'.$id.'" style="display:inherit;" src="'.$scripturl.'?action=arcade;sa=popup;game=PLAY" scrolling="no" frameborder="0" width="805" height="620">
<!--<![endif]--></iframe></p></center>';
      
574
Category block for SMF Arcade 2.5

Copy and paste this into a PHP code block (I suggest top or bottom block):

global $db_prefix, $modSettings, $context, $sourcedir, $scripturl, $smcFunc, $boardurl;

$requestit = array();
$rowit = array();
$category = array();
$jam = array();
$jam['arcade_category'] = array();

   $requestit = $smcFunc['db_query']('', '
      SELECT id_cat, cat_name, num_games, cat_order
      FROM {db_prefix}arcade_categories
      ORDER BY cat_order',
      array()
   );

    while ($rowit = $smcFunc['db_fetch_assoc']($requestit))
   {
      $jam['arcade_category'][] = array(
         'id' => $rowit['id_cat'],
         'name' => $rowit['cat_name'],
         'href' => $scripturl . '?action=arcade;category=' . $rowit['id_cat'],
         'games' => $rowit['num_games'],
         'order' => $rowit['cat_order'],
      );
   }
   $smcFunc['db_free_result']($requestit);
 
   /*
       Set table width & column variables  -
      change $NumberOfColumns for the number of columns across                  */
   $NumberOfColumns=4;
   $columns=0;

   echo '<table summary="cats_block2" border="0" cellspacing="2" cellpadding="5" class="smalltext" align="center" style="overflow: hidden;">
         <tr>';

   foreach ($jam['arcade_category'] as $category)
   {   
      if ($columns <= $NumberOfColumns)  {
$gamepic_name = str_replace (" ", "_", $category['name']);
$gamepic_name = str_replace ("/", "-", $gamepic_name);
$category_pic = '<img src="' .$boardurl. '/Themes/default/images/arc_icons/'.$gamepic_name.'.gif" border="0" alt="~"  title="'.$category['name'].'" width="25" height="22" />';
            echo'   <td align="justify" width="320">', $category_pic," ",
               '<a href="', $category['href'], '">',$category['name'], '</a> (', $category['games'] , '
               games)</td>';
      $columns++;
      }

      if ($columns >= $NumberOfColumns)  {
         echo '</tr>';
         echo '<tr>';
         $columns=0;
      }

       }

   echo '<td>';
/* mt  */
echo '</td></tr></table>';
   

<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>

For Simple Portal users, you can have this show in your arcade (only) by selecting Advanced Options and enter the following into Custom Display Options:
~action|arcade


Note:
The categories can also be displayed with small icons. Just name the icon the same as your category name except change any spaces to an underscore (case sensitive) and make sure it's in gif format.
Place the icons in: / Themes / default / images / arc_icons
The icons are set at 20 x 20 but this can be edited within the block.

575
SMF Arcade Block Codes / Latest Games Block
July 06, 2013, 02:59:32 PM
SMF 2.0 Rcx and SMF Arcade

Latest games block (icons only):

Create a new php block...

Enter this for custom display options:
(For viewing on portal - leave this line blank)

~action|arcade


Change '$icons_per_row' to equal the amount preferred
Change 'LIMIT' to equal the amount preferred

Main code:

// Latest games block by Underdog
// For SMF2.0 Rcx and SMF Arcade
// Arcade page already has latest game command
// - it just needs a button put on the arcade page
// Suggested placement is on portal

global $db_prefix, $scripturl, $modSettings, $boardurl, $smcFunc;
   $arcade = '<table><tr>';
   $count1 = 0;
   $icons_per_row = 4;

   $request = $smcFunc['db_query']('', '
   SELECT game.id_game, game.game_name, game.game_directory, game.thumbnail
      FROM {db_prefix}arcade_games AS game
     ORDER BY game.id_game DESC   
      LIMIT 44', array()
   );
   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
      if ($count1 > ($icons_per_row - 1)){$count1 = 0; $arcade .= '</tr><tr>';}
      $count1 =$count1 + 1;
      $arcade .= '<td align="center"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $row['id_game'] . '"><img style="width:42px; height:42px;" src="' . $boardurl . '/Games/';
      if(isset($row['game_directory']) && $row['game_directory'] != '') {$arcade .= $row['game_directory'] . '/';}
      $arcade .= $row['thumbnail'] . '" alt="'.$row['game_name'].'" title="'.$row['game_name'].'" /></a></td>';   
   }
$smcFunc['db_free_result']($request);   
   $arcade .= '</tr></table>';
   echo $arcade;


576
SMF Arcade Block Codes / Random Games Block
July 06, 2013, 02:57:31 PM
SMF 2.0 Rcx and SMF Arcade 2.5

Random games block (icons only):

This one is set up only to appear when the user is not playing a game.
There are 2 limit settings... one for users and one for guests. You can set both as the same if you wish.

Create a new php block...

Enter this for custom display options:
(For viewing on portal - leave this line blank)
~action|arcade

$evenRows = [BOOLEAN] option to trim uneven rows
$guestMax = [INT] to equal the amount preferred
$userMax = [INT] to equal the amount preferred
$icons_per_row = [INT] to equal the amount preferred

Main code:
// adjustable variables
list($evenRows, $guestMax, $userMax, $icons_per_row) = array(true, 60, 28, 4);

global $scripturl, $modSettings, $smcFunc, $user_info, $settings;
$check_game = isset($_REQUEST['game']) ? floatval($_REQUEST['game']) : 0;
$path = str_replace('\\', '/', $modSettings['gamesDirectory']);
$filepath = rtrim($path, '/');
$defaultIcon = file_exists($settings['default_theme_dir'] . '/images/arc_icons/game.gif') ? $settings['default_images_url'] . '/arc_icons/game.gif' : '';
list($arcade, $arcadePermissionMode, $count1) = array('', (!isset($modSettings['arcadePermissionMode']) ? 1 : $modSettings['arcadePermissionMode']), 0);


// check permissions
if (allowedTo('arcade_admin'))
{
$see_game = '1=1';
$see_category = '1=1';
}
else
{
if ($arcadePermissionMode >= 2)
{
if ($user_info['is_guest'])
$see_game = '(game.id_cat = 0 AND ' . (allowedTo('arcade_view') ? 1 : 0) . ' = 1) OR (game.local_permissions = 0 OR FIND_IN_SET(-1, game.member_groups))';
else
$see_game = '(game.local_permissions = 0 OR (FIND_IN_SET(' . implode(', game.member_groups) OR FIND_IN_SET(', $user_info['groups']) . ', game.member_groups)))';
}

if ($arcadePermissionMode == 1 || $arcadePermissionMode >= 3)
{
if ($user_info['is_guest'])
$see_category = '(game.id_cat = 0 AND ' . (allowedTo('arcade_view') ? 1 : 0) . ' = 1) OR (FIND_IN_SET(-1, category.member_groups))';
else
$see_category = '(FIND_IN_SET(' . implode(', category.member_groups) OR FIND_IN_SET(', $user_info['groups']) . ', category.member_groups) OR ISNULL(category.member_groups))';
}
}

if (empty($arcadePermissionMode))
$where = 'enabled = 1';
elseif ($arcadePermissionMode == 1)
$where = '(enabled = 1 AND ' . $see_category . ')';
elseif ($arcadePermissionMode == 2)
$where = '(enabled = 1 AND ' . $see_game . ')';
elseif ($arcadePermissionMode == 3)
$where = '(enabled = 1 AND (' . $see_category . ' AND ' . $see_game . '))';
elseif ($arcadePermissionMode == 4)
$where = '(enabled = 1 AND (' . $see_category . ' OR ' . $see_game. '))';

$where = !empty($where) ? $where : '1=1';


if ($check_game == false)
{
$arcade = '<div style="display: table;width: 100%;"><div style="display: table-row;">';
$id_game = false;
$result =  $smcFunc['db_query']('', '
SELECT COUNT(*) as total
FROM {db_prefix}arcade_games as game
LEFT JOIN {db_prefix}arcade_categories AS category ON (category.id_cat = game.id_cat)
WHERE {raw:query_see_game}',
array(
'query_see_game' => $where,
)
);
$totalView = $smcFunc['db_fetch_assoc']($result);
$smcFunc['db_free_result']($result);

$totalPermitted = !empty($totalView['total']) ? $totalView['total'] : 0;
$guestMax = $totalPermitted >= $guestMax ? (int)$guestMax : (int)$totalPermitted;
$userMax = $totalPermitted >= $userMax ? (int)$userMax : (int)$totalPermitted;
$guestMax = $evenRows ? $guestMax - ($guestMax % $icons_per_row) : $guestMax;
$userMax = $evenRows ? $userMax - ($userMax % $icons_per_row) : $userMax;

if (empty($user_info['is_guest']) && !empty($totalPermitted))
{
$request = $smcFunc['db_query']('', '
SELECT game.id_game, game.game_name, game.game_directory, game.thumbnail, game.id_cat, category.member_groups
FROM {db_prefix}arcade_games AS game
LEFT JOIN {db_prefix}arcade_categories AS category ON (category.id_cat = game.id_cat)
WHERE {raw:query_see_game}
ORDER BY RAND()
LIMIT ' . $userMax,
array(
'query_see_game' => $where,
)
);

while ($row = $smcFunc['db_fetch_assoc']($request))
{
if ($count1 % $icons_per_row == 0)
$arcade .= '</div><div style="display: table-row;">';


$thumbnailFile = '';

if (!empty($row['thumbnail']))
{
$thumbnailFile = $filepath . '/' . (!empty($row['game_directory']) ? $row['game_directory'] . '/' : '') . $row['thumbnail'];
$thumbnailPath = file_exists($thumbnailFile) ? $modSettings['gamesUrl'] . '/' . (!empty($row['game_directory']) ? $row['game_directory'] . '/' : '') . $row['thumbnail'] : '';
}
elseif (!empty($defaultIcon))
$thumbnailPath = $defaultIcon;

$count1++;

if (empty($thumbnailFile))
continue;

$arcade .= '<div class="centertext" style="display: table-cell;"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $row['id_game'] . '"><img style="width:42px; height:42px;" src="' . $thumbnailPath . '" alt="'.$row['game_name'].'" title="'.$row['game_name'].'" /></a></div>';

}
$smcFunc['db_free_result']($request);

$arcade .= '</div></div>';
}
elseif (!empty($totalPermitted))
{
$request = $smcFunc['db_query']('', '
SELECT game.id_game, game.game_name, game.game_directory, game.thumbnail, game.id_cat, category.member_groups
FROM {db_prefix}arcade_games AS game
LEFT JOIN {db_prefix}arcade_categories AS category ON (category.id_cat = game.id_cat)
WHERE {raw:query_see_game}
ORDER BY RAND()
LIMIT ' . $guestMax,
array(
'query_see_game' => $where,
)
);

while ($row = $smcFunc['db_fetch_assoc']($request))
{
if ($count1 % $icons_per_row == 0)
$arcade .= '</div><div style="display: table-row;">';


$thumbnailFile = '';

if (!empty($row['thumbnail']))
{
$thumbnailFile = $filepath . '/' . (!empty($row['game_directory']) ? $row['game_directory'] . '/' : '') . $row['thumbnail'];
$thumbnailPath = file_exists($thumbnailFile) ? $modSettings['gamesUrl'] . '/' . (!empty($row['game_directory']) ? $row['game_directory'] . '/' : '') . $row['thumbnail'] : '';
}
elseif (!empty($defaultIcon))
$thumbnailPath = $defaultIcon;

$count1++;

if (empty($thumbnailFile))
continue;

$arcade .= '<div class="centertext" style="display: table-cell;"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $row['id_game'] . '"><img style="width:42px; height:42px;" src="' . $thumbnailPath . '" alt="'.$row['game_name'].'" title="'.$row['game_name'].'" /></a></div>';
}

$arcade .= '</div></div>';

$smcFunc['db_free_result']($request);
}

echo $arcade;
}
577
SMF Arcade Block Codes / Drop-Down Category Block
July 06, 2013, 02:56:25 PM
Drop-Down categories block:

SMF 2.0 Rcx edit

This will give you a nice drop-down category menu inside a php block.
You can check out the one in this arcade for the example.

------------------------------------
Create a php block...

Custom Display Options :
(For viewing on portal - leave this line blank)

~action|arcade


Main Code:

// Category php block for smf 2.0/smf arcade
// Written by Underdog
// Drop-down menu style taken from Hambil/Jeza
// Other variables are set in case another menu style is desired

global $scripturl, $smcFunc;
$count = 1;
$cat_name = array();
$cat_link = array();
$cat_drop = array();
$where1 = $scripturl . '?action=arcade;category=';
echo '<form action="', $scripturl, '?action=arcade" method="post">
<select name="category" style="font-size: 100%; color: white;" onchange="JavaScript:submit()">
<option value="">View By Category</option>';

$request = $smcFunc['db_query']('', '
   SELECT id_cat, cat_name, num_games, cat_order
      FROM {db_prefix}arcade_categories
     ORDER BY cat_order', 
      array()
   );
   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
$count = $row['id_cat'];
$cat_name[$count] = $row['cat_name'];
$cat_link[$count] = $where1 . $count;
$cat_drop[$count] = '<a href="' . $cat_link[$count] .'">'.$cat_name[$count].'</a>';

echo '
<option value="', $count, '">', $cat_name[$count], '</option>';

   }
$smcFunc['db_free_result']($request);

echo '
</select></form>';


------------------------------------

Note: You can change your font color with this part of the above code:

<select name="category" style="font-size: 100%; color: white;"

578
SMF 1.1.11  -  OR  -  SMF 2.0 RC3 installation package:


E-Arcade 2.5.9  -  TO  -  SMF Arcade 2.0.1.8 Conversion

OR

E-Arcade Beta4  -  TO  -  SMF Arcade 2.5Rc1 Conversion


This is a tool designed for renaming E-Arcade to SMF Arcade database tables/columns.


Instructions:

- Make sure to backup your database prior to using this tool

- Make sure BOTH arcades are uninstalled in your Admin / Packages menu

- Install and apply this tool to commence the database changes

- Uninstall/Delete this tool from your Admin / Packages list

- Delete E-Arcade from your Admin / Packages list

- Install SMF Arcade from your Admin / Packages list

- Do not run this install package ever again.



***** WARNING *****

Current SMF Arcade users beware - this tool may delete your current db entries if you try to use it.

This tool has but only 1 purpose and that is to convert from E-Arcade  - TO -  SMF Arcade

The change-over is not reversable. Once you commence the process, you can not revert back to E-Arcade.
(Unless you restore the database backup from the first step)


Only download, install and continue with this installation if you have read and understand the purpose of this tool.
The author of this tool is not responsible for any data loss due to improper use.




Many thanks to the SMF Arcade Beta Testers for helping me test this application.



Notes:

    * Transfers user data such as scores (with comments), favorites, categories and ratings
    * Transfers game data such as save-types, dimensions, background color, descriptions and help text
    * DOES NOT transfer tournaments or any tournament information, therefore these must start anew.
    * The process is not reversible and converting to SMF Arcade is permanent.
      (Unless you restore the database backup from the first step)



The package is attached.


579
SMF Arcade Support + Plugins / PDL/Skin Combo
July 06, 2013, 01:40:51 PM
SMF ARCADE PDL Package
For SMF Arcade v2.5 RC2


      This will add the following optional features to SMF Arcade:

       
  • Auto-posting: option for displaying the game inside the post itself (or text only if preferred)
  • Popup/BBC/PHP Block: option to display games in these formats
  • Game Downloading: option for enabling game downloads from your arcade. Restrictions for users on amount of posts and downloads per day can be preset.
    Downloads can be disabled for specific games or all games.
    Game files are auto-zipped and storage is optional.
    Permissions can be set for this option.
  • Secondary Game Template:  option for enabling a game template with a personal background.
    A panoramic picture approx. 2000 x 1600 is recommended.
  • Error Reporting:    Links can be displayed in the arcade for reporting game errors.
    Permissions can be set for this option.
  • A list is provided in the Arcades/PDL Settings menu that can be edited for error reporting and/or disabling downloads of specific games.
  • The default arcade game list template is modified to include these features.
  • Jeza template included with this combo package
  • Option to auto adjust improper save type settings
  • IBP 3.2 support

Written by Underdog     



     
      After install, check the Admin / Arcade / Settings.
      Make/enable settings and features of this modification from the arcade admin settings menu.


     
PDL-Skin-Combo is for SMF Arcade v2.5 RC2



Version 1.0.3 is only necessary for those that lack the appropriate PEAR support.

Version 1.04 has some template fixes and includes PEAR support. It is advised for everyone to use this version.
580
SMF Arcade Support + Plugins / Purge Arcade
July 06, 2013, 01:30:42 PM
*****    Purge Arcade DB Entries v1.1    *****

This is a tool designed for purging all SMF Arcade or E-Arcade related tables and columns from your database.
All your game files will remain but any data stored in the db concerning the Arcade will be omitted.


---------------------------------------------------------------

*****        Instructions        *****

- Make sure to backup your database prior to using this tool.

- Make sure BOTH arcades are uninstalled in your Admin / Packages menu

- Install and apply this tool to commence the database changes

- Uninstall/Delete this tool from your Admin / Packages list

- Delete any Arcade modifications you do not wish to re-install

- If opting to reinstall your Arcade - Install it now (ie. SMF Arcade)    

- Do not run this install package again unless you wish to purge your database of all Arcade data.



---------------------------------------------------------------


*****     WARNINGS     *****

- Current Arcade users beware - this tool is designed to purge your database of any Arcade data.

- The change-over is not reversable. Once you commence the process, you can not retrieve your saved Arcade data.

---------------------------------------------------------------

Only use this installation if you have read and understand the purpose of this tool.
The author of this tool is not responsible for any unwanted data loss due to improper use.

DOWNLOAD ~ Purge All Arcade Tables Tool
581
Spamblocker / Spam Blocker Modification for SMF
July 02, 2013, 08:09:24 AM
Spam Blocker

Developed for SMF forums c/o Chen Zhen @ Web-Develop.ca
Copyright 2013
Beta testers: Skhilled & TinMan

Purpose and/or usage of this software package:

The purpose of this anti-spam modification software package is to detect unsolicited web traffic (a.k.a. Spam) and restrict and/or limit its access from registering as users and/or participating on your Simple Machines Forum website.

This software package is distributed under the terms of its Freeware License whereas all of its condtional terms are noted within its license link from your SMF Administraion Panel and/or the link provided in this paragraph. If you do not agree to the terms shown in the license, do not download and/or use this software package. 

If you commend this software package and/or any other contributions that underdog@webdevelop.comli.com develops for the SMF community, please feel free to make a donation to paypal using the image/link provided below.
Thank you for opting to use this software package.





Spam Blocker Features:

  • User IP's and/or Email's are checked externally on anti-spam source sites
  • IP's/Emails that are flagged/reported as spam can be blocked from registering on your forum
  • Flagged IP's/Emails can be banned upon registration
  • Flagged IP's/Emails can be redirected to a specific URL during the registration process (ie. Honeypot script)
  • Topics/Replies can be filtered through the Akismet database
  • Topics/Replies can be reported to the Stop Forum Spam database
  • Topics/Replies can be subject to rule based filtering
  • Specific membergroup(s) and preset number of initial posts can be opted for post filtering
  • Options for specific ban restrictions
  • Custom user & error messages
  • Whitelist that allows specific IP's/Ranges to bypass the IP/Email check
  • Blacklist of IP's/Ranges added to the ban list by Spam Blocker
  • 1 hour cache of data to limit resource usage
  • License and guide for usage are provided on the Administration page



Current anti-spam resources:

Registration
  • Akismet Email Analysis
  • Stop Forum Spam Email Analysis
  • Stop Forum Spam IP Analysis
  • Project Honeypot IP Analysis
  • Spamhaus IP Analysis (sbl-xbl block list)

Posts/Topics
  • Akismet Filtering
  • Akismet Reporting
  • Stop Forum Spam Reporting
  • Custom Rule Based Filtering Options



Annotations:
  • Do not edit the note text from entries added to your ban list from Spam Blocker. They are used as a reference for when this modification omits blacklist/ban list entities. That textarea input will be disabled for ban enitities added by Spam Blocker.
  • If an IP is somehow on the spam reporting source sites in error, it can be added to this modifications white list. It will not filter those whitelisted IP's during the registration process.



Changelog:

[Version 1.0]
+ Initial release
+ User IP's and/or Email Addresses can be checked & denied upon registration
+ Option to ban reported IP's and/or Email Addresses 
+ Option to redirect flagged entities to a specific URL during the registration process
+ Specific ban restrictions
+ Topics/Replies can be filtered through the Akismet database
+ Topics/replies can be reported to the Stop Forum Spam database
+ Topics/Replies can be subject to rule based filtering
+ Editable message to be displayed to denied IP/Email (attempting registry)
+ Editable error log message
+ Whitelist to bypass IP check
+ Blacklist to display IP's added by Spam Blocker
+ Blacklist Optimization (Ban list comparison)
+ Option to delete expired Blacklist IP's
+ Option to allow Spamblocker to auto delete expired ban's
+ 1 hour cache (ip, time, pass/fail) to limit resource usage
+ License and guide provided on Admin page



Recommended minimal requirements:
Server:   PHP 5.2+ with libxml, cURL, socket connections & DOM enabled
              MYSQL 5.0+ using MyISAM or InnoDB engine
Browser Add-Ons (for admin): Adobe Flashplayer 11.5+, JRE 7.10+, HTML5 capability
SMF Version: 2.0.4+




Disclaimers:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Please read all other license agreements contained within this package.



Notes:
 The simplest way to set up this modification is to acquire all the necessary API keys, enter them in the mods configuration and then execute Default Configuration from its configuration template.  After which you can tweak a few settings to your desired specifics.

  For post filtering it is suggested to go into your permission settings and Enable Post Filtering for your lowest post ranked (first) membergroup.



Reminder: Back up your database prior to installing any modification!


Files located here:[DOWNLOAD]
582
Premiumbeat for SMF / Premiumbeat Mp3 Platform
July 02, 2013, 07:53:17 AM
LINK TO MODIFICATION

SMF 2.0x - Premiumbeat Mp3 Player

Mp3 Platform for SMF forums c/o underdog@webdevelop.comli.com
      
This will install a flash mp3 player onto your SMF forum & will work with a php block/module and/or individually
from a permission based forum link producing a popup.
For an invisible player - set height and width to 0 in settings (or your block/module code)
as well as disabling the title and body of your block/module.
Options include local or outside sourced url inputs, auto-loading folders, upload/download and various membergroup permissions.
      
Mp3's using Playlist #99 will play for every playlist and all other mp3 playlists are block/popup specific.

Recently tested on SMF 2.0.4 with no issues.
The Premiumbeat v2.0 stable version is only available for the SMF2.0x branch.
Support for SMF 1.1x has now been dropped although the beta version will be left available for it.
Thank you for opting to use this software package & enjoy.


Basic guidelines to get you started:
  • Always have a playlist available (create one if necessary)
  • Assign your playlists their file folder
  • Assign your playlists to designated usergroups (each usergroup can only be assigned to one playlist)
  • The popup will not work unless you assign membergroups to playlists (this includes Admins!)
  • Experiment with other playlist settings until its appearance is satisfactory
  • Adjust Premiumbeat settings to have the override use an opted playlist
  • Adjust Premiumbeat settings to enable/disable the playlink and/or drop-down buttons
  • Adjust each membergroup its Premiumbeat permissions to allow access to various functions
  • Files can be uploaded showing Anonymous and/or the username of the uploader
  • Files that are manually uploaded to the playlist folder via ftp are anonymous with no n/a date
  • Admins have permission to do all functions
  • Users can only delete their own files if the permission is set
  • Users can only change their own anonymous/name for files
  • This player only accepts mp3 file types - no others for this version
  • PHP 5.3 or more advanced is necessary on your server to use this modification
  • Please read the recommended requirements shown below
  • Please read the license and abide by its guidelines else do not use this modification
  • Set playlists to be available in the upload/download template if desired



Recommended requirements:

Server: PHP 5.3+, HTML5+, MYSQL 5.0+, json support enabled (v1.2+)
Browsers: IE 7+, Firefox 3.6+, Safari 5+, Chrome 5+, Opera 10.5+
Browser Add-ons: javascript 1.8+, Adobe Flash Player 10+

Recommended Portal for SMF:
SimplePortal (https://www.simpleportal.net)




This version has been modified to work with SMF 2.0x Forums.

This SMF package falls under the Creative Commons - Attribution No Derivatives License (by-nd) 3.0.
All author contributions noted below fall under their own respected licenses. The above noted license allows such conditions, please click on its link for specifics.

Development Credits:

Premiumbeat for SMF-Underdog (http://webdevelop.comli.com) Creative Commons License - Attribution No Derivatives
Premiumbeat Flash Music Player-Gilles & Francois Arbour (http://premiumbeat.com) Permission was granted directly from the authors
jQuery AXuploader-Alban Xhaferllari (http://www.albanx.com) Dual licensed under the MIT or GPL Version 2 licenses
SMF Documentation-Skhilled (http://www.docskillz.com/docs/) GNU Free Documentation License

Disclaimers:

  This modification is intended to be used for legal purposes only! The *Premiumbeat for SMF* application package is intended for use with mp3 files under licenses that allow non-profit distribution of copyrighted or non-copyrighted works (ie. Creative Commons license) and their respected terms/conditions (ie. Attribution No Derivatives).  The author's involved in this project are in no way responsible for the end-user's possible abuse of copyright laws & do not condone such practices.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Please read all other license agreements contained within this package.
Block codes are available from the Premiumbeat Block Code page.