Esempio n. 1
0
File: link.php Progetto: ruoL/fun-x
 public function update_action()
 {
     if (!$this->input->is_ajax_request()) {
         show_404();
     }
     $name = $this->input->post('name', true);
     $link = $this->input->post('link', true);
     $info = $this->input->post('info', true);
     $sort = (int) $this->input->post('sort');
     $data['name'] = trim($name);
     $data['link'] = $link;
     $data['info'] = substring(format_content($info), 240);
     $data['sort'] = $sort > 255 ? 255 : $sort;
     if (!$data['name'] or !$data['link']) {
         JSON('error', '对不起,请填写必填字段!');
     }
     if (!is_url($data['link'])) {
         JSON('error', '请填写有效的网站 URL 地址!');
     }
     $lid = (int) $this->input->post('lid');
     $this->db->update('link', $data, array('lid' => $lid));
     if ($this->db->affected_rows()) {
         JSON('success', '恭喜,链接已更新成功!');
     } else {
         JSON('error', '对不起,链接没有更新名更新失败!');
     }
 }
Esempio n. 2
0
 public function parse_path($file)
 {
     if (is_string($file)) {
         if (strlen($file[0]) > 0 && $file[0] == '/') {
             $file = substring($file, 1);
         }
         return $this->get_loader_url() . $file;
     }
     return false;
 }
