Example #1
0
function sortHill($arr)
{
    $n = count($arr);
    $h = 1;
    while ($h < $n / 3) {
        $h = $h * 3 + 1;
    }
    while ($h >= 1) {
        for ($i = 0; $i < $n; $i++) {
            for ($j = $i; $j > $h; $j -= $h) {
                if ($arr[$j] < $arr[$j - $h]) {
                    switchOrder($arr, $j, $j - $h);
                } else {
                    break;
                }
            }
        }
        $h = $h / 3;
    }
}
Example #2
0
if (isset($_REQUEST['col'])) {
    $column = $_REQUEST['col'];
} else {
    $column = "post_date";
}
if (isset($_REQUEST['dir'])) {
    $dir = $_REQUEST['dir'];
} else {
    $dir = "ASC";
}
if ($column == "post_date") {
    $datelink = "archive.php?col=post_date&dir=" . switchOrder($dir);
    $titlelink = "archive.php?col=post_title&dir=ASC";
} else {
    $datelink = "archive.php?col=post_date&dir=ASC";
    $titlelink = "archive.php?col=post_title&dir=" . switchOrder($dir);
}
$query = "SELECT ID, post_title, post_date FROM wp_posts WHERE post_status = 'publish' ORDER BY {$column} {$dir}";
$result = mysql_query($query);
echo "<p><h2>Illinois Marching Online News Archives</h3><p>";
echo "<table class='table_grid' border=0 cellspacing=5 width='100%'>";
echo "<thead><tr class='catbg'>";
echo "<td><a href='{$datelink}'><font color='#FFFFFF'>Date</font></a></td>";
echo "<td><a href='{$titlelink}'><font color='#FFFFFF'>Article</font></a></td>";
echo "</tr></thead>";
$i = 0;
while ($row = mysql_fetch_array($result)) {
    if ($i % 2 == 0) {
        $style = "windowbg";
    } else {
        $style = "h";
Example #3
0
                    }
                    $dstW = intval($srcW * $ratio);
                    $dstH = intval($srcH * $ratio);
                    $im2 = imagecreatetruecolor($dstW, $dstH);
                    imagecopyresampled($im2, $img, 0, 0, 0, 0, $dstW, $dstH, $srcW, $srcH);
                    imagejpeg($im2, $tmpfile, 85);
                } else {
                    imagejpeg($img, $tmpfile, 85);
                }
                $SQL[] = 'IceContent=' . StrSafe_DB(file_get_contents($tmpfile));
            }
            // 			debug_svela($_FILES);
        }
        safe_w_sql("update IdCardElements set " . implode(',', $SQL) . " where IceTournament={$_SESSION['TourId']} and IceOrder={$IdOrder}");
        if (!empty($Options['Order'])) {
            switchOrder($IdOrder, intval($Options['Order']));
        }
    }
}
if (!empty($_FILES['UploadedBgImage']['size'])) {
    unset($img);
    switch ($_FILES['UploadedBgImage']['type']) {
        case 'image/png':
            $img = imagecreatefrompng($_FILES['UploadedBgImage']['tmp_name']);
        case 'image/jpeg':
            if (!isset($img)) {
                $img = imagecreatefromjpeg($_FILES['UploadedBgImage']['tmp_name']);
            }
            break;
    }
    if (!empty($img)) {