|
Searchtheweb
|
 |
« Reply #4 on: April 05, 2011, 05:39:51 AM » |
|
I am glad I can help other people. I must say this code works with phparcadescript v 3.0 which I use, I DON'T KNOW if it works with version 4.0 though... You can at least try
Inside index.php from the admin folder search for : $result = mysql_query( "update games set gametitle = '$newgamename', gamedesc = '$newgamedesc', gamekeywords = '$newgamekeywords', gameheight = '$newgameheight', gamewidth = '$newgamewidth', category = '$newcategory', gamefile = '$newgamefile', gameicon = '$newgameicon', gamestatus = '$newgamestatus', iconlocation = '$newiconlocation', gamelocation = '$newgamelocation', instructions = '$newgameinstructions', filetype = '$newfiletype', customcode = '$newgamecustom', infosup = '$newinfosup', articoljoc = '$newarticoljoc', featured = '$featuredstatus', featuredicon = '$featuredicon', timesplayed = '$newgamesplayed' where gameid = '$id'" );
Right after this code ends put this code and overwrite index.php file from the admin folder:
if($newgamestatus == 1) { $result = mysql_query( "select dateadded from games where gameid = '$id'" ); $row = mysql_fetch_row($result); if($row[0] == 0) { $dateadded = time(); $result = mysql_query( "update games set dateadded = '$dateadded' where gameid = '$id'" ); } }
What this code does: let's say you inserted with an autopopulate script hundreds of game but you set them to inactive so you can edit them one by one. In this situation you normally wouldn't get any post date for that games. So, this script does this: when you select for the very first time on a game edit page the Active status, while updating, this inserts the date into the dateadded so that the date when you set that game to Active is recorded.
After inserting this code, you just don't have to do anything else. If the game was already active and you edit it, it doesn't change the dateadded. It inserts the date only if the game HAS NEVER BEEN ACTIVE before, not even once.
That's about all. Hope it helps you. I'm sure the phparcadescript cms owners will include this in the next versions as there are many who use gamepacks and autopopulate scripts and don't set all games active at once.
|