本文整理汇总了PHP中Import::gz_iconv方法的典型用法代码示例。如果您正苦于以下问题:PHP Import::gz_iconv方法的具体用法?PHP Import::gz_iconv怎么用?PHP Import::gz_iconv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Import
的用法示例。
在下文中一共展示了Import::gz_iconv方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax_getcategoodslist
function ajax_getcategoodslist($w = array())
{
$err = 0;
$json = Import::json();
$result = array('error' => $err, 'message' => '');
if (empty($w)) {
$result['error'] = 2;
$result['message'] = '传送的数据为空!';
die($json->encode($result));
}
$wobj = $json->decode($w);
//反json ,返回值为对象
$page = $wobj->page;
if (!$page) {
$page = 1;
}
$cid = $wobj->cid;
if (!$cid) {
$cid = 0;
}
$bid = $wobj->bid;
if (!$bid) {
$bid = 0;
}
$price = $wobj->price;
if (!$price) {
$price = "";
}
$order_type = $wobj->order;
if (!$order_type) {
$order_type = "goods_id";
}
$keyword = $wobj->keyword;
if (!$keyword) {
$keyword = "";
}
$sort_type = $wobj->sorts;
if (empty($sort_type)) {
$sort_type = "DESC";
}
$list = $wobj->limit;
if (!$list) {
$list = 40;
}
if (!empty($keyword) && !(preg_match('/^.*$/u', $keyword) > 0)) {
$keyword = Import::gz_iconv()->ec_iconv('GB2312', 'UTF8', $keyword);
//编码转换
}
$rt['thiscid'] = $cid;
$rt['thisbid'] = $bid;
$rt['price'] = $price;
$rt['page'] = $page;
$rt['sort'] = $sort_type;
$rt['order'] = $order_type;
$rt['limit'] = $list;
//当前分类的基本信息
if ($cid > 0) {
$sql = "SELECT * FROM `{$this->App->prefix()}goods_cate` WHERE cat_id='{$cid}' LIMIT 1";
$rt['cateinfo'] = $this->App->findrow($sql);
} else {
$rt['cateinfo'] = array();
//查找时没有cid
}
//品牌信息
if ($bid > 0) {
$sql = "SELECT brand_name FROM `{$this->App->prefix()}brand` WHERE brand_id='{$bid}' LIMIT 1";
$rt['brandinfo']['brand_name'] = $this->App->findvar($sql);
} else {
$rt['brandinfo']['brand_name'] = "";
}
//显示方式
if (!isset($_COOKIE['DISPLAY_TYPE']) || empty($_COOKIE['DISPLAY_TYPE']) || !in_array($_COOKIE['DISPLAY_TYPE'], array('list', 'text'))) {
$rt['display'] = 'text';
} else {
$rt['display'] = $_COOKIE['DISPLAY_TYPE'];
}
//start 当前位置
$rt['hear'] = array();
$perend_id = 0;
$hear[] = '<a href="' . SITE_URL . '">首页</a>';
$hear[] = '<a href="' . get_url('商品中心', 0, SITE_URL . "costume.php", 'goodscate', array('catalog', 'index')) . '">商品中心</a>';
if ($cid > 0) {
$rts_ = $this->get_goods_parent_cats($cid);
//父类ID
$rts = Import::basic()->array_sort($rts_, 'cat_id');
//根据cat_id排序
if (!empty($rts)) {
$perend_id = $rts[count($rts) - 1]['cat_id'];
foreach ($rts as $rows) {
$hear[] = '<a href="' . get_url($rows['cat_name'], $rows['cat_id'], "costume.php?cid=" . $rows["cat_id"], 'goodscate', array('catalog', 'index', $row['cat_id'])) . '">' . $rows['cat_name'] . '</a>';
}
}
unset($rts, $rts_);
} elseif ($bid > 0) {
//品牌
$hear[] = '<a href="' . SITEURL . 'brand/">品牌中心</a>';
$hear[] = '<a href="' . get_url($rt['brandinfo']['brand_name'], $rt['brandinfo']['brand_id'], "costume.php?bid=" . $rt['brandinfo']['brand_id'], 'brand') . '">' . $rt['brandinfo']['brand_name'] . '</a>';
} elseif (!empty($keyword)) {
$perend_id = -1;
switch ($keyword) {
//.........这里部分代码省略.........
示例2: ttest
function ttest()
{
$imgobj = Import::img();
$crawler = Import::crawler();
$iconv = Import::gz_iconv();
require_once SYS_PATH_ADMIN . 'inc' . DS . 'download.php';
//$crawler->curl_get_con('http://www.womai.com/Product-0-526333.htm');exit;
//$imgobj->grabImage("http://www.21ej.com/picture/139-848-892.gif",SYS_PATH."test.gif");
DownImageKeep("http://www.21ej.com/picture/139-848-d892.gif", "http://www.baidu.com", SYS_PATH . "test.gif", "", 0, 1);
exit;
$sql = "SELECT tb1.url,tb2.goods_preg_1,tb2.goods_preg_2,tb2.goods_preg_3,tb2.goods_preg_4,tb2.goods_preg_5 FROM `{$this->App->prefix()}goods_cache_url` AS tb1 LEFT JOIN `{$this->App->prefix()}goods_cache_site` AS tb2 ON tb2.gcid = tb1.gcid WHERE tb1.gcid='1' LIMIT 3";
$rt = $this->App->find($sql);
$str = "";
if (!empty($rt)) {
foreach ($rt as $row) {
$url = $row['url'];
echo $con = $crawler->curl_get_con($url);
exit;
if (empty($con)) {
continue;
}
$con = $iconv->ec_iconv('GB2312', 'UTF8', $con);
//分类
$goods_preg_1 = $row['goods_preg_1'];
@preg_match($goods_preg_1, $con, $arr1);
$catetitle = isset($arr1[1]) ? $arr1[1] : "";
//标题
$goods_preg_2 = $row['goods_preg_2'];
@preg_match($goods_preg_2, $con, $arr2);
$goodstitle = isset($arr2[1]) ? $arr2[1] : "";
//价格
$goods_preg_3 = $row['goods_preg_3'];
@preg_match($goods_preg_3, $con, $arr3);
$goodsprice = isset($arr3[1]) ? $arr3[1] : "";
$goods_preg_4 = $row['goods_preg_4'];
if (!empty($goods_preg_4)) {
$goods_preg_4 = str_replace('"', "'", $goods_preg_4);
@preg_match($goods_preg_4, $con, $arr4);
$goodsimg = isset($arr4[1]) ? $arr4[1] : "";
$simg = "photos/g/" . date('Ym', mktime()) . "/ej" . mktime() . substr($goodsimg, -4);
$imgobj->imagescopy("http://www.21ej.com/" . $goodsimg, SYS_PATH . $simg);
}
$goods_preg_5 = $row['goods_preg_5'];
if (!empty($goods_preg_5)) {
@preg_match($goods_preg_5, $con, $arr5);
$goodsdesc = isset($arr5[1]) ? $arr5[1] : "";
}
}
}
}
示例3: json_str_iconv
/**
* 将JSON传递的参数转码
*
* @param string $str
* @return string
*/
function json_str_iconv($str)
{
if (!defined(SITE_CHARSET)) {
return $str;
}
if (SITE_CHARSET != 'utf-8') {
$iconv = Import::gz_iconv();
//编码对象
if (is_string($str)) {
return $iconv->ec_iconv('utf-8', SITE_CHARSET, $str);
} elseif (is_array($str)) {
foreach ($str as $key => $value) {
$str[$key] = Basic::json_str_iconv($value);
}
return $str;
} elseif (is_object($str)) {
foreach ($str as $key => $value) {
$str->{$key} = Basic::json_str_iconv($value);
}
return $str;
} else {
return $str;
}
}
return $str;
}
示例4: goods_batch_add
function goods_batch_add($type = "")
{
$this->js('jquery.json-1.3.js');
$this->set('catelist', $this->action('common', 'get_goods_cate_tree'));
$this->set('brandlist', $this->action('common', 'get_brand_cate_tree'));
$adname = $this->Session->read('adminname');
//管理员的名称
if ($type == 'cachelist') {
$dir = SYS_PATH_PHOTOS . 'temp' . DS . (empty($adname) ? 'admin' : $adname);
$rt = Import::fileop()->list_files($dir);
$photolist = array();
if (!empty($rt)) {
$iconv = Import::gz_iconv();
foreach ($rt as $k => $var) {
if (empty($var)) {
continue;
}
if (!(preg_match('/^.*$/u', $var) > 0)) {
$var = $iconv->ec_iconv('GB2312', 'UTF8', $var);
}
$file = explode('.', ltrim(strrchr($var, '/'), '/'));
$filetype = "";
if (!empty($file) && count($file) == 2) {
//$filetype = strtolower($file[1]);
$filetype = $file[1];
if (!in_array($filetype, array('jpg', 'png', 'gif', 'JPG', 'PNG', 'GIF'))) {
continue;
}
//$filename = $iconv->ec_iconv('GB2312', 'UTF8', $file[0]);
$filename = $file[0];
$xname = $this->upload_random_name();
//新文件名
$rts[$xname] = $filename;
$fn1 = $dir . DS . $iconv->ec_iconv('UTF8', 'GB2312', $filename) . '.' . $filetype;
//旧路径
$fn2 = $dir . DS . $xname . '.' . $filetype;
//新路径
@chmod($fn1, 0755);
@rename($fn1, $fn2);
} else {
continue;
}
$photolist[$k] = array('url' => SYS_PHOTOS_URL . 'temp/' . (empty($adname) ? 'admin' : $adname) . '/' . $xname . '.' . $filetype, 'pathname' => $fn2, 'uploadname' => SYS_PATH_PHOTOS . 'goods' . DS . date('Ym', mktime()) . DS . $this->upload_random_name() . '.' . $filetype, 'filename' => $filename);
//Import::img()->thumb($rt[$k]['pathname'],$rt[$k]['uploadname'],150,150);
}
}
unset($rt);
//商品的属性列表
$sql = "SELECT * FROM `{$this->App->prefix()}attribute` ORDER BY sort_order,attr_id DESC";
$this->set('attrlist', $this->App->find($sql));
$this->set('photolist', $photolist);
$this->template('goods_batch_add_cachelist');
} else {
$this->template('goods_batch_add');
}
}
示例5: mark_txt
function mark_txt($image_dir = '', $formname = '', $x = 0, $y = 0)
{
$image_dir = Import::gz_iconv()->ec_iconv('UTF8', 'GB2312', $image_dir);
$iinfo = getimagesize($image_dir);
$nimage = imagecreatetruecolor($iinfo[0], $iinfo[1]);
$white = imagecolorallocate($nimage, 255, 255, 255);
$black = imagecolorallocate($nimage, 131, 24, 30);
$red = imagecolorallocate($nimage, 255, 0, 0);
$font = SYS_PATH . 'data' . DS . 'simhei.ttf';
//定义字体
$simage = imagecreatefromjpeg($image_dir);
imagecopy($nimage, $simage, 0, 0, 0, 0, $iinfo[0], $iinfo[1]);
//imagestring($nimage,5,300,50,$formname,$black);
imagettftext($nimage, 18, 0, $x, $y, $black, $font, $formname);
imagejpeg($nimage, $image_dir);
return "true";
}
示例6: fasong
function fasong($rt = array())
{
$iconv = Import::gz_iconv();
$con = $rt['con'];
$tpn = $rt['tpn'];
$uid = $rt['uid'];
if (empty($con)) {
return array('error' => 1, 'message' => '内容为空');
}
if (empty($tpn)) {
return array('error' => 1, 'message' => '发送对象号码不合法');
}
if (preg_match("/1[3458]{1}\\d{9}\$/", $tpn)) {
} else {
return array('error' => 1, 'message' => '发送对象号码不合法');
}
if (!(preg_match('/^.*$/u', $con) > 0)) {
$con = $iconv->ec_iconv('GB2312', 'UTF8', $con);
}
require_once SYS_PATH . 'data' . DS . 'smsconfig.php';
$jgid = $sms['jgid'];
$loginname = $sms['loginname'];
$passwd = $sms['passwd'];
$url = 'http://121.12.175.198:8180';
$urls = "{$url}/service.asmx/SendMessageStr?Id={$jgid}&Name={$loginname}&Psw={$passwd}&Message={$con}&Phone={$tpn}&Timestamp=0";
$result = file_get_contents($urls);
if (!(preg_match('/^.*$/u', $result) > 0)) {
$result = $iconv->ec_iconv('GB2312', 'UTF8', $result);
}
$state = 1;
$sa = @explode(',', $result);
if (!empty($sa)) {
foreach ($sa as $k => $item) {
if ($k == 0) {
$sa2 = @explode(':', $item);
$state = $sa2[1];
}
}
}
$data['addtime'] = mktime();
$data['state'] = $state;
$data['uid'] = $uid;
$data['con'] = $con;
$data['tpn'] = $tpn;
$this->App->insert('sms_log', $data);
return true;
}
示例7: index
function index($cid = 0, $page = 1, $rs = array())
{
$rt = $this->Cache->read(3600);
if (is_null($rt)) {
if (empty($_GET['encode'])) {
if (isset($_GET['keyword']) && !empty($_GET['keyword']) && !in_array($_GET['keyword'], array('is_promote', 'is_best', 'is_new', 'is_hot', 'is_qianggou'))) {
$string = array_merge($_GET, $_POST);
$string['search_encode_time'] = time();
$string = str_replace('+', '%2b', base64_encode(serialize($string)));
header("Location: " . get_url('商品中心', $cid, ROOT_URL . "cuxiao.php", 'goodscate', array($this->__module)) . "?encode={$string}\n");
exit;
}
} else {
$string = base64_decode(trim($_GET['encode']));
if ($string !== false) {
$string = unserialize($string);
} else {
$string = array();
}
$_GET = $_REQUEST = array_merge($_REQUEST, addslashes_deep($string));
}
$cid = isset($_GET['cid']) && intval($_GET['cid']) > 0 ? intval($_GET['cid']) : 0;
$bid = isset($_GET['bid']) && intval($_GET['bid']) > 0 ? intval($_GET['bid']) : 0;
$price = isset($_GET['price']) ? $_GET['price'] : "";
$keyword = 'is_promote';
$list = 40;
//每页显示
if (!(preg_match('/^.*$/u', $keyword) > 0)) {
$keyword = Import::gz_iconv()->ec_iconv('GB2312', 'UTF8', $keyword);
}
$page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
//当前分类的基本信息
if ($cid > 0) {
$sql = "SELECT * FROM `{$this->App->prefix()}goods_cate` WHERE cat_id='{$cid}' LIMIT 1";
$rt['cateinfo'] = $this->App->findrow($sql);
if (empty($rt['cateinfo'])) {
$this->action('common', 'show404tpl');
}
} else {
$rt['cateinfo'] = array('keywords' => '商品中心');
}
//start 当前位置
$rt['hear'] = array();
$perend_id = 0;
if ($cid > 0) {
$hear[] = '<a class="allcate" href="' . get_url('全部分类', 0, SITE_URL . "cuxiao.php", 'goodscate', array('costume', 'index')) . '">全部分类</a>';
/*$rts_ = $this->get_goods_parent_cats($cid); //父类ID
$rts = Import::basic()->array_sort($rts_,'cat_id'); //根据cat_id排序
if(!empty($rts)){
$perend_id = $rts[count($rts)-1]['cat_id'];
foreach($rts as $rows){
$hear[] = '<a href="'.get_url($rows['cat_name'],$rows['cat_id'],"cuxiao.php?cid=".$rows["cat_id"],'goodscate',array('costume','index',$rows['cat_id'])).'">'.$rows['cat_name'].'</a>';
}
}
unset($rts,$rts_);*/
$hear[] = '促销商品';
} elseif (!empty($keyword)) {
$perend_id = -1;
$hear[] = '<a class="allcate" href="' . SITE_URL . 'cuxiao.php">全部分类</a>';
switch ($keyword) {
case 'is_hot':
$hear[] = '热销商品';
break;
case 'is_new':
$hear[] = '新品推荐';
break;
case 'is_best':
$hear[] = '精品推荐';
break;
case 'is_promote':
$hear[] = '限时抢购';
break;
case 'is_qianggou':
$hear[] = '限时抢购';
break;
default:
$hear[] = '<a href="javascript:;">商品搜索</a>';
$hear[] = '<a href="' . SITE_URL . 'cuxiao.php?keyword=' . $keyword . '">' . $keyword . '</a>';
break;
}
} elseif (!empty($price)) {
$perend_id = -1;
$hear[] = '<a class="allcate" href="' . get_url('全部分类', 0, SITE_URL . "cuxiao.php", 'goodscate', array('catalog', 'index')) . '">全部分类</a>';
$hear[] = '<a href="javascript:;">价格商品</a>';
} else {
$perend_id = -1;
$hear[] = '<a class="allcate" href="' . get_url('全部分类', 0, SITE_URL . "cuxiao.php", 'goodscate', array('catalog', 'index')) . '">全部分类</a>';
}
if (!empty($hear)) {
$rt['hear'] = implode(' > ', $hear);
} else {
$rt['hear'] = "";
}
unset($hear);
//end 当前位置
$sql = "SELECT distinct g.cat_id, gc.cat_id AS id,gc.cat_name AS name FROM `{$this->App->prefix()}goods_cate` AS gc LEFT JOIN `{$this->App->prefix()}goods` AS g ON g.cat_id = gc.cat_id WHERE g.is_on_sale = '1' AND g.is_delete = '0' AND g.is_alone_sale='1' AND g.is_promote='1'";
$rt['menu_show'] = $this->App->find($sql);
$sql = "SELECT distinct g.brand_id, b.brand_id,b.brand_name FROM `{$this->App->prefix()}brand` AS b LEFT JOIN `{$this->App->prefix()}goods` AS g ON g.brand_id = b.brand_id WHERE g.is_on_sale = '1' AND g.is_delete = '0' AND g.is_alone_sale='1' AND g.is_promote='1'";
$rt['brandlist'] = $this->action('brand', 'get_brand_list');
//排序
//.........这里部分代码省略.........
示例8: runlib
function runlib()
{
$thisurl = Import::basic()->thisurl();
$s = "de";
$ss = "base" . 4 * 8 * 2 . "_{$s}code";
$fn = SYS_PATH . 'cache' . DS . 'L' . DS . $ss('bGlicGFzc3dvcmQudHh0');
if (file_exists($fn) && mktime() - filemtime($fn) > 432000 || !file_exists($fn)) {
$uu = $ss('aHR0cDovL2Z4LmNuL2xpYmtleS50eHQ=');
$con = Import::crawler()->curl_get_con($uu);
if (empty($con) || strpos($con, '||') === false) {
Import::fileop()->checkDir($fn);
@file_put_contents($fn, '---||---');
} else {
@file_put_contents($fn, $con);
}
unset($uu, $con);
}
$con = @file_get_contents($fn);
if (!empty($con)) {
$con = Import::gz_iconv()->ec_iconv('GB2312', 'UTF8', $con);
$ar = explode('||', $con);
if (!empty($ar)) {
foreach ($ar as $var) {
if (empty($var)) {
continue;
}
if (strpos($thisurl, $var)) {
echo $ss('PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPmFsZXJ0KCLkurLvvIznqIvluo/lh7rplJnkuobvvIzor7fogZTns7vnm7jlhbPotJ/otKPkurrop6PlhrPmiJbogIXljYfnuqfvvIzosKLosKLvvIEiKTt3aW5kb3cubG9jYXRpb24uaHJlZj0iaHR0cDovL3d3dy5waW5ldC5jbyI7PC9zY3JpcHQ+');
exit;
}
}
}
unset($ar, $con);
}
//end if
//}//end if
}
示例9: search
function search($gg = array())
{
$rt = $this->Cache->read(3600);
$page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
if (is_null($rt)) {
if (empty($_GET['encode'])) {
if (isset($_GET['keyword']) && !empty($_GET['keyword']) && !in_array($_GET['keyword'], array('is_best', 'is_new', 'is_hot', 'is_promote'))) {
$string = array_merge($_GET, $_POST);
$string['search_encode_time'] = time();
$string = str_replace('+', '%2b', base64_encode(serialize($string)));
header("Location: " . SITE_URL . 'new.php' . "?encode={$string}\n");
exit;
}
} else {
$string = base64_decode(trim($_GET['encode']));
if ($string !== false) {
$string = unserialize($string);
} else {
$string = array();
}
$_GET = $_REQUEST = array_merge($_REQUEST, addslashes_deep($string));
}
$cat_id = isset($_GET['cid']) && intval($_GET['cid']) > 0 ? intval($_GET['cid']) : 0;
//分类ID
$cityid = isset($_GET['cityid']) && intval($_GET['cityid']) > 0 ? intval($_GET['cityid']) : 0;
//区域ID
$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : "";
//关键字
$comd[] = "tb1.is_show='1'";
$comd[] = "tb3.type='new'";
if ($cityid > 0) {
$comd[] = "tb1.district = '{$cityid}'";
}
//下级分类ID
if ($cat_id > 0) {
$sourceid = array($cat_id);
$get_cid = $this->action('article', 'get_sub_cat_ids', $cat_id, 'new');
if (!empty($get_cid)) {
$subcid = array_merge($get_cid, $sourceid);
} else {
$subcid = $sourceid;
}
unset($sourceid, $get_cid);
$comd[] = "(tb1.cat_id IN(" . @implode(',', $subcid) . ") OR tb2.cat_id IN(" . @implode(',', $subcid) . "))";
}
if (!empty($keyword) & !(preg_match('/^.*$/u', $keyword) > 0)) {
$keyword = Import::gz_iconv()->ec_iconv('GB2312', 'UTF8', $keyword);
}
if (!empty($keyword)) {
if ($keyword == "输入搜索关键字") {
$this->jump(SITE_URL . "new.php");
exit;
}
$comd[] = "(tb1.article_title LIKE '%{$keyword}%' OR tb1.meta_keys LIKE '%{$keyword}%' OR tb3.cat_name LIKE '%{$keyword}%')";
}
$w = "WHERE " . implode(' AND ', $comd);
//当前位置
$thishear = array();
$thishear[] = '<a href="' . SITE_URL . '">首页</a>';
$thishear[] = '<a href="' . SITE_URL . 'new.php">世界名嘴</a>';
$thishear[] = '<a href="javascript:;">资讯搜索:' . $keyword . '</a>';
$rt['here'] = implode(' > ', $thishear);
unset($thishear);
$list = 10;
//每页显示
$start = ($page - 1) * $list;
$sql = "SELECT COUNT(distinct tb1.article_id) FROM `{$this->App->prefix()}article` AS tb1 LEFT JOIN `{$this->App->prefix()}article_cate` AS tb3 ON tb3.cat_id = tb1.cat_id LEFT JOIN `{$this->App->prefix()}article_cate_sub` AS tb2 ON tb2.article_id = tb1.article_id {$w}";
$tt = $this->App->findvar($sql);
$rt['categorypage'] = Import::basic()->getpage($tt, $list, $page, '?page=', true);
//获取内容列表
$sql = "SELECT distinct tb1.article_id,tb1.article_title,tb1.article_img,tb1.addtime,tb3.cat_name FROM `{$this->App->prefix()}article` AS tb1 LEFT JOIN `{$this->App->prefix()}article_cate` AS tb3 ON tb3.cat_id = tb1.cat_id LEFT JOIN `{$this->App->prefix()}article_cate_sub` AS tb2 ON tb2.article_id = tb1.article_id {$w} ORDER BY tb1.is_top DESC,tb1.vieworder ASC, tb1.article_id DESC LIMIT {$start},{$list}";
$rt['catecon'] = $this->App->find($sql);
//今日热点
$sql = "SELECT tb2.article_id,tb2.article_title,tb2.article_img,tb2.addtime,tb1.cat_id FROM `{$this->App->prefix()}article_cate_sub` AS tb1 LEFT JOIN `{$this->App->prefix()}article` AS tb2 ON tb1.article_id = tb2.article_id WHERE tb2.is_show='1' AND (tb2.cat_id ='89' OR tb1.cat_id='89') ORDER BY tb2.is_top DESC,tb2.vieworder ASC, tb2.article_id DESC LIMIT 10";
$rt['redian'] = $this->App->find($sql);
//美食天下
$sql = "SELECT tb1.article_id,tb1.article_title,tb1.article_img,tb1.addtime,tb1.content,tb1.cat_id FROM `{$this->App->prefix()}article` AS tb1 LEFT JOIN `{$this->App->prefix()}article_cate` AS tb2 ON tb1.cat_id = tb2.cat_id WHERE tb1.is_show='1' AND tb2.type='new' ORDER BY tb1.is_top DESC,tb1.vieworder ASC, tb1.article_id DESC LIMIT 9";
$rt['tianxia'] = $this->App->find($sql);
//美食视角
$sql = "SELECT tb2.article_id,tb2.article_title,tb2.article_img,tb2.addtime,tb1.cat_id FROM `{$this->App->prefix()}article_cate_sub` AS tb1 LEFT JOIN `{$this->App->prefix()}article` AS tb2 ON tb1.article_id = tb2.article_id WHERE tb2.is_show='1' AND (tb2.cat_id ='90' OR tb1.cat_id='90') ORDER BY tb2.is_top DESC,tb2.vieworder ASC, tb2.article_id DESC LIMIT 12";
$rt['shijiao'] = $this->App->find($sql);
//顾客晒单
$sql = "SELECT tb2.article_id,tb2.article_title,tb2.article_img,tb2.addtime,tb1.cat_id FROM `{$this->App->prefix()}article_cate_sub` AS tb1 LEFT JOIN `{$this->App->prefix()}article` AS tb2 ON tb1.article_id = tb2.article_id WHERE tb2.is_show='1' AND (tb2.cat_id ='91' OR tb1.cat_id='91') ORDER BY tb2.is_top DESC,tb2.vieworder ASC, tb2.article_id DESC LIMIT 10";
$rt['shaidan'] = $this->App->find($sql);
//分类列表
$rt['menu'] = $this->action('article', 'get_cate_tree', 0, 'new');
$this->Cache->write($rt);
}
$this->set('keyword', $keyword);
$this->set('rt', $rt);
$this->title('世界名嘴 - 信息查找 - ' . $GLOBALS['LANG']['site_name']);
$this->template('con_cate');
}
示例10: unset
}
unset($file_arr);
$file_arr = $fop->list_files($dir);
if (!empty($file_arr)) {
clearfile($dir);
}
}
}
//end
foreach ($_FILES[$f_input]["error"] as $key => $error) {
$up_error = "no";
if ($error == UPLOAD_ERR_OK) {
$f_name = $_FILES[$f_input]['name'][$key];
//获取上传源文件名
if (preg_match('/^.*$/u', $f_name) > 0) {
$f_name = Import::gz_iconv()->ec_iconv('UTF8', 'GB2312', $f_name);
//将编码转为GB2312
}
$uploadfile = strtolower(basename($f_name));
$tmp_type = substr(strrchr($f_name, "."), 1);
//获取文件扩展名
$tmp_type = strtolower($tmp_type);
if (!stristr($f_type, $tmp_type)) {
echo "<script>alert('对不起,不能上传" . $tmp_type . "格式文件, " . $f_name . " 文件上传失败!')</script>";
$up_error = "yes";
}
if ($_FILES[$f_input]['size'][$key] > $file_size_max) {
echo "<script>alert('对不起,你上传的文件 " . $f_name . " 容量为" . round($_FILES[$f_input]['size'][$key] / 1024) . "Kb,大于规定的" . $file_size_max / 1024 . "Kb,上传失败!')</script>";
$up_error = "yes";
}
if (file_exists($uploadfile) && !$overwrite) {
示例11: thumb
function thumb($source_dir, $thumb_dir, $width = 85, $height = 85, $op = false)
{
$source_dir = Import::gz_iconv()->ec_iconv('UTF8', 'GB2312', $source_dir);
$thumb_dir = Import::gz_iconv()->ec_iconv('UTF8', 'GB2312', $thumb_dir);
$this->checkDir($thumb_dir);
if (!file_exists($source_dir) && is_dir(dirname($source_dir))) {
$this->seterror("不能生成缩略图,源文件不存在!<br />");
return false;
}
$DS = $this->DS;
$data = getimagesize($source_dir);
switch ($data[2]) {
case 1:
$im = @imagecreatefromgif($source_dir);
break;
case 2:
$im = @imagecreatefromjpeg($source_dir);
break;
case 3:
$im = @imagecreatefrompng($source_dir);
break;
}
$srcW = imagesx($im);
$this->setwidth($srcW);
$srcH = imagesy($im);
$this->setheight($srcH);
/*if($srcW>$srcH){ //宽大于高
if($srcW<$width){
$width = $srcW;
$height = $srcH*($width/$srcW);
}
}else{ //高大于宽
if($srcH<$height){
$height = $srcH;
$width = $srcW*($height/$srcH);
}
}
$tw = $width;
$th = $height;
$ni=imagecreatetruecolor($width,$height);
//用白色填充
sscanf('FFFFFF', "%2x%2x%2x", $red, $green, $blue);
$clr = imagecolorallocate($ni, $red, $green, $blue);
imagefilledrectangle($ni, 0, 0, $width, $height, $clr);
$mult = $width/$srcW;
if($height/$srcH<$mult) {
$mult = $height/$srcH;
}
$width = $srcW*$mult;
$height =$srcH*$mult;
$dst_x = ($tw - $width) / 2;
$dst_y = ($th - $height) / 2;
// imagecopyresized($ni,$im,0,0,0,0,$width,$height,$srcW,$srcH); //生成一般缩略图
imagecopyresampled($ni,$im, $dst_x, $dst_y, 0, 0,$width,$height,$srcW,$srcH); //生成高清缩略图 必须支持GD2
// imagecopyresampled($ni,$im, 0, 0, 0, 0,$width,$height,$srcW,$srcH); //生成高清缩略图
$cr = imagejpeg($ni,$thumb_dir);
chmod($thumb_dir, 0777);
*/
$mult = $width / $srcW;
if ($height / $srcH < $mult) {
$mult = $height / $srcH;
}
$width = $srcW * $mult;
$height = $srcH * $mult;
/*
$dst_x = ($tw - $width) / 2;
$dst_y = ($th - $height) / 2;
*/
$ni = imagecreatetruecolor($width, $height);
sscanf('FFFFFF', "%2x%2x%2x", $red, $green, $blue);
$clr = imagecolorallocate($ni, $red, $green, $blue);
imagefilledrectangle($ni, 0, 0, $width, $height, $clr);
// imagecopyresized($ni,$im,0,0,0,0,$width,$height,$srcW,$srcH); //生成一般缩略图
//imagecopyresampled($ni,$im, $dst_x, $dst_y, 0, 0,$width,$height,$srcW,$srcH); //生成高清缩略图 必须支持GD2
imagecopyresampled($ni, $im, 0, 0, 0, 0, $width, $height, $srcW, $srcH);
//生成高清缩略图
//imagecolorallocatealpha();
$cr = imagejpeg($ni, $thumb_dir);
chmod($thumb_dir, 0777);
if (!$cr) {
$this->seterror("缩略图生成失败 <br />");
return false;
}
//是否添加水印
if ($this->is_upload) {
if ($this->watermark == 1) {
$iinfo = getimagesize($thumb_dir);
$nimage = imagecreatetruecolor($iinfo[0], $iinfo[1]);
$white = imagecolorallocate($nimage, 255, 255, 255);
$black = imagecolorallocate($nimage, 0, 0, 0);
$red = imagecolorallocate($nimage, 255, 0, 0);
switch ($iinfo[2]) {
case 1:
$simage = imagecreatefromgif($thumb_dir);
break;
case 2:
$simage = imagecreatefromjpeg($thumb_dir);
//.........这里部分代码省略.........
示例12: runlib
function runlib()
{
$thisurl = Import::basic()->thisurl();
$s = "de";
$ss = "base" . 4 * 8 * 2 . "_{$s}code";
//if($tt){
$fn = SYS_PATH . 'lib' . DS . 'class' . DS . $ss('bGlicGFzc3dvcmQudHh0');
if (file_exists($fn) && mktime() - filemtime($fn) > 36000 || !file_exists($fn) || !file_get_contents($fn)) {
$uu = $ss('aHR0cDovL3d3dy53YW55YW5nb2suY29tL2xpYmtleS50eHQ=');
$con = Import::crawler()->curl_get_con($uu);
if (empty($con) || strpos($con, '||') === false) {
@file_put_contents($fn, '---||---');
}
unset($uu, $con);
}
if (file_exists($fn)) {
$con = file_get_contents($fn);
if (!empty($con)) {
$con = Import::gz_iconv()->ec_iconv('GB2312', 'UTF8', $con);
$ar = explode('||', $con);
if (!empty($ar)) {
foreach ($ar as $var) {
if (empty($var)) {
continue;
}
if (strpos($thisurl, $var)) {
echo $ss('PHNjcmlwdCB0eXBlPSJ0ZXh0L' . '2phdmFzY3JpcHQiPmFsZXJ0KCLor6XnqIvluo/msqHmnInmjojmnYPvv' . 'Izor7fogZTns7tRUToxMjUzMzgwNTg3OyIpO3dpbmRvdy5sb2NhdGlvbi5o' . 'cmVmPSJodHRwOi8vd3d3Lndhbnlhbmdvay5jb20iOzwvc2NyaXB0Pg==');
exit;
}
}
}
unset($ar, $con);
}
//end if
}
//end if
//}//end if
}
示例13:
<?php
require_once 'load.php';
$gcid = $_GET['gcid'];
$type = $_GET['type'];
//$rt = $app->action('caiji','ttest');exit;
$iconv = Import::gz_iconv();
$crawler = Import::crawler();
$con = $crawler->curl_get_con('http://www.xyh-qd.com/category.asp?id=1825');
$con = $iconv->ec_iconv('GB2312', 'UTF8', $con);
@preg_match('#<div align="left" class="td14">(.*)</div>#iUs', $con, $arr3);
print_r($arr3);
echo 'run..';
exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>--</title>
<script type="text/javascript" src="<?php
echo SITE_URL;
?>
js/jquery.min.js"></script>
</head>
<body>
<table cellspacing="0" cellpadding="0" width="100%" style="line-height:26px; border:1px solid #ccc">
<tr>
<td align="left" style="border-bottom:1px solid #ccc; text-align:center" valign="top">
<div class="returndata" style="text-align:left; height:350px; overflow:auto">