*

Recent

Author Topic: Quick List of games in a DROP DOWN MENU!!!!  (Read 6020 times)

Sterling

  • Jr. Member
  • **
  • Posts: 81
  • Force: +1/-0
    • Hitchhike games
Quick List of games in a DROP DOWN MENU!!!!
« on: May 08, 2009, 10:05:44 AM »
Well I was thinking a drop down menu with all of the games in our databse would be a very useful feature to add. Well of course the games are linked! 8)

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Quick List of games in a DROP DOWN MENU!!!!
« Reply #1 on: May 08, 2009, 11:26:18 AM »
Might also make the page a bit slow loading if you have a few thousand games in the list. Some visitors might click away if it takes to long. You absolutely sure you want something like that? If you do, I might be able to come up with it in the next few days, but I really recommend against it and I won't make it part of the regular release as it could slow down loading of a page.

Sterling

  • Jr. Member
  • **
  • Posts: 81
  • Force: +1/-0
    • Hitchhike games
Re: Quick List of games in a DROP DOWN MENU!!!!
« Reply #2 on: May 08, 2009, 06:13:29 PM »
 :-\Ok, That makes sense!!! Or it could have just the top games or something?

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Quick List of games in a DROP DOWN MENU!!!!
« Reply #3 on: May 08, 2009, 06:50:15 PM »
Top 100 games maybe? The script does have the top games page on it already, but a quick dropdown of the top 100 or so might be a good thing.

becksa

  • Newbie
  • *
  • Posts: 15
  • Force: +3/-0
Re: Quick List of games in a DROP DOWN MENU!!!!
« Reply #4 on: May 09, 2009, 02:39:50 AM »
I agree with Kurt, although i think sometimes we have too much going on these sites.The user just wants to play games after all.

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Quick List of games in a DROP DOWN MENU!!!!
« Reply #5 on: May 10, 2009, 07:31:50 PM »
OK, here is a quickie, I have not had much time to test it too much so I make no promises as too how well it works.

First make a new file named mostplayeddropdown.php and and put this code into it

Code: [Select]

<?php

$dr2 
$db->query(sprintf('SELECT * FROM dd_games ORDER BY views DESC LIMIT 100 '));
$droplisttext '<select name=\'droplist1\' id=\'droplistgames\' onchange=\'document.location=(droplist1.value)\'>
<option value=\'/\'>Select a Game</option>'
;
while(
$dr1 $db->fetch_row($dr2)){
$gamenamedp ereg_replace('[^A-Za-z0-9]''-'$dr1['name']);
if($seo_on == 1){
$playlink3 ''.$domain.'/play/'.$dr1['ID'].'-'.$gamename.'.html';
}else{
$playlink3 ''.$domain.'/index.php?action=play&amp;ID='.$dr1['ID'].'';
}


       
$droplisttext .= '<option value=\''.$playlink3.'\'>'.$gamenamedp.'</option>
      '
;

};
$droplisttext .= '</select>';



?>




Upload it to your server in the /includes folder

Open your template header.php file and up near the top under

Code: [Select]

include ("js/rating_update.php");



insert the line

Code: [Select]


include ("includes/mostplayeddropdown.php");



Then decide where you want to place the dropdown menu and tell it to write out the variable $droplisttext. I'll let you decide where, though up on the right side of the menu might be a good spot.

Let me know how it works. I tried it in IE7, but I'm kinda buried and can't test it much so I make no promises. It won't be an oficial part of the release for reasons stated above. If you want it you'll need to manually insert it.

Sterling

  • Jr. Member
  • **
  • Posts: 81
  • Force: +1/-0
    • Hitchhike games
Re: Quick List of games in a DROP DOWN MENU!!!!
« Reply #6 on: May 11, 2009, 09:18:16 AM »
Thanks Kurt!!!! :o