PDA

View Full Version : Remove All Scores Button


Chuckie
01-01-2006, 03:04 PM
This will add a button in you scores tools section of you Arcade Admincp. Tested on only 2 sites so far and works good.

Does 3 quarries at execution only.

1 php file to edit.

Open /admincp/arcadeadmin.php

add these 2 edits in the stated locations.

Back up you database!!!!!!!
No Warranties or guarantees express or implied.

{Fixed Code} (http://www.v3arcade.com/forums/showpost.php?p=7314&postcount=3)

egyptsons
01-03-2006, 05:12 AM
Thanks
:)

I do it and it's works good :cool:

Our Sponsors
 

marquisite
01-21-2006, 11:59 AM
For some reason I couldnt get it to work, however with some editing it does now!

I changed the UPDATE order around, as that was the cause of the invalid sql query error.

Here is my code:

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// REMOVE ALL SCORES
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if ($_REQUEST['do'] == 'removescores')
{

print_cp_header($vbphrase['arcade_scores']);
$db->query_write("DELETE FROM " . TABLE_PREFIX ."arcade_sessions
");
$db->query_write("DELETE FROM " . TABLE_PREFIX ."arcade_news
");

$db->query_write("UPDATE " . TABLE_PREFIX ."arcade_games SET highscore='0.000'");
$db->query_write("UPDATE " . TABLE_PREFIX ."arcade_games SET highscorerid='0'");

// Getting Arcade functions to rebuild the counts.
require_once(DIR . '/includes/functions_arcade.php');
build_games();

print_cp_redirect('arcadeadmin.php?do=scores');
}

Chuckie
01-29-2006, 08:21 AM
For some reason I couldnt get it to work, however with some editing it does now!

I changed the UPDATE order around, as that was the cause of the invalid sql query error.

Here is my code:

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// REMOVE ALL SCORES
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if ($_REQUEST['do'] == 'removescores')
{

print_cp_header($vbphrase['arcade_scores']);
$db->query_write("DELETE FROM " . TABLE_PREFIX ."arcade_sessions
");
$db->query_write("DELETE FROM " . TABLE_PREFIX ."arcade_news
");

$db->query_write("UPDATE " . TABLE_PREFIX ."arcade_games SET highscore='0.000'");
$db->query_write("UPDATE " . TABLE_PREFIX ."arcade_games SET highscorerid='0'");

// Getting Arcade functions to rebuild the counts.
require_once(DIR . '/includes/functions_arcade.php');
build_games();

print_cp_redirect('arcadeadmin.php?do=scores');
}

You are right, it is an error on my part that would cause a problem if you have a table prefix. Cannot edit my post above to fix it.

Our Sponsors
 

Detomah
01-29-2006, 09:28 AM
Don't suppose you could add some kind of double check reference to the code, so that it doesn't delete all the scroes with a single click? I could forsee some violent langueage by various webmasters after having little accidents.

I got it working fine, but if you read between the lines above, you may get an idea of what I did by accident when I first added it. ;)

Fortunately it was on a day where all the scores were due a reset anyway.

theguru
03-10-2006, 06:36 PM
Would it be possible for some kind person to come up with the following code for me please?

I'd like a cron job that would automatically remove scores that are older than a specified period (eg 1 month)

fly
03-15-2006, 11:09 AM
Where does this code go? I think that part got deleted. Anyone know if this works with 1.0.5?

imported_lairnoc
03-15-2006, 03:47 PM
Where does this code go? I think that part got deleted. Anyone know if this works with 1.0.5?

yeah i wanno know that too prune all button would be great actually

imported_legendarybennnn
03-18-2006, 08:55 PM
would love to know this aswell

fly
03-20-2006, 08:21 AM
would love to know this aswell
It does work, as I just ran the SQL queries. Would love to know how to get this into the script though.

Shafy
03-20-2006, 01:17 PM
where is the code for showing the actual button?

The templete edits where are that? Can someome please give us the complete code and edits.

Thanks

imported_Zendiver
03-22-2006, 09:35 AM
Here is what I have done to remove all scores. See file attached.

imported_Black Cobra
04-04-2006, 01:09 AM
Can the attachment be approved so we can use this please?

dvg323
04-04-2006, 01:44 AM
the newest version of the arcade has this feature included. ;)~

theguru
04-18-2006, 12:25 PM
the newest version of the arcade has this feature included. ;)~
Does it? Which version specifically and where?

imported_kimrur
04-19-2006, 12:33 PM
I haven't seen it in the newest version either

imported_Black Cobra
04-21-2006, 01:12 PM
he might of had it in the olde version and it kept in when he updated...

CrazyEh
04-21-2006, 05:29 PM
Does Zen's version work?. I need to clear all the scores, but I'm kind of worried here.. I'm not sure why this isn't included?.

Thanks.

Chuckie
05-15-2006, 07:51 AM
Zens works fine. Only difference is he added a check and a popup. Either way they are both good and safe if you want you scores database cleaned out.

Ryder
12-01-2006, 10:59 PM
sorry if this is too old to be revived but works great, thanks for the mod :D!