Php Arcade Script Forums
May 18, 2013, 09:39:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Recover your password to gain access to the forum. If you own a phpAS license you don't have to register a new account.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: DateAdded reset button in admin ?  (Read 3092 times)
Searchtheweb
Newbie
*
Posts: 35


View Profile Email
« on: April 03, 2011, 10:54:34 AM »

Hi JanArve,

You said something about a reset button for the dateadded in the /forums/ but no news on that. Can you give me some news on it ? I really need it and anybody who inserts a game pack with an autopopulate script will find himself/herself in this situation (=no dateadded for any game)
Logged
JanArve
*
Posts: 135


View Profile Email
« Reply #1 on: April 03, 2011, 06:57:48 PM »

Hey,

Yes it is on our feature request list, but at the moment I can't give you any specific date it will be finished. If it is something you really need fast your best bet is to try and find a coder to do this for you. It shouldn't take them more than an hour to make a reset button that set a game's date to the current time/date. Normally we can do customizations, but at the moment we are all tied up behind the scenes of the new website system to make sure everything is working smoothly and the reported bugs are taken care of.
Logged
Searchtheweb
Newbie
*
Posts: 35


View Profile Email
« Reply #2 on: April 04, 2011, 02:09:05 PM »

Hi,

I solved it. I got the dateadded reset code done! It's working perfectly know.

Thank you anyways!
Logged
JanArve
*
Posts: 135


View Profile Email
« Reply #3 on: April 04, 2011, 03:33:55 PM »

I'm glad you got it to work! I'm sorry I wasn't able to help you out more, but these are quite hectic times at the moment.

It would be great if you would like to share the code, I'm sure there are many more that could benefit from it.
Logged
Searchtheweb
Newbie
*
Posts: 35


View Profile Email
« 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.
Logged
Searchtheweb
Newbie
*
Posts: 35


View Profile Email
« Reply #5 on: April 05, 2011, 05:41:08 AM »

infosup = '$newinfosup',
                  articoljoc = '$newarticoljoc', are codes I inserted that you won't find in your code. Search for other parts of the respective code in order to find the spot where you should insert the code I wrote.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!