本文整理汇总了PHP中filtrate函数的典型用法代码示例。如果您正苦于以下问题:PHP filtrate函数的具体用法?PHP filtrate怎么用?PHP filtrate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filtrate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: exit
<?php
!function_exists('html') && exit('ERR');
$rsdb = $db->get_one("SELECT * FROM {$pre}article WHERE aid='{$id}'");
if (!$id) {
showerr("数据不存在");
}
if ($step == 2) {
$rs = $db->get_one("SELECT * FROM `{$pre}report` WHERE `ip`='{$onlineip}'");
if (!$web_admin && $timestamp - $rs[posttime] < 30) {
showerr("请30秒后再举报信息");
}
if (!$Type) {
showerr("请选择一个类型");
} elseif (strlen($myname) > 30) {
showerr("你的称呼不能大于30个字符");
}
$Title = "来自“{$webdb[webname]}”的邮件,你朋友“{$myname}”给你推荐了一篇精彩文章!!";
$rs[email] = $email;
$content = filtrate($content);
$Type = filtrate($Type);
$Content = str_replace("\n", "<br>", $Content);
$db->query("INSERT INTO `{$pre}report` ( `aid` , `type` , `uid` , `name` , `content` , `posttime` , `ip` ) VALUES ('{$id}','{$Type}','{$lfjuid}','{$myname}','{$content}','{$timestamp}','{$onlineip}')");
refreshto("{$webdb['www_url']}/", "谢谢你,举报本条信息!", 5);
}
require ROOT_PATH . "inc/head.php";
require html("report");
require ROOT_PATH . "inc/foot.php";
开发者ID:GHubgenius,项目名称:qbbj,代码行数:28,代码来源:report.php
示例2: die
<?php
if (!function_exists('html')) {
die('F');
}
require_once dirname(__FILE__) . "/googlemap.inc.php";
explain_url($city_id);
$title = filtrate($title);
$cityname || ($cityname = '北京');
eregi("^[a-z0-9 ]+\$", $cityname) || ($cityname = '中国' . $cityname);
//中文城市名要加上中国二字
print <<<EOT
<!DOCTYPE html>
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>谷歌地图位置显示 {$titleDB['title']}</title>
<link href="{$webdb['www_url']}/images/default/googlemap.css" rel="stylesheet" type="text/css" />
<SCRIPT LANGUAGE="JavaScript">
<!--
if('{$showDomain}'=='1'){
\tif('{$webdb['cookieDomain']}'!='')document.domain = '{$webdb['cookieDomain']}';
}else{
\twindow.onerror=function (){
\t\turl = '{$WEBURL}';
\t\turl +=url.indexOf('?')>0?'&':'?';
\t\tif('{$webdb['cookieDomain']}'!='')window.location.href=url+'showDomain=1';
\t\treturn true;
\t};
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:show_ggmaps.php
示例3: showerr
showerr("你的空间不足,上传失败,<A HREF='?uid={$lfjuid}'>点击查看你的空间容量信息</A>");
}
$array[updateTable] = 1;
//统计用户上传的文件占用空间大小
$filename = upfile(is_array($postfile) ? $_FILES[postfile][tmp_name] : $postfile, $array);
$icon = "icon/{$lfjuid}" . strtolower(strrchr($filename, "."));
@unlink(ROOT_PATH . "{$webdb['updir']}/{$icon}");
rename(ROOT_PATH . "{$webdb['updir']}/icon/{$filename}", ROOT_PATH . "{$webdb['updir']}/{$icon}");
$icon_array = getimagesize(ROOT_PATH . "{$webdb['updir']}/{$icon}");
if ($icon_array[0] > 150 || $icon_array[1] > 150) {
$icon_url = "{$webdb['www_url']}/{$webdb['updir']}/{$icon}";
}
}
if ($icon) {
$filetype = strtolower(strrchr($icon, "."));
$icon = filtrate($icon);
if ($filetype != '.gif' && $filetype != '.jpg') {
showerr("头像只能是.gif或.jpg格式");
}
}
//过滤不健康的字
$truename = replace_bad_word($truename);
$introduce = replace_bad_word($introduce);
$address = replace_bad_word($address);
if ($cityid) {
@extract($db->get_one("SELECT fup AS provinceid FROM {$pre}area WHERE fid='{$cityid}'"));
}
$array = array("uid" => $lfjuid, "username" => $lfjid, "email" => $email, "password" => $password, "icon" => $icon, "sex" => $sex, "bday" => $bday, "introduce" => $introduce, "oicq" => $oicq, "msn" => $msn, "homepage" => $homepage, "address" => $address, "postalcode" => $postalcode, "mobphone" => $mobphone, "telephone" => $telephone, "idcard" => $idcard, "truename" => $truename, "provinceid" => $provinceid, "cityid" => $cityid);
if ($lfjdb[email_yz] && $lfjdb[email] != $email) {
if (!$webdb[EditYzEmail]) {
showerr("你不可以再修改邮箱,因为已经审核过了.");
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:userinfo.php
示例4: die
}
$yz = 1;
if (!$web_admin) {
if ($webdb[Info_PostCommentType] == 2) {
die('管理员设置不可以发表评论');
} elseif ($webdb[Info_PostCommentType] == 1 && !$lfjuid) {
die('管理员设置游客不可以发表评论');
}
if ($webdb[Info_PassCommentType] == 2) {
$yz = 0;
} elseif ($webdb[Info_PassCommentType] == 1 && !$lfjuid) {
$yz = 0;
}
}
$username = filtrate($username);
$content = filtrate($content);
$content = str_replace("@@br@@", "<br>", $content);
//过滤不健康的字
$username = replace_bad_word($username);
$content = replace_bad_word($content);
//处理有人恶意用他人帐号做署名的
if ($username) {
$rs = $db->get_one(" SELECT {$TB['uid']} AS uid FROM {$TB['table']} WHERE {$TB['username']}='{$username}' ");
if ($rs[uid] != $lfjuid) {
$username = "匿名";
}
}
$rss = $db->get_one(" SELECT * FROM {$_pre}content WHERE id='{$id}' ");
if (!$rss) {
die("原数据不存在");
}
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:comment_ajax.php
示例5: dirname
require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == 'add' && $Apower[membermenu_list]) {
if ($gid == 2) {
showmsg("不能是游客组");
}
if (!$postdb[name]) {
showmsg("名称不能为空");
}
if ($fid && !$postdb['linkurl']) {
showmsg("链接地址不能为空");
}
if (!$addsort && !$fid) {
showmsg("请选择一个分类");
}
$postdb[name] = filtrate($postdb[name]);
$postdb[linkurl] = filtrate($postdb[linkurl]);
$db->query("INSERT INTO `{$pre}admin_menu` (`fid`, `name`, `linkurl`, `color`, `target`, `groupid`, `list`) VALUES ('{$fid}', '{$postdb['name']}', '{$postdb['linkurl']}', '{$postdb['color']}', '{$postdb['target']}','-{$gid}', '{$postdb['list']}')");
jump("添加成功", "?lfj={$lfj}&job=list&gid={$gid}", 1);
} elseif ($action == 'delete' && $Apower[membermenu_list]) {
$rs = $db->get_one("SELECT * FROM {$pre}admin_menu WHERE fid='{$id}'");
if ($rs) {
showmsg("请先删除子菜单或者把子菜单移走.才能删除此菜单");
}
$db->query("DELETE FROM `{$pre}admin_menu` WHERE id='{$id}'");
jump("删除成功", "?lfj={$lfj}&job=list&gid={$gid}", 1);
} elseif ($action == "editlist" && $Apower[membermenu_list]) {
foreach ($order as $key => $value) {
$db->query("UPDATE {$pre}admin_menu SET list='{$value}' WHERE id='{$key}'");
}
jump("修改成功", "?lfj={$lfj}&job=list&gid={$gid}", 1);
} elseif ($job == "sysmenu" && $Apower[membermenu_list]) {
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:memberguidemenu.php
示例6: header
header("location:{$detail['showurl']}");
exit;
}
}
}
/**
*文章检查
**/
check_article($rsdb);
//统计点击次数
$db->query("UPDATE {$pre}article{$erp} SET hits=hits+1,lastview='{$timestamp}' WHERE aid='{$aid}'");
//SEO
$titleDB[title] = filtrate(strip_tags("{$rsdb['title']} - {$fidDB['name']} - {$webdb['webname']}"));
$titleDB[keywords] = filtrate($rsdb[keywords]);
$rsdb[description] || ($rsdb[description] = get_word(preg_replace("/(<([^<]+)>|\t| |\n)/is", "", $rsdb[content]), 250));
$titleDB[description] = filtrate($rsdb[description]);
//文章风格
$STYLE = $rsdb[style] ? $rsdb[style] : ($fidDB[style] ? $fidDB[style] : $STYLE);
//相关栏目名称模板
if (is_file(html("{$webdb['SideSortStyle']}"))) {
$sortnameTPL = html("{$webdb['SideSortStyle']}");
} else {
$sortnameTPL = html("side_sort/0");
}
/**
*模板选择
**/
//类似大旗那样,框架网页模板
if ($rsdb[iframeurl]) {
$head_tpl = "template/default/none.htm";
$main_tpl = "template/default/none.htm";
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:bencandy.php
示例7: showerr
} else {
showerr("还没通过审核");
}
}
/**
*内容页的风格优先于栏目的风格,栏目的风格优先于系统的风格
**/
if ($rsdb[style]) {
$STYLE = $rsdb[style];
} elseif ($fidDB[style]) {
$STYLE = $fidDB[style];
}
//SEO
$titleDB[title] = filtrate(strip_tags("{$rsdb['title']} - {$city_DB[name][$city_id]}{$fidDB['name']} - {$webdb['Info_webname']}"));
$titleDB[keywords] = filtrate(strip_tags($rsdb[keywords]));
$titleDB[description] = filtrate(get_word(strip_tags($rsdb[content]), 200)) . filtrate(strip_tags("{$fidDB['metadescription']} {$webdb['Info_metadescription']}"));
/**
*栏目指定了哪些用户组才能看信息内容
**/
if ($fidDB[allowviewcontent]) {
if (!$web_admin && !in_array($groupdb[gid], explode(",", $fidDB[allowviewcontent]))) {
if (!$lfjid || !in_array($lfjid, explode(",", $fidDB[admin]))) {
showerr("你所在用户组,无权浏览");
}
}
}
/**
*对信息内容字段的处理
**/
$Module_db->hidefield = true;
$Module_db->classidShowAll = true;
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:bencandy.php
示例8: showerr
showerr('栏目不存在!');
}
//SEO
$titleDB[title] = "{$fidDB['name']} - {$webdb['Info_webname']}";
/**
*模型参数配置文件
**/
$field_db = $module_DB[$fidDB[mid]][field];
if (!$lfjuid) {
showerr('你还没有登录!');
} elseif ($fidDB[type]) {
showerr("大分类,不允许发表内容");
}
if ($action == "postnew" || $action == "edit") {
$postdb['title'] = filtrate($postdb['title']);
$postdb['keywords'] = filtrate($postdb['keywords']);
}
/**处理提交的新发表内容**/
if ($action == "postnew") {
/*验证码处理*/
if (!$web_admin) {
if (!check_imgnum($yzimg)) {
showerr("验证码不符合,发布失败");
}
}
if (!$postdb[title]) {
showerr("标题不能为空");
} elseif (strlen($postdb[title]) > 80) {
showerr("标题不能大于40个汉字.");
}
if (eregi("[a-z0-9]{15,}", $postdb[title])) {
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:post.php
示例9: checkpost
function checkpost($field_db, &$postdb, $rsdb = '')
{
foreach ($field_db as $key => $rs) {
//检查必填项目
if ($rs[mustfill] == 1) {
if (is_array($postdb[$rs[field_name]])) {
if (implode('', $postdb[$rs[field_name]]) === '') {
showerr("{$rs['title']},你必须选择一项");
}
} elseif ($postdb[$rs[field_name]] === '' || !isset($postdb[$rs[field_name]])) {
showerr("{$rs['title']},不能为空");
}
}
//检查是否是整数
if ($rs[field_type] == 'int' && $postdb[$rs[field_name]] && !ereg("^[-0-9]+\$", $postdb[$rs[field_name]])) {
showerr("{$rs['title']} 必须为整数");
}
//检查是否超出字数
if ($rs[field_type] == 'varchar') {
$rs[field_leng] = $rs[field_leng] ? $rs[field_leng] : 255;
if (strlen($postdb[$rs[field_name]]) > $rs[field_leng]) {
showerr("{$rs['title']} 不能超过 {$rs[field_leng]} 个字");
}
}
if ($rs[field_type] == 'int') {
$rs[field_leng] = $rs[field_leng] ? $rs[field_leng] : 10;
if (strlen($postdb[$rs[field_name]]) > $rs[field_leng]) {
showerr("{$rs['title']} 不能超过 {$rs[field_leng]} 个字");
}
}
if ($rs[form_type] == 'upmorefile' || $rs[form_type] == 'upmorepic') {
//修改的时候
$array = array();
if ($rsdb[$rs[field_name]]) {
$detail = explode("\n", $rsdb[$rs[field_name]]);
foreach ($detail as $value) {
$d = explode("@@@", $value);
$array[] = $d[0];
}
}
foreach ($postdb[$rs[field_name]][url] as $key => $value) {
if (!$value) {
continue;
}
//修改的时候.就不需要
if (!@in_array($value, $array)) {
//$this->cut_img($value,$postdb); //裁个小图出来
//$this->img_water($value); //加水印
}
//标题介绍图
if (!$postdb[picurl]) {
$postdb[picurl] = $value;
$postdb[ispic] = 1;
}
$_array[] = "{$value}@@@{$postdb[$rs[field_name]][name][$key]}@@@{$postdb[$rs[field_name]][fen][$key]}";
}
$postdb[$rs[field_name]] = implode("\n", $_array);
}
if ($rs[form_type] == 'ieedit' || $rs[form_type] == 'ieeditsimp') {
global $lfjdb, $_pre;
$postdb[$key] = str_replace("<img ", "<img onload=\\'if(this.width>600)makesmallpic(this,600,800);\\' ", $postdb[$key]);
$postdb[$key] = move_attachment($lfjdb[uid], $postdb[$key], "{$_pre}/" . date("W"));
$postdb[$key] = En_TruePath($postdb[$key]);
//过滤js代码
$postdb[$key] = preg_replace('/javascript/i', 'java script', $postdb[$key]);
//过滤框架代码
$postdb[$key] = preg_replace('/<iframe ([^<>]+)>/i', '<iframe \\1>', $postdb[$key]);
} elseif ($rs[form_type] == 'classdb') {
$postdb[$key] = filtrate(implode("/#/", $postdb[$key]));
} else {
if (is_array($postdb[$key])) {
$postdb[$key] = implode("/", $postdb[$key]);
}
//过滤不安全的字符
$postdb[$key] = filtrate($postdb[$key]);
}
if (strlen($postdb[$key]) > 30000) {
showerr("内容不能大于1.5万个汉字");
}
}
}
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:81,代码来源:module.class.php
示例10: error_reporting
@(include_once ROOT_PATH . 'inc/biz/function.php');
if (!$webdb['debug']) {
error_reporting(0);
}
@(include_once ROOT_PATH . "data/module.php");
@(include_once ROOT_PATH . "data/htmltype.php");
@(include_once ROOT_PATH . "data/showhtmltype.php");
require_once ROOT_PATH . "data/mysql_config.php";
require_once ROOT_PATH . 'inc/mysql_class.php';
require_once ROOT_PATH . 'inc/class.user.php';
require_once ROOT_PATH . 'data/level.php';
$timestamp = time() + $webdb['time'] * 60;
$_POST[loginname] && ($_POST[loginname] = filtrate($_POST[loginname]));
$_POST[loginpwd] && ($_POST[loginpwd] = filtrate($_POST[loginpwd]));
$FROMURL = filtrate($FROMURL);
$WEBURL = filtrate($WEBURL);
/**
*封IP
**/
$IS_BIZ && Limt_IP('ForbidIp');
list($usr_sid, $usr_oltime, $usr_lastvist, $usr_lasturl) = explode("\t", get_cookie('USR'));
if (!$usr_sid) {
$usr_sid = rands(8);
}
unset($_ENV, $HTTP_COOKIE, $HTTP_ENV_VARS, $_REQUEST, $HTTP_POST_VARS, $HTTP_GET_VARS, $HTTP_POST_FILES, $HTTP_COOKIE_VARS);
$db = new MYSQL_DB();
unset($web_admin, $sort_admin, $lfjid, $lfjuid, $lfjpwd, $lfjdb, $groupdb);
$usr_oltime = intval($usr_oltime);
/*用户登录模块*/
if ($webdb[passport_type] && is_file(ROOT_PATH . "inc/passport/{$webdb[passport_type]}.php")) {
require_once ROOT_PATH . "inc/passport/{$webdb[passport_type]}.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:common.inc.php
示例11: register_user
function register_user($array)
{
global $webdb;
if ($this->get_passport($array[username], 'name')) {
return '当前用户已经存在了';
}
if (!$array[username]) {
return '用户名不能为空';
} elseif (!$array[email]) {
return '邮箱不能为空';
} elseif (!$array[password]) {
return '密码不能为空';
} elseif (strlen($array[username]) > 15 || strlen($array[username]) < 3) {
return '用户名不能小于3个字节或大于15个字节';
} elseif (strlen($array[password]) > 30 || strlen($array[password]) < 5) {
return '密码不能小于5个字符或大于30个字符';
} elseif (!ereg("^[-a-zA-Z0-9_\\.]+\\@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}\$", $array[email])) {
return '邮箱不符合规则';
} elseif ($webdb[emailOnly] && $this->check_emailexists($array[email])) {
return '当前邮箱已被注册了,请更换一个邮箱!';
}
$S_key = array('|', ' ', '', "'", '"', '/', '*', ',', '~', ';', '<', '>', '$', "\\", "\r", "\t", "\n", "`", "!", "?", "%", "^");
foreach ($S_key as $value) {
if (strpos($array[username], $value) !== false) {
return '用户名中包含有禁止的符号“{$value}”';
}
if (strpos($password, $value) !== false) {
return '密码中包含有禁止的符号“{$value}”';
}
}
foreach ($array as $key => $value) {
$array[$key] = filtrate($value);
}
$array[uid] = $this->register_passport($array);
$this->register_data($array);
return $array[uid];
}
开发者ID:GHubgenius,项目名称:qbbj,代码行数:37,代码来源:class.user.php
示例12: dirname
<?php
require dirname(__FILE__) . "/" . "global.php";
require_once ROOT_PATH . "inc/class.inc.php";
$Guidedb = new Guide_DB();
$Guidedb->mid = $mid;
$keyword = str_replace("%", "\\%", $keyword);
$keyword = trim($keyword);
$rows = 20;
if (($_GET[type] || $_POST[type]) && !$keyword) {
showerr("关键字不能为空");
}
if ($_GET[keyword] || $_POST[keyword]) {
$type = filtrate($type);
$search_module = 0;
if (!$type) {
$type = 'title';
}
if (!$web_admin) {
if (!$groupdb[SearchArticleType]) {
showerr("你所在用户组,无权使用搜索!");
} elseif ($type == 'content' && $groupdb[SearchArticleType] != 2) {
showerr("你所在用户组,无权搜索文章内容!");
}
}
if ($_POST[keyword] && $timestamp - $_COOKIE[searchTime] < 3) {
showerr("3秒钟内,请不要重复提交查询");
}
setcookie("searchTime", $timestamp, $timestamp + 3);
$SQL = " A.yz=1 ";
if ($mid == -1) {
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:search.php
示例13: move_attachment
$postdb[ispic] = 0;
}
//图片目录转移
$postdb[content] = move_attachment($lfjdb[uid], $postdb[content], "{$_pre}/{$fid}");
//获取远程图片
$postdb[content] = get_outpic($postdb[content], $fid, $GetOutPic);
$postdb[content] = En_TruePath($postdb[content]);
$postdb[content] = preg_replace('/javascript/i', 'java script', $postdb[content]);
//过滤js代码
$postdb[content] = preg_replace('/<iframe ([^<>]+)>/i', '<iframe \\1>', $postdb[content]);
//过滤框架代码
foreach ($postdb as $key => $value) {
if ($key == 'content') {
continue;
}
$postdb[$key] = filtrate($value);
}
$db->query("UPDATE `{$_pre}content` SET title='{$postdb['title']}',keywords='{$postdb['keywords']}',picurl='{$postdb['picurl']}',ispic='{$postdb['ispic']}',city_id='{$city_id}',iframeurl='{$postdb['iframeurl']}',jumpurl='{$postdb['jumpurl']}',author='{$postdb['author']}',copyfrom='{$postdb['copyfrom']}',copyfromurl='{$postdb['copyfromurl']}' WHERE id='{$id}'");
$db->query("UPDATE `{$_pre}content_1` SET content='{$postdb['content']}' WHERE id='{$id}'");
refreshto("list.php?job=list", "<a href='{$Mdomain}/bencandy.php?fid={$fid}&id={$id}&rid={$rid}' target='_blank'>查看效果</a> <a href='list.php?job=list'>返回列表</a> <a href='{$FROMURL}'>继续修改</a>", 600);
} else {
$atc = "postnew";
$isiframe[0] = " checked ";
require ROOT_PATH . "member/head.php";
require dirname(__FILE__) . "/template/post.htm";
require ROOT_PATH . "member/foot.php";
}
//采集外部图片
function get_outpic($str, $fid = 0, $getpic = 1)
{
global $webdb, $_pre;
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:post.php
示例14: move_attachment
/*缩略图处理*/
if ($postdb[picurl] && !strstr($postdb[picurl], "http://")) {
//图片目录转移
move_attachment($lfjdb[uid], tempdir($postdb[picurl]), "special/{$postdb['fid']}");
if (file_exists(ROOT_PATH . "{$webdb['updir']}/special/{$postdb['fid']}/" . basename($postdb[picurl]))) {
$postdb[picurl] = "special/{$postdb['fid']}/" . basename($postdb[picurl]);
}
$water_info = getimagesize(ROOT_PATH . "{$webdb['updir']}/{$postdb['picurl']}");
if ($webdb[if_gdimg] && $water_info[0] > 150) {
gdpic(ROOT_PATH . "{$webdb['updir']}/{$postdb['picurl']}", ROOT_PATH . "{$webdb['updir']}/{$postdb['picurl']}", 200, 150);
}
}
$postdb[title] = filtrate($postdb[title]);
$postdb[content] = filtrate($postdb[content]);
$postdb[picurl] = filtrate($postdb[picurl]);
$postdb[banner] = filtrate($postdb[banner]);
$postdb[allowpost] = @implode(",", $postdb[allowpost]);
}
}
if ($job == 'listsp') {
$rows = 10;
if ($page < 1) {
$page = 1;
}
$min = ($page - 1) * $rows;
$showpage = getpage("{$pre}special", "WHERE uid='{$lfjuid}'", "?job=listsp", $rows);
$query = $db->query("SELECT S.*,F.name AS fname FROM {$pre}special S LEFT JOIN {$pre}spsort F ON S.fid=F.fid WHERE S.uid='{$lfjuid}' ORDER BY id DESC LIMIT {$min},{$rows}");
while ($rs = $db->fetch_array($query)) {
$detail = explode(",", $rs[aids]);
$rs[NUM] = count($detail);
$rs[picurl] = tempdir($rs[picurl]);
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:special.php
示例15: label_set_rs
function label_set_rs($format, $rs)
{
global $db, $pre, $timestamp, $webdb, $TB_url;
//分类的话,对于分表的情况,要特别处理,不支持其它频道调用,会出错
if ($format[SYS] == 'fenlei' && !$rs[posttime]) {
global $Fid_db;
$_erp = $Fid_db[tableid][$rs[fid]];
$rs = $db->get_one("SELECT * FROM {$pre}{$format[wninfo]}content{$_erp} WHERE id='{$rs['id']}' ");
}
//读取自定义字段的表,方便调用,如果声明了noReadMid就不要读了
if ($format[wninfo] && $rs[mid] && !$format[noReadMid]) {
$_rss = $db->get_one("SELECT * FROM {$pre}{$format[wninfo]}content_{$rs[mid]} WHERE id='{$rs['id']}' ");
$_rss && ($rs = $rs + $_rss);
//文章要读取自定义字段的表,方便调用
} elseif ($format[SYS] == 'artcile' && $rs[mid]) {
$_rss = $db->get_one("SELECT * FROM {$pre}article_content_{$rs[mid]} WHERE aid='{$rs['aid']}' ");
$_rss && ($rs = $rs + $_rss);
}
//扩展接口,少用
if ($format[eval_code]) {
eval($format[eval_code]);
}
//附件处理
if ($format[SYS] == 'pwbbs') {
//隐藏或出售贴
if ($ifhide || strstr($rs[content], '[sell=')) {
$rs[content] = '******';
}
$rs[content] = preg_replace("/\\[([^\\]]+)\\]/is", "", $rs[content]);
global $db_attachname;
$rs[picurl] = '';
if ($rs[attachurl]) {
//兼容旧版与非主题有图片的.
if (is_file(ROOT_PATH . "{$webdb['passport_path']}/{$db_attachname}/thumb/{$rs['attachurl']}")) {
$rs[picurl] = "{$webdb['passport_url']}/{$db_attachname}/thumb/{$rs['attachurl']}";
} else {
$rs[picurl] = "{$webdb['passport_url']}/{$db_attachname}/{$rs['attachurl']}";
}
}
$dfont = explode("~", $rs[titlefont]);
$rs[titlecolor] = $dfont[0];
} elseif ($format[SYS] == 'dzbbs') {
$rs[content] = preg_replace("/\\[([^\\]]+)\\]/is", "", $rs[content]);
global $_DCACHE;
$rs[picurl] = '';
$rs[attachment] && ($rs[picurl] = "{$webdb['passport_url']}/{$_DCACHE[settings][attachurl]}/{$rs['attachment']}");
}
$rs[full_time] = $rs[posttime];
$rs[full_title] = $rs[title];
//内容
$rs[description] && ($rs[content] = $rs[description]);
$rs[content] = preg_replace('/<([^<]*)>/is', "", $rs[content]);
//把HTML代码过滤掉
$rs[content] = preg_replace('/ | | /is', "", $rs[content]);
//把多余的空格去除掉
$rs[full_content] = $rs[content];
$rs[content] = get_word($rs[content], $format[content_num]);
//标题样式
$rs[fontweight] = $rs[fontcolor] = '';
$rs[fonttype] == 1 && ($rs[fontweight] = 'font-weight:bold;');
$rs[titlecolor] && ($rs[fontcolor] = "color:{$rs['titlecolor']};");
//标题
$rs[smalltitle] && ($rs[title] = $rs[smalltitle]);
//如果有简短标题的话,就使用简短标题
$rs[title] = preg_replace('/<([^<]*)>/is', "", $rs[title]);
$rs[title] = get_word($rs[title], $format[titlenum], $format[titleflood]);
if (!$format[timeformat]) {
$format[timeformat] = "Y/m/d";
}
$rs[posttime] = date($format[timeformat], $rs[posttime]);
if ($rs[picurl]) {
$rs[picurl] = filtrate($rs[picurl]);
$rs[picurl] = tempdir($rs[picurl]);
//4:3的图
$rs[picurl2] = "{$rs['picurl']}.jpg";
//3:4的图
$rs[picurl3] = "{$rs['picurl']}.jpg.jpg";
//1:1的图
} else {
$rs[picurl2] = $rs[picurl3] = "";
}
//最新文章
if ($timestamp - $rs[full_time] < $format[newhour] * 3600) {
$rs['new'] = "<img src='{$webdb['www_url']}/images/default/new.gif' border=0>";
} else {
$rs['new'] = "";
}
//热门文章
if ($format[hothits] && $rs[hits] > $format[hothits]) {
$rs[hot] = "<img src='{$webdb['www_url']}/images/default/hot.gif' border=0>";
} else {
$rs[hot] = "";
}
//V6以前的版本需要用到
if ($format[SYS] == 'artcile') {
$rs[id] = $rs[aid];
}
//主要是针对$url,$listurl这两个地址得到其真实网址
$detail = make_ture_path($format, $rs);
$rs[tpl_1code] = $detail[tpl_1code];
//.........这里部分代码省略.........
开发者ID:GHubgenius,项目名称:qbbj,代码行数:101,代码来源:label_funcation.php
示例16: member_field
function member_field($array)
{
$post_tpl = "<!--\r\n<?php\r\nprint <<<EOT\r\n--> \r\n<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\"><tr><td width='28%'></td><td width='72%'></td></tr>";
$show_tpl = "<!--\r\n<?php\r\nprint <<<EOT\r\n--> \r\n<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">";
foreach ($array as $key => $rs) {
if ($rs[mustfill]) {
$namedb[] = filtrate($rs[title]);
$iddb[] = "atc_{$rs[field_name]}";
}
$post_tpl .= make_post_table($rs);
$show_tpl .= "<tr> <td style='border-bottom:1px dotted #ccc;'>{$rs[title]}:</td> <td style='border-bottom:1px dotted #ccc;'>{\$rsdb[{$rs[field_name]}]} {$rs[form_units]} </td></tr>";
}
if ($namedb) {
$_name = implode(",", $namedb);
$_id = implode(",", $iddb);
$post_tpl = str_replace("<table", "<table onmouseover=\"ckregdata('{$_id}','{$_name}');\"", $post_tpl);
}
$post_tpl .= "</table>\r\n<!--\r\nEOT;\r\n?>-->";
$show_tpl .= "</table>\r\n<!--\r\nEOT;\r\n?>-->";
write_file(ROOT_PATH . "template/default/regfield_show.htm", $show_tpl);
write_file(ROOT_PATH . "template/default/regfield.htm", $post_tpl);
}
开发者ID:GHubgenius,项目名称:qbbj,代码行数:22,代码来源:regfield.php
示例17: while
if ($job) {
$query = $db->query(" SELECT * FROM {$_pre}config ");
while ($rs = $db->fetch_array($query)) {
$webdb[$rs[c_key]] = $rs[c_value];
}
}
if ($job == "label") {
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=../{$dirname}/index.php?jobs=show'>";
exit;
} elseif ($job == "config") {
$showNoPassComment[intval($webdb[showNoPassComment])] = ' checked ';
$webdb[Info_webOpen] ? $Info_webOpen1 = 'checked' : ($Info_webOpen0 = 'checked');
$Info_webOpen[intval($webdb[Info_webOpen])] = ' checked ';
$yzImgGuestBook[intval($webdb[yzImgGuestBook])] = ' checked ';
$viewNoPassGuestBook[intval($webdb[viewNoPassGuestBook])] = ' checked ';
$ifOpenGuestBook[intval($webdb[ifOpenGuestBook])] = ' checked ';
$groupPassPassGuestBook = group_box("webdbs[groupPassPassGuestBook]", explode(",", $webdb[groupPassPassGuestBook]));
$module_close[intval($webdb[module_close])] = " checked ";
get_admin_html('config');
} elseif ($action == "config") {
if (isset($webdbs[Info_webadmin])) {
$webdbs[Info_webadmin] = filtrate($webdbs[Info_webadmin]);
$db->query("UPDATE {$pre}module SET adminmember='{$webdbs['Info_webadmin']}' WHERE id='{$webdb['module_id']}'");
}
if (isset($webdbs[Info_weburl])) {
$webdbs[Info_weburl] = filtrate($webdbs[Info_weburl]);
$db->query("UPDATE {$pre}module SET domain='{$webdbs['Info_weburl']}' WHERE id='{$webdb['module_id']}'");
}
module_write_config_cache($webdbs);
refreshto($FROMURL, "修改成功");
}
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:center.php
示例18: elseif
} elseif ($job == 'send') {
if ($step == 2) {
$rsdb = $userDB->get_passport($touser, 'name');
if (!$rsdb) {
showerr("当前用户不存在");
}
if (!$title) {
showerr("标题不能为空");
}
if (strlen($array[title]) > 100) {
showerr("标题太长了!");
}
$array[touid] = $rsdb[uid];
$array[fromuid] = $lfjuid;
$array[fromer] = $lfjid;
$array[title] = filtrate($title);
//针对火狐浏览器做的处理
$postdb[content] = str_replace("=\\\"../{$webdb['updir']}/", "=\\\"{$webdb['www_url']}/{$webdb['updir']}/", $postdb[content]);
$postdb[content] = preg_replace('/javascript/i', 'java script', $postdb[content]);
$postdb[content] = preg_replace('/<(script)([^<>]*)>/i', '<\\1\\2>', $postdb[content]);
$postdb[content] = preg_replace('/<iframe ([^<>]+)>/i', '<iframe \\1>', $postdb[content]);
$array[content] = stripslashes($postdb[content]);
$array[content] = En_TruePath($array[content], 1);
pm_msgbox($array);
refreshto("?job=list", "发送成功", 1);
}
if ($uid) {
$rsdb = $userDB->get_passport($uid);
$username = $rsdb[username];
}
require dirname(__FILE__) . "/" . "head.php";
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:pm.php
示例19: dirname
<?php
require_once dirname(__FILE__) . "/" . "global.php";
$etype = $etype ? 'simple' : 'full';
$_GET[id] = filtrate($_GET[id]);
print <<<EOT
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>Æ벩Õûվϵͳ</title>
</head>
<body leftmargin="0" topmargin="0">
<SCRIPT LANGUAGE="JavaScript">
<!--
var bokecc_id='{$webdb['bokecc_id']}';
var KE_EDITOR_TYPE = "{$etype}";
//-->
</SCRIPT>
<script type="text/javascript" src="{$webdb['www_url']}/ewebeditor/KindEditor.js"></script>
<input type="hidden" name="content" id="content">
<script type="text/javascript">
var editor = new KindEditor("editor");
editor.hiddenName = "content";
editor.skinPath = "{$webdb['www_url']}/ewebeditor/skins/default/";
editor.iconPath = "{$webdb['www_url']}/images/default/faceicon/";
editor.imageAttachPath = "upload_files";
editor.imageUploadCgi = "upfile_eweb.php";
editor.cssPath = "{$webdb['www_url']}/ewebeditor/common.css";
editor.editorWidth = "100%";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:kindeditor.php
示例20: upfile
$array[updateTable] = 1;
//统计用户上传的文件占用空间大小
$filename = upfile($postfile, $array);
$postdb[logo] = "friendlink/{$filename}";
}
}
if ($postdb[logo] && !eregi("(gif|jpg|png)\$", $postdb[logo])) {
showerr("LOGO,只能上传GIF,JPG,PNG格式的文件,你不能上传此文件:{$array['name']}");
}
if (!strstr($postdb[url], 'htttp://')) {
$postdb[url] = "htttp://" . $postdb[url];
}
$postdb[name] = filtrate($postdb[name]);
$postdb[url] = filtrate($postdb[url]);
$postdb[descrip] = filtrate($postdb[descrip]);
$postdb[logo] = filtrate($postdb[logo]);
}
if ($action == 'reg') {
if (!$lfjid) {
showerr('请先登录');
}
$db->query("INSERT INTO `{$pre}friendlink` (`name` , `url` ,`fid` , `logo` , `descrip` , `list`,ifhide,yz,iswordlink,uid,username ) VALUES ('{$postdb['name']}','{$postdb['url']}','{$postdb['fid']}','{$postdb['logo']}','{$postdb['descrip']}','0','1','0','0','{$lfjuid}','{$lfjid}')");
refreshto("?", "你的申请资料已经提交成功,请等待管理员审核后,才可以显示出来", '10');
} else {
$select_fid = select_fsort("postdb[fid]", "");
require ROOT_PATH . "inc/head.php";
require html("friendlink");
require ROOT_PATH . "inc/foot.php";
}
function select_fsort($name, $ckfid)
{
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:friendlink.php
注:本文中的filtrate函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论