*

Recent

Author Topic: few questions...  (Read 14278 times)

Trasion

  • Guest
few questions...
« on: July 20, 2009, 04:49:44 PM »
1) How can I make a page to show all games? Like make a category called "All Games", and it lists them all?

2) When I send a message to another player, it simply sends it to myself, and not them. (this is simply reporting the bug, I do not plan to use messaging, so I don't need the fix. But I suggest you fix it in the next version ;D)

3) As soon as I installed this software, my stats said...

"Users Online: 2641"

I am absolutely positive that my website does not have that many people online. It keeps changing, but I think it's a problem. It stays around that number, give or take. What's wrong with it? (it was like this after install - I didn't touch it)

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: few questions...
« Reply #1 on: July 20, 2009, 05:06:46 PM »
For adding an all games page, make a file called allgames.php in the pages dictionary and add this to it:
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 LIMIT '.$limits.','.$max.' '$ID));
$totalres mysql_result($db->query('SELECT COUNT(ID) AS total FROM dd_games'),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;
if(!
$db->num_rows($r)){
echo 
' <tr>
<td colspan=\'2\' class=\'content\'>There currently are no games.</td>
</tr>'
;
}
while(
$in $db->fetch_row($r)){
$gamename ereg_replace('[^A-Za-z0-9]'''$in['name']);
if($seo_on == 1){
$playlink ''.$domain.'/play/'.$in['ID'].'-'.$gamename.'.html';
}else{
$playlink ''.$domain.'/index.php?action=play&amp;ID='.$in['ID'].'';
}
if(
$count%2==0){

       echo 
'<tr>
       <td width=\'50%\' valign=\'top\'>
      
       <table width=\'100%\' border=\'0\'>
       <tr>
       <td valign=\'top\' colspan=\'2\' class=\'header\'><b>'
.$in['name'].'</b></td>
       </tr>
       <tr>
       <td width=\'55\' height=\'55\' valign=\'top\' class=\'content\'>
       <a href=\''
.$playlink.'\'>
       '
;
       if($in['type'] == 1){
       echo ' <img src=\''.$domain.'/'.$thumbsfolder.'/'.$in['thumb'].'\' width=\'55\' width=\'55\' border=\'0\'>';
       }else{
       echo ' <img src=\''.$in['thumburl'].'\' width=\'55\' width=\'55\' border=\'0\'>';
       }
      
       echo ' </a>
       </td>
       <td valign=\'top\' class=\'content\'>'
.browsedesclimit($in['description']).
       <a href=\''
.$playlink.'\' class=\'playlink\'><b>Play</b></a></td>
       </tr>
       </table>
      
       </td>
'
;
}else{
 echo 
'
       <td width=\'50%\' valign=\'top\'>
      
       <table width=\'100%\' border=\'0\'>
       <tr>
       <td valign=\'top\' colspan=\'2\' class=\'header\'><b>'
.$in['name'].'</b></td>
       </tr>
       <tr>
       <td width=\'55\' height=\'55\' valign=\'top\' class=\'content\'>
       <a href=\''
.$playlink.'\'>
       '
;
       if($in['type'] == 1){
       echo ' <img src=\''.$domain.'/'.$thumbsfolder.'/'.$in['thumb'].'\' width=\'55\' width=\'55\' border=\'0\'>';
       }else{
       echo ' <img src=\''.$in['thumburl'].'\' width=\'55\' width=\'55\' border=\'0\'>';
       }
      
       echo ' </a>
       </td>
       <td valign=\'top\' class=\'content\'>'
.browsedesclimit($in['description']).
       <a href=\''
.$playlink.'\' class=\'playlink\'><b>Play</b></a></td>
       </tr>
       </table>
      
       </td>
</tr>'
;
}
$count++;
}

echo 
"</table>";
echo 
'Pages: ';
for(
$i 1$i <= $totalpages$i++){ 
$urk ''.$domain.'/index.php?action=allgames&page='.$i.'';

echo 
'<a href=\''.$urk.'\' class=\'pagenat\'>'.$i.'</a>&nbsp; ';

}
echo 
'<br /><br />';


$pgname clean($_GET['name']);


?>


Then open up index.php and add this:
Code: [Select]
case 'allgames':
include ('pages/allgames.php');
break;
after:
Code: [Select]
case 'play':
include ('pages/play.php');
break;

(there may or may not be a problem with it)

and for the other stuff, I think Kurt or Admin could help you out

Trasion

  • Guest
Re: few questions...
« Reply #2 on: July 20, 2009, 05:11:30 PM »
Could you help me out with something?

I'd like in the top navigation, for it to say:

Sort By: All Games | Newest Games | Most Played

And when you click one, it opens a page with every game, but it shows them listed a different way. How can I accomplish this?

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: few questions...
« Reply #3 on: July 20, 2009, 05:32:48 PM »
Well for the order, in any game page just look for something like:
Code: [Select]
$r = $db->query(sprintf('SELECT * FROM dd_games ORDER BY views DESC LIMIT '.$limits.','.$max.' '));And you can change that to ORDER BY --W/E-- DESC --W/E-- being whatever you want it to order by or for random:
ORDER BY RAND()

For the links, just add them in each page you want them to show up (browse.php, mostplayed.php, etc..)

Trasion

  • Guest
Re: few questions...
« Reply #4 on: July 20, 2009, 05:36:36 PM »
So I just add the code you showed me two posts above, into three different files, and just change the "ORDER" part? Then link to each?

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: few questions...
« Reply #5 on: July 20, 2009, 05:44:36 PM »
no no no. That post you said you wanted all games, right?
There is already files with Newest Games and Most Played.
But yeah just do the ORDER BY thing in each file you want to change then for the All Games | Newest Games | Most Played links just add something like:
Code: [Select]
<tr>
<td colspan=\'2\' class=\'header\'><a href="index.php?action=W/E">Something</a> | <a href="index.php?action=W/E">Something</a> | <a href="index.php?action=W/E">Something</a></td>
</tr>
Something like that...  :D

Trasion

  • Guest
Re: few questions...
« Reply #6 on: July 20, 2009, 05:46:17 PM »
I'm sorry, but I do not understand!

(I'm a noob with this :(, I just started learning PHP and all this today!)

Could you please explain it a bit more?

Also, check this out Adam: http://freearcadescript.net/forums/index.php/topic,137.msg576.html#new - let me know what you think!

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: few questions...
« Reply #7 on: July 20, 2009, 05:50:33 PM »
Thanks Adam.

As for the messaging system, I just tested it again on one of my instals and it didn't do that. I did find a bug, but not the one described. PM me the URL so I can look at it?

The stats counter is something I have yet to look at. It was there when I first started digging into the script, and I've had a feeling it might not be working right for one reason or other. It is on the back burner to be looked at though. Is it installed on a site with another script running perhaps?

Trasion

  • Guest
Re: few questions...
« Reply #8 on: July 20, 2009, 05:54:24 PM »
I PMed you Kurt. :) Please let me know what you find. With the messaging, as well as the stats counter.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: few questions...
« Reply #9 on: July 20, 2009, 05:59:36 PM »
Its fine, I was a noob once too  :D
All you have to do is...
For the order of the games in any page:
find that code I told you about before (or something like it) then change the ORDER BY.
If you ORDER BY views DESC then the games will be ordered by the number of views they have in descending order.

For the links on each page like mostplayed, browse, etc... All you have to do is add this in anywhere you want it:
Code: [Select]
<tr>
<td colspan=\'2\' class=\'header\'><a href="index.php?action=mostplayed">Most Played</a> | <a href="index.php?action=newest">Newest Games</a> | <a href="index.php?action=allgames">All Games</a></td>
</tr>

And for the all games page just do what I had said in my other post..

Do you understand it a little more?

Trasion

  • Guest
Re: few questions...
« Reply #10 on: July 20, 2009, 06:05:15 PM »
Yep! Thanks Adam!

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: few questions...
« Reply #11 on: July 20, 2009, 06:06:49 PM »
No prob.   :)

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: few questions...
« Reply #12 on: July 20, 2009, 06:47:26 PM »
OK, the probelm is in the file /pages/showprofile.php

Open it up and very near the bottom find
Code: [Select]

<input name="to" value="'.$userid.'" type="hidden">



and edit it to read

Code: [Select]

<input name="to" value="'.$userids.'" type="hidden">




and it should work.

Trasion

  • Guest
Re: few questions...
« Reply #13 on: July 21, 2009, 12:40:23 PM »
Kurt,I just did what you said to do in your first post on this thread..

It now gives me the error:

Quote
Fatal error: Call to undefined function clean() in /home/zoovix/public_html/pages/allgames.php on line 2


When I try to open up http://zoovix.com/pages/allgames.php

Please help me fix it.

Trasion

  • Guest
Re: few questions...
« Reply #14 on: July 21, 2009, 12:42:26 PM »
It works when I go to http://zoovix.com/allgames/ though! Just noticed that.

But it shows it way up there.. Check it out. What's wrong with it mate?