Posted: Mon May 09, 2005 1:28 pm Post subject: games scanner
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.
forahobby Administrator
Joined: May 22, 2003 Posts: 23944 Location: NSW, Australia
Posted: Mon May 09, 2005 3:05 pm Post subject:
hi mastermind,
Rather then going ahead coding something i already have planned why not get started on this..
gamename.ini files..
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.
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
Sooo actually my auto thingie is done. See it in action here
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:
109 Time(s)
fg1.JPG
Description:
Filesize:
30.16 KB
Viewed:
109 Time(s)
forahobby Administrator
Joined: May 22, 2003 Posts: 23944 Location: NSW, Australia
Posted: Tue May 10, 2005 1:20 pm Post subject:
oh, ok..
I see what you mean now.. I must have misunderstood your post
Very nice..
// ####### 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();
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
And don't forget the fix for the renamed admin.php I noticed that a lot of replacing must be done
forahobby Administrator
Joined: May 22, 2003 Posts: 23944 Location: NSW, Australia
Posted: Fri Jun 24, 2005 11:48 pm Post subject:
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..
thanks that is amazing i added 50 games in what 50 seconds cool!
|
All times are GMT |Page 1 of 1
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