Results 1 to 14 of 14

Thread: [How to?] Create a page w/Games

  1. #1
    License owner
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    10

    Default [How to?] Create a page w/Games

    Hello,
    Can somebody tell me how to write a new page with a selection of games (random, by cat...)?

    Thanks.

  2. #2
    License owner
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    1,120

    Default

    Someone may be able to help you once you verify your license
    East Coast Scripts. The Ultimate Arcade Webmaster Resource

    My Arcade - Squish Arcade

    AV Arcade Mods - Available at ECS Shop | Demos at ECS Mod Arcade | Custom mods at EC Scripts!
    Latest Release - AV Arcade FAQ - Don't waste any more time replying to questions in PMs!

    Useful Links
    Arcade Hosting - Reliable arcade hosting from only $4 a month!
    TalkArcades - A forum dedicated to arcade owners.

  3. #3
    License owner
    Join Date
    Jun 2009
    Location
    Charlottesville, Virginia, USA
    Posts
    3,315

    Default

    yea get verified and we can help you out. What you want is quite simple actually.

  4. #4
    License owner
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    10

    Default

    How to get verified?

    Nevermind, i think i've found how to verify it.
    Last edited by AnyWay; 04-14-2010 at 12:25 PM.

  5. #5
    License owner
    Join Date
    Jun 2009
    Location
    Charlottesville, Virginia, USA
    Posts
    3,315

    Default

    Quote Originally Posted by AnyWay View Post
    How to get verified?

    Nevermind, i think i've found how to verify it.

    Musta worked, your a smurf now like the rest of us LOL. I will have to give you a tut on this topic tomorrow though. Got classes till 9 tonight and I gotta leave in like 20 miniutes. Maybe Goalie will take care of you before then

  6. #6
    License owner
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    10

    Default

    Eheh ok, thank you all.
    Have a good day, Bad Wolf.

  7. #7
    License owner
    Join Date
    Apr 2009
    Location
    UK
    Posts
    1,480

    Default

    You can use this query in your PHP page

    Code:
    SELECT * FROM ava_games WHERE category_id="[ID]" AND published=1 ORDER BY rand()
    Replace ID with your category ID

  8. #8
    License owner
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    10

    Default

    I have this query that should give me 10 random games, each time:
    $sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY rand() LIMIT 10");
    I have the html code to display games, also.

    What i don't have/know is the code to write in the php page to let the sql query work. Should i include something? Is there any doc i can read?

    Thanks for the help.
    Last edited by AnyWay; 04-14-2010 at 06:36 PM. Reason: more info.

  9. #9
    License owner
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    1,120

    Default

    What exactly are you trying to do? Are you creating a page through your admin panel? If you want to include PHP (which it seems you do), you might want to look at the custom PHP page mod in the add-on forum.
    East Coast Scripts. The Ultimate Arcade Webmaster Resource

    My Arcade - Squish Arcade

    AV Arcade Mods - Available at ECS Shop | Demos at ECS Mod Arcade | Custom mods at EC Scripts!
    Latest Release - AV Arcade FAQ - Don't waste any more time replying to questions in PMs!

    Useful Links
    Arcade Hosting - Reliable arcade hosting from only $4 a month!
    TalkArcades - A forum dedicated to arcade owners.

  10. #10
    License owner
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    10

    Default

    No, i'm making a .php file.
    In this file i'd want 10 random games to appear.

  11. #11
    License owner
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    1,120

    Default

    Ok, have you taken a look at the custom php page mod?
    East Coast Scripts. The Ultimate Arcade Webmaster Resource

    My Arcade - Squish Arcade

    AV Arcade Mods - Available at ECS Shop | Demos at ECS Mod Arcade | Custom mods at EC Scripts!
    Latest Release - AV Arcade FAQ - Don't waste any more time replying to questions in PMs!

    Useful Links
    Arcade Hosting - Reliable arcade hosting from only $4 a month!
    TalkArcades - A forum dedicated to arcade owners.

  12. #12
    License owner
    Join Date
    Jun 2009
    Location
    Charlottesville, Virginia, USA
    Posts
    3,315

    Default

    Darn I hate it when I can help out but cant get to my stuff. I have random games all over the place in all of my arcades. That part is super simple. But I dont recall off hand the code. I really dont like to access files on public computers. Still got 3 hours of class for the day. And a 2 hour class in the morning. But if we have'nt got you straight by then I will hook you up

  13. #13
    License owner
    Join Date
    Jun 2009
    Location
    Charlottesville, Virginia, USA
    Posts
    3,315

    Default

    Ok for you new page go here and get this

    http://forum.avscripts.net/showthread.php?t=4916

    For your random games do this

    In your includes folder;

    create a new file called random_games.php

    Paste this in it;

    **NOTE - The parts in green and bolded can be removed if you dont want your games in a table. I think it makes them behave a little better than just being free. And you can control the background color. You can also change how many games you have. Look at top of the code
    Code:
    ORDER BY RAND()LIMIT20')
    Change the number to how ever many you want.

    Code:
    <table style="border-color: #000000; border-width: 0px; background-color: #ffffff;" border="0" align="center"  width="670">
    <tbody>
    <tr>
    <td>
    <?php
    echo '<ul>';
     
    $sql = mysql_query("SELECT * FROM ava_games ORDER BY RAND() LIMIT 20");
    while($row = mysql_fetch_array($sql))
    {
     $seo_name = seoname($row['name']);
     
     if ($setting['seo_on'] == 0)
     {
      $url = 'index.php?task=view&amp;id='.$row['id'];
     }
     else if ($setting['seo_on'] == 2)
     {
     
    $cat_name = mysql_fetch_array(mysql_query("SELECT name FROM ava_cats WHERE id=$row[category_id]"));
      $seo_cat_name = seoname($cat_name['name']);
      $url = $seo_cat_name.'/'.$row['id'].'/'.$seo_name.$setting['seo_extension'];
     }
     else
     {
      $url = 'view/'.$row['id'].'/'.$seo_name.$setting['seo_extension'];
     }
     
     
     if (strlen($row['name']) > $template['module_max_chars'])
     {
      $name = substr($row['name'], 0, $template['module_max_chars'])."...";
     }
     else
     {
     
    $name = $row['name'];
     }
                    echo '
     
         <a href="'.$setting['site_url'].'/'.$url.'"><img title="'.$row['description'].'" align="absmiddle" src="'.$row['image'].'" width="110" height="100" />
       <!--<img src="'.$setting['site_url'].'/games/images/'.$seo_name['image'].'" alt="" class="game_pic_small" />-->
         ';
    }
     
    echo '</ul>';
    ?>
    <td>
    </tr>
    </tbody>
    </table>
    Now paste this anywhere you want random games to show;

    Code:
     <?php include ('includes/random_games.php');?>
    Last edited by Bad Wolf; 04-15-2010 at 03:53 AM.

  14. #14
    License owner
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    10

    Default

    Ok, thank you very much, it's working!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •