Quote:
Originally Posted by txsbmw
I am having this exact same issue and my members are now complaining. Any idea on how to fix this?
|
I've created custom script based on REMOVE ZERO arcade cp functionality. Added to the script "DELETE INCORRECT SCORES" ability and then added it to VB's cronjob.
For me it solved the problem.
First you might want to run mentioned function manually (from adminCP/arcade/Score Tools/Remove all zero scores) and make sure if it helps.
I've also added removal of incorrect users, ones with empty userid. Dunno where they are coming from.
I've attached the script to this post. On my forums I added it to "Scheduled tasks" to be run every 30 minutes Before you can add it to "Scheduled tasks" you will need to upload it to /includes/cron/
USE THIS SCRIPT ON YOUR OWN RISK. I GIVE NO WARRANTY AT ALL.
I recommend you to be very carefull with this script and with any third party scripts.
I created this script for internal use only and never tested it on any other forums but mine.
Below is sctipt's code.
PHP Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
echo ("vbulletin->db is not an object");
exit;
}
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('cpuser', 'arcade', 'user');
$specialtemplates = array('arcade_bitdef');
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// REMOVE ZERO SCORES AN INCORRECT USERS
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
$db=$vbulletin->db;
$db->query_write("DELETE FROM " . TABLE_PREFIX . "arcade_sessions WHERE score=0 AND valid=1");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "arcade_sessions WHERE userid=''");
// Getting Arcade functions to rebuild the counts.
require_once(DIR . '/includes/functions_arcade.php');
build_games();
log_cron_action('Arcade Clear Zero scores completed', $nextitem);
?>