*

Recent

Author Topic: Well basically i wanted to know  (Read 4581 times)

WhaaaaaTha

  • Newbie
  • *
  • Posts: 33
  • Force: +0/-0
Well basically i wanted to know
« on: July 14, 2009, 04:26:21 PM »
Well basically i wanted to know how can the newest game added be shown first in the game category.

So basically currently if i go to action games the first game in the start is the oldest game that was uploaded first. I want the newest game to show how can i do this?

Thanks ^_^

WhaaaaaTha

  • Newbie
  • *
  • Posts: 33
  • Force: +0/-0
Re: Well basically i wanted to know
« Reply #1 on: July 14, 2009, 04:31:39 PM »
and also can i see a live demo of the new release thnxs

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Well basically i wanted to know
« Reply #2 on: July 14, 2009, 04:48:38 PM »
In the category listing on the main page, or in the category pages themselves? It's all in how you write the SQL query, use an order by in it and it comes out how ever you wish.

If you have added them manually, order by dateadded probably works best. If you have added them as a game pack, the dateadded might not have come out in a usable fashion and order by ID might work best.

If I knew which spot you were looking for specificaly I could probably write it exactly.

Sorry, all mine are random on the main page so I don't have a demo of it to show.

WhaaaaaTha

  • Newbie
  • *
  • Posts: 33
  • Force: +0/-0
Re: Well basically i wanted to know
« Reply #3 on: July 15, 2009, 10:23:59 AM »
Im talking about the category page

in

pages/browse.php

Code: [Select]
<?php
$ID 
clean($_GET['ID']);
$ID abs((int) ($ID));
$max $gamesonpage;
$show clean($_GET['page']);
if(empty(
$show)){
$show 1;
}
$limits = ($show 1) * $max
$r $db->query(sprintf('SELECT * FROM dd_games WHERE category=\'%u\' LIMIT '.$limits.','.$max.' '$ID));
$totalres mysql_result($db->query('SELECT COUNT(ID) AS total FROM dd_games WHERE category=\''.$ID.'\''),0);
$totalpages ceil($totalres $max); 
echo 
'<table width=\'100%\' border=\'0\' align=\'center\'>
<tr>
<td colspan=\'2\' class=\'header\'>'
.clean($_GET['name']).' Games</td>
</tr>'
;
$count 0;

basically i want the games to show order by the newest game added in that category understand  ;D

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Well basically i wanted to know
« Reply #4 on: July 15, 2009, 12:14:47 PM »
Try this:

Code: [Select]

<?php
$ID 
clean($_GET['ID']);
$ID abs((int) ($ID));
$max $gamesonpage;
$show clean($_GET['page']);
if(empty(
$show)){
$show 1;
}
$limits = ($show 1) * $max
$r $db->query(sprintf('SELECT * FROM dd_games WHERE category=\'%u\' ORDER BY dateadded DESC LIMIT '.$limits.','.$max.' '$ID));
$totalres mysql_result($db->query('SELECT COUNT(ID) AS total FROM dd_games WHERE category=\''.$ID.'\''),0); 
$totalpages ceil($totalres $max); 
echo 
'<table width=\'100%\' border=\'0\' align=\'center\'>
<tr>
<td colspan=\'2\' class=\'header\'>'
.clean($_GET['name']).' Games</td>
</tr>'
;
$count 0;




Let me know how it works.

Oh yea, I misunderstood your request. The new release in in demo mode in our official demo now. Link in the menu to you left.