Esempio n. 3
0
 /**
  * 构造函数
  * 
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $p = (int) $this->input->get('p');
     $k = (string) $this->input->get('k', true);
     $this->_page = $p === 0 ? 1 : $p;
     $this->_keys = $this->_safereplace(substring(trim($k), 32, false));
     if (empty($this->_keys)) {
         show_404();
     }
 }
 public function combine($form1, $form2, $act2)
 {
     if ($act2 == null) {
         // Ex.:  _k + paaq > _paaq
         return substring($form1, 0, strlen($form1) - 1) . $form2;
     } else {
         $act2Type = -1;
         $act2Type = $act2->type();
         if ($act2Type == Action::NULLACTION) {
             // Ex.:  _k + paaq > _paaq
             return substr($form1, 0, strlen($form1) - 1) . $form2;
         } elseif ($act2Type == Action::DELETION) {
             // Ex.:  _VVk + ilitaq > _Vilitaq
             return substr($form1, 0, strlen($form1) - 2) . $form2;
         } elseif ($act2Type == Action::SELFDECAPITATION) {
             // Ex.: _VVk + uqqaq > _VVqqaq
             return substr($form1, 0, strlen($form1) - 1) . substr($form2, 1);
         } elseif ($act2Type == Action::INSERTION) {
             // Ex.: _VVq + u > _VVngu
             return substr($form1, 0, strlen($form1) - 1) . $act2->getInsert() . $form2;
         } elseif ($act2Type == Action::SPECIFICDELETION) {
             // Ex.: _Vaq + it > _Vit
             return substr($form1, 0, strlen($form1) - 2) . $form2;
         } else {
             return "";
         }
     }
 }
Esempio n. 5
0
 public function update_action()
 {
     if (!$this->input->is_ajax_request()) {
         show_404();
     }
     $cid = (int) $this->input->post('cid');
     if ($cid === 0) {
         JSON('error', '对不起,更新分类提交失败!');
     }
     $name = $this->input->post('name', true);
     $link = $this->input->post('link', true);
     $keyword = $this->input->post('keyword', true);
     $description = $this->input->post('description', true);
     $sort = (int) $this->input->post('sort');
     $data['name'] = trim($name);
     $data['link'] = url_title($link, 'underscore', true);
     $data['sort'] = $sort > 255 ? 255 : $sort;
     $data['keyword'] = format_keyword($keyword);
     $data['description'] = substring(format_content($description), 240);
     if (!$data['name'] or !$data['link']) {
         JSON('error', '对不起,请填写必填字段!');
     }
     if ($this->category_model->get_info(array('cid !=' => $cid, 'name' => $name))) {
         JSON('error', '对不起,分类名称已经存在!');
     }
     if ($this->category_model->get_info(array('cid !=' => $cid, 'link' => $link))) {
         JSON('error', '对不起,分类链接名称已经存在!');
     }
     $this->db->update('category', $data, array('cid' => $cid));
     if ($this->db->affected_rows()) {
         JSON('success', '恭喜,分类 ' . $data['name'] . ' 更新成功!');
     } else {
         JSON('error', '对不起,分类没有更新或更新失败!');
     }
 }
Esempio n. 6
0
</td>
        <td><?php 
        echo $item['command'];
        ?>
</td>
        <td><?php 
        echo $item['time'];
        ?>
&nbsp;</td>
        <td><?php 
        echo $item['status'];
        ?>
&nbsp;</td>
        <td>
		<div class="message_head"><span class="message_icon"><i class="icon-plus"></i></span><cite><?php 
        echo substring($item['info'], 0, 40);
        ?>
:</cite></div>
		<div class="message_body" style="width: 300px;">
			<pre><span style="color: blue;"><?php 
        echo $item['info'];
        ?>
</span></pre>
		</div>
        </td>
        <td><?php 
        echo $item['host'];
        ?>
:<?php 
        echo $item['port'];
        ?>
Esempio n. 7
0
if (!empty($datalist)) {
    ?>
 <?php 
    foreach ($datalist as $item) {
        ?>
    <tr style="font-size: 12px;">
        <td><a href="<?php 
        echo site_url('slowquery/detail/' . $item['checksum'] . '/' . $setval['server_id']);
        ?>
" target="_blank"  title="点击进入详情"><?php 
        echo $item['checksum'];
        ?>
</a></td>
         <td>
         <div class="message_head"><span class="message_icon"><i class="icon-plus"></i></span><cite><?php 
        echo substring($item['fingerprint'], 0, 40);
        ?>
:</cite></div>
		<div class="message_body" style="width: 300px;">
			<pre><span style="color: blue;"><?php 
        echo $item['fingerprint'];
        ?>
</span></pre>
		</div>
        
        <td><?php 
        echo $item['last_seen'];
        ?>
</td>
        <td><?php 
        echo $item['ts_cnt'];
Esempio n. 8
0
function wee_process_weeSet($keyval, $wee)
{
    $key = trim(substring($keyval, 0, strpos($keyval, '=')));
    $val = trim(substring($keyval, strpos($keyval, '=') + 1, 999));
    $wee[$key] = $val;
}
function View()
{
    $d_id = be("all", "id");
    global $db;
    ?>

<table class="admin_vod_feedback tb" width="50%">
	<tr>
	<td  width="5%"></td>
	<td width="40%">反馈类别</td>
	<td>反馈次数</td>
	</tr>
	
<?php 
    for ($i = 1; $i <= 10; $i++) {
        if ($i == 8) {
            continue;
        }
        ?>
 <tr><td></td>
	<td><select id="feedback_types" name="feedback_types" disabled>
	<option value="9" <?php 
        if ($i == "9") {
            echo "selected";
        }
        ?>
>程序反馈影片无法播放</option>
	<option value="1" <?php 
        if ($i == "1") {
            echo "selected";
        }
        ?>
>用户反馈影片无法播放</option>
	<option value="2" <?php 
        if ($i == "2") {
            echo "selected";
        }
        ?>
>用户反馈影片播放不流畅</option>
	<option value="3" <?php 
        if ($i == "3") {
            echo "selected";
        }
        ?>
>用户反馈影片加载比较慢</option>
	<option value="4" <?php 
        if ($i == "4") {
            echo "selected";
        }
        ?>
>用户反馈影片不能下载</option>
	<option value="5" <?php 
        if ($i == "5") {
            echo "selected";
        }
        ?>
>用户反馈观看影片时出现闪退</option>
	<option value="6" <?php 
        if ($i == "6") {
            echo "selected";
        }
        ?>
>用户反馈画质不清晰</option>
	<option value="7" <?php 
        if ($i == "7") {
            echo "selected";
        }
        ?>
>用户反馈音画不同步</option>
	<option value="8" <?php 
        if ($i == "8") {
            echo "selected";
        }
        ?>
>用户反馈其它(用户自己填写,可不填)</option>
	<option value="10" <?php 
        if ($i == "10") {
            echo "selected";
        }
        ?>
>程序反馈视频地址失效</option>
	</select></td>
	<td><?php 
        echo $db->getOne("select count(*) as count from tbl_video_feedback where feedback_type like '%" . $i . "%' and prod_id=" . $d_id);
        ?>
</td>
	</tr>
 <?php 
    }
    ?>
</table>
<table class="admin_vod_feedback tb" width="50%">
	<tr>
	<td colspan="3">反馈类别:其它(用户自己填写,可不填)</td>
	</tr>
	<tr>
	<td  width="5%"></td>
	<td>反馈时间</td>
	<td>反馈内容</td>
	</tr>
	
	<?php 
    $rs = $db->query("select * from tbl_video_feedback where feedback_type like '%8%' and prod_id=" . $d_id);
    while ($row = $db->fetch_array($rs)) {
        ?>
      <tr><td  width="5%"></td>
		<td width="40%"><?php 
        echo isToday($row["create_date"]);
        ?>
</td>
		<td><?php 
        echo substring($row["feedback_memo"], 20);
        ?>
</td>
	 </tr>
    <?php 
    }
    unset($rs);
    ?>
	</table>
<?php 
    echo '</body>
</html>';
}
Esempio n. 10
0
    } else {
        if (substring($path, 11) != '../template' || count(explode('../', $path)) > 2) {
            showErr('System', '非法目录请求');
            return;
        }
        $extarr = array('.html', '.htm', '.js', '.xml', '.wml');
        if (!in_array($suffix, $extarr)) {
            $suffix = '.html';
        }
        fwrite(fopen($path . '/' . $filename . $suffix, 'wb'), $filecontent);
    }
    showMsg('文件内容保存完毕', '');
} elseif ($method == 'del') {
    $file = $p['file'];
    $file = str_replace('\\', '/', $file);
    if (substring($file, 11) != '../template' || count(explode('../', $file)) > 2) {
        showErr('System', '非法目录请求');
        return;
    }
    if (file_exists($file)) {
        unlink($file);
    }
    redirect(getReferer());
} elseif ($method == 'ads') {
    $path = '../template/' . $MAC['site']['templatedir'] . '/' . $MAC['site']['adsdir'] . '/';
    if (!is_dir($path)) {
        showErr('System', '未找到指定系统路径:' . $path);
        return;
    }
    $plt->set_file('main', $ac . '_' . $method . '.html');
    $fcount = 0;
Esempio n. 11
0
function MovieInflow($sql_collect, $MovieNumW, $isMandCollect)
{
    global $db;
    ?>
    <table class=tb>
        <tr>
            <td colspan="2" align="center">入 库 状 态</td>
            <div id="refreshlentext" style="background: #006600"></div>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center"><span id="storagetext">正 在 入 库...</span></td>
        </tr>
    </table>
    <?php 
    $iscover = be("iscover", "get");
    $rs = $db->query($sql_collect);
    $rscount = $MovieNumW;
    if ($rscount == 0) {
        echo "<script>alert('没有可入库的数据!'); location.href='collect_vod.php';</script>";
        exit;
    }
    if ($rscount > 10000) {
        $rscount = 1000;
    } elseif ($rscount > 5000) {
        $rscount = 500;
    } elseif ($rscount > 1000) {
        $rscount = 100;
    } else {
        $rscount = 10;
    }
    while ($row = $db->fetch_array($rs)) {
        if (!(isset($row["m_playfrom"]) && !is_null($row["m_playfrom"]) && strlen(trim($row["m_playfrom"])) > 0)) {
            continue;
        }
        if (isset($row["m_playfrom"]) && !is_null($row["m_playfrom"]) && ($row["m_playfrom"] === 'cntv' || $row["m_playfrom"] === 'wasu' || $row["m_playfrom"] === 'kankan' || $row["m_playfrom"] === 'tudou' || $row["m_playfrom"] === '')) {
            continue;
        }
        $flag = false;
        $title = $row["m_name"];
        $d_type = $row["m_typeid"];
        $title = replaceStr($title, "&lt;", "<<");
        $title = replaceStr($title, "&gt;", ">>");
        $title = trim(replaceStr($title, "&nbsp;", ' '));
        $title = replaceStr($title, " 国语", "");
        $testUrl = $row["m_urltest"];
        $year = $row['m_year'];
        $typeName = $row["m_type"];
        $duraning = $row["duraning"];
        $title = replaceStr($title, "'", "''");
        $titlenolang = $title;
        $d_language = $row["m_language"];
        $flag_lang = false;
        $d_state = $row["m_state"];
        if ($d_type === '131' && strpos($year, ',') !== false) {
            var_dump($title . " 是综艺而不是动漫。");
            continue;
        }
        if ($d_type === '3' && !is_null($d_state) && strlen($d_state) != 8) {
            var_dump($title . " 是动漫而不是综艺。");
            continue;
        }
        if (!isN($d_language)) {
            $titlenolang = trim(replaceStr($titlenolang, $d_language, ''));
            $titlenolang = trim($titlenolang);
            if (strpos($title, $d_language) !== false) {
                $flag_lang = true;
            }
        }
        $strSet = "";
        $sql = "SELECT * FROM {pre}vod WHERE d_playfrom != 'so_hu_cp' and d_name = '" . $titlenolang . "' and d_type = '" . $d_type . "' ";
        //		var_dump($sql);
        $rowvod = $db->getRow($sql);
        //	     var_dump($rowvod["d_id"]);
        if (!isN($rowvod["d_status"]) && ($rowvod["d_status"] === 1 || $rowvod["d_status"] === '1')) {
            var_dump($titlenolang . " is locked");
            if (!$isMandCollect) {
                continue;
            }
        }
        if ($flag_lang && (isN($rowvod["d_id"]) || be("post", "CCTV") == "1")) {
            $sql = "SELECT * FROM {pre}vod WHERE d_playfrom != 'so_hu_cp' and d_name = '" . $title . "' and d_type = '" . $d_type . "' ";
            $rowvod = $db->getRow($sql);
            if (!isN($rowvod["d_status"]) && ($rowvod["d_status"] === 1 || $rowvod["d_status"] === '1')) {
                var_dump($title . " is locked");
                if (!$isMandCollect) {
                    continue;
                }
            }
        }
        global $db;
        $id = $row["m_id"];
        $sql2 = "select * from {pre}cj_vod_url where u_movieid=" . $id . " order by name desc ";
        $rs_collect2 = $db->query($sql2);
        $mrowurl = $db->fetch_array($rs_collect2);
        //插入新数据开始
        if (isN($rowvod["d_id"]) || be("post", "CCTV") == "1") {
            $flag = true;
            $d_pic = replaceStr($row["m_pic"], "'", "''");
            $d_pic_ipad = replaceStr($row["d_pic_ipad"], "'", "''");
            $d_addtime = date('Y-m-d H:i:s', time());
            $d_year = $row["m_year"];
            if (isN($d_year) || $d_year === '未知') {
                $d_year = '其他';
            }
            $d_content = $row["m_content"];
            $d_hits = $row["m_hits"];
            $d_area = $row["m_area"];
            if (isN($d_area) || $d_area === '未知') {
                $d_area = '其他';
            }
            $d_remarks = $row["m_remarks"];
            if (!isNum($d_remarks)) {
                $d_remarks = '';
            }
            $d_state = $row["m_state"];
            $d_starring = $row["m_starring"];
            $d_directed = $row["m_directed"];
            $duraning = $row["duraning"];
            $d_name = $title;
            $typeName = $row["m_type"];
            if (isN($typeName) || $typeName === '未知') {
                $typeName = '其他';
            }
            $d_enname = hanzi2pinyin($d_name);
            $d_capital_name = Hanzi2PinYin_Captial($d_name);
            $d_letter = strtoupper(substring($d_enname, 1));
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
                    $rowtype = $db->getRow($sql);
                    if ($rowtype) {
                        $d_type = $rowtype["t_id"];
                    }
                    unset($rowtype);
                }
            }
            if (!($d_type === '1' || $d_type === 1)) {
                $duraning = '';
            }
            if (isN($mrowurl["iso_video_url"]) && isN($mrowurl["android_vedio_url"])) {
                //判断下载地址 无
                if ($row["m_playfrom"] == "qq" || $row["m_playfrom"] == "pptv") {
                    $strSet .= "can_search_device='iPad,iphone,apad,aphone,web' , ";
                    //入库  不勾tv.vender
                    echo "qq和pptv播放源直接入库   视频名称: \"" . $title . "\"  播放源: " . $row["m_playfrom"] . "\";";
                }
            } else {
                // 判断下载地址 有
                if ($row["m_playfrom"] == "youku") {
                    // 入库数据是优酷
                    $strSet .= "can_search_device='TV,Vendor' , ";
                    //入库 勾选tv vendor
                } else {
                    $strSet .= "can_search_device='TV,iPad,iphone,apad,aphone,web,Vendor' , ";
                    //入库 全部勾选
                }
            }
            //writetofile("gaoca.txt", $duraning);
            echo "states: " . $d_state . isNum($d_state);
            echo "remarks: " . isNum($d_remarks);
            if (isNum($d_state)) {
                $sql = "insert {pre}vod (d_pic_ipad,duraning,d_type_name,d_type,d_pic,d_addtime,d_time,d_year,d_content,d_hits,d_area,d_language,d_name,d_enname,d_starring,d_directed,d_state,d_remarks,d_capital_name) values('" . $d_pic_ipad . "' ,'" . $duraning . "' , '" . $typeName . "','" . $d_type . "','" . $d_pic . "','" . $d_addtime . "','" . $d_addtime . "','" . $d_year . "','" . $d_content . "','" . $d_hits . "','" . $d_area . "','" . $d_language . "','" . $d_name . "','" . $d_enname . "','" . $d_starring . "','" . $d_directed . "','" . $d_state . "','" . $d_remarks . "','" . $d_capital_name . "') ";
            } else {
                if (!isNum($d_state) && $isMandCollect) {
                    $sql = "insert {pre}vod (d_pic_ipad,duraning,d_type_name,d_type,d_pic,d_addtime,d_time,d_year,d_content,d_hits,d_area,d_language,d_name,d_enname,d_starring,d_directed,d_remarks,d_capital_name) values('" . $d_pic_ipad . "' ,'" . $duraning . "' , '" . $typeName . "','" . $d_type . "','" . $d_pic . "','" . $d_addtime . "','" . $d_addtime . "','" . $d_year . "','" . $d_content . "','" . $d_hits . "','" . $d_area . "','" . $d_language . "','" . $d_name . "','" . $d_enname . "','" . $d_starring . "','" . $d_directed . "','" . $d_remarks . "','" . $d_capital_name . "') ";
                    sendMail(array('*****@*****.**', '*****@*****.**'), '', '<CMS>:影片《' . $title . '》 连载信息非法' . $row["m_playfrom"]);
                } else {
                    if (!isNum($d_remarks) && $isMandCollect) {
                        $sql = "insert {pre}vod (d_pic_ipad,duraning,d_type_name,d_type,d_pic,d_addtime,d_time,d_year,d_content,d_hits,d_area,d_language,d_name,d_enname,d_starring,d_directed,d_state,d_capital_name) values('" . $d_pic_ipad . "' ,'" . $duraning . "' , '" . $typeName . "','" . $d_type . "','" . $d_pic . "','" . $d_addtime . "','" . $d_addtime . "','" . $d_year . "','" . $d_content . "','" . $d_hits . "','" . $d_area . "','" . $d_language . "','" . $d_name . "','" . $d_enname . "','" . $d_starring . "','" . $d_directed . "','" . $d_state . "','" . $d_capital_name . "') ";
                        sendMail(array('*****@*****.**', '*****@*****.**'), '', '<CMS>:影片《' . $title . '》 备注信息非法' . $row["m_playfrom"]);
                    } else {
                        if (!isNum($d_remarks) && $isMandCollect && !isNum($d_state)) {
                            $sql = "insert {pre}vod (d_pic_ipad,duraning,d_type_name,d_type,d_pic,d_addtime,d_time,d_year,d_content,d_hits,d_area,d_language,d_name,d_enname,d_starring,d_directed,d_capital_name) values('" . $d_pic_ipad . "' ,'" . $duraning . "' , '" . $typeName . "','" . $d_type . "','" . $d_pic . "','" . $d_addtime . "','" . $d_addtime . "','" . $d_year . "','" . $d_content . "','" . $d_hits . "','" . $d_area . "','" . $d_language . "','" . $d_name . "','" . $d_enname . "','" . $d_starring . "','" . $d_directed . "','" . $d_capital_name . "') ";
                            sendMail(array('*****@*****.**', '*****@*****.**'), '', '<CMS>:影片《' . $title . '》 连载、备注信息非法' . $row["m_playfrom"]);
                        }
                    }
                }
            }
            writetofile("gaoca.txt", $sql);
            $db->query($sql);
            $did = $db->insert_id();
            //			if($d_type === '2' || $d_type === '131' ){
            //				$d_addtime= date('Y-m-d H:i:s',time());
            //			  	$db->query("INSERT INTO mac_vod_pasre_item (prod_id,create_date) VALUES('".$did."','".$d_addtime."')");
            //			}
        } else {
            //同名不处理, 如果是电影也不更新
            if (be("post", "CCTV") == "3") {
                //var_dump("dd");
                continue;
            }
            //	   echo 'prod youku '.strpos($rowvod["d_playfrom"],"youku").'cj youku '.$row["m_playfrom"].'prod p2p'.strpos($rowvod["d_playfrom"],"p2p");
            if (@strpos($rowvod["d_playfrom"], "youku") === false && $row["m_playfrom"] === "youku") {
                echo "优酷不更新入库   视频名称: \"" . $title . "\"  播放源: " . $row["m_playfrom"] . "\";";
                continue;
            } else {
                if ($row["m_playfrom"] != "youku" && (strpos($rowvod["d_playfrom"], "youku") !== false || @strpos($rowvod["d_playfrom"], "p2p") !== false)) {
                    echo " 库内存在p2p或优酷不入库   视频名称: \"" . $title . "\"  播放源: " . $row["m_playfrom"] . "\";";
                    continue;
                } else {
                    if (isN($mrowurl["iso_video_url"]) && isN($mrowurl["android_vedio_url"]) && $row["m_playfrom"] === "fengxing") {
                        echo " fengxing无下载地址不更新入库   视频名称: \"" . $title . "\"  播放源: " . $row["m_playfrom"] . "\";";
                        continue;
                    }
                }
            }
            //更新数据开始
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
                    $rowtype = $db->getRow($sql);
                    if ($rowtype) {
                        $d_type = $rowtype["t_id"];
                    }
                    unset($rowtype);
                }
            }
            $strSet .= " d_type='" . $d_type . "', ";
            if (!isN($typeName) && $typeName !== '未知') {
                $strSet .= " d_type_name='" . $typeName . "', ";
            }
            $strSet .= " d_name='" . $title . "', ";
            $d_enname = hanzi2pinyin($title);
            $strSet .= " d_enname='" . $d_enname . "', ";
            $d_capital_name = Hanzi2PinYin_Captial($title);
            $strSet .= " d_capital_name='" . $d_capital_name . "', ";
            if (be("post", "CCTV2") == "2") {
                $d_area = $row["m_area"];
                if (isN($d_area) || $d_area === '未知') {
                    $d_area = '其他';
                }
                $strSet .= "d_area='" . $d_area . "',";
            }
            if (be("post", "CCTV6") == "6") {
                $d_language = $row["m_language"];
                $strSet .= "d_language='" . $d_language . "',";
            }
            if (be("post", "CCTV7") == "7") {
                $d_remarks = $row["m_remarks"];
                if (isNum($d_remarks)) {
                    $strSet .= "d_remarks='" . $d_remarks . "',";
                } else {
                    if (!isNum($d_remarks) && $isMandCollect) {
                        sendMail(array('*****@*****.**', '*****@*****.**'), '', '<CMS>:影片《' . $title . '》 备注信息非法' . $row["m_playfrom"]);
                    }
                }
            }
            if (be("post", "CCTV8") == "8") {
                $d_directed = $row["m_directed"];
                $strSet .= "d_directed='" . $d_directed . "',";
            }
            if (be("post", "CCTV9") == "9" && !isN($duraning)) {
                if (!($d_type === '1' || $d_type === 1)) {
                    $duraning = '';
                }
                $strSet .= " duraning='" . $duraning . "', ";
            }
            if (be("post", "CCTV1") == "1") {
                $d_year = $row["m_year"];
                if (isN($d_year) || $d_year === '未知') {
                    $d_year = '其他';
                }
                $strSet .= "d_year='" . $d_year . "',";
            }
            if (be("post", "CCTV3") == "3") {
                $d_starring = $row["m_starring"];
                $strSet .= "d_starring='" . $d_starring . "',";
            }
            if (be("post", "CCTV4") == "4") {
                $d_pic = $row["m_pic"];
                $strSet .= "d_pic='" . $d_pic . "',";
            }
            if (be("post", "CCTV5") == "5") {
                $d_content = $row["m_content"];
                $strSet .= "d_content='" . $d_content . "',";
            }
            $d_state = $row["m_state"];
            if (!isN($d_state) && $d_state !== '0') {
                if (isNum($d_state)) {
                    $strSet .= "d_state='" . $d_state . "',";
                } else {
                    if (!isNum($d_state) && $isMandCollect) {
                        sendMail(array('*****@*****.**', '*****@*****.**'), '', '<CMS>:影片《' . $title . '》 连载信息非法' . $row["m_playfrom"]);
                    }
                }
            }
            $strSet .= "d_name='" . $title . "',";
            $d_enname = hanzi2pinyin($title);
            $strSet .= "d_enname='" . $d_enname . "',";
            $d_letter = strtoupper(substring($d_enname, 1));
            $strSet .= "d_letter='" . $d_letter . "',";
            $d_addtime = date('Y-m-d H:i:s', time());
            $strSet .= "d_time='" . $d_addtime . "',";
            if ($d_type === '2' || $d_type === '131') {
                if (!($d_state === $rowvod["d_state"]) && $rowvod["favority_user_count"] > 0) {
                    $t_id = $rowvod["d_id"];
                    $info = $db->getRow('select prod_id from mac_vod_pasre_item where prod_id=' . $t_id);
                    if ($info === false) {
                        $d_addtime = date('Y-m-d H:i:s', time());
                        $db->query("INSERT INTO mac_vod_pasre_item (prod_id,create_date) VALUES('" . $t_id . "','" . $d_addtime . "')");
                    }
                }
            }
        }
        //更新数据结束
        if ($flag == false) {
            $did = $rowvod["d_id"];
        }
        //获取影片URL
        $playAndWebArray = getVodPlanAndWebUrl($row["m_id"], $testUrl, $row["m_playfrom"], $d_type);
        if ($playAndWebArray['noVideoUrlFlag'] && $isMandCollect) {
            sendMail(array('*****@*****.**', '*****@*****.**'), '<CMS>:影片《' . $title . '》 视频地址为空,不能入库', '<CMS>:影片《' . $title . '》 视频地址为空,播放器:' . $row["m_playfrom"]);
            continue;
        }
        //		$urls = getVodUrl($row["m_id"]);
        //   var_dump($playAndWebArray);
        $urls = $playAndWebArray['playUrl'];
        $webUrls = $playAndWebArray['webUrl'];
        if (!(isset($webUrls) && !is_null($webUrls) && strlen($webUrls) > 0)) {
            $webUrls = $testUrl;
        }
        $videoUrls = $playAndWebArray['videoUrl'];
        if (isN($videoUrls)) {
            $videoUrls = "";
        } else {
            if (strpos($videoUrls, "\$") === 0) {
                $videoUrls = substr($videoUrls, 1);
            }
        }
        //       var_dump($videoUrls);
        $tmpplayurl = $rowvod["d_playurl"];
        $tmpweburl = $rowvod["webUrls"];
        $tmpvideourl = $rowvod["d_downurl"];
        $tmpplayfrom = $rowvod["d_playfrom"];
        $tmpplayserver = $rowvod["d_playserver"];
        if (isN($tmpplayurl)) {
            $tmpplayurl = "";
        }
        if (isN($tmpvideourl)) {
            $tmpvideourl = "";
        }
        if (isN($tmpweburl)) {
            $tmpweburl = "";
        }
        if (isN($tmpplayfrom)) {
            $tmpplayfrom = "";
        }
        if (isN($tmpplayfrom)) {
            if (isN($videoUrls)) {
                $strSet .= "d_playfrom='" . $row["m_playfrom"] . "',d_playserver='" . $row["m_playserver"] . "',d_playurl='" . $urls . "',webUrls='" . $webUrls . "'";
            } else {
                $strSet .= "d_playfrom='" . $row["m_playfrom"] . "',d_playserver='" . $row["m_playserver"] . "',d_playurl='" . $urls . "',webUrls='" . $webUrls . "' ,d_downurl='" . $row["m_playfrom"] . '$$' . $videoUrls . "'";
            }
        } else {
            if (strpos("," . $tmpplayfrom, $row["m_playfrom"]) > 0) {
                if (be("post", "CCTV") == "2") {
                    if (isN($videoUrls)) {
                        $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $row["m_playserver"] . "\$\$\$" . $tmpplayfrom . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' " . "',webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ,d_downurl='" . $tmpvideourl . "'";
                    } else {
                        $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $row["m_playserver"] . "\$\$\$" . $tmpplayfrom . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' " . "',webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ,d_downurl='" . $tmpvideourl . "\$\$\$" . $row["m_playfrom"] . '$$' . $videoUrls . "'";
                    }
                } else {
                    $arr1 = explode("\$\$\$", $tmpplayurl);
                    $tempWebArray1 = explode("\$\$\$", $tmpweburl);
                    $tempVideoArray1 = explode("\$\$\$", $tmpvideourl);
                    $arr2 = explode("\$\$\$", $tmpplayfrom);
                    $tmpplayurl = "";
                    $tmpweburl = "";
                    $tmpvideourl = "";
                    $rc = false;
                    for ($k = 0; $k < count($arr2); $k++) {
                        if ($rc) {
                            $tmpweburl = $tmpweburl . "\$\$\$";
                        }
                        $rc = false;
                        if ($arr2[$k] !== $row["m_playfrom"]) {
                            $tmpweburl = $tmpweburl . $tempWebArray1[$k];
                            $rc = true;
                        } else {
                            if (isN($webUrls)) {
                                $webUrls = $tempWebArray1[$k];
                            }
                        }
                    }
                    $tmpweburl = $webUrls . "\$\$\$" . $tmpweburl;
                    $rc = false;
                    for ($k = 0; $k < count($arr2); $k++) {
                        if ($rc) {
                            $tmpplayurl = $tmpplayurl . "\$\$\$";
                        }
                        $rc = false;
                        if ($arr2[$k] !== $row["m_playfrom"]) {
                            $tmpplayurl = $tmpplayurl . $arr1[$k];
                            $rc = true;
                        } else {
                            if (isN($urls)) {
                                $urls = $arr1[$k];
                            }
                        }
                    }
                    $tmpplayurl = $urls . "\$\$\$" . $tmpplayurl;
                    $rc = false;
                    for ($k = 0; $k < count($tempVideoArray1); $k++) {
                        if ($rc) {
                            $tmpvideourl = $tmpvideourl . "\$\$\$";
                        }
                        $rc = false;
                        $arr2 = explode("\$\$", $tempVideoArray1[$k]);
                        if ($arr2[0] !== $row["m_playfrom"]) {
                            if (!isN($tempVideoArray1[$k])) {
                                $tmpvideourl = $tmpvideourl . $tempVideoArray1[$k];
                                $rc = true;
                            }
                        } else {
                            if (isN($videoUrls) && count($arr2) > 1) {
                                $videoUrls = $arr2[1];
                            }
                        }
                    }
                    if (isN($videoUrls)) {
                        $tmpvideourl = $tmpvideourl;
                    } else {
                        $tmpvideourl = $row["m_playfrom"] . '$$' . $videoUrls . "\$\$\$" . $tmpvideourl;
                    }
                    //				if(!isN($str))
                    $strSet .= "d_playurl='" . $tmpplayurl . "' , webUrls='" . $tmpweburl . "' , d_downurl='" . $tmpvideourl . "'";
                    //				$tmpplayfrom , $row["m_playfrom"]
                    $tmpplayfrom = replaceStr($tmpplayfrom, " ", "");
                    $tmpplayfrom = replaceStr($tmpplayfrom, $row["m_playfrom"] . "\$\$\$", "");
                    $tmpplayfrom = replaceStr($tmpplayfrom, $row["m_playfrom"], "");
                    $strSet .= ",d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "' ";
                }
            } else {
                if (isN($videoUrls)) {
                    $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $row["m_playserver"] . "\$\$\$" . $tmpplayserver . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' ,webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ";
                } else {
                    $tempVideoArray1 = explode("\$\$\$", $tmpvideourl);
                    $tmpvideourl = "";
                    $rc = false;
                    //			   var_dump($tempVideoArray1);
                    for ($k = 0; $k < count($tempVideoArray1); $k++) {
                        if ($rc) {
                            $tmpvideourl = $tmpvideourl . "\$\$\$";
                        }
                        $rc = false;
                        $arr2 = explode("\$\$", $tempVideoArray1[$k]);
                        if ($arr2[0] !== $row["m_playfrom"]) {
                            if (!isN($tempVideoArray1[$k])) {
                                $tmpvideourl = $tmpvideourl . $tempVideoArray1[$k];
                                $rc = true;
                            }
                        }
                    }
                    if (isN($videoUrls)) {
                        $tmpvideourl = $tmpvideourl;
                    } else {
                        $tmpvideourl = $row["m_playfrom"] . '$$' . $videoUrls . "\$\$\$" . $tmpvideourl;
                    }
                    $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $tmpplayserver . "\$\$\$" . $row["m_playserver"] . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' ,webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ,d_downurl='" . $tmpvideourl . '\' ';
                }
            }
        }
        //	    writetofile("d:\\up.txt", $strSet);
        $sql = "update {pre}vod set " . $strSet . " where d_id=" . $did;
        //		writetofile("d:\\ts.txt", "update {pre}vod set ".$strSet." where d_id=" .$did);
        $filePath = "../../upload/export/" . iconv("UTF-8", "GBK", 'dd') . ".txt";
        fwrite(fopen($filePath, "wb"), $sql);
        //		var_dump($sql);
        $db->query($sql);
        $db->query("update {pre}cj_vod set m_zt=1 where m_id=" . $row["m_id"]);
        $MovieInflowNum = $MovieInflowNum + 1;
        if ($MovieInflowNum >= $MovieNumW) {
            //			echo "<script type=\"text/javascript\" language=\"javascript\">";
            //			echo "document.getElementById(\"refreshlentext\").style.width = \"100%\";";
            //			echo "document.getElementById(\"refreshlentext\").innerHTML = \"100%\";";
            //			echo "document.getElementById(\"storagetext\").innerHTML = \"入库完毕 <a href='collect_vod.php'>返回</a>\";";
            //			echo "alert('入库完毕'); location.href='collect_vod.php';";
            //			echo "</script>";
        } elseif (fmod($MovieInflowNum, $rscount) == 0) {
            echo "<script type=\"text/javascript\" language=\"javascript\">";
            echo "document.getElementById(\"refreshlentext\").style.width = \"" . $MovieInflowNum / $MovieNumW * 100 . "%\";";
            echo "document.getElementById(\"refreshlentext\").innerHTML = \"" . $MovieInflowNum / $MovieNumW * 100 . "%\";";
            echo "document.getElementById(\"storagetext\").innerHTML = \"正在入库......\";";
            echo "</script>";
        }
    }
    echo "<script type=\"text/javascript\" language=\"javascript\">";
    echo "document.getElementById(\"refreshlentext\").style.width = \"100%\";";
    echo "document.getElementById(\"refreshlentext\").innerHTML = \"100%\";";
    echo "document.getElementById(\"storagetext\").innerHTML = \"入库完毕 <a href='" . getReferer() . "'>返回</a>\";";
    echo "alert('入库完毕'); ";
    echo "var current_date='" . date('Y-m-d H:i:s', time()) . "'";
    echo "</script>";
    unset($rs);
}
Esempio n. 12
0
exit;
// course information
$output = substring($output, "<div id=\"content\">", "<div id=\"footer\">");
$courseInfo = substring($output, "<table width=100% border=0 cellpadding=1 cellspacing=1>", "<!-- Display ONLY if not EMBA -->");
$courseInfo = substring($courseInfo, "<table>", "</table>");
$fCourseInfo = validateHTML($courseInfo);
printCourseInfo($fCourseInfo);
// grades information
$str = "<!-- Display ONLY if not EMBA -->";
$gradesInfo = substr($output, stripos($output, $str) + strlen($str));
$fGradesInfo = validateHTML(substring($gradesInfo, "<table border=0 cellpadding=1 cellspacing=1>", $str));
$fGradesInfo = substring($fGradesInfo, "<table>", "</table>");
printGradesInfo($fGradesInfo);
// detailed information
$detailed = substring($gradesInfo, "<table border=0 cellpadding=1 cellspacing=0>", "<p><br>");
$detailed = substring($detailed, "<table>", "</table>");
$fDetailed = validateHTML($detailed);
printDetailed($fDetailed);
curl_close($ch);
function printCourseInfo($xmlString)
{
    $xml = new SimpleXMLELement($xmlString);
    print "<p>";
    $i = 0;
    foreach ($xml->tr as $tr) {
        $j = 0;
        foreach ($tr->td as $td) {
            $class = $j == 0 ? "title" : "value";
            if ($i == 3) {
                $a = $td->a;
                if ($a != "") {
Esempio n. 13
0
function MovieInflow($sql_collect, $MovieNumW)
{
    global $db;
    ?>
<table class=tb>
	<tr>
		<td  colspan="2" align="center"> 入 库 状 态 </td>
		<div id="refreshlentext" style="background:#006600"></div>
		</td>
	</tr>
  	<tr>
		<td  colspan="2" align="center"><span id="storagetext">正 在 入 库...</span></td>
  	</tr>
</table>
<?php 
    $iscover = be("iscover", "get");
    $rs = $db->query($sql_collect);
    $rscount = $db->num_rows($rs);
    //	var_dump($rscount);
    if ($rscount == 0) {
        echo "<script>alert('没有可入库的数据!'); location.href='collect_vod.php';</script>";
        exit;
    }
    if ($rscount > 10000) {
        $rscount = 1000;
    } elseif ($rscount > 5000) {
        $rscount = 500;
    } elseif ($rscount > 1000) {
        $rscount = 100;
    } else {
        $rscount = 10;
    }
    while ($row = $db->fetch_array($rs)) {
        if (!(isset($row["m_playfrom"]) && !is_null($row["m_playfrom"]) && strlen(trim($row["m_playfrom"])) > 0)) {
            continue;
        }
        if (isset($row["m_playfrom"]) && !is_null($row["m_playfrom"]) && ($row["m_playfrom"] === 'cntv' || $row["m_playfrom"] === 'wasu' || $row["m_playfrom"] === 'kankan' || $row["m_playfrom"] === 'tudou' || $row["m_playfrom"] === '')) {
            continue;
        }
        $flag = false;
        $title = $row["m_name"];
        $d_type = $row["m_typeid"];
        $title = replaceStr($title, "&lt;", "<<");
        $title = replaceStr($title, "&gt;", ">>");
        $testUrl = $row["m_urltest"];
        $year = $row['m_year'];
        $title = replaceStr($title, "'", "''");
        $strSet = "";
        $sql = "SELECT * FROM {pre}vod WHERE d_name = '" . $title . "' and d_type = '" . $d_type . "' ";
        $rowvod = $db->getRow($sql);
        if (!isN($rowvod["d_status"]) && ($rowvod["d_status"] === 1 || $rowvod["d_status"] === '1')) {
            var_dump($title . " is locked");
            continue;
        }
        //插入新数据开始
        if (isN($rowvod["d_id"]) || be("post", "CCTV") == "1") {
            $flag = true;
            $d_pic = replaceStr($row["m_pic"], "'", "''");
            $d_addtime = date('Y-m-d H:i:s', time());
            $d_year = $row["m_year"];
            $d_content = $row["m_content"];
            $d_hits = $row["m_hits"];
            $d_area = $row["m_area"];
            $d_language = $row["m_language"];
            $d_remarks = $row["m_remarks"];
            $d_state = $row["m_state"];
            $d_starring = $row["m_starring"];
            $d_directed = $row["m_directed"];
            $d_name = $title;
            $d_enname = hanzi2pinyin($d_name);
            if (isN($d_letter)) {
                $d_letter = strtoupper(substring($d_enname, 1));
            }
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
                    $rowtype = $db->getRow($sql);
                    if ($rowtype) {
                        $d_type = $rowtype["t_id"];
                    }
                    unset($rowtype);
                }
            }
            $sql = "insert {pre}vod (d_type_name,d_type,d_pic,d_addtime,d_time,d_year,d_content,d_hits,d_area,d_language,d_name,d_enname,d_starring,d_directed,d_state,d_remarks) values('" . $row["m_type"] . "','" . $d_type . "','" . $d_pic . "','" . $d_addtime . "','" . $d_addtime . "','" . $d_year . "','" . $d_content . "','" . $d_hits . "','" . $d_area . "','" . $d_language . "','" . $d_name . "','" . $d_enname . "','" . $d_starring . "','" . $d_directed . "','" . $d_state . "','" . $d_remarks . "') ";
            $db->query($sql);
            $did = $db->insert_id();
        } else {
            //同名不处理, 如果是电影也不更新
            if (be("post", "CCTV") == "3" || $d_type === '1' || $d_type == 1) {
                //var_dump("dd");
                continue;
            }
            //更新数据开始
            if ($row["m_typeid"] > 0) {
                $d_type = $row["m_typeid"];
            } else {
                if (!isN($row["m_type"])) {
                    $sql = "select * from {pre}vod_type where t_name like '%" . $row["m_type"] . "%' ";
                    $rowtype = $db->getRow($sql);
                    if ($rowtype) {
                        $d_type = $rowtype["t_id"];
                    }
                    unset($rowtype);
                }
            }
            $strSet .= " d_type='" . $d_type . "', ";
            $strSet .= " d_type_name='" . $row["m_type"] . "', ";
            if (be("post", "CCTV2") == "2") {
                $d_area = $row["m_area"];
                $strSet .= "d_area='" . $d_area . "',";
            }
            if (be("post", "CCTV6") == "6") {
                $d_language = $row["m_language"];
                $strSet .= "d_language='" . $d_language . "',";
            }
            if (be("post", "CCTV7") == "7") {
                $d_remarks = $row["m_remarks"];
                $strSet .= "d_remarks='" . $d_remarks . "',";
            }
            if (be("post", "CCTV8") == "8") {
                $d_directed = $row["m_directed"];
                $strSet .= "d_directed='" . $d_directed . "',";
            }
            if (be("post", "CCTV1") == "1") {
                $d_year = $row["m_year"];
                $strSet .= "d_year='" . $d_year . "',";
            }
            if (be("post", "CCTV3") == "3") {
                $d_starring = $row["m_starring"];
                $strSet .= "d_starring='" . $d_starring . "',";
            }
            if (be("post", "CCTV4") == "4") {
                $d_pic = $row["m_pic"];
                $strSet .= "d_pic='" . $d_pic . "',";
            }
            if (be("post", "CCTV5") == "5") {
                $d_content = $row["m_content"];
                $strSet .= "d_content='" . $d_content . "',";
            }
            $d_state = $row["m_state"];
            $strSet .= "d_state='" . $d_state . "',";
            $strSet .= "d_name='" . $title . "',";
            $d_enname = hanzi2pinyin($title);
            $strSet .= "d_enname='" . $d_enname . "',";
            if (isN($d_letter)) {
                $d_letter = strtoupper(substring($d_enname, 1));
            }
            $strSet .= "d_letter='" . $d_letter . "',";
            $d_addtime = date('Y-m-d H:i:s', time());
            $strSet .= "d_time='" . $d_addtime . "',";
        }
        //更新数据结束
        if ($flag == false) {
            $did = $rowvod["d_id"];
        }
        //获取影片URL
        $playAndWebArray = getVodPlanAndWebUrl($row["m_id"], $testUrl, $row["m_playfrom"], $d_type);
        //		$urls = getVodUrl($row["m_id"]);
        //   var_dump($playAndWebArray);
        $urls = $playAndWebArray['playUrl'];
        $webUrls = $playAndWebArray['webUrl'];
        if (!(isset($webUrls) && !is_null($webUrls) && strlen($webUrls) > 0)) {
            $webUrls = $testUrl;
        }
        $videoUrls = $playAndWebArray['videoUrl'];
        if (isN($videoUrls)) {
            $videoUrls = "";
        } else {
            if (strpos($videoUrls, "\$") === 0) {
                $videoUrls = substr($videoUrls, 1);
            }
        }
        //       var_dump($videoUrls);
        $tmpplayurl = $rowvod["d_playurl"];
        $tmpweburl = $rowvod["webUrls"];
        $tmpvideourl = $rowvod["d_downurl"];
        $tmpplayfrom = $rowvod["d_playfrom"];
        $tmpplayserver = $rowvod["d_playserver"];
        if (isN($tmpplayurl)) {
            $tmpplayurl = "";
        }
        if (isN($tmpvideourl)) {
            $tmpvideourl = "";
        }
        if (isN($tmpweburl)) {
            $tmpweburl = "";
        }
        if (isN($tmpplayfrom)) {
            $tmpplayfrom = "";
        }
        if (isN($tmpplayfrom)) {
            if (isN($videoUrls)) {
                $strSet .= "d_playfrom='" . $row["m_playfrom"] . "',d_playserver='" . $row["m_playserver"] . "',d_playurl='" . $urls . "',webUrls='" . $webUrls . "'";
            } else {
                $strSet .= "d_playfrom='" . $row["m_playfrom"] . "',d_playserver='" . $row["m_playserver"] . "',d_playurl='" . $urls . "',webUrls='" . $webUrls . "' ,d_downurl='" . $row["m_playfrom"] . '$$' . $videoUrls . "'";
            }
        } else {
            if (strpos("," . $tmpplayfrom, $row["m_playfrom"]) > 0) {
                if (be("post", "CCTV") == "2") {
                    if (isN($videoUrls)) {
                        $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $row["m_playserver"] . "\$\$\$" . $tmpplayfrom . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' " . "',webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ,d_downurl='" . $tmpvideourl . "'";
                    } else {
                        $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $row["m_playserver"] . "\$\$\$" . $tmpplayfrom . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' " . "',webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ,d_downurl='" . $tmpvideourl . "\$\$\$" . $row["m_playfrom"] . '$$' . $videoUrls . "'";
                    }
                } else {
                    $arr1 = explode("\$\$\$", $tmpplayurl);
                    $tempWebArray1 = explode("\$\$\$", $tmpweburl);
                    $tempVideoArray1 = explode("\$\$\$", $tmpvideourl);
                    $arr2 = explode("\$\$\$", $tmpplayfrom);
                    $tmpplayurl = "";
                    $tmpweburl = "";
                    $tmpvideourl = "";
                    $rc = false;
                    for ($k = 0; $k < count($arr2); $k++) {
                        if ($rc) {
                            $tmpweburl = $tmpweburl . "\$\$\$";
                        }
                        $rc = false;
                        if ($arr2[$k] !== $row["m_playfrom"]) {
                            $tmpweburl = $tmpweburl . $tempWebArray1[$k];
                            $rc = true;
                        } else {
                            if (isN($webUrls)) {
                                $webUrls = $tempWebArray1[$k];
                            }
                        }
                    }
                    $tmpweburl = $webUrls . "\$\$\$" . $tmpweburl;
                    $rc = false;
                    for ($k = 0; $k < count($arr2); $k++) {
                        if ($rc) {
                            $tmpplayurl = $tmpplayurl . "\$\$\$";
                        }
                        $rc = false;
                        if ($arr2[$k] !== $row["m_playfrom"]) {
                            $tmpplayurl = $tmpplayurl . $arr1[$k];
                            $rc = true;
                        } else {
                            if (isN($urls)) {
                                $urls = $arr1[$k];
                            }
                        }
                    }
                    $tmpplayurl = $urls . "\$\$\$" . $tmpplayurl;
                    $rc = false;
                    for ($k = 0; $k < count($tempVideoArray1); $k++) {
                        if ($rc) {
                            $tmpvideourl = $tmpvideourl . "\$\$\$";
                        }
                        $rc = false;
                        $arr2 = explode("\$\$", $tempVideoArray1[$k]);
                        if ($arr2[0] !== $row["m_playfrom"]) {
                            if (!isN($tempVideoArray1[$k])) {
                                $tmpvideourl = $tmpvideourl . $tempVideoArray1[$k];
                                $rc = true;
                            }
                        } else {
                            if (isN($videoUrls) && count($arr2) > 1) {
                                $videoUrls = $arr2[1];
                            }
                        }
                    }
                    if (isN($videoUrls)) {
                        $tmpvideourl = $tmpvideourl;
                    } else {
                        $tmpvideourl = $row["m_playfrom"] . '$$' . $videoUrls . "\$\$\$" . $tmpvideourl;
                    }
                    //				if(!isN($str))
                    $strSet .= "d_playurl='" . $tmpplayurl . "' , webUrls='" . $tmpweburl . "' , d_downurl='" . $tmpvideourl . "'";
                    //				$tmpplayfrom , $row["m_playfrom"]
                    $tmpplayfrom = replaceStr($tmpplayfrom, " ", "");
                    $tmpplayfrom = replaceStr($tmpplayfrom, $row["m_playfrom"] . "\$\$\$", "");
                    $tmpplayfrom = replaceStr($tmpplayfrom, $row["m_playfrom"], "");
                    $strSet .= ",d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "' ";
                }
            } else {
                if (isN($videoUrls)) {
                    $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $row["m_playserver"] . "\$\$\$" . $tmpplayserver . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' ,webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ";
                } else {
                    $tempVideoArray1 = explode("\$\$\$", $tmpvideourl);
                    $tmpvideourl = "";
                    $rc = false;
                    //			   var_dump($tempVideoArray1);
                    for ($k = 0; $k < count($tempVideoArray1); $k++) {
                        if ($rc) {
                            $tmpvideourl = $tmpvideourl . "\$\$\$";
                        }
                        $rc = false;
                        $arr2 = explode("\$\$", $tempVideoArray1[$k]);
                        if ($arr2[0] !== $row["m_playfrom"]) {
                            if (!isN($tempVideoArray1[$k])) {
                                $tmpvideourl = $tmpvideourl . $tempVideoArray1[$k];
                                $rc = true;
                            }
                        }
                    }
                    if (isN($videoUrls)) {
                        $tmpvideourl = $tmpvideourl;
                    } else {
                        $tmpvideourl = $row["m_playfrom"] . '$$' . $videoUrls . "\$\$\$" . $tmpvideourl;
                    }
                    $strSet .= "d_playfrom='" . $row["m_playfrom"] . "\$\$\$" . $tmpplayfrom . "',d_playserver='" . $tmpplayserver . "\$\$\$" . $row["m_playserver"] . "',d_playurl='" . $urls . "\$\$\$" . $tmpplayurl . "' ,webUrls='" . $webUrls . "\$\$\$" . $tmpweburl . "' ,d_downurl='" . $tmpvideourl . '\' ';
                }
            }
        }
        //	    writetofile("d:\\up.txt", $strSet);
        $sql = "update {pre}vod set " . $strSet . " where d_id=" . $did;
        //		writetofile("d:\\ts.txt", "update {pre}vod set ".$strSet." where d_id=" .$did);
        $filePath = "../../upload/export/" . iconv("UTF-8", "GBK", 'dd') . ".txt";
        fwrite(fopen($filePath, "wb"), $sql);
        //		var_dump($sql);
        $db->query($sql);
        $db->query("update {pre}cj_vod set m_zt=1 where m_id=" . $row["m_id"]);
        $MovieInflowNum = $MovieInflowNum + 1;
        if ($MovieInflowNum >= $MovieNumW) {
            //			echo "<script type=\"text/javascript\" language=\"javascript\">";
            //			echo "document.getElementById(\"refreshlentext\").style.width = \"100%\";";
            //			echo "document.getElementById(\"refreshlentext\").innerHTML = \"100%\";";
            //			echo "document.getElementById(\"storagetext\").innerHTML = \"入库完毕 <a href='collect_vod.php'>返回</a>\";";
            //			echo "alert('入库完毕'); location.href='collect_vod.php';";
            //			echo "</script>";
        } elseif (fmod($MovieInflowNum, $rscount) == 0) {
            echo "<script type=\"text/javascript\" language=\"javascript\">";
            echo "document.getElementById(\"refreshlentext\").style.width = \"" . $MovieInflowNum / $MovieNumW * 100 . "%\";";
            echo "document.getElementById(\"refreshlentext\").innerHTML = \"" . $MovieInflowNum / $MovieNumW * 100 . "%\";";
            echo "document.getElementById(\"storagetext\").innerHTML = \"正在入库......\";";
            echo "</script>";
        }
    }
    echo "<script type=\"text/javascript\" language=\"javascript\">";
    echo "document.getElementById(\"refreshlentext\").style.width = \"100%\";";
    echo "document.getElementById(\"refreshlentext\").innerHTML = \"100%\";";
    echo "document.getElementById(\"storagetext\").innerHTML = \"入库完毕 <a href='collect_vod.php'>返回</a>\";";
    echo "alert('入库完毕'); location.href='collect_vod.php';";
    echo "</script>";
    unset($rs);
}
Esempio n. 14
0
        ?>
</td>
        <td><?php 
        echo substring($item['Query_time_max'], 0, 5);
        ?>
</td>
        <td><?php 
        echo substring($item['Lock_time_sum'], 0, 6);
        ?>
</td>
        <td><?php 
        echo substring($item['Lock_time_min'], 0, 7);
        ?>
</td>
        <td><?php 
        echo substring($item['Lock_time_max'], 0, 7);
        ?>
</td>
	</tr>
 <?php 
    }
} else {
    ?>
<tr>
<td colspan="10">
<font color="red"><?php 
    echo $this->lang->line('no_record');
    ?>
</font>
</td>
</tr>
Esempio n. 15
0
 $d_state = intval($array3[$xn_d_state][$key]);
 $d_type = $xt == '0' ? $array3[$xn_d_type][$key] : $flag . $array3[$xn_d_type][$key];
 $d_type = intval($bindcache[$d_type]);
 $d_starring = htmlspecialchars_decode($array3[$xn_d_starring][$key]);
 $d_directed = htmlspecialchars_decode($array3[$xn_d_directed][$key]);
 $d_pic = $array3[$xn_d_pic][$key];
 $d_time = $array3[$xn_d_time][$key];
 $d_year = intval($array3[$xn_d_year][$key]);
 $d_area = $array3[$xn_d_area][$key];
 $d_lang = $array3[$xn_d_lang][$key];
 $d_content = htmlspecialchars_decode($array3[$xn_d_content][$key]);
 $d_playurls = htmlspecialchars_decode($array3[$xn_d_urls][$key]);
 $d_playurls = str_replace("'", "''", $d_playurls);
 preg_match_all($xn_url, $d_playurls, $array4);
 $d_enname = Hanzi2PinYin($d_name);
 $d_letter = strtoupper(substring($d_enname, 1));
 $d_addtime = time();
 $d_time = $d_addtime;
 $d_hitstime = "";
 $d_hits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_dayhits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_weekhits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_monthhits = rand($MAC['collect']['vod']['hitsstart'], $MAC['collect']['vod']['hitsend']);
 $d_scorenum = rand(1, 500);
 $d_scoreall = $d_scorenum * rand(1, 10);
 $d_score = round($d_scoreall / $d_scorenum, 1);
 $d_hide = $MAC['collect']['vod']['hide'];
 if ($MAC['collect']['vod']['psernd'] == 1) {
     $d_content = repPseRnd('vod', $d_content, $i);
 }
 if ($MAC['collect']['vod']['psesyn'] == 1) {
function cjView($strlink, $num)
{
    global $starringarr, $titlearr, $picarr, $strListUrl, $p_playspecialtype, $p_playtype, $p_videocodeType, $p_videocodeApiUrl, $p_id, $p_videocodeApiUrlParamstart, $p_videocodeApiUrlParamend, $p_videourlstart, $p_videourlend, $playcodeApiUrl, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend, $playcodeApiUrltype, $db, $strListUrl, $p_titletype, $starringarr, $titlearr, $picarr, $p_id, $p_titlestart, $p_titleend, $p_lzstart, $p_lzend, $p_hitsstart, $p_hitsend, $p_starringtype, $p_starringstart, $p_starringend, $p_picstart, $p_picend, $p_typestart, $p_typeend, $p_pictype, $p_classtype, $p_collect_type, $p_timestart, $p_timeend, $p_areastart, $p_areaend, $p_contentstart, $p_contentend, $p_playcodestart, $p_playcodeend, $p_playlinkstart, $p_playlinkend, $p_playurlstart, $p_playurlend, $p_playcodetype, $p_playlinktype, $p_playtype, $p_coding, $p_lzstart, $p_lzend, $p_lzcodetype, $p_lzcodestart, $p_lzcodeend, $p_languagestart, $p_languageend, $p_remarksstart, $p_remarksend, $p_script, $p_showtype, $p_savefiles, $strdstate, $p_server, $p_setnametype, $p_setnamestart, $p_setnameend, $p_directedstart, $p_directedend, $cache;
    $androidUrl = "";
    //var_dump($strlink);var_dump($strListUrl);
    try {
        $pos = strpos($strlink, "href=\"");
        if ($pos !== false) {
            $strlink = substr($strlink, $pos + 6);
        }
        $pos = strpos($strlink, "\"");
        if ($pos !== false) {
            $strlink = substr($strlink, 0, $pos);
        }
    } catch (Exception $e) {
    }
    $strlink = definiteUrl($strlink, $strListUrl);
    writetofile("crawel_auto_info.log", $p_id . '{=====}' . $strlink . "{=====}View===start");
    $strViewCode = getPage($strlink, $p_coding);
    if ($strViewCode == false) {
        $strdstate = "true";
        writetofile("crawel_auto_error.log", $p_id . '{=====}' . $strlink . '{=====}' . $strListUrl);
        $sb = $sb + 1;
        return;
    } else {
        //节目名称,来自列表或者来自内容页
        if ($p_titletype == 1) {
            $titlecode = $titlearr[$num];
        } else {
            $titlecode = getBody($strViewCode, $p_titlestart, $p_titleend);
        }
        //		var_dump($titlearr[$num]);
        $titlecode = filterScript($titlecode, $p_script);
        $titlecode = replaceFilters($titlecode, $p_id, 1, 0);
        $titlecode = replaceStr(replaceStr(replaceStr($titlecode, ",", " "), "'", ""), "\"\"", "");
        $titlecode = trim($titlecode);
        //		$sql="select count(*) as cc from {pre}cj_vod where m_name='".$titlecode."' and m_playfrom='".$p_playtype."'";
        //		$row=$db->getOne($sql);
        //		//var_dump($row);var_dump($titlecode);
        //		$rowcount = $row;
        //先缩小范围
        if ($p_lzcodetype == 1) {
            //连载范围
            $lzfwcode = getBody($strViewCode, $p_lzcodestart, $p_lzcodeend);
            //连载编码
            $lzcode = getBody($lzfwcode, $p_lzstart, $p_lzend);
            $lzcode = replaceStr($lzcode, "false", "0");
            $lzcode = trim($lzcode);
            $lzcode = intval($lzcode);
        } else {
            $lzcode = getBody($strViewCode, $p_lzstart, $p_lzend);
            $lzcode = replaceStr($lzcode, "false", "0");
            $lzcode = trim($lzcode);
            $lzcode = intval($lzcode);
        }
        //		if ($p_playcodetype !=2 &&($lzcode == 0) && ($rowcount>0)) {
        //			$strdstate = "true";
        //			echo "<tr><td colspan=\"2\">遇到重复电影数据跳过采集!</TD></TR>";
        //			return;
        //		}
        if (isN($p_hitsstart) || !isnum($p_hitsstart)) {
            $p_hitsstart = 0;
        }
        if (isN($p_hitsend) || !isnum($p_hitsend)) {
            $p_hitsend = 0;
        }
        if ($p_hitsstart == 0 && $p_hitsend == 0) {
            $m_hits = 0;
        } else {
            $m_hits = rand($p_hitsend, $p_hitsstart);
        }
        if ($p_starringtype == 1) {
            $starringcode = $starringarr[$num];
        } else {
            $starringcode = getBody($strViewCode, $p_starringstart, $p_starringend);
        }
        //演员
        $starringcode = filterScriptStar($starringcode, $p_script);
        $starringcode = replaceStr(replaceStr(replaceStr($starringcode, ",", " "), "'", ""), "\"\"", "");
        $starringcode = trim($starringcode);
        if ($p_pictype == 1) {
            $piccode = $picarr[$num];
        } else {
            $piccode = getBody($strViewCode, $p_picstart, $p_picend);
        }
        //图片
        $piccode = trim($piccode);
        $piccode = getHrefFromImg(definiteUrl($piccode, $strListUrl));
        //栏目设置
        if ($p_classtype == 1) {
            $typecode = filterScript(getBody($strViewCode, $p_typestart, $p_typeend), $p_script);
            $typecode = trim($typecode);
            $m_typeid = changeId($typecode, $p_id, 0, 0);
        } else {
            $typecode = $p_collect_type;
            $typecode = trim($typecode);
            $m_typeid = $p_collect_type;
            $typearr = getValueByArray($cache[0], "t_id", $typecode);
            $typecode = $typearr["t_name"];
        }
        if ($m_typeid == 0) {
            $m_typeid = $p_collect_type;
        }
        $typecode = filterScript($typecode, $p_script);
        //导演
        $directedcode = filterScriptStar(getBody($strViewCode, $p_directedstart, $p_directedend), $p_script);
        $directedcode = replaceStr($directedcode, "false", "");
        $directedcode = replaceStr($directedcode, "'", "");
        $directedcode = trim($directedcode);
        //备注
        $remarkscode = filterScript(getBody($strViewCode, $p_remarksstart, $p_remarksend), $p_script);
        $remarkscode = replaceStr($remarkscode, "false", "");
        $remarkscode = trim($remarkscode);
        //语音
        $languagecode = filterScript(getBody($strViewCode, $p_languagestart, $p_languageend), $p_script);
        $languagecode = replaceStr($languagecode, "false", "未知");
        $languagecode = trim($languagecode);
        //时间
        $timecode = filterScript(getBody($strViewCode, $p_timestart, $p_timeend), $p_script);
        if ($timecode == false) {
            $timecode == "未知";
        }
        $timecode = trim($timecode);
        //地区
        $areacode = filterScript(getBody($strViewCode, $p_areastart, $p_areaend), $p_script);
        if ($areacode == false) {
            $areacode = "未知";
        }
        $areacode = trim($areacode);
        //内容
        $contentcode = filterScript(getBody($strViewCode, $p_contentstart, $p_contentend), $p_script);
        if ($contentcode == false) {
            $contentcode = "未知";
        }
        $contentcode = filterScript(replaceFilters($contentcode, $p_id, 2, 0), $p_script);
        $contentcode = replaceStr(replaceStr(replaceStr($contentcode, ",", " "), "'", ""), "\"\"", "");
        $contentcode = trim($contentcode);
        $m_area = $areacode;
        $m_languageid = $languagecode;
        //播放列表,缩小
        if ($p_playcodetype == 1) {
            $playcode = getBody($strViewCode, $p_playcodestart, $p_playcodeend);
            //获取地址设置
            if ($p_playlinktype > 0) {
                //播放链接
                $weburl = getArray($playcode, $p_playlinkstart, $p_playlinkend);
            } else {
                //内容页直接获取地址, 地址开始
                $weburl = getArray($playcode, $p_playurlstart, $p_playurlend);
            }
            if ($p_setnametype == 3) {
                $setnames = getArray($playcode, $p_setnamestart, $p_setnameend);
            }
        } else {
            if ($p_playcodetype == 2) {
                //from api
                //		writetofile("d:\\s.txt",$linkcode) ;
                //		echo $p_playcodeApiUrlParamend .'=='.$playcodeApiUrlParamstart;
                //		echo $playcodeApiUrlParamstart .'\n' .$p_playcodeApiUrlParamend .'  = '.$playcodeApiUrltype;
                if ($playcodeApiUrltype == 0) {
                    $paracode = getBody($strViewCode, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend);
                } else {
                    $paracode = getBody($UrlTestMoive, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend);
                }
                //		echo $paracode;
                $p_apibatchurl = replaceStr($playcodeApiUrl, "{PROD_ID}", $paracode);
                $p_apibatchurls = replaceStr($p_apibatchurl, "{PAGE_NO}", 1);
                $playcode = getFormatPage($p_apibatchurls, $p_coding);
                $weburl = getArray($playcode, $p_playlinkstart, $p_playlinkend);
                $page_num = 2;
                //		echo "page 1 :".$weburl .'\n';
                $flag = true;
                while ($flag && $page_num < 15 && strpos($playcodeApiUrl, "{PAGE_NO}") !== false) {
                    $p_apibatchurls = replaceStr($p_apibatchurl, "{PAGE_NO}", $page_num);
                    //			echo $p_apibatchurls .'\n';
                    $playcode = getFormatPage($p_apibatchurls, $p_coding);
                    $weburls = getArray($playcode, $p_playlinkstart, $p_playlinkend);
                    //		    echo "page ".$page_num." :".$weburls .'\n';
                    if ($weburls) {
                        $weburl = $weburl . "{Array}" . $weburls;
                        $page_num = $page_num + 1;
                    } else {
                        $flag = false;
                    }
                }
                //		var_dump($weburl);
                //		if ($p_playlinktype >0) {
                //			$weburl = getArray($playcode,$p_playlinkstart,$p_playlinkend);
                //		}
                //		else{
                //			$weburl = getArray($playcode,$p_playurlstart,$p_playurlend);
                //		//	var_dump($playcode);
                //		}
                //		if ($p_setnametype == 3) {
                //			$setnames = getArray($playcode,$p_setnamestart,$p_setnameend);
                //		}
            } else {
                if ($p_playlinktype > 0) {
                    $weburl = getArray($strViewCode, $p_playlinkstart, $p_playlinkend);
                    //				var_dump($weburl);
                } else {
                    $weburl = getArray($strViewCode, $p_playurlstart, $p_playurlend);
                    $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($strViewCode, $p_coding, $p_script);
                    $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($strViewCode, $p_coding, $p_script);
                    writetofile("android_log.txt", $strlink . '{===}' . $androidUrl . '{===}' . $videoAddressUrl);
                }
                if ($p_setnametype == 3) {
                    $setnames = getArray($strViewCode, $p_setnamestart, $p_setnameend);
                }
            }
        }
        if ($p_showtype == 1) {
            if ($p_savefiles == 1) {
                $filename = time() . $num;
                if (strpos($piccode, ".jpg") || strpos($piccode, ".bmp") || strpos($piccode, ".png") || strpos($piccode, ".gif")) {
                    $extName = substring($piccode, 4, strlen($piccode) - 4);
                } else {
                    $extName = ".jpg";
                }
                $picpath = "upload/vod/" . getSavePicPath() . "/";
                $picfile = $filename . $extName;
                //echo "<tr><td width=\"20%\" >自动下载图片:</td><td><iframe border=\"0\" valign=\"bottom\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" frameborder=\"0\" scrolling=\"no\" width=\"400\" height=\"15\" src=\"../admin_pic.php?action=downpic&wjs=1&path=../".$picpath."&file=".$picfile."&url=".$piccode."\"></iframe></td></tr>";
                $piccode = $picpath . $picfile;
            }
        } else {
            //		echo "<tr><td colspan=\"2\" align=\"center\">第".($num+1)."条数据采集结果</td></tr><tr><td width=\"20%\" >来源:</td><td >".$strlink."</td></tr><tr><td width=\"20%\" >名称:</td><td >".$titlecode." 连载:".$lzcode." 备注:".$remarkscode."</td></tr>";
        }
        if ($weburl == false) {
            //			echo "<tr><td colspan=\"2\">在获取播放列表链接时出错 ".$strlink." / '.$strListUrl.'</TD></TR>";
            writetofile("crawel_auto_error.log", $p_id . '{=====}' . $strlink . '{=====}' . $strListUrl);
            //			$sb=$sb+1;
            return;
        } else {
            $sql = "select m_id,m_name,m_type,m_area,m_playfrom,m_starring,m_directed,m_pic,m_content,m_year,m_addtime,m_urltest,m_zt,m_pid,m_typeid,m_hits,m_playserver,m_state from {pre}cj_vod where  m_pid='" . $p_id . "' and m_name='" . $titlecode . "'  order by m_id desc";
            $rowvod = $db->getRow($sql);
            if ($rowvod) {
                $cg = $cg + 1;
                $movieid = $rowvod["m_id"];
                if (isN($titlecode)) {
                    $titlecode = $rowvod["m_name"];
                }
                if (isN($starringcode)) {
                    $starringcode = $rowvod["m_starring"];
                }
                if (isN($piccode)) {
                    $piccode = $rowvod["m_pic"];
                }
                $sql = "update {pre}cj_vod set m_pic='" . $piccode . "', m_type='" . $typecode . "',m_area='" . $areacode . "',m_urltest='" . $strlink . "',m_name='" . $titlecode . "',m_starring='" . $starringcode . "',m_directed='" . $directedcode . "',m_year='" . $timecode . "',m_playfrom='" . $p_playtype . "',m_content='" . $contentcode . "',m_addtime='" . date('Y-m-d H:i:s', time()) . "',m_zt='0',m_pid='" . $p_id . "',m_typeid='" . $m_typeid . "',m_playserver='" . $p_server . "',m_state='" . $lzcode . "',m_language='" . $languagecode . "',m_remarks='" . $remarkscode . "' where m_id=" . $rowvod["m_id"];
                writetofile("sql.txt", $sql);
                $db->query($sql);
                //			$sql="delete from {pre}cj_vod_url where u_movieid=".$rowvod["m_id"];
                //			writetofile("sql.txt", $sql);
                //			$db->query($sql);
            } else {
                $cg = $cg + 1;
                $sql = "insert {pre}cj_vod (m_name,m_type,m_area,m_playfrom,m_starring,m_directed,m_pic,m_content,m_year,m_urltest,m_zt,m_pid,m_typeid,m_hits,m_playserver,m_state,m_addtime,m_language,m_remarks) values('" . $titlecode . "','" . $typecode . "','" . $areacode . "','" . $p_playtype . "','" . $starringcode . "','" . $directedcode . "','" . $piccode . "','" . $contentcode . "','" . $timecode . "','" . $strlink . "','0','" . $p_id . "','" . $m_typeid . "','" . $m_hits . "','" . $p_server . "','" . $lzcode . "','" . date('Y-m-d H:i:s', time()) . "','" . $languagecode . "','" . $remarkscode . "')";
                writetofile("sql.txt", $sql);
                $db->query($sql);
                $movieid = $db->insert_id();
            }
            $webArray = explode("{Array}", $weburl);
            $setnamesArray = explode("{Array}", $setnames);
            $webArraTemp = array();
            $index = 0;
            $webUrls = '';
            for ($i = 0; $i < count($webArray); $i++) {
                $UrlTemp = $webArray[$i];
                if (strpos($webUrls, $UrlTemp . '<array>') === false) {
                    $webArraTemp[$index] = $UrlTemp;
                    $webUrls = $webUrls . $UrlTemp . '<array>';
                    $index++;
                }
            }
            //	    writetofile("d:\\ssssss.txt","p_videocodeType:".$p_videocodeType);
            $webArray = $webArraTemp;
            //http://www.youku.com/show_episode/id_zc16d0492e81411e196ac.html?dt=json&divid=reload_1&__rt=1&__ro=reload_1
            for ($i = 0; $i < count($webArray); $i++) {
                $WebTestx = $webArray[$i];
                if ($p_playspecialtype == 1 && strpos("," . $p_playspecialrrul, "[变量]")) {
                    $Keyurl = explode("[变量]", $p_playspecialrrul);
                    $urli = getBody($UrlTest, $Keyurl[0], $Keyurl[1]);
                    if ($urli == false) {
                        break;
                    }
                    $WebTestx = replaceStr($p_playspecialrerul, "[变量]", $urli);
                }
                if ($p_playspecialtype == 2) {
                    $urArray = explode("/", $strlink);
                    $ur = "";
                    for ($k = 0; $k < count($urArray) - 1; $k++) {
                        $ur = $ur . $urArray[$k] . "/";
                    }
                    $WebTestx = $ur . $WebTestx . ".html";
                }
                writetofile("crawel_auto_info.log", $p_id . '{=====}' . $WebTestx . "{=====}ViewList===start");
                if ($p_playlinktype == 1) {
                    //播放页获取地址
                    $WebTestx = getHrefFromLink($WebTestx);
                    $WebTestx = definiteUrl($WebTestx, $strListUrl);
                    $playCode = getPage($WebTestx, $p_coding);
                    $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($playCode, $p_coding, $p_script);
                    $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($playCode, $p_coding, $p_script);
                    writetofile("android_log.txt", $strlink . '{===}' . $androidUrl . '{===}' . $videoAddressUrl);
                    $url = getBody($playCode, $p_playurlstart, $p_playurlend);
                    $url = replaceLine($url);
                } else {
                    if ($p_playlinktype == 2) {
                        //播放链接中获取地址
                        $WebTestx = getHrefFromLink($WebTestx);
                        if (isN($p_playurlend)) {
                            $tmpA = strpos($WebTestx, $p_playurlstart);
                            $url = substr($WebTestx, strlen($WebTestx) - $tmpA - strlen($p_playurlstart) + 1);
                        } else {
                            $url = getBody($WebTestx, $p_playurlstart, $p_playurlend);
                        }
                    } else {
                        if ($p_playlinktype == 3) {
                            //单播放页获取所有播放地址
                            $WebTestx = getHrefFromLink($WebTestx);
                            $playCode = getPage($WebTestx, $p_coding);
                            $tmpB = getArray($webCode, $p_playurlstart, $p_playurlend);
                            $tmpC = explode("{$Array}\$", $tmpB);
                            foreach ($tmpC as $tmpD) {
                                $sql = "SELECT {pre}vod_url.u_url FROM ({pre}vod_url INNER JOIN {pre}vod ON {pre}vod_url.u_movieid = {pre}vod.m_id)  where {pre}vod_url.u_url='" . $tmpD . "' and {pre}vod.m_pid=" . $p_id;
                                $row = $db->getRow($sql);
                                if (!$row) {
                                    $strTempUrl = $strTempUrl . $tmpD . "<br>";
                                    $db->query("insert into {pre}vod_url(u_url,u_movieid) values('" . $tmpD . "','" . $movieid . "')");
                                }
                            }
                            break;
                        } else {
                            $url = $WebTestx;
                            $url = replaceLine($url);
                        }
                    }
                }
                $url = replaceFilters($url, $p_id, 3, 0);
                if ($p_setnametype == 1) {
                    $setname = getBody($url, $p_setnamestart, $p_setnameend);
                    //					$url = $setname . "$" . $url;
                } else {
                    if ($p_setnametype == 2 && $p_playlinktype == 1) {
                        $setname = getBody($playCode, $p_setnamestart, $p_setnameend);
                        //					$url = $setname ."$" .$url;
                    } else {
                        if ($p_setnametype == 3) {
                            $setname = $setnamesArray[$i];
                        }
                    }
                }
                $sql = "SELECT {pre}cj_vod_url.u_url FROM ({pre}cj_vod_url INNER JOIN {pre}cj_vod ON {pre}cj_vod_url.u_movieid = {pre}cj_vod.m_id)  where {pre}cj_vod_url.u_url='" . $url . "' and {pre}cj_vod.m_pid=" . $p_id . " and {pre}cj_vod.m_id=" . $movieid;
                $rowurl = $db->getRow($sql);
                //     		   writetofile("d:\\sql.txt",$rowurl);
                if (!$rowurl) {
                    if ($p_playlinktype == 1) {
                        $strTempUrl .= $url . "<br>";
                        $url = replaceStr($url, "'", "''");
                        writetofile("sql.txt", "insert into {pre}cj_vod_url(u_url,u_movieid,u_weburl,iso_video_url,name,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($WebTestx) . "','" . getHrefFromLink($videoAddressUrl) . "','" . filterScriptStar($setname, $p_script) . "' ,'" . $androidUrl . "' )");
                        $db->query("insert into {pre}cj_vod_url(u_url,u_movieid,u_weburl,iso_video_url,name,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($WebTestx) . "','" . getHrefFromLink($videoAddressUrl) . "','" . filterScriptStar($setname, $p_script) . "' ,'" . $androidUrl . "' )");
                    } else {
                        $strTempUrl .= $url . "<br>";
                        writetofile("sql.txt", "insert into {pre}cj_vod_url(u_url,u_movieid,iso_video_url,u_weburl,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($videoAddressUrl) . "','" . getHrefFromLink($strlink) . "', '" . $androidUrl . "')");
                        $db->query("insert into {pre}cj_vod_url(u_url,u_movieid,iso_video_url,u_weburl,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($videoAddressUrl) . "','" . getHrefFromLink($strlink) . "', '" . $androidUrl . "')");
                    }
                }
            }
        }
    }
    $cg = $cg + 1;
}
Esempio n. 17
0
<?php

ob_end_clean();
ob_implicit_flush(true);
require_once "admin_conn.php";
require_once "version.php";
chkLogin();
$action = be("get", "action");
$updateserver = "";
$updatelog = "bak/update.xml";
$verstr = getPage($updateserver . "?v=" . version, "utf-8");
$adpath = $_SERVER["SCRIPT_NAME"];
$adpath = substring($adpath, strripos($adpath, "/"));
$n = strripos($adpath, "/");
$adpath = substring($adpath, strlen($adpath) - $n, $n + 1) . "/";
switch ($action) {
    case "checkversion":
        checkversion();
        break;
    case "showfilelist":
        headAdmin("更新列表");
        showfilelist();
        break;
    case "showfile":
        headAdmin("更新列表");
        showfile();
        break;
}
dispseObj();
function checkversion()
{
Esempio n. 18
0
            fclose($f);
            /*$f = fopen("../output/" . $_POST['ques-name'].".txt",'w');
              fclose($f);*/
            echo "<h1>" . $_POST['ques-name'] . "</h1>";
            move_uploaded_file($_FILES["output-file"]["tmp_name"], "../output/temp.txt");
            /*
             *create multiple test cases
             */
            $f = fopen("../output/temp.txt", 'r');
            $cases = 0;
            while (!feof($f)) {
                $temp = fgets($f);
                if (substring($temp, "#Test") || substring($temp, "#test")) {
                    $case_file = fopen("../output/" . $_POST['ques-name'] . "/" . $cases . ".txt", 'w');
                    $line = fgets($f);
                    while (!substring($line, "#end")) {
                        fwrite($case_file, $line);
                        $line = fgets($f);
                    }
                    fclose($case_file);
                    $cases++;
                }
            }
            fclose($f);
            header("Location: adminhome.php?id=1");
        }
    }
    //header("Location: adminhome.php?id=3");//id = 3 is for updation
}
?>
</div>
Esempio n. 19
0
                 $db->Update('{pre}vod', array('d_topic'), array($d_topic), 'd_id=' . $id);
             }
         } elseif ($flag == 'del') {
             $sql = 'delete from {pre}vod_relation where r_type=2 and r_a=' . $tid . ' and r_b=' . $id;
             $db->query($sql);
             $sql = 'update {pre}vod set d_topic=replace(d_topic,\'' . $tid . '\',\'\') where d_id=' . $id;
             $db->query($sql);
         }
         $sql = 'select d_id,d_name,d_enname,d_type,d_starring from {pre}vod_relation t inner join {pre}vod d on d.d_id=t.r_b where t.r_type=2 and t.r_a=' . $tid;
     }
     $rs = $db->queryArray($sql, false);
     for ($i = 0; $i < count($rs); $i++) {
         $typearr = $GLOBALS['MAC_CACHE'][$tab . 'type'][$rs[$i][$pre . 'type']];
         $alink = "../" . $tpl->getLink($tab, 'detail', $typearr, $rs[$i], true);
         $alink = str_replace("../" . $MAC['site']['installdir'], "../", $alink);
         if (substring($alink, 1, strlen($alink) - 1) == "/") {
             $alink .= "index." . $MAC['app']['suffix'];
         }
         $rs[$i][$pre . 'link'] = $alink;
     }
     $str = json_encode($rs);
     if ($str != '[]') {
         echo $str;
         return;
     }
     echo '[]';
 } elseif ($ac == 'typenow') {
     if ($tab == 'art') {
         $pre = 'a';
     } else {
         $pre = 'd';
Esempio n. 20
0
function printPath($path, $isHrefEnd = false)
{
    $html = null;
    if ($path != null && $path != '/' && strpos($path, '/') !== false) {
        $array = explode('/', preg_replace('|^/(.*?)$|', '\\1', $path));
        $item = null;
        $url = null;
        foreach ($array as $key => $entry) {
            if ($key === 0) {
                $seperator = preg_match('|^\\/(.*?)$|', $path) ? '/' : null;
                $item = $seperator . $entry;
            } else {
                $item = '/' . $entry;
            }
            if ($key < count($array) - 1 || $key == count($array) - 1 && $isHrefEnd) {
                $html .= '<span class="path_seperator">/</span><a href="index.php?dir=' . rawurlencode($url . $item) . '">';
            } else {
                $html .= '<span class="path_seperator">/</span>';
            }
            $url .= $item;
            $html .= '<span class="path_entry">' . substring($entry, 0, NAME_SUBSTR, NAME_SUBSTR_ELLIPSIS) . '</span>';
            if ($key < count($array) - 1 || $key == count($array) - 1 && $isHrefEnd) {
                $html .= '</a>';
            }
        }
    }
    return $html;
}
Esempio n. 21
0
"/>
                            <input type="file" id="attach" name="attach" onChange="uploadImageAction(this, <?php 
        echo $v->aid;
        ?>
)" title="单击上传头图" />
                        </div>
                        <div class="article fl">
                            <p class="title">
                                <a href="<?php 
        echo site_url('article/' . $v->aid);
        ?>
" title="<?php 
        echo $v->title;
        ?>
" target="_blank"><?php 
        echo substring($v->title, 46);
        ?>
</a>
                                <?php 
        if ($v->image == 1) {
            ?>
                                <img src="<?php 
            echo static_url('images/image.png');
            ?>
" class="image" title="有图有真相" />
                                <?php 
        }
        ?>
                            </p>
                            <p class="author">由 <a href="javascript:;"><?php 
        echo $this->plus->get_username_by_uid($v->uid);
            ++$i;
            ?>
<tr class="tr_<?php 
            echo $vo["id"];
            ?>
">
			<td><?php 
            echo $vo["id"];
            ?>
</td>
			<td><?php 
            echo $vo["user"];
            ?>
</td>
			<td><?php 
            echo substring($vo["body"], 0, 50);
            ?>
</td>
			<td><a class="blue" href="<?php 
            echo $vo["articleid"];
            ?>
"><?php 
            echo $vo["articletitle"];
            ?>
</a></td>
			<td><?php 
            echo date("Y-m-d h:i:s", $vo["addtime"]);
            ?>
</td>
			<td>
				<a href="<?php 
Esempio n. 23
0
File: make.php Progetto: klarclm/sgv
 $serverarr = explode('$$$', $row['d_' . $flag . 'server']);
 $notearr = explode('$$$', $row['d_' . $flag . 'note']);
 for ($i = 0; $i < count($fromarr); $i++) {
     $tpl->P["src"] = $i + 1;
     $from = $fromarr[$i];
     $show = $GLOBALS['MAC_CACHE']['vod' . $flag][$fromarr[$i]]['show'];
     $server = $serverar[$i];
     $note = $notearr[$i];
     $tpl->H = $html2;
     if ($rcfrom) {
         $tpl->playdownlist($flag);
     }
     $tpl->H = str_replace(array('[vod:' . $flag . 'from]', '[vod:' . $flag . 'show]', '[vod:' . $flag . 'serve	r]', '[vod:' . $flag . 'note]'), array($from, $show, $server, $note), $tpl->H);
     $tpl->ifex();
     $lnkflag = $tpl->getLink('vod', $flag, $tpl->T, $row);
     $lnk2 = substring($lnkflag, strpos($lnkflag, "?"));
     $lnk2 = str_replace('{src}', $i + 1, $lnk2);
     if ($MAC['site']['installdir'] != "/") {
         $lnk2 = str_replace($MAC['site']['installdir'], "../", $lnk2);
     } else {
         $lnk2 = ".." . $lnk2;
     }
     if (substr($lnk2, strlen($lnk2) - 1, 1) == "/") {
         $lnk2 .= "index." . $MAC['app']['suffix'];
     }
     $path = dirname($lnk2);
     mkdirs($path);
     fwrite(fopen($lnk2, "wb"), $tpl->H);
 }
 unset($fromarr);
 unset($serverarr);
Esempio n. 24
0
 /**
  * Parse headers given in $input and return
  * as assoc array.
  *
  * @param string Headers to parse
  * @return array Contains parsed headers
  * @access private
  */
 function _parseHeaders($input)
 {
     if ($input !== '') {
         // Unfold the input
         $input = preg_replace("/\r?\n/", "\r\n", $input);
         //#7065 - wrapping.. with encoded stuff.. - probably not needed,
         // wrapping space should only get removed if the trailing item on previous line is a
         // encoded character
         $input = preg_replace("/=\r\n(\t| )+/", '=', $input);
         $input = preg_replace("/\r\n(\t| )+/", ' ', $input);
         $headers = explode("\r\n", trim($input));
         $got_start = false;
         foreach ($headers as $value) {
             if (!$got_start) {
                 // munge headers for mbox style from
                 if ($value[0] == '>') {
                     $value = substring($value, 1);
                     // remove mbox >
                 }
                 if (substr($value, 0, 5) == 'From ') {
                     $value = 'Return-Path: ' . substr($value, 5);
                 } else {
                     $got_start = true;
                 }
             }
             $hdr_name = substr($value, 0, $pos = strpos($value, ':'));
             $hdr_value = substr($value, $pos + 1);
             if ($hdr_value[0] == ' ') {
                 $hdr_value = substr($hdr_value, 1);
             }
             $return[] = array('name' => $hdr_name, 'value' => $hdr_value);
         }
     } else {
         $return = array();
     }
     return $return;
 }
Esempio n. 25
0
    }
    $pattern = '/[^\\x00-\\x80]/';
    if (!preg_match($pattern, $g_content)) {
        alert('内容必须包含中文,请重新输入!');
        exit;
    }
    $g_name = badFilter($g_name);
    $g_name = strip_tags($g_name);
    $g_content = badFilter($g_content);
    $g_content = strip_tags($g_content);
    $g_ip = ip2long(getIP());
    $g_time = time();
    if ($MAC['other']['gbookaudit'] == 1) {
        $g_hide = 1;
    } else {
        $g_hide = 0;
    }
    if (strlen($g_name) > 64) {
        $g_name = substring($g_name, 64);
    }
    if (strlen($g_content) > 255) {
        $g_content = substring($g_content, 255);
    }
    $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
    $db->Add("{pre}gbook", array("g_vid", "g_hide", "g_name", "g_ip", "g_time", "g_content"), array($g_vid, $g_hide, $g_name, $g_ip, $g_time, $g_content));
    $_SESSION["last_gbooktime"] = time();
    $_SESSION["code_gbook"] = "";
    alert('留言成功');
} else {
    showErr('System', '未找到指定系统模块');
}
Esempio n. 26
0
 /**
  * Generates an OAuth signature
  *
  * @param string          $httpmethod   Usually either 'GET' or 'POST' or 'DELETE'
  * @param string          $method       The API method to call
  * @param array  optional $params       The API call parameters, associative
  * @param bool   optional append_to_get Whether to append the OAuth params to GET
  *
  * @return string Authorization HTTP header
  */
 protected function _sign($httpmethod, $method, $params = array(), $append_to_get = false)
 {
     if (self::$_oauth_consumer_key === null) {
         throw new Exception('To generate a signature, the consumer key must be set.');
     }
     $sign_params = array('consumer_key' => self::$_oauth_consumer_key, 'version' => '1.0', 'timestamp' => time(), 'nonce' => $this->_nonce(), 'signature_method' => 'HMAC-SHA1');
     $sign_base_params = array();
     foreach ($sign_params as $key => $value) {
         $sign_base_params['oauth_' . $key] = $this->_url($value);
     }
     if ($this->_oauth_token != null) {
         $sign_base_params['oauth_token'] = $this->_url($this->_oauth_token);
     }
     $oauth_params = $sign_base_params;
     foreach ($params as $key => $value) {
         $sign_base_params[$key] = $this->_url($value);
     }
     ksort($sign_base_params);
     $sign_base_string = '';
     foreach ($sign_base_params as $key => $value) {
         $sign_base_string .= $key . '=' . $value . '&';
     }
     $sign_base_string = substr($sign_base_string, 0, -1);
     $signature = $this->_sha1($httpmethod . '&' . $this->_url($method) . '&' . $this->_url($sign_base_string));
     $params = $append_to_get ? $sign_base_params : $oauth_params;
     $params['oauth_signature'] = $signature;
     $keys = $params;
     ksort($keys);
     if ($append_to_get) {
         $authorization = '';
         foreach ($keys as $key => $value) {
             $authorization .= $key . '="' . $this->_url($value) . '", ';
         }
         return authorization . substring(0, authorization . length - 1);
     }
     $authorization = 'OAuth ';
     foreach ($keys as $key => $value) {
         $authorization .= $key . "=\"" . $this->_url($value) . "\", ";
     }
     return substr($authorization, 0, -2);
 }
