*

Recent

Author Topic: [Add On] All Games Drop down List  (Read 5434 times)

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
[Add On] All Games Drop down List
« on: April 03, 2015, 10:22:55 PM »
Add a drop down list of all games to your sidebar.



Monster:
Copy and paste code to file allgameslist.php
Upload to templates/monster/blocks/
Code: [Select]
<?php
echo'<div class="content">
     <select name="dropdownlist" onchange="location.href = this.value;">
     <option value="">Select a game...</option>'
;
      
$gamelist $db->query('SELECT * FROM fas_games WHERE active=\'1\' order by `name` ASC');
  while($row $db->Fetch_row($gamelist)){
  $gamename preg_replace('#\W#''-'$row['name']);
      if (
$seo_on == 1){
  echo "<option value='".$domain."/play/".$row["ID"]."-".$gamename.".html'>".titlelimit($row["name"])."</option>";
  }else{
  echo "<option value='".$domain."/index.php?action=play&amp;ID=".$row["ID"]."'>".titlelimit($row["name"])."</option>";
  }
  };
echo
'</select>
   </div>'
;
?>


Add to templates/monster/template.php
Code: [Select]
                        include("templates/$template/blocks/allgameslist.php");

Tiles:
Copy and paste code to file allgameslist.php
Upload to templates/tiles/blocks/
Code: [Select]
<?php
echo'<div id="side_holder">
    <div align="center">
    <select name="dropdownlist" onchange="location.href = this.value;">
    <option value="">Select a game...</option>'
;
$gamelist $db->query('SELECT * FROM fas_games WHERE active=\'1\' order by `name` ASC');
while($row $db->Fetch_row($gamelist)){
$gamename preg_replace('#\W#''-'$row['name']);
            if (
$seo_on == 1){
echo "<option value='".$domain."/play/".$row["ID"]."-".$gamename.".html'>".titlelimit($row["name"])."</option>";
        }else{
echo "<option value='".$domain."/index.php?action=play&amp;ID=".$row["ID"]."'>".titlelimit($row["name"])."</option>";
        }
};
echo
'</select>
     </div>
 </div>'
;
?>


Add to includes/blocks.php
Code: [Select]
include("templates/$template/blocks/allgameslist.php");