Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/topsites/cron.php
<?PHP
$topsites_directory = $_SERVER['DOCUMENT_ROOT'] . 'topsites';

chdir($topsites_directory);

$sapi = php_sapi_name();

if( $sapi != 'cli' )
{
    $message = "<pre>This script can only be executed by the cli version of PHP.\n" .
               "Current executing environment: <b>$sapi</b></pre>";
    
    if( isset($_SERVER['REQUEST_METHOD']) )
    {
        echo $message;
    }
    else
    {
        echo strip_tags($message);
    }

    exit;
}

require_once('tsphp.php');

$argument = $GLOBALS['argv'][1];


switch($argument)
{
    case '--rerank':
        {
            RerankAccounts('cron.php');

            $result = $DB->Query("SELECT * FROM topsites_Pages");

            while( $page = $DB->NextRow($result) )
            {
                BuildPage($page['Identifier']);
            }

            $DB->Free($result);
            $DB->Disconnect();
        }
        break;

    case '--reset':
        ResetCurrentHits('cron.php');
        break;

    case '--clearips':
        ClearIPLogs();
        break;

    case '--totalreset':
        ResetTotalHits();
        break;
    
    /*case '--ratingreset':
        ResetRatings();
        break;*/

    case '--clearcheatlog':
        ClearCheatLog();
        break;

    case '--clearcheattally':
        ClearCheatTally();
        break;

    case '--clearmemberstats':
        ClearAccountStats();
        break;

    case '--removeunconfirmed':
        RemoveUnconfirmed();
        break;

    case '--optimizedatabase':
        DoDatabaseOptimize();
        break;

    case '--backup':
        {
            DoDataBackup('cron-data.txt');
            DoSQLBackup('cron-sql.txt');

            $times =& IniParse("{$GLOBALS['DDIR']}/times");

            $times['Backup'] = time();

            IniWrite("{$GLOBALS['DDIR']}/times", $times);
        }
        break;

    default:
        echo "ERROR: Invalid command line argument\n\n";
        break;
}


?>
Return current item: DDL CMS