function editstep1()
{
    global $db;
    $p_id = be("all", "p_id");
    $p_name = be("post", "p_name");
    $p_coding = be("post", "p_coding");
    $p_playtype = be("post", "p_playtype");
    $p_pagetype = be("all", "p_pagetype");
    $p_url = be("post", "p_url");
    $p_pagebatchurl = be("post", "p_pagebatchurl");
    $p_manualurl = be("post", "p_manualurl");
    $p_pagebatchid1 = be("post", "p_pagebatchid1");
    $p_pagebatchid2 = be("post", "p_pagebatchid2");
    $p_script = be("arr", "p_script");
    $sarr = explode(",", $p_script);
    $p_script = 0;
    foreach ($sarr as $s) {
        if (!isN($s)) {
            $p_script = $p_script | intval($s);
        }
    }
    $p_collecorder = be("post", "p_collecorder");
    $p_savefiles = be("post", "p_savefiles");
    $p_intolib = be("post", "p_intolib");
    $p_ontime = be("post", "p_ontime");
    $p_server = be("post", "p_server");
    $p_hitsstart = be("post", "p_hitsstart");
    $p_hitsend = be("post", "p_hitsend");
    $p_colleclinkorder = be("post", "p_colleclinkorder");
    $showcode = be("post", "showcode");
    $p_showtype = be("post", "p_showtype");
    if (isN($p_collecorder)) {
        $p_collecorder = 0;
    }
    if (isN($p_savefiles)) {
        $p_savefiles = 0;
    }
    if (isN($p_intolib)) {
        $p_intolib = 0;
    }
    if (isN($p_ontime)) {
        $p_ontime = 0;
    }
    if (isN($p_server)) {
        $p_server = 0;
    }
    if (isN($p_colleclinkorder)) {
        $p_colleclinkorder = 0;
    }
    if (!isNum($p_pagebatchid1)) {
        $p_pagebatchid1 = 1;
    }
    if (!isNum($p_pagebatchid2)) {
        $p_pagebatchid2 = 1;
    }
    switch ($p_pagetype) {
        case 0:
            $strlisturl = $p_url;
            break;
        case 1 or 3:
            $strlisturl = replaceStr($p_pagebatchurl, "{ID}", $p_pagebatchid1);
            break;
        case 2:
            if (strpos($p_manualurl, "|")) {
                $strlisturl = substring($p_manualurl, strpos($p_manualurl, "|") - 1);
            } else {
                $strlisturl = $p_manualurl;
            }
            break;
    }
    $strListCode = getPage($strlisturl, $p_coding);
    if ($strListCode == false) {
        errmsg("采集系统提示", "<li>在获取:" . $strlisturl . "网页源码时发生错误!</li>");
    }
    $_SESSION["strListCode"] = $strListCode;
    if (isN($p_id)) {
        $sql = "INSERT {pre}cj_vod_projects(p_name,p_coding,p_playtype,p_pagetype,p_url,p_pagebatchurl,p_manualurl,p_pagebatchid1,p_pagebatchid2,p_script,p_showtype,p_collecorder,p_savefiles,p_ontime,p_server,p_hitsstart,p_hitsend,p_time,p_colleclinkorder)  values ('" . $p_name . "','" . $p_coding . "','" . $p_playtype . "','" . $p_pagetype . "','" . $p_url . "','" . $p_pagebatchurl . "','" . $p_manualurl . "','" . $p_pagebatchid1 . "','" . $p_pagebatchid2 . "','" . $p_script . "','" . $p_showtype . "','" . $p_collecorder . "','" . $p_savefiles . "','" . $p_ontime . "','" . $p_server . "','" . $p_hitsstart . "','" . $p_hitsend . "','" . date('Y-m-d H:i:s', time()) . "','" . $p_colleclinkorder . "')";
    } else {
        $sql = "update {pre}cj_vod_projects set p_name='" . $p_name . "',p_coding='" . $p_coding . "',p_playtype='" . $p_playtype . "',p_pagetype='" . $p_pagetype . "',p_url='" . $p_url . "',p_pagebatchurl='" . $p_pagebatchurl . "',p_manualurl='" . $p_manualurl . "',p_pagebatchid1='" . $p_pagebatchid1 . "',p_pagebatchid2='" . $p_pagebatchid2 . "',p_script='" . $p_script . "',p_showtype='" . $p_showtype . "',p_collecorder='" . $p_collecorder . "',p_savefiles='" . $p_savefiles . "',p_ontime='" . $p_ontime . "',p_server='" . $p_server . "',p_hitsstart='" . $p_hitsstart . "',p_hitsend='" . $p_hitsend . "',p_colleclinkorder='" . $p_colleclinkorder . "' where p_id =" . $p_id;
    }
    $db->query($sql);
    if (isN($p_id)) {
        $p_id = $db->insert_id();
    }
    $sql = "select * from {pre}cj_vod_projects where p_id = " . $p_id;
    $row = $db->getRow($sql);
    $p_starringtype = $row["p_starringtype"];
    $p_starringstart = $row["p_starringstart"];
    $p_starringend = $row["p_starringend"];
    $p_titletype = $row["p_titletype"];
    $p_titlestart = $row["p_titlestart"];
    $p_titleend = $row["p_titleend"];
    $p_pictype = $row["p_pictype"];
    $p_picstart = $row["p_picstart"];
    $p_picend = $row["p_picend"];
    $p_listcodestart = $row["p_listcodestart"];
    $p_listcodeend = $row["p_listcodeend"];
    $p_listlinkstart = $row["p_listlinkstart"];
    $p_listlinkend = $row["p_listlinkend"];
    if ($p_pagetype == 3) {
        header("Location:collect_vod_manage.php?action=editstep2&p_pagetype=" . $p_pagetype . "&p_id=" . $p_id . "&p_coding=" . $p_coding . "&listurl=" . $strlisturl . "&showcode=" . $showcode);
        exit;
    }
    if ($showcode == "1") {
        ?>
<table class="tb">
	<tr><td>
	<TEXTAREA style="WIDTH: 100%; HEIGHT: 200px" id="htmlcode" wrap="off" readOnly><?php 
        echo $strListCode;
        ?>
</TEXTAREA>
	</td></tr>
</table>
<?php 
    }
    ?>
<form action="?action=editstep2" method="post">
	<INPUT id="p_id" name="p_id" type="hidden" value="<?php 
    echo $p_id;
    ?>
" >
  	<INPUT id="listurl" name="listurl" type="hidden" value="<?php 
    echo $strlisturl;
    ?>
" >
  	<INPUT id="p_coding" name="p_coding" type="hidden" value="<?php 
    echo $p_coding;
    ?>
" >
  	<INPUT id="showcode" name="showcode" type="hidden" value="<?php 
    echo $showcode;
    ?>
" >
  	<INPUT id="p_playtype" name="p_playtype" type="hidden" value="<?php 
    echo $p_playtype;
    ?>
" >
<table class="tb">
  	<tr>
  		<td  colspan="2" align="center">列表连接设置 当前获取的测试地址:<?php 
    echo $strlisturl;
    ?>
</td>
  	</tr>
    <tr>
      <td width="20%">列表开始代码:</td>
      <td>
 <span onClick="if(document.Form.p_listcodestart.rows>2)document.Form.p_listcodestart.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_listcodestart.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_listcodestart" cols="70" rows="3"><?php 
    echo $p_listcodestart;
    ?>
</textarea>
	  </td>
    </tr>
    <tr>
      <td>列表结束代码:</td>
      <td>
<span onClick="if(document.Form.p_listcodeend.rows>2)document.Form.p_listcodeend.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_listcodeend.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_listcodeend" cols="70" rows="3"><?php 
    echo $p_listcodeend;
    ?>
</textarea>
	  </td>
    </tr>
    <tr>
      <td>链接开始代码:</td>
      <td>
 <span onClick="if(document.Form.p_listlinkstart.rows>2)document.Form.p_listlinkstart.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_listlinkstart.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_listlinkstart" cols="70" rows="3"><?php 
    echo $p_listlinkstart;
    ?>
</textarea>
	  </td>
    </tr>
    <tr>
      <td>链接结束代码:</td>
      <td>
<span onClick="if(document.Form.p_listlinkend.rows>2)document.Form.p_listlinkend.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_listlinkend.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_listlinkend" cols="70" rows="3"><?php 
    echo $p_listlinkend;
    ?>
</textarea>
	  </td>
    </tr>
    <tr>
      <td>列表采集名称:</td>
      <td>
      	<input type="radio" value="0" id="p_titletype" name="p_titletype" <?php 
    if ($p_titletype == 0) {
        echo "checked=\"checked\"";
    }
    ?>
 onClick="ChangeCutPara(0,'trp_titlestart','trp_titleend');">
否&nbsp;&nbsp;
<input type="radio" value="1" id="p_titletype" name="p_titletype" <?php 
    if ($p_titletype == 1) {
        echo "checked=\"checked\"";
    }
    ?>
 onClick="ChangeCutPara(1,'trp_titlestart','trp_titleend');">
是&nbsp;
	  </td>
    </tr>
    
    <tr id="trp_titlestart" style="display:none">
      <td>名称开始代码:</td>
      <td>
 <span onClick="if(document.Form.p_titlestart.rows>2)document.Form.p_titlestart.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_titlestart.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_titlestart" cols="70" rows="3"><?php 
    echo $p_titlestart;
    ?>
</textarea>
	  </td>
    </tr>
    <tr id="trp_titleend" style="display:none">
      <td>名称结束代码:</td>
      <td>
<span onClick="if(document.Form.p_titleend.rows>2)document.Form.p_titleend.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_titleend.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_titleend" cols="70" rows="3"><?php 
    echo $p_titleend;
    ?>
</textarea>
	  </td>
    </tr>
    
    <tr>
      <td>列表采集主演:</td>
      <td>
      	<input type="radio" value="0" id="p_starringtype" name="p_starringtype" <?php 
    if ($p_starringtype == 0) {
        echo " checked=\"checked\"";
    }
    ?>
 onClick="ChangeCutPara(0,'trp_starringstart','trp_starringend');">
否&nbsp;&nbsp;
<input type="radio" value="1" id="p_starringtype" name="p_starringtype" <?php 
    if ($p_starringtype == 1) {
        echo "checked=\"checked\"";
    }
    ?>
 onClick="ChangeCutPara(1,'trp_starringstart','trp_starringend');">
是&nbsp;
	  </td>
    </tr>
    <tr id="trp_starringstart" style="display:none">
      <td>主演开始代码:</td>
      <td>
 <span onClick="if(document.Form.p_starringstart.rows>2)document.Form.p_starringstart.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_starringstart.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_starringstart" cols="70" rows="3"><?php 
    echo $p_starringstart;
    ?>
</textarea>
	  </td>
    </tr>
    <tr id="trp_starringend" style="display:none">
      <td>主演结束代码:</td>
      <td>
<span onClick="if(document.Form.p_starringend.rows>2)document.Form.p_starringend.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_starringend.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_starringend" cols="70" rows="3"><?php 
    echo $p_starringend;
    ?>
</textarea>
	  </td>
    </tr>
    
    <tr>
      <td>列表采集图片:</td>
      <td>
      	<input type="radio" value="0" id="p_pictype" name="p_pictype" <?php 
    if ($p_pictype == 0) {
        echo "checked=\"checked\"";
    }
    ?>
 onClick="ChangeCutPara(0,'trp_picstart','trp_picend');">
否&nbsp;&nbsp;
<input type="radio" value="1" id="p_pictype" name="p_pictype" <?php 
    if ($p_pictype == 1) {
        echo "checked=\"checked\"";
    }
    ?>
 onClick="ChangeCutPara(1,'trp_picstart','trp_picend');">
是&nbsp;
	  </td>
    </tr>
    <tr id="trp_picstart" style="display:none">
      <td>图片开始代码:</td>
      <td>
 <span onClick="if(document.Form.p_picstart.rows>2)document.Form.p_picstart.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_picstart.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_picstart" cols="70" rows="3"><?php 
    echo $p_picstart;
    ?>
</textarea>
	  </td>
    </tr>
    <tr id="trp_picend" style="display:none">
	<td>图片结束代码:</td>
	<td>
<span onClick="if(document.Form.p_picend.rows>2)document.Form.p_picend.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.Form.p_picend.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_picend" cols="70" rows="3"><?php 
    echo $p_picend;
    ?>
</textarea>
	</td>
    </tr>
	<tr>
	 <td colspan="2"><input type="submit" class="btn" id="btnNext" name="btnNext" value="下一步"></td>
	 </tr>
</table>
</form>
<script language="JavaScript">
function ChangeCutPara(flag,element1,element2)
{
	switch (flag)
	{
	case 0 :
	$("#"+element1).css("display","none");
	$("#"+element2).css("display","none");
	break;
	case 1 :
	$("#"+element1).css("display","");
	$("#"+element2).css("display","");
	break;
	}
}
ChangeCutPara(<?php 
    echo $p_starringtype;
    ?>
,"trp_starringstart","trp_starringend");
ChangeCutPara(<?php 
    echo $p_titletype;
    ?>
,"trp_titlestart","trp_titleend");
ChangeCutPara(<?php 
    echo $p_pictype;
    ?>
,"trp_picstart","trp_picend");
</script>
<?php 
}
Esempio n. 28
0
 public static function parse_js_number($num)
 {
     if (preg_match(self::$RE_HEX_NUMBER, $num)) {
         return intval(substring($num, 2), 16);
     } elseif (preg_match(self::$RE_OCT_NUMBER, $num)) {
         return intval(substring($num, 1), 8);
     } elseif (preg_match(self::$RE_DEC_NUMBER, $num)) {
         return floatval($num);
     }
 }
