Esempio n. 1
0
 static function init()
 {
     if (!self::$wpdb) {
         global $wpdb;
         self::$wpdb = $wpdb;
         self::$video_table = $wpdb->prefix . self::$video_table;
         self::$category_table = $wpdb->prefix . self::$category_table;
     }
 }
Esempio n. 2
0
                                        </div>
                                         <br>
                                        <div class="form-field">
                                            <label class="cm-required">地址: </label>
                                            <input type="text" size="30" value="<?php 
echo $data["href"];
?>
" name="href" id="href">
                                        </div>
                                         <br>
                                        <div class="form-field">
                                           <label class="cm-required">分类: </label>
                                           <select name="category_id">
                                            <option value="0">---请选分类---</option>
                                            <?php 
$rows = PtpVideoDB::getCategoryRows(1);
$cate_id = $data["category_id"];
foreach ($rows as $row) {
    $sel = '';
    if ($cate_id == $row['id']) {
        $sel = ' selected="selected"';
    }
    ?>
                                            <option value="<?php 
    echo $row['id'];
    ?>
"<?php 
    echo $sel;
    ?>
><?php 
    echo $row['name'];
Esempio n. 3
0
 static function init()
 {
     return PtpVideoDB::setup();
 }
Esempio n. 4
0
                                            <th width="5%" align="left" style="background: #fff;">
                                             <input type="checkbox" value="Y" name="check_all" onclick="checkAll(this)"> 全选
                                            </th>
                                            <th width="5%" align="left" style="background: #fff;">排序</th>
                                            <th width="20%" align="left" style="background: #fff;">名称</th>
                                            <th width="20%" align="left" style="background: #fff;">视频</th>
                                            <th width="20%" align="left" style="background: #fff;">封面</th>
                                            <th width="10%" align="left" style="background: #fff;">分类</th>
                                            <th width="10%" align="left" style="background: #fff;">是否显示</th>
                                            <th width="10%" align="left" style="background: #fff;">操作</th>
                                        </tr>
                                        <!--//循环输出管理员列表-->
                                   <?php 
foreach (PtpVideoDB::pageRows($pstart, $pagesize, $video_table, $keywords) as $row) {
    $id = $row['id'];
    $category = PtpVideoDB::getCategoryRow($row['category_id']);
    ?>
                                    <tr height="40">
                                            <td class="center" style="background: #fff;">
                                                <input name="delete_id[]" type="checkbox" class="checkbox cm-item" value="<?php 
    echo $id;
    ?>
">
                                            </td>
                                            <td style="background: #fff;"><input type="text" class="input-text-short" size="3" value="<?php 
    echo $row['sort'];
    ?>
" name="sort[<?php 
    echo $id;
    ?>
]"></td>
Esempio n. 5
0
            }
        }
        header("Location: ?page=" . PtpVideo::$_category_url);
        exit;
    } else {
        if (!$action && $id) {
            //select
            //URL : /wp-admin/admin.php?page=ptp-video-category&file=category_op.php&id=2
            $title = "更新";
            $data = PtpVideoDB::getCategoryRow($id);
        } else {
            if (isset($_POST['act_sort'])) {
                $sorts = $_POST['sort'];
                foreach ($sorts as $id => $sort) {
                    $data = array('sort' => $sort);
                    PtpVideoDB::saveCategory($data, $id);
                }
                header("Location: ?page=" . PtpVideo::$_category_url);
                exit;
            }
        }
    }
}
?>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tbody>
        <tr valign="top">
            <td class="content">
                <div class="clear" id="main_column">
                    
Esempio n. 6
0
<?php

/*
Template Name:视频
*/
//header("Location: /video/culture/");
get_header();
$post_id = get_the_ID();
$post = get_post($post_id);
$title = $post->post_title;
$where = "name = '{$title}'";
//根据栏目标题匹配分类
$videoCat = PtpVideoDB::getCategoryRow($where);
$cat_id = $videoCat['id'];
$where = "category_id = '{$cat_id}'";
$videos = PtpVideoDB::getVideoRows($where);
?>

<div class="centerdiv home_bg">
	<div class="center_topimg">
    	<p class="top_img_draw"></p>
    </div>
    
    <div class="center_div">
    	<div class="p2">
        	<div class="p2-1 clearfix">
        		<?php 
get_sidebar('video-sidebar');
?>
        		
                <div class="company_info">
Esempio n. 7
0
" class="cm-check-changes">
                            <div id="pagination_contents">
                                <table width="100%" cellspacing="1" cellpadding="0" border="0" style="background:#ddd;" class="table_pd">
                                    <tbody>
                                        <tr height="40">
                                            <th width="5%" align="left" style="background: #fff;">
                                             <input type="checkbox" value="Y" name="check_all" onclick="checkAll(this)"> 全选
                                            </th>
                                            <th width="15%" align="left" style="background: #fff;">排序</th>
                                            <th width="15%" align="left" style="background: #fff;">名称</th>
                                            <th width="15%" align="left" style="background: #fff;">是否显示</th>
                                            <th width="10%" align="left" style="background: #fff;">操作</th>
                                        </tr>
                                        <!--//循环输出管理员列表-->
                                   <?php 
foreach (PtpVideoDB::pageRows($pstart, $pagesize, $category_table, $keywords) as $row) {
    $id = $row['id'];
    ?>
                                    <tr height="40">
                                            <td class="center" style="background: #fff;">
                                                <input name="delete_id[]" type="checkbox" class="checkbox cm-item" value="<?php 
    echo $id;
    ?>
">
                                            </td>
                                            <td style="background: #fff;"><input type="text" class="input-text-short" size="3" value="<?php 
    echo $row['sort'];
    ?>
" name="sort[<?php 
    echo $id;
    ?>