*

Recent

Author Topic: [Add On] Category Drop Down List  (Read 6442 times)

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
[Add On] Category Drop Down List
« on: April 03, 2015, 10:53:58 PM »
Add a Category Drop Down list to your sidebar.



Monster:
Copy and paste code to file categorylist.php
Upload to templates/monster/blocks/
Code: [Select]
<?php
echo'<div class="content">
     <select name="dropdownlist" onchange="location.href = this.value;">
     <option value="">Select Category...</option>'
;
$catlist $db->query('SELECT * FROM fas_categories WHERE active=\'1\'');
while($row $db->Fetch_row($catlist)){
$categoryname preg_replace('#\W#''-'$row['name']);
                        if(
$seo_on == 1){
echo "<option value='".$domain."/browse/".$row["ID"]."-".$categoryname.".html'>".($row["name"])." Games</option>";
        }else{
echo "<option value='".$domain."/index.php?action=browse&amp;ID=".$row["ID"]."'>".($row["name"])." Games</option>";
    }
};
echo
'</select>
   </div>'
;
?>


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

Tiles:
Copy and paste code to file categorylist.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 Category...</option>'
;
$catlist $db->query('SELECT * FROM fas_categories WHERE active=\'1\'');
while($row $db->Fetch_row($catlist)){
$categoryname preg_replace('#\W#''-'$row['name']);
                        if(
$seo_on == 1){
echo "<option value='".$domain."/browse/".$row["ID"]."-".$categoryname.".html'>".($row["name"])." Games</option>";
        }else{
echo "<option value='".$domain."/index.php?action=browse&amp;ID=".$row["ID"]."'>".($row["name"])." Games</option>";
    }
};
echo
'</select>
     </div>
 </div>'
;
?>


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

*Note* I added Games to the category title, so if you have your category's named " Action Games " you will need to edit categorylist.php

outlaw16151

  • Jr. Member
  • **
  • Posts: 54
  • Force: +0/-0
    • OutlawsGameroom
Re: [Add On] Category Drop Down List
« Reply #1 on: July 07, 2015, 11:26:19 AM »
how about having the side_nav image included above the dropdown menu