Exemple #1
0
        $user_loc_message .= $st[22];
    } elseif (!isset($_POST['sure'])) {
        //not confirmed yet.
        get_var($cw['emergency_return'], $_SERVER['PHP_SELF'], $st[23], 'sure', 'yes');
    } else {
        explore_sys($user, 1);
        //on the off chance it hasn't been destroyed.
        $user_ship['config'] = str_replace("er", "", $user_ship['config']);
        dbn("update {$db_name}_ships set location = '1', mine_mode = '0', config='{$user_ship['config']}', upgrade_slots = upgrade_slots + 1 where ship_id = '{$user['ship_id']}'");
        $user_ship['mine_mode'] = 0;
        $user_ship['location'] = 1;
        $user['location'] = 1;
        get_star();
    }
}
archive_links();
#random event stuff:
if ($star['event_random'] > 0) {
    if ($star['event_random'] == 2) {
        $random_str = "<font color=#00aaaa><center><p />" . $st[24] . " <a href='help.php?topic=Random_Events' target='_blank'>(" . $cw['help'] . ")</a>";
        $random_str .= "<p />" . $st[25] . "</center><p /></font>";
        $header = $cw['nebula'];
    } elseif ($star['event_random'] == 4) {
        $random_str = "<center><p />" . $st[26];
        $random_str .= "<p />" . $st[27] . "</center>";
        $header = $cw['metal_rush'];
    } elseif ($star['event_random'] == 5) {
        $random_str = "<center><p />" . $st[28];
        $random_str .= "<p />" . $st[29] . "<p />";
        $header = $cw['supernova'];
    } elseif ($star['event_random'] == 6) {
set_time_limit(3600);
// Don't let PHP timeout
$SEED_URL = "http://www.schrenk.com";
// First URL spider downloads
$MAX_PENETRATION = 1;
// Set spider penetration depth
$FETCH_DELAY = 1;
// Wait one second between page fetches
$ALLOW_OFFISTE = true;
// Don't allow spider to roam from the SEED_URL's domain
$spider_array = array();
# Get links from $SEED_URL
echo "Harvesting Seed URL    \n";
$temp_link_array = harvest_links($SEED_URL);
$spider_array = archive_links($spider_array, 0, $temp_link_array);
# Spider links in remaining penetration levels
for ($penetration_level = 1; $penetration_level <= $MAX_PENETRATION; $penetration_level++) {
    $previous_level = $penetration_level - 1;
    for ($xx = 0; $xx < count($spider_array[$previous_level]); $xx++) {
        unset($temp_link_array);
        $temp_link_array = harvest_links($spider_array[$previous_level][$xx]);
        echo "Level={$penetration_level}, xx={$xx} of " . count($spider_array[$previous_level]) . " <br>\n";
        $spider_array = archive_links($spider_array, $penetration_level, $temp_link_array);
    }
}
# Download images from pages referenced in $spider_array
for ($penetration_level = 1; $penetration_level <= $MAX_PENETRATION; $penetration_level++) {
    for ($xx = 0; $xx < count($spider_array[$previous_level]); $xx++) {
        download_images_for_page($spider_array[$previous_level][$xx]);
    }
}