*

Recent

Author Topic: Games positions  (Read 4675 times)

5hey

  • Newbie
  • *
  • Posts: 3
  • Force: +0/-0
Games positions
« on: March 18, 2009, 06:17:36 AM »
How can i change the position of games in the same categorie? because I want to display the newer ones first or to sort them by name.
and is there any possibility that I can choose what games should be displayed on the home page.
Please I need help.
Thanks.

5hey

  • Newbie
  • *
  • Posts: 3
  • Force: +0/-0
Re: Games positions
« Reply #1 on: March 18, 2009, 08:37:52 AM »
I sent an email to you.

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Games positions
« Reply #2 on: March 18, 2009, 09:25:13 AM »
In /pages/base_home.php is where the SQL query is set up. A couple of lines that read

Code: [Select]

$ir = $db->query(sprintf('SELECT * FROM dd_games WHERE category=\'%u\' LIMIT 0,'.$limitboxgames.'', $row['ID']));


You can add an "ORDER BY....." and choose what field you want it sorted by and place it in where the "....." is.

Code: [Select]

$ir = $db->query(sprintf('SELECT * FROM dd_games WHERE category=\'%u\'  ORDER BY ID desc LIMIT 0,'.$limitboxgames.'', $row['ID']));


I personaly changed it to "ORDER BY  rand()" so that it shows different games each time on the arcade I'm working on.

Code: [Select]

$ir = $db->query(sprintf('SELECT * FROM dd_games WHERE category=\'%u\'  ORDER BY rand () LIMIT 0,'.$limitboxgames.'', $row['ID']));



This is something I'm hoping to catch in the next zip file.

5hey

  • Newbie
  • *
  • Posts: 3
  • Force: +0/-0
Re: Games positions
« Reply #3 on: March 18, 2009, 10:53:45 AM »
Yes it works now.
Thank you very much.