예제 #1
0
function options_screen3()
{
    if ($_GET["upgrade"] == "check") {
        return check_for_updates();
    } else {
        if ($_GET["upgrade"] == "doupgrade") {
            return do_updates();
        }
    }
    return;
}
예제 #2
0
 if (rand(1, 99) == 30) {
     $poll_peer = filter_sql(file_get_contents("http://timekoin.net/time.php", FALSE, $context, NULL, 12));
     $my_time = time();
     if (abs($poll_peer - $my_time) > 15 && empty($poll_peer) == FALSE) {
         // Timekoin peer time is not in sync
         mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'time_sync_error' LIMIT 1");
     } else {
         // Timekoin peer time is in sync
         mysql_query("UPDATE `main_loop_status` SET `field_data` = '0' WHERE `main_loop_status`.`field_name` = 'time_sync_error' LIMIT 1");
     }
 }
 //*****************************************************************************************************
 //*****************************************************************************************************
 // Do a update software check and report to user if one is available
 if (rand(1, 300) == 100) {
     if (check_for_updates(TRUE) == 1) {
         // Update available, alert user
         mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'update_available' LIMIT 1");
     }
 }
 //*****************************************************************************************************
 //*****************************************************************************************************
 // Check for spamming IPs
 $sql = "SELECT * FROM `ip_activity` GROUP BY `ip`";
 $sql_result = mysql_query($sql);
 $sql_num_results = mysql_num_rows($sql_result);
 $request_max = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'server_request_max' LIMIT 1"), 0, "field_data");
 if ($request_max > 0) {
     for ($i = 0; $i < $sql_num_results; $i++) {
         $sql_row = mysql_fetch_array($sql_result);
         $select_IP = $sql_row["ip"];
예제 #3
0
<?php

include "config.php";
function check_for_updates()
{
    $version_file = "update_exists.txt";
    $version = file_get_contents('http://www.smccandl.net/pwaplusphp_version.html');
    if ($version !== false) {
        $version = trim($version);
        if ($version > $THIS_VERSION) {
            echo "<a href='http://pwaplusphp.googlecode.com/files/pwa+php_v{$version}.tar'>Get v{$version}!</a>";
            $fh = fopen($version_file, 'w') or die("can't open file");
            fwrite($fh, $version);
            fclose($fh);
        }
    } else {
        # We had an error, fake a high version number so no message is printed.
        $version = "99";
    }
}
check_for_updates();
예제 #4
0
						</li>
					<?php 
        }
    }
}
?>
 
		</ul>
<?php 
echo "</td></tr>";
echo "<tfoot><tr><th valign=top colspan=3></th></tr></tfoot>\n";
echo "</table>";
echo "<br />";
echo "<table class='widefat' width='100%'>";
if ($PRO_VERSION == "TRUE") {
    $pro_version_msg = check_for_updates($THIS_VERSION);
    $pv = "Pro";
    $pro_title = "You are using PWA+PHP Pro";
} else {
    $pv = "Basic";
    $pro_version_msg = "For \$10, the <a href='http://pwaplusphp.smccandl.net/pro/' target='_BLANK'>Pro Version</a> offers advanced features including: support for comments, thumbnail and XML caching for dramatically faster page loads, jQuery effects, two widgets, editor buttons, and more! Learn <a target='_BLANK' href='http://pwaplusphp.smccandl.net/pro/buy'>how to buy it</a>.";
    $pro_title = "24x Faster Page Loads with Pro!";
}
echo "<thead><tr><th valign=top colspan=3>{$pro_title}</th></tr></thead>\n";
echo "<tr><td>{$pro_version_msg}";
echo "</td></tr>";
echo "<tfoot><tr><th valign=top colspan=3></th></tr></tfoot>\n";
echo "</table>";
echo "<br />";
if ($PRO_VERSION == "TRUE") {
    echo "<table class='widefat' width='100%'>";
예제 #5
0
function tk_client_task()
{
    // Repeat Task
    peer_list();
    transaction_queue();
    if (rand(1, 150) == 100) {
        if (check_for_updates(TRUE) == 1) {
            // Update available, alert user
            mysql_query("UPDATE `options` SET `field_data` = '1' WHERE `options`.`field_name` = 'update_available' LIMIT 1");
        }
    }
    return;
}