HQ NETWORK:   XBOX ONE |  XBOX 360 |  AIDELUXE HQ Network: 14,079 | Guests: 8486 | Members: 2 


   Current Location: Forums New google drive   |   Which modchip is this?   |   Anyone here capable or interested in restarting XBConnect?   |   Error code 05   |   original xbox with 0 memory   |   Why cell damage is low with ratings   |   New Game - Fursan al-Aqsa - Knights of al-Aqsa Mosque   |   Xbox-Hq.Com VIP Member Testimonials   |   XBHD: A Full-Featured Original Xbox Adapter from EON Gaming,   |   Best place for XBox ROMS?   |   
  Home | Active Topics | CD/DVD Media | Downloads | Forums | Feedback | Games | HardDrives | Homebrew | My Profile | ModChips | Reviews | Search | SoftMods | Tutorials

Xbox Forums

Discuss all aspects of the original Xbox Console in our Interactive Xbox Forums..

Get Xbox Game Pass Ultimate
Xbox-Hq.Com :: View topic - games scanner
Xbox-Hq.Com Forum Index -> pnFlashGames Project
Post new topic Reply to topic    
 games scanner View previous topic :: View next topic  
 
 
 
 
MaSTeRMinD
V.I.P. Lifetime

Xbox Version: none
Modded: none

Joined: Jan 24, 2005
Posts: 16

Post Posted: Mon May 09, 2005 1:28 pm   
Post subject: games scanner
Reply with quote
 
Will be great if we have a games scanner.
Let say you want to add 50 games or more, now you have to edit every single game , and thats kind of annoying, but imagine , that you have have a php script that scans selected dir and if this dir contains .swf files, auto fills a page with gamename.swf thesaname.gif for game image the same name for game name . All you need to do is add description and other values. Then copy the games to games dir. I know that this a lazy ass scirpt, but we all hate the repeated actions like adding a game.

I think that this is not a hard one to code, and i will try to do it by myself and post code here, but will be good if we have it.


View user's profile Send private message Send e-mail
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23942
Location: NSW, Australia

Post Posted: Mon May 09, 2005 3:05 pm   
Post subject:
Reply with quote
 
hi mastermind,

Rather then going ahead coding something i already have planned why not get started on this..

gamename.ini files.. Smile

The web app should read a directory and add the fields from the gamename.ini file directly into the database.

This is the way PnFlashGames do it.. If you go to their site you will see when you download a game it has a .ini file included with it.

Just remember too.. Im the only guy who has coded anything on this baby.

anyway, talk l8r and hope to hear back soon

FH
http://www.xbox-hq.com

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com | www.c64-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
MaSTeRMinD
V.I.P. Lifetime

Xbox Version: none
Modded: none

Joined: Jan 24, 2005
Posts: 16

Post Posted: Tue May 10, 2005 9:54 am   
Post subject:
Reply with quote
 
yes gamename.ini files is even better, but if you dont have such ?
Like i have 700 flash games pack, how to add them all Smile
Sooo actually my auto thingie is done. See it in action here Smile

If you think that the code will be useful for everybody i will send it to you.



fg2.JPG
 Description:
 Filesize:  26.59 KB
 Viewed:  108 Time(s)

fg2.JPG



fg1.JPG
 Description:
 Filesize:  30.16 KB
 Viewed:  105 Time(s)

fg1.JPG




View user's profile Send private message Send e-mail
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23942
Location: NSW, Australia

Post Posted: Tue May 10, 2005 1:20 pm   
Post subject:
Reply with quote
 
oh, ok..
I see what you mean now.. I must have misunderstood your post Smile
Very nice..

cant wait to hear some of your other ideas too.

l8r

FH
http://www.xbox-hq.com

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com | www.c64-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
MaSTeRMinD
V.I.P. Lifetime

Xbox Version: none
Modded: none

Joined: Jan 24, 2005
Posts: 16

Post Posted: Tue May 10, 2005 2:01 pm   
Post subject:
Reply with quote
 
Ok so here is the code

In function FlashGamesMenu() edit last line with these two

Code:
echo "<a href=\"admin.php?op=FlashGamesGameMenu\">"._FGADMIN_GAMEOPTIONS."</a>&nbsp;|&nbsp;";
    echo "<a href=\"admin.php?op=GamesDirScan\">"._FGADMIN_GAMESSCAN."</a></center>";


After ####### END Reset Hi-Scores Tables ##