function main()
{
    global $db, $template, $cache;
    $loginname = getCookie("adminname");
    $keyword = be("all", "keyword");
    $stype = be("all", "stype");
    $area = be("all", "area");
    $topic = be("all", "topic");
    $level = be("all", "level");
    $from = be("all", "from");
    $sserver = be("all", "sserver");
    $sstate = be("all", "sstate");
    $repeat = be("all", "repeat");
    $repeatlen = be("all", "repeatlen");
    $order = be("all", "order");
    $pagenum = be("all", "page");
    $sort = be("all", "sort");
    $spic = be("all", "spic");
    $hide = be("all", "hide");
    $d_status = be("all", "d_status");
    $douban_score = be("all", "douban_score");
    $ipadpic = be("all", "ipadpic");
    $d_douban_id = be("all", "d_douban_id");
    $can_search_device = be("all", "can_search_device");
    if (!isNum($level)) {
        $level = 0;
    } else {
        $level = intval($level);
    }
    if (!isNum($sstate)) {
        $sstate = 0;
    } else {
        $sstate = intval($sstate);
    }
    if (!isNum($stype)) {
        $stype = 0;
    } else {
        $stype = intval($stype);
    }
    if (!isNum($area)) {
        $area = 0;
    } else {
        $area = intval($area);
    }
    if (!isNum($topic)) {
        $topic = 0;
    } else {
        $topic = intval($topic);
    }
    if (!isNum($spic)) {
        $spic = 0;
    } else {
        $spic = intval($spic);
    }
    if (!isNum($ipadpic)) {
        $ipadpic = 0;
    } else {
        $ipadpic = intval($ipadpic);
    }
    if (!isNum($hide)) {
        $hide = -1;
    } else {
        $hide = intval($hide);
    }
    if (!isNum($douban_score)) {
        $douban_score = 0;
    } else {
        $douban_score = intval($douban_score);
    }
    if (!isNum($repeatlen)) {
        $repeatlen = 0;
    }
    if (!isNum($d_status)) {
        $d_status = -1;
    } else {
        $d_status = intval($d_status);
    }
    if (isNum($d_douban_id)) {
        $d_douban_id = intval($d_douban_id);
    }
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $where = " d_type in (1,2,3,131) ";
    $keyword_col = be("all", "keyword_col");
    if (!isN($keyword)) {
        $keyword = trim($keyword);
        if (isN($keyword_col)) {
            $where .= " AND ( d_directed like '%" . $keyword . "%' or d_starring like '%" . $keyword . "%' or d_name like '%" . $keyword . "%' or d_enname like '%" . $keyword . "%'   ) ";
        } else {
            $where .= " AND " . $keyword_col . " like '%" . $keyword . "%' ";
        }
    }
    if ($stype > 0) {
        $typearr = getValueByArray($cache[0], "t_id", $stype);
        if (is_array($typearr)) {
            $where = $where . " and d_type in (" . $typearr["childids"] . ")";
        } else {
            $where .= " AND d_type=" . $stype . " ";
        }
    }
    if ($stype == -1) {
        $where .= " AND d_type=0 ";
    }
    if ($area > 0) {
        $where .= " AND d_area = " . $area . " ";
    }
    if ($topic > 0) {
        $where .= " AND d_topic = " . $topic . " ";
    }
    if ($level > 0) {
        $where .= " AND d_level = " . $level . " ";
    }
    if ($sstate == 1) {
        $where .= " AND d_state>0 ";
    } else {
        if ($sstate == 2) {
            $where .= " AND d_state=0 ";
        }
    }
    if ($hide != -1) {
        $where .= " AND d_hide=" . $hide . " ";
    }
    if ($d_douban_id == -1) {
        $where .= " AND d_douban_id=" . $d_douban_id . " ";
    } else {
        if ($d_douban_id == 1) {
            $where .= " AND d_douban_id >0 ";
        } else {
            if ($d_douban_id == 2) {
                $where .= " AND d_douban_id =0 ";
            }
        }
    }
    if ($d_status != -1) {
        $where .= " AND d_status=" . $d_status . " ";
    }
    if ($douban_score == 1) {
        $where .= " AND d_score >0 ";
    }
    if ($douban_score == 2) {
        $where .= " AND d_score <=0 ";
    }
    if ($stype == 1 || $stype == 2) {
        $douban_scoreT = "block";
    } else {
        $douban_scoreT = "none";
    }
    if (!isN($can_search_device)) {
        //    	if($can_search_device ==='TV'){
        //    		$where .= " AND can_search_device like '%TV%' ";
        //    	}else {
        //    		$where .= " AND (can_search_device like '".$can_search_device."' or can_search_device is null or can_search_device ='' ) ";
        //    	}
        $where .= " AND (can_search_device like '" . $can_search_device . "' or can_search_device is null or can_search_device ='' ) ";
    }
    if ($repeat == "ok") {
        $repeatSearch = " d_name ";
        if ($repeatlen > 0) {
            $repeatSearch = " substring(d_name,1," . $repeatlen . ") ";
        }
        $repeatsql = " , (SELECT " . $repeatSearch . " as d_name1 FROM {pre}vod GROUP BY d_name1 HAVING COUNT(*)>1) as `t2` ";
        $where .= " AND `{pre}vod`.`d_name`=`t2`.`d_name1` ";
        if (isN($order)) {
            $order = "d_name,d_addtime";
        }
    }
    $douban_comment = be("all", "douban_comment");
    if (!isNum($douban_comment)) {
        $douban_comment = 0;
    } else {
        $douban_comment = intval($douban_comment);
    }
    if ($douban_comment == 1) {
        $where .= " and d_id in (SELECT DISTINCT content_id FROM tbl_comments WHERE author_id IS NULL AND thread_id IS NULL) ";
    }
    if ($douban_comment == 2) {
        $where .= " and d_id not in (SELECT DISTINCT content_id FROM tbl_comments WHERE author_id IS NULL AND thread_id IS NULL) ";
    }
    if (isN($order)) {
        $orders = "d_time desc ";
    } else {
        if (!isN($sort)) {
            $orders = $order . ' ' . $sort;
        }
    }
    if (!isN($sserver)) {
        $where .= " AND d_playserver like '%" . $sserver . "%' ";
    }
    if (!isN($from)) {
        $where .= " and d_playfrom like  '%" . $from . "%' ";
    }
    if ($spic == 1) {
        $where .= " AND d_pic = '' ";
    } else {
        if ($spic == 2) {
            $where .= " and  d_pic not like '%joyplus%' and d_pic!=''  ";
        }
    }
    if ($ipadpic == 1) {
        $where .= " AND (d_pic_ipad = ''  or d_pic_ipad is null )";
    } else {
        if ($ipadpic == 2) {
            $where .= " AND d_pic_ipad not like '%joyplus%' and d_pic_ipad != '' ";
        }
    }
    $select_weburl = be("all", "select_weburl");
    $select_videourl = be("all", "select_videourl");
    $select_videourl_play = be("all", "select_videourl_play");
    if (!isNum($select_videourl_play)) {
        $select_videourl_play = -1;
    } else {
        $select_videourl_play = intval($select_videourl_play);
    }
    if ($select_videourl_play == 0) {
        $where .= " AND d_play_check = 0 ";
    }
    if ($select_videourl_play == 2) {
        $where .= " AND d_play_check = 2 ";
    }
    if ($select_videourl_play == 1) {
        $where .= " AND d_play_check = 1 ";
    }
    if ($select_weburl == 1) {
        $where .= " AND webUrls is not null and webUrls !='' ";
    }
    if ($select_weburl == 2) {
        $where .= " AND (webUrls is null or  webUrls ='') ";
    }
    if ($select_videourl == 1) {
        $where .= " AND d_downurl is not null and d_downurl !='' ";
    }
    if ($select_videourl == 2) {
        $where .= " AND (d_downurl is null or d_downurl ='') ";
    }
    $sql = "SELECT count(*) FROM {pre}vod " . $repeatsql . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    //$sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide,p.id as popular_id FROM {pre}vod ".$repeatsql." left join {pre}vod_popular as p on p.vod_id=d_id  WHERE" . $where . " ORDER BY " . $orders . "  limit ".(app_pagenum * ($pagenum-1)) .",".app_pagenum;
    $sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide FROM {pre}vod " . $repeatsql . "  WHERE" . $where . " ORDER BY " . $orders . "  limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    // var_dump($sql);
    $rs = $db->query($sql);
    ?>


<script type="text/javascript" src="./resource/thickbox-compressed.js"></script>
<script type="text/javascript" src="./resource/thickbox.js"></script>
<link href="./resource/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript">
$(document).ready(function(){
	$("#form1").validate({
		rules:{
			repeatlen:{
				number:true,
				max:10
			}
		}
	});
	
	$("#btnrepeat").click(function(){
		var repeatlen = $("#repeatlen").val();
		var reg = /^\d+$/;
		var re = repeatlen.match(reg);
		if (!re){ repeatlen=0; }
		if (repeatlen >20){ alert("长度最大20");$("#repeatlen").focus();return;}
		var url = "admin_vod.php?repeat=ok&repeatlen=" + repeatlen;
		window.location.href=url;
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_vod.php?action=del");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#plsc").click(function(){
		var ids="",rc=false;
		$("input[name='d_id']").each(function() {
			if(this.checked){
				if(rc)ids+=",";
				ids =  ids + this.value;
				rc=true;
			}
        });
		$("#form1").attr("action","admin_makehtml.php?acton=viewpl&flag=vod&d_id="+ids);
		$("#form1").submit();
	});
});
function filter(){
	var stype=$("#stype").val();
	var order=$("#order").val();
	var from=$("#from").val();
	var sort=$("#sort").val();
	var keyword=$("#keyword").val();
	var keyword_col=$("#keyword_col").val();
	var can_search_device=$("#can_search_device").val();
	var url = "admin_online_subscribe.php?can_search_device="+can_search_device+"&keyword_col="+keyword_col+"&sort="+sort+"&keyword="+encodeURI(keyword)+"&stype="+stype+"&order="+order+"&from="+from; //ipadpic
	window.location.href=url;
}


function prepareWeiboText(type,id,name){
	   document.getElementById( "weiboText").value= name; 
	   document.getElementById( "notify_msg_prod_id").value= id; 
	   document.getElementById( "notify_msg_prod_type").value= type; 
	   $('#SendWeiboMsg').empty();
}


function sendWeiboText(){

	
	var weibotxt= document.getElementById( "weiboText").value;
	var notify_msg_prod_id= document.getElementById( "notify_msg_prod_id").value;
	var notify_msg_prod_type= document.getElementById( "notify_msg_prod_type").value;
	var urlT='admin_vod.php?action=notifyMsg&prod_type='+notify_msg_prod_type+'&prod_id='+notify_msg_prod_id+'&content=' +encodeURIComponent(weibotxt) ;
	var channels= document.getElementById( "channel[]");
	alert(channels);
	for(var i = 0; i < channels.length; i++){
		 if (channels[i].checked == true) {
			  urlT = urlT +'&channels='+channels[i].value;				 		 
		  }
	}
		 $.post(urlT, {Action:"post"}, function (data, textStatus){     
			  if(textStatus == "success"){   
	          //alert(data);
				  $('#SendWeiboMsg').empty().append(data);
	           }else{
	        	   $('#SendWeiboMsg').empty().append('发送失败。');
	           }
	       });
	
    // alert(urlT);
	 
}

</script>
<table class="admin_online_subscribe tb">
	<tr>
	<td>
	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">
	过滤条件:<select id="stype" name="stype" onchange="javascript:{var typeid= this.options[this.selectedIndex].value; if(typeid=='1' ||  typeid=='2'){document.getElementById('btnsearchs').style.display='block';  document.getElementById('btnsearchsThumbs').style.display='block';document.getElementById('btnsearchsComment').style.display='block';}else {document.getElementById('btnsearchs').style.display='none'; document.getElementById('btnsearchsThumbs').style.display='none';document.getElementById('btnsearchsComment').style.display='none';}}">
	<option value="0">视频栏目</option>
	<option value="-1" <?php 
    if ($stype == -1) {
        echo "selected";
    }
    ?>
>没有栏目</option>
	<?php 
    echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $stype);
    ?>
	</select>
	&nbsp;
	
	<select id="order" name="order">
	<option value="d_time">视频排序</option>
	<option value="d_id" <?php 
    if ($order == "d_id") {
        echo "selected";
    }
    ?>
>视频编号</option>
	<option value="d_name" <?php 
    if ($order == "d_name") {
        echo "selected";
    }
    ?>
>视频名称</option>
	<option value="d_play_num" <?php 
    if ($order == "d_play_num") {
        echo "selected";
    }
    ?>
>播放次数</option>
	<option value="d_year" <?php 
    if ($order == "d_year") {
        echo "selected";
    }
    ?>
>上映日期</option>
	</select>
	&nbsp;<select id="sort" name="sort">
	<option value="desc" <?php 
    if ($sort == "desc") {
        echo "selected";
    }
    ?>
>视频排序 降序序</option>
	<option value="asc" <?php 
    if ($sort == "asc") {
        echo "selected";
    }
    ?>
>视频排序  升序</option>
	</select>
	
	
	&nbsp;
	<select id="from" name="from">
	<option value="">视频播放器</option>
	<?php 
    echo makeSelectPlayer($from);
    ?>
	</select>
	
	 <select   id="can_search_device" name="can_search_device">
	    <option value="" >投放设备</option>
		<option value="TV" <?php 
    if ($can_search_device === 'TV') {
        echo "selected";
    }
    ?>
>TV版</option>
		<option value="iPad" <?php 
    if ($can_search_device === 'iPad') {
        echo "selected";
    }
    ?>
>iPad版</option>
		<option value="iphone" <?php 
    if ($can_search_device === 'iphone') {
        echo "selected";
    }
    ?>
>iphone版</option>
		<option value="apad" <?php 
    if ($can_search_device === 'apad') {
        echo "selected";
    }
    ?>
>Android-Pad版</option>
		<option value="aphone" <?php 
    if ($can_search_device === 'aphone') {
        echo "selected";
    }
    ?>
>Android-Phone版</option>
		<option value="web" <?php 
    if ($can_search_device === 'web') {
        echo "selected";
    }
    ?>
>网站版</option>
	</select> 
	
	</td>
	</tr>
	<tr>
	<td colspan="4">
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">&nbsp;
	<select id="keyword_col" name="keyword_col">
	<option value="">关键字的匹配列</option>
	<option value="d_name" <?php 
    if ($keyword_col == "d_name") {
        echo "selected";
    }
    ?>
>视频名称</option>
	<option value="d_starring" <?php 
    if ($keyword_col == "d_starring") {
        echo "selected";
    }
    ?>
>演员</option>
	<option value="d_directed" <?php 
    if ($keyword_col == "d_directed") {
        echo "selected";
    }
    ?>
>导演</option>
	</select>
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">
	
	</td>
	
	</tr>
	</table>
	</td>
	</tr>
</table>

<form id="form1" name="form1" method="post">
<table class="tb">
	<tr>
	<td width="10%">编号</td>
	<td width="25%">名称</td>
	<td width="10%">播放次数</td>
	<td width="10%">上映日期</td>
	<td width="5%">分类</td>
	<td width="20%">时间</td>
	<td width="20%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
	<tr><td align="center" colspan="12">没有任何记录!</td></tr>
	<?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $d_id = $row["d_id"];
            $tname = "未知";
            $tenname = "";
            $typearr = getValueByArray($cache[0], "t_id", $row["d_type"]);
            if (is_array($typearr)) {
                $tname = $typearr["t_name"];
                $tenname = $typearr["t_enname"];
            }
            ?>
    <tr>
	<td><?php 
            echo $d_id;
            ?>
</td>
	<td><?php 
            echo substring($row["d_name"], 20);
            ?>
	<?php 
            if ($row["d_state"] > 0) {
                echo "<font color=\"red\">[" . $row["d_state"] . "]</font>";
            }
            ?>
	<?php 
            if (!isN($row["d_remarks"])) {
                echo "<font color=\"red\">[" . $row["d_remarks"] . "]</font>";
            }
            ?>
	<?php 
            if ($row["d_hide"] == 1) {
                echo "<font color=\"red\">[隐藏]</font>";
            }
            ?>
	</td>
	<td><?php 
            echo $row["d_play_num"];
            ?>
</td>
	<td><?php 
            echo $row["d_year"];
            ?>
</td>
	<td><?php 
            echo $tname;
            ?>
</td>
	<td><?php 
            echo isToday($row["d_time"]);
            ?>
</td>
	<td><a href="admin_vod_topic.php?action=info&id=<?php 
            echo $d_id;
            ?>
">所在榜单</a> |
	<a class="thickbox" href="#TB_inline?height=400&width=600&inlineId=myOnPageContent" onclick="javascript:{prepareWeiboText('<?php 
            echo $row["d_type"];
            ?>
','<?php 
            echo $d_id;
            ?>
','<?php 
            echo substring($row["d_name"], 20);
            ?>
');}" > 消息推送</a>	 </td>
    </tr>
	<?php 
        }
    }
    ?>
