コード例 #1
0
/**
 * First create the dropdown
 * make sure to change POST_TYPE to the name of your custom post type
 * 
 * @author Ohad Raz
 * 
 * @return void
 */
function wpse45436_admin_posts_filter_restrict_manage_posts()
{
    $type = 'player';
    if (isset($_GET['post_type'])) {
        $type = $_GET['post_type'];
    }
    //only add filter to post type you want
    if ('player' == $type) {
        //change this to the list of values you want to show
        //in 'label' => 'value' format
        $grades = get_terms(array('grade'));
        ?>
        <select name="grade">
        <option value=""><?php 
        _e('Show all Grades', 'wose45436');
        ?>
</option>
        <?php 
        $current_v = isset($_GET['grade']) ? $_GET['grade'] : '';
        foreach ($grades as $grade) {
            printf('<option value="%s"%s>%s</option>', $grade->slug, $grade->slug == $current_v ? ' selected="selected"' : '', $grade->name);
        }
        ?>
        </select>
        
        <?php 
        $camps = get_terms(array('camp'));
        ?>
        
        <select name="camp">
        <option value=""><?php 
        _e('Show all Camps', 'wose45436');
        ?>
</option>
        <?php 
        $current_v = isset($_GET['camp']) ? $_GET['camp'] : '';
        foreach ($camps as $camp) {
            printf('<option value="%s"%s>%s</option>', $camp->slug, $camp->slug == $current_v ? ' selected="selected"' : '', $camp->name);
        }
        ?>
        </select>
<?php 
        $sizes = get_terms(array('size'));
        ?>
        
        <select name="size">
        <option value=""><?php 
        _e('Show all Sizes', 'wose45436');
        ?>
</option>
        <?php 
        $current_v = isset($_GET['size']) ? $_GET['size'] : '';
        foreach ($sizes as $size) {
            printf('<option value="%s"%s>%s</option>', $size->slug, $size->slug == $current_v ? ' selected="selected"' : '', $size->name);
        }
        ?>
        </select>
        
        <input type="text" name="order_id" value="<?php 
        echo getGetVar('order_id');
        ?>
" placeholder="Order ID" />     
        <?php 
    }
}
コード例 #2
0
ファイル: addList.php プロジェクト: brandonberger/oop
<?php

require '../core/sessions.php';
require '../core/functions.php';
getGetVar();
require_once '../core/db.php';
startSession();
getPersonalList($id);
getUserToken($id);
if ($_COOKIE['online'] == $id) {
    if (isset($_POST['list_name_submit']) && !empty($_POST['list_name_submit'])) {
        if (empty($_POST['list_name'])) {
            $_SESSION['temp_msg'] = 'Please enter a list name';
            header('Location: ../edit-list.php?id=' . $id . '&success=false');
            exit;
        }
        $listName = $_POST['list_name'];
        addList($userID, $listName);
        $_SESSION['temp_msg'] = $listAdded_success;
        header('Location: ../edit-list.php?id=' . $id . '&success=true');
        exit;
    }
}
?>

コード例 #3
0
ファイル: dl-2.php プロジェクト: kjk/web-arslexis
<?php

# Author: Krzysztof Kowalczyk (krzysztofk@pobox.com)
#
# Script called from dl.php, just redirects the download
# to the file if login/pwd/name of the product are valid
require "../phpinc/settings.inc";
error_reporting(E_ALL);
set_error_handler("errorHandler");
# make sure we got login, pwd, name variables
verifyGetVarExists('login');
verifyGetVarExists('pwd');
verifyGetVarExists('name');
$login = stripQuotes(myUrlDecode(getGetVar('login')));
$pwd = stripQuotes(myUrlDecode(getGetVar('pwd')));
$productName = getGetVar(myUrlDecode('name'));
if (!canDownloadProduct($login, $pwd, $productName)) {
    doError("Cannot download for login={$login}, pwd={$pwd}, product={$productName}\n");
}
$fullPath = getProductFilePath($productName);
$fileName = getProductFileName($productName);
verifyFileExists($fullPath);
updateDlCount($login, $pwd, $productName);
// and finally return the file
header("Content-Type: application/octet-stream\n");
header("Content-disposition: attachment; filename={$fileName}\n");
header("Content-transfer-encoding: binary\n");
header("Content-Length: " . filesize($fullPath) . "\n");
$fp = fopen($fullPath, "rb");
fpassthru($fp);