Code:
// ####### Start auto scan for games ## 
function GamesDirScan(){
     global $admin, $user_prefix, $dbi, $db, $nukeurl, $module_name, $dir;
   include("header.php");
   GraphicAdmin();
   FlashGamesMenu();
       echo"<center><font class=\"title\"><b>"._FGADMIN_GAMESSCAN."</b></font></center><br><br>";
       OpenTable();


    echo "<div align=\"center\">";
   
    echo "<form name=\"form1\" method=\"post\" action=\"\">";
             echo"<tr><td><B>"._FGADMIN_SCANDIRPATH."</B></td><td><input type=\"text\" size=\"50\" maxlength=\"255\" name=\"dir\" value=\"<yourpathhere>/modules/Flash_Games/newgames\"><br></td></tr>";
       
        echo"<tr><td width=\"100\"><B>"._FGADMIN_GAMECATEGORY."</B></td>"
   ."<td><select name=\"add_gcid\">";
   $result2=sql_query("select cid, cname from ".$prefix."_flashgames_cat", $dbi);
   while(list($cid, $cname) = sql_fetch_row($result2, $dbi)) {
        $cid2 = intval($cid2);
      if ($gcid==$cid) {
         $sel = "selected";
      } else {
         $sel = "";
      }
      
       echo "<option value=\"$cid\" $sel>$cname ($cid)</option>";
   }
   echo "</td></tr>";
    echo"<tr><td><B>"._FGADMIN_GAMETYPE."</B></td>"
      ."<td><select name=\"add_gtype\">";
   $result2=sql_query("select cid, cname from ".$prefix."_flashgames_gtype_cat", $dbi);
   while(list($cid, $cname) = sql_fetch_row($result2, $dbi)) {
        $cid2 = intval($cid2);
      if ($gtype==$cid) {
         $sel = "selected";
      } else {
         $sel = "";
      }
      
       echo "<option value=\"$cid\" $sel>$cname</option>";
      
   }
   
   echo "</td></tr>";


       echo"<tr><td><B>"._FGADMIN_GAMESWFWIDTH."</b></td><td><input type=\"text\" name=\"add_gwidth\" size=\"3\" maxlength=\"3\"></td>";
       echo"<tr><td><B>"._FGADMIN_GAMESWFHEIGHT."</b></td><td><input type=\"text\" name=\"add_gheight\" size=\"3\" maxlength=\"3\"></td>";
       echo "<tr><td><input type=\"submit\" name=\"Submit\" value=\"Start\"><br></td><td><b>"._FGADMIN_GAMESSCANNOTES."</b>";
     
       echo "</div>";
       echo "</form>";
   echo "</td></tr>";
       CloseTable();


if(empty($dir)) $dir = "";
if ($dir<>"")
{
$dir = stripslashes($dir);
$arrfiles = array();
if (is_dir($dir)) {
if ($handle = opendir($dir))
 {
chdir($dir);
while (false !== ($file = readdir($handle)))
   {
    if ($file != "." && $file != ".." && !is_dir($file)) $arrfiles[] = $file;
   }
 }
closedir($handle);
}
$filesi=$arrfiles;

while(list($key, $us) = each($filesi))
   {
     if (substr($us,-3)=="swf")
     {
     $i++;
     echo "<div align=\"center\"><b>"._FGADMIN_ADDINGGAMES."</b><br>";
     echo $i . " - " . stripslashes($us) . "<br>\n";
     echo "</div>";
    $add_gwidth=$_POST['add_gwidth'];
    $add_gheight=$_POST['add_gheight'];
    $add_gcid=$_POST['add_gcid'];
    $add_gtype=$_POST['add_gtype'];
    $add_gname=substr($us,0,-4);
    $add_gimage=$add_gname.".gif";
    $sql = "insert into ".$user_prefix."_flashgames_games";
    $sql .= "(gid,gcid,gtype,gname,gdescription,gimage,gfilename,gauthorname,gauthorurl,gwidth,gheight,gcolor, glicensekey, hits) ";
    $sql .= "values (NULL,'$add_gcid', '$add_gtype', '$add_gname','Empty Please Fill Me','$add_gimage','$us','unknown','Unknown','$add_gwidth','$add_gheight','$add_gcolor','$add_glicensekey','0')";
    $result = sql_query($sql, $dbi);
   
   
     }
   }
}
   
    include("footer.php");
}
// ####### End auto scan for games ##


Right after that follows switch($op)

Add somewhere

Code:
case "GamesDirScan":
    GamesDirScan();
    break;


In case.php

Code:
case "GamesDirScan":


And in the admin language file

Code:
define("_FGADMIN_GAMESSCAN","Dir Scanner");
define("_FGADMIN_SCANDIRPATH","Directory For Scanning ");
define("_FGADMIN_GAMESSCANNOTES","Enter the Full path to the directory you want to scan!!!<br>These settings  will be used for ALL GAMES <br>added after the scan is complete.");
define("_FGADMIN_ADDINGGAMES","Adding Games From Selected Directory");


P.S. Will be glad to see this in future releases, and you can add some antilamer checks, because i didn't Smile
And don't forget the fix for the renamed admin.php I noticed that a lot of replacing must be done Smile


View user's profile Send private message Send e-mail
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23942
Location: NSW, Australia

Post Posted: Fri Jun 24, 2005 11:48 pm   
Post subject:
Reply with quote
 
hi MaSTeRMinD,

ill hopefully have this option for the v0.4++ released of the VIP VERSION.
I will ofcourse credit you for the add-on but im sure it will change dramatically..

Ill make changes to your code so that:

' eg. You have 700 swf files but you dont want to manually add them all '

1. dump all the roms into a different directory then normal.
eg. modules/Flash_Games/auto/
2. the script will look up the 'modules/Flash_Games/auto/' directory and will automatically add the game into the database with a automatic name made from the filename.
3. It will check to make sure the .swf doesnt already exist and if it does it will not add it automatically to the database.
4. It will make standard comments eg. 'No Comments Available' and will also fill out the author details and all other sections of the add game form.

anyway, thanks again for submitting some code.. It always helps to have somewhere to start from..

l8r

FH
http://www.xbox-hq.com

btw.. check out v0.4 on HQ now.. You all will love the new sort, search and per page functions.

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com | www.c64-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
dragongamer
Xbox-HQ Enthusiast
Xbox-HQ Enthusiast

Xbox Version: none
Modded: none

Joined: Sep 22, 2005
Posts: 34

Post Posted: Sat Oct 08, 2005 5:37 pm   
Post subject:
Reply with quote
 
thanks that is amazing i added 50 games in what 50 seconds cool!


View user's profile Send private message
 
Display posts from previous:   
  Post new topic  
 
  Reply to topic  
|
 All times are GMT | Page 1 of 1
Jump to:  
 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
 


Get Xbox Game Pass Ultimate