<!--	<tr>-->
<!--	<td colspan="12">-->
<!--	全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'d_id[]');"/>&nbsp;-->
<!--    批量操作:<input type="button" id="btnDel" value="删除" class="input">-->
<!--	<input type="button" id="pltj" value="推荐" onClick="plset('pltj','vod')" class="input">-->
<!--	<input type="button" id="plfl" value="分类" onClick="plset('plfl','vod')" class="input">-->
<!--	<input type="button" id="plzt" value="专题" onClick="plset('plzt','vod')" class="input">-->
<!--	<input type="button" id="plluobo" value="轮播图" onClick="plsetLuobo()" class="input">-->
<!--	<input type="button" id="plbd" value="视频悦单" onClick="plsetBD('plbd','vod','1')" class="input">-->
<!--	<input type="button" id="plbd" value="视频悦榜" onClick="plsetBD('plbd','vod','2')" class="input">-->
<!--	<input type="button" id="plrq" value="人气" onClick="plset('plrq','vod')" class="input">-->
<!--	<input type="button" id="plsc" value="生成" class="input">-->
<!--	<input type="button" id="plyc" value="显隐" onClick="plset('plyc','vod')" class="input">-->
<!--	<span id="plmsg" name="plmsg"></span>-->
<!--	</td>-->
<!--	</tr>-->
	<tr class="formlast">
	<td align="center" colspan="12">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_online_subscribe.php?page={p}&can_search_device=" . $can_search_device . "&keyword=" . urlencode($keyword) . "&keyword_col=" . $keyword_col . "&sort=" . $sort . "&order=" . $order . "&stype=" . $stype . "&from=" . $from);
    ?>
	</td>
	</tr>
