本文整理汇总了PHP中be函数的典型用法代码示例。如果您正苦于以下问题:PHP be函数的具体用法?PHP be怎么用?PHP be使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了be函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editall
function editall()
{
global $db;
$t_id = be("arr", "t_id");
$ids = explode(",", $t_id);
foreach ($ids as $id) {
$t_name = be("post", "t_name" . $id);
$t_enname = be("post", "t_enname" . $id);
$t_sort = be("post", "t_sort" . $id);
// $t_template = be("post","t_template" .$id);
// $t_vodtemplate = be("post","t_vodtemplate" .$id);
// $t_playtemplate = be("post","t_playtemplate" .$id);
// $t_key = be("post","t_key" .$id);
// $t_des = be("post","t_des" .$id);
if (isN($t_name)) {
echo "名称不能为空";
exit;
}
if (isN($t_enname)) {
echo "别名不能为空";
exit;
}
if (!isNum($t_sort)) {
echo "排序号不能为空或不是数字";
exit;
}
// if (isN($t_template)) { $t_template = "vodlist.html";}
// if (isN($t_vodtemplate)) { $t_vodtemplate = "vod.html";}
// if (isN($t_playtemplate)) { $t_playtemplate = "vodplay.html";}
$db->Update("{pre}vod_type", array("t_name", "t_enname", "t_sort"), array($t_name, $t_enname, $t_sort), "t_id=" . $id);
}
updateCacheFile();
echo "修改完毕";
}
示例2: chkLogin
function chkLogin()
{
global $db;
$m_id = getCookie("adminid");
$m_id = chkSql($m_id, true);
$m_name = getCookie("adminname");
// writetofile("operate.log", "loginame:{".$m_name ."};action:{".be("all","action")."};referce:{".getReferer()."}.request:{".$_SERVER["REQUEST_URI"]."};parameters GET:{".json_encode($_GET)."}" );
writetofile("operate.log", "loginame:{" . $m_name . "};action:{" . be("all", "action") . "};referce:{" . getReferer() . "}.request:{" . $_SERVER["REQUEST_URI"] . "};parameters POST:{" . json_encode($_POST) . "}");
$m_name = chkSql($m_name, true);
if (!isN($m_name) && !isN($m_id)) {
$row = $db->getRow("SELECT * FROM {pre}manager WHERE m_name='" . $m_name . "' AND m_id= '" . $m_id . "' AND m_status ='1'");
if ($row) {
$loginValidate = md5($row["m_random"] . $row["m_name"] . $row["m_id"]);
if (getCookie("admincheck") != $loginValidate) {
sCookie("admincheck", "");
die("<script>top.location.href='index.php?action=login';</script>");
}
} else {
sCookie("admincheck", "");
die("<script>top.location.href='index.php?action=login';</script>");
}
} else {
die("<script>top.location.href='index.php?action=login';</script>");
}
}
示例3: checkLogin
function checkLogin()
{
global $db;
$m_name = be("post", "m_name");
$m_name = chkSql($m_name, true);
$m_password = be("post", "m_password");
$m_password = chkSql($m_password, true);
$m_password = md5($m_password);
$m_check = be("post", "m_check");
if (isN($m_name) || isN($m_password) || isN($m_check)) {
alertUrl("请输入您的用户名或密码!", "?action=login");
}
$row = $db->getRow("SELECT * FROM {pre}manager WHERE m_name='" . $m_name . "' AND m_password = '" . $m_password . "' AND m_status=1");
if ($row && $m_check == app_safecode) {
sCookie("adminid", $row["m_id"]);
sCookie("adminname", $row["m_name"]);
sCookie("adminlevels", $row["m_levels"]);
$randnum = md5(rand(1, 99999999));
sCookie("admincheck", md5($randnum . $row["m_name"] . $row["m_id"]));
$db->Update("{pre}manager", array("m_logintime", "m_loginip", "m_random"), array(date("Y-m-d H:i:s"), getIP(), $randnum), " m_id=" . $row["m_id"]);
echo "<script>top.location.href='index.php';</script>";
} else {
alertUrl("您输入的用户名和密码不正确或者您不是系统管理员!", "?action=login");
}
}
示例4: save
function save()
{
$areastr = be("post", "areastr");
$langstr = be("post", "langstr");
fwrite(fopen("../inc/vodarea.txt", "wb"), $areastr);
fwrite(fopen("../inc/vodlang.txt", "wb"), $langstr);
updateCacheFile();
echo "修改完毕";
}
示例5: save
function save()
{
$program_country = be("post", "program_country");
$program_area = be("post", "program_area");
$program_type = be("post", "program_type");
$tv_playfrom = be("post", "tv_playfrom");
fwrite(fopen("../inc/program_country.txt", "wb"), $program_country);
fwrite(fopen("../inc/program_area.txt", "wb"), $program_area);
fwrite(fopen("../inc/program_type.txt", "wb"), $program_type);
fwrite(fopen("../inc/tv_playfrom.txt", "wb"), $tv_playfrom);
updateCacheFile();
echo "修改完毕";
}
示例6: chgpwd
function chgpwd()
{
global $db;
$oldP = be('all', 'old_pwds');
$newP = be('all', 'new_pwd');
$m_name = getCookie("adminname");
$row = $db->getRow("select m_id from {pre}manager where m_password='" . md5($oldP) . "' and m_name='" . $m_name . "'");
if (!isN($row['m_id'])) {
$db->Update("{pre}manager", array('m_password'), array(md5($newP)), "m_name='" . $m_name . "'");
echo '更新密码成功';
} else {
echo '输入的旧密码不对';
}
}
示例7: cjsel
function cjsel()
{
global $action, $rtype, $rpage, $rkey, $rday, $cjurl, $xt, $rid, $cjflag;
$ids = be("arr", "ids");
if (isN($ids)) {
errMsg("采集提示", "请选择采集数据");
}
if ($xt == "1") {
$url = $cjurl . "?ac=videolist&rid=" . $rid . "&ids=" . $ids;
} else {
if ($xt == "2") {
$url = $cjurl . "?s=plus-api-xml-cms-ff-action-ids-vodids-" . $ids . "-cid--play--inputer--wd--h-0-p-1";
} else {
$url = $cjurl . "?action=cjsel&ids=" . $ids;
}
}
insertdata($url, "cjsel");
}
示例8: headAdminCollect
* Date: 14-2-18
* Time: 下午3:11
*/
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "api_collect_youku_cj.php";
headAdminCollect("优酷视频采集");
define("VIDEOS", "https://openapi.youku.com/v2/shows/videos.json?client_id=715115c589f8533a&show_id={id}&page=1&count={count}");
define("SHOWINFO", "https://openapi.youku.com/v2/shows/show.json?client_id=715115c589f8533a&show_id={id}");
$action = be("get", "action");
$contentparmStart = "showid_en=\"";
$contentparaend = "\";";
if (isset($action) && $action === 'collectSimpl') {
$type_id = be("all", "type_id");
$web_url = be("all", "web_url");
$site_url = be("all", "site_url");
$id = '';
if (!isN($web_url)) {
$content = getPage($web_url, 'utf-8');
$id = getBody($content, $contentparmStart, $contentparaend);
} else {
if (!isN($site_url) && preg_match('/id_z(\\w.+?).html/', $site_url)) {
$ids = preg_match_all('/id_z(\\w.+?).html/', $site_url, $match);
$id = $match[1][0];
} else {
errmsg("采集提示", "采集信息不能为空");
}
}
$content = getYoukuInfo($id, $type_id);
$pid = '';
$category = "电影";
示例9: str_replace
$tpl->H = str_replace("{maccms:gbookverify}", $MAC['other']['gbookverify'], $tpl->H);
if (strpos($tpl->H, '{maccms:count_gbook_all}')) {
$tpl->H = str_replace("{maccms:count_gbook_all}", $tpl->getDataCount('gbook', "all"), $tpl->H);
}
if (strpos($tpl->H, '{maccms:count_gbook_day}')) {
$tpl->H = str_replace("{maccms:count_gbook_day}", $tpl->getDataCount('gbook', "day"), $tpl->H);
}
$tpl->pageshow();
} elseif ($method == 'save') {
$g_vid = be("all", "g_vid");
$g_vid = chkSql($g_vid);
$g_name = be("all", "g_name");
$g_name = chkSql($g_name);
$g_content = be("all", "g_content");
$g_content = chkSql($g_content);
$g_code = be("all", "g_code");
$g_code = chkSql($g_code);
if (!isNum($g_vid)) {
$g_vid = 0;
}
if (isN($g_name) || isN($g_content)) {
alert('请输入昵称和内容');
exit;
}
if ($MAC['other']['gbookverify'] == 1 && $_SESSION["code_gbook"] != $g_code) {
alert('验证码错误');
exit;
}
if (getTimeSpan("last_gbooktime") < $MAC['other']['gbooktime']) {
alert('请不要频繁操作');
exit;
示例10: showMsg
$tab = $p['tab'];
}
if ($tab == 'art') {
if ($MAC['view']['artdetail'] != 2) {
showMsg('内容页面浏览模式非静态,不需要生成静态文件', '');
}
$tpl->C["siteaid"] = 26;
$pre = 'a';
} else {
if ($MAC['view']['voddetail'] != 2 && $MAC['view']['vodplay'] < 2 && $MAC['view']['voddown'] < 2) {
showMsg('内容、播放、下载页面浏览模式均非静态,不需要生成静态文件', '');
}
$tpl->C["siteaid"] = 16;
$pre = 'd';
}
$ids = be('arr', $tab . 'type');
$no = $p['no'];
$ac2 = $p['ac2'];
$num = 0;
$page = 1;
if (empty($ids)) {
$ids = $p['ids'];
$vid = $p['vid'];
$num = intval($p['num']);
$min = intval($p['min']);
$jump = $p['jump'];
$pagecount = $p['pagecount'];
$datacount = $p['datacount'];
$page = intval($p['pg']);
}
if (!empty($ids)) {
示例11: ob_implicit_flush
<?php
ob_implicit_flush(true);
ini_set('max_execution_time', '0');
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "../score/AutoDouBanParseScore.php";
$pagenum = be("all", "pagenum");
if (!isNum($pagenum)) {
$pagenum = 1;
} else {
$pagenum = intval($pagenum);
}
updateVodPic($pagenum);
writetofile("mac_cj_vod.txt", 'finish');
function updateVodPic($pagenum)
{
global $db;
$scoreDouban = new AutoDouBanParseScore();
$sql = "SELECT count(*) FROM ( SELECT m_name\nFROM mac_cj_vod\nWHERE m_pid =180 AND m_typeid =131\nGROUP BY m_name) as c";
$nums = $db->getOne($sql);
$app_pagenum = 10;
$pagecount = ceil($nums / $app_pagenum);
// $pagecount=2;
$flag = true;
for ($i = $pagenum; $i <= $pagecount && $flag; $i++) {
writetofile("mac_cj_vod.txt", 'check item for vod type{=}' . $nums . '{=}Total{=}' . $pagecount . '{=}' . $i);
$sql = "SELECT m_name, m_pic, m_pic_ipad, m_year,m_language \nFROM mac_cj_vod\nWHERE m_pid =180 \nAND m_typeid =131\nGROUP BY m_name order by m_name asc limit " . $app_pagenum * ($i - 1) . "," . $app_pagenum;
// var_dump($sql);
$rs = $db->query($sql);
$flag = parseVodPad($rs, $scoreDouban);
示例12: main
function main()
{
global $arrtype;
?>
<script language="javascript">
$(document).ready(function(){
$("#form2").validate({
rules:{
name:{
required:true,
stringCheck:true,
maxlength:64
},
parent_id:{
required:true
},
disp_order:{
number:true
},
type_desc:{
maxlength:254
},
type_key:{
maxlength:254
}
}
});
$("#form3").validate({
rules:{
t_type1:{
required:true
},
t_type2:{
required:true
}
}
});
$('#form1').form({
onSubmit:function(){
if(!$("#form1").valid()) {return false;}
},
success:function(data){
$.messager.alert('系统提示', data, 'info',function(){
location.href=location.href;
});
}
});
$('#form2').form({
onSubmit:function(){
if(!$("#form2").valid()) {return false;}
},
success:function(data){
$.messager.alert('系统提示', data, 'info');
}
});
$("#btnEdit").click(function(){
$("#form1").attr("action","?action=editall");
$("#form1").submit();
});
$("#btnAdd").click(function(){
$('#form2').form('clear');
$("#flag").val("add");
$('#win1').window('open');
});
$("#btnCancel").click(function(){
location.href= "admin_apk_category.php?updatecache=1";
});
$("#btnMove").click(function(){
$('#form3').form('clear');
$('#win2').window('open');
});
});
function ShowPDIV(i,p){
if($("#type_P_CID_"+i)[0].length==0){
var v = $("#type_H_V")[0].innerHTML.split('@|@');
$("#type_P_CID_"+i)[0].options[0] = new Option("作为顶级","0");
for(j=1;j<v.length;j++){
$("#type_P_CID_"+i)[0].options[j] = new Option(v[j].split('|=|')[1],v[j].split('|=|')[0]);
if(p==v[j].split('|=|')[0]) $("#type_P_CID_"+i)[0].options[j].selected = true;
}
}
$("#type_P_DIV_"+i)[0].style.display = ($("#type_P_DIV_"+i)[0].style.display == "none") ? "block" : "none";
}
function SelectPid(p,i){
window.location.href = '?action=editid&typeid='+i+'&t_pid='+p;
}
</script>
<form action="" method="post" id="form1" name="form1">
<table class="tb2">
<tr>
<td> </td>
<td width="35" align="center">编号</td>
<td width="15%">名称</td>
<td width="10%">关键字</td>
<td width="15%">描述</td>
<td width="5%">排序</td>
<td width="25%">操作</td>
</tr>
//.........这里部分代码省略.........
示例13: elseif
} elseif ($method == 'topic') {
$tpl->C["siteaid"] = 14;
$tpl->P['cp'] = 'vodtopic';
$tpl->P['cn'] = $tpl->P['id'] . '-' . $tpl->P['pg'] . '-' . $tpl->P['order'] . '-' . $tpl->P['by'];
echoPageCache($tpl->P['cp'], $tpl->P['cn']);
$tpl->P['vodtopicid'] = $tpl->P['id'];
$tpl->T = $MAC_CACHE['vodtopic'][$tpl->P['vodtopicid']];
if (!is_array($tpl->T)) {
showMsg("获取数据失败,请勿非法传递参数", "../");
}
$db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
$tpl->loadtopic('vod');
$tpl->pageshow();
} elseif ($method == 'search') {
$tpl->C["siteaid"] = 15;
$wd = trim(be("all", "wd"));
$wd = chkSql($wd);
if (!empty($wd)) {
$tpl->P["wd"] = $wd;
}
//if(empty($tpl->P["wd"]) && empty($tpl->P["ids"]) && empty($tpl->P["pinyin"]) && empty($tpl->P["starring"]) && empty($tpl->P["directed"]) && empty($tpl->P["area"]) && empty($tpl->P["lang"]) && empty($tpl->P["year"]) && empty($tpl->P["letter"]) && empty($tpl->P["tag"]) && empty($tpl->P["type"]) && empty($tpl->P["typeid"]) && empty($tpl->P["classid"]) ){ alert ("搜索参数不正确"); }
if ($tpl->P['pg'] == 1 && getTimeSpan("last_searchtime") < $MAC['app']['searchtime']) {
showMsg("请不要频繁操作,时间间隔为" . $MAC['app']['searchtime'] . "秒", MAC_PATH);
exit;
}
$tpl->P['cp'] = 'vodsearch';
$tpl->P['cn'] = urlencode($tpl->P['wd']) . '-' . $tpl->P['pg'] . '-' . $tpl->P['order'] . '-' . $tpl->P['by'] . '-' . $tpl->P['ids'] . '-' . $tpl->P['pinyin'] . '-' . $tpl->P['type'] . '-' . $tpl->P['year'] . '-' . $tpl->P['letter'] . '-' . $tpl->P['typeid'] . '-' . $tpl->P['classid'] . '-' . urlencode($tpl->P['area']) . '-' . urlencode($tpl->P['lang']) . '-' . urlencode($tpl->P['tag']) . '-' . urlencode($tpl->P['starring']) . '-' . urlencode($tpl->P['directed']);
echoPageCache($tpl->P['cp'], $tpl->P['cn']);
$tpl->P["where"] = '';
$tpl->P["des"] = '';
$db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
示例14: main
function main()
{
global $db, $cache;
$pagenum = be("get", "page");
if (isN($pagenum) || !isNum($pagenum)) {
$pagenum = 1;
}
if ($pagenum < 1) {
$pagenum = 1;
}
$pagenum = intval($pagenum);
$sql = "select * from {pre}cj_vod_projects ";
$rscount = $db->query($sql);
$nums = $db->num_rows($rscount);
//总记录数
$pagecount = ceil($nums / app_pagenum);
//总页数
$sql = $sql . "limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
$rs = $db->query($sql);
?>
<table border="0" cellpadding="3" cellspacing="1">
<tr>
<td>
菜单:<a href="collect_vod_manage.php?action=add">添加采集规则</a> | <a href="collect_vod_manage.php?action=upexp">导入采集规则</a>
</td>
</tr>
</table>
<form action="" method="post" name="form1">
<table class="collect_vod_manage tb">
<tr>
<td width="5%"> </td>
<td width="10%">项目名称</td>
<td width="10%">播放类型</td>
<td width="10%">入库分类</td>
<td width="20%">上次采集</td>
<td width="45%">操作</td>
</tr>
<?php
if (!$rs) {
?>
<tr><td align="center" colspan="7" >没有任何记录!</td></tr>
<?php
} else {
while ($row = $db->fetch_array($rs)) {
?>
<tr>
<td><input name="p_id[]" type="checkbox" id="p_id" value="<?php
echo $row["p_id"];
?>
" /></td>
<td><a href="?action=edit&p_id=<?php
echo $row["p_id"];
?>
"><?php
echo $row["p_name"];
?>
</a></td>
<td><?php
echo $row["p_playtype"];
?>
</td>
<td>
<?php
if ($row["p_classtype"] == 1) {
echo "<font color=red>自定义分类</font>";
} else {
$typearr = getValueByArray($cache[0], "t_id", $row["p_collect_type"]);
echo $typearr["t_name"];
}
?>
</td>
<td><?php
echo isToDay($row['p_time']);
?>
</td>
<td>
<A href="collect_vod_cj.php?ignoreExistM=true&p_id=<?php
echo $row["p_id"];
?>
">采集</A>|
<A href="collect_vod_cj.php?p_id=<?php
echo $row["p_id"];
?>
">采集(包括已经采集过)</A>|
<A href="?action=collectSimple&p_id=<?php
echo $row["p_id"];
?>
&p_name=<?php
echo $row["p_name"];
?>
">采集单个视频</A>|
<A href="?action=collectVideo&p_id=<?php
echo $row["p_id"];
?>
&p_name=<?php
echo $row["p_name"];
?>
">采集视频地址</A>|
<A href="?action=edit&p_id=<?php
//.........这里部分代码省略.........
示例15: main
function main()
{
global $db, $cache;
$tv_id = be("all", "tv_id");
$day = be("all", "day");
if (!isNum($tv_id)) {
$tv_id = 0;
} else {
$tv_id = intval($tv_id);
}
if (isN($day)) {
$day = date('Y-m-d', time());
}
$where = " 1=1 ";
$where .= " AND tv_id =" . $tv_id;
$where .= " AND day ='" . $day . "'";
$pagenum = be("all", "page");
if (!isNum($pagenum)) {
$pagenum = 1;
} else {
$pagenum = intval($pagenum);
}
if ($pagenum < 1) {
$pagenum = 1;
}
$sql = "SELECT count(*) FROM {pre}tv_program_item as a " . " where " . $where;
$nums = $db->getOne($sql);
$pagecount = ceil($nums / app_pagenum);
$sql1 = "SELECT * FROM {pre}tv_program_item where " . $where . " and play_time<='12:00' order by play_time asc ";
$sql2 = "SELECT * FROM {pre}tv_program_item where " . $where . " and play_time>'12:00' order by play_time asc ";
// var_dump($sql);
$rs1 = $db->query($sql1);
$rs2 = $db->query($sql2);
?>
<script language="javascript">
function filter(){
var tv_id=$("#tv_id").val();
var day =$("#date").val();
if(day ==''){
var url = "admin_program_items_day.php?tv_id="+tv_id+"&day="+day;
}else {
var url = "admin_program_items.php?tv_id="+tv_id+"&day="+day;
}
window.location.href=url;
}
function collecProgram(){
var tv_id=$("#tv_id").val();
var day =$("#date").val();
var url = "admin_program_items.php?action=collecProgram&tv_id="+tv_id+"&day="+day;
$.get(url,"", function(obj) {
alert(obj);
});
}
$(document).ready(function(){
$('#form1').form({
onSubmit:function(){
if(!$("#form1").valid()) {return false;}
},
success:function(data){
$.messager.alert('系统提示', data, 'info',function(){
location.href=location.href;
});
}
});
$("#btnDel").click(function(){
if(confirm('确定要删除吗')){
$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}vod_topic_items");
$("#form1").submit();
}
else{return false}
});
$("#btnEdit").click(function(){
$("#form1").attr("action","?action=editall");
$("#form1").submit();
});
$("#btnAdd").click(function(){
$('#form2').form('clear');
$("#flag").val("add");
$('#win1').window('open');
});
$("#btnAdd_down").click(function(){
$('#form2').form('clear');
$("#flag").val("add");
$('#win1').window('open');
});
$('#form2').form({
onSubmit:function(){
if(!$("#form2").valid()) {return false;}
},
success:function(data){
//.........这里部分代码省略.........