</table>

</form>
<div id="myOnPageContent" style="display:none">
<script language="javascript">

$('#form2').form({
	success:function(data){
		$('#SendWeiboMsg').empty().append(data);
		$("#btnEdit").attr("disabled",false); 		
    }
});

$("#btnEdit").click(function(){
	if(confirm('确定要推送消息吗')){
		$("#form2").attr("action","?action=notifyMsg");
		var weibotxt= $("#weiboText").val();
		$("#btnEdit").attr("disabled",true); 
		if(weibotxt ==''){
          alert("发送内容不能为空。");
          $("#btnEdit").attr("disabled",false); 
          return;
		}

		if(weibotxt.length>=110){
	          alert("你发送的内容太长,不能超过110个字符。");
	          $("#btnEdit").attr("disabled",false); 
	          return;
		}
		var prod_id= $("#notify_msg_prod_id").val();
		
		var prod_type= $("#notify_msg_prod_type").val();
		 $('#SendWeiboMsg').empty().append('正在推送消息.....<br/>');
		var urlT='admin_online_subscribe.php?action=notifyMsg&notify_msg_prod_type='+prod_type+'&notify_msg_prod_id='+prod_id+'&content=' +encodeURIComponent(weibotxt) ;
		var channels=document.getElementsByName("channel[]");
		var channelFlag=true;
		var index=0;
		var indexSelect=0;
		for(var i = 0; i < channels.length; i++){
			 if (channels[i].checked == true) {
				  channelFlag=false;
				  indexSelect++;
				  urlTs = urlT +'&channel='+channels[i].value;	
				 // alert(channels[i].value);	
				  $.post(urlTs, {Action:"post"}, function (data, textStatus){     
					  if(textStatus == "success"){ 
						  index++;  
			          //alert(data);
						  $('#SendWeiboMsg').append(data).append('<br/>');
			           }else{
			        	   index++;  
			        	   $('#SendWeiboMsg').append('发送失败。').append('<br/>');
			           }
					  if( index==indexSelect){			  
						     $("#btnEdit").attr("disabled",false); 
						     $('#SendWeiboMsg').append('推送消息完成。').append('<br/>');
				      }
			       });	 		 
			  }
		}
		if(channelFlag){
			alert('你必须要选择一个频道发送');
	    }
	   
	    
		//$("#form2").submit();
		
	}
});
</script>
<form id="form2"  name="form1" method="post">
<table class="table" cellpadding="0" cellspacing="0" width="100%" border="0">

                <thead class="tb-tit-bg">
<!--                   <tr>-->
<!--                        <td > <h3 class="title">    发送设备:<select name="device_type" id="device_type" >                       -->
<!--                             <option value="" >所有设备</option>-->
<!--                             <option value="ios" >IOS</option>-->
<!--                             <option value="android" >Android</option>                          -->
<!--                        </select> -->
<!--                        </h3></td>    -->
<!--                      -->
<!--                    </tr>-->
                    <tr>
                        <td colspan="2"><span><h3>发送信息</h3></span></td>    
                       
                    </tr>
                    <input type="hidden" name="notify_msg_prod_id" id="notify_msg_prod_id" value="">
                    <input type="hidden" name="notify_msg_prod_type" id="notify_msg_prod_type" value="">
                      
                      <tr>
                        <td colspan="2" align="center"><textarea name="wbText" id="weiboText" rows="10" cols="90"></textarea></td>
                    </tr>
                     <tr>
                        <td align="left"> <br/>
                            Parse 云推送<br/>
	                        &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_ANDROID"   />悦视频 Android版<br/>
<!--						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_TV"  />悦视频 TV版<br/>-->
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IOS"  />悦视频 IOS版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPHONE"  />今晚剧场iphone版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPAD"  />今晚剧场IPAD版<br/>
                        </td>
                         <td align="left"> <br/>
                                                                         百度云推送<br/>
	                        &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_ANDROID_BAIDU"   />悦视频 Android版<br/>
<!--						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_TV_BAIDU"  />悦视频 TV版<br/>-->
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IOS_BAIDU"  />悦视频 IOS版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPHONE_BAIDU"  />今晚剧场iphone版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPAD_BAIDU"  />今晚剧场IPAD版<br/>
                        </td>
                    </tr>
                      <tr>
                         <td align="center" colspan="2"><input type="button" value="发送消息" id="btnEdit"  class="input"  /></td>
                      </tr>
                        <tr>
                        <td align="left" colspan="2">  <font color=red><span id="SendWeiboMsg"></span></font></td>    
                       
                    </tr> 
                    
                </thead>
            </table>
</form>
</div>
<?php 
    if ($pagenum == 1 && $where == " 1=1 ") {
        echo "<script>showpic();</script>";
    }
    unset($rs);
}
Esempio n. 30
0
 /**
  * Removes a refinement from the list of refinements
  * Warning, on the 4.6 product, the refinements defined in the context can not be removed with this method, see {@link SearchParameter::$ZAP_REFINE} instead
  * 
  * @param string $refId the id of the category
  * @see SearchParameter::$REFINE
  * @see SearchParameter::$CANCEL_REFINE
  */
 public function cancelRefinement($refId)
 {
     $found = false;
     foreach ($this->standardParameters as $param) {
         if ($param . getName() == SearchParameter::$REFINE) {
             if ($param . getValue() . substring(1) == $refId) {
                 $found = true;
                 continue;
             }
         }
         $filteredParams[] = $param;
     }
     $this->standardParameters = $filteredParams;
     if (!$found) {
         $this->standardParameters[] = new SearchParameter(SearchParameter::$CANCEL_REFINE, $refId);
     }
 }