資源簡介
require('../system/home/index.php');
$K = new Index('magic-shell');
$cfg = $K->config->get('locoyspider');
new locoyspider($cfg);
class locoyspider
{
public $cfg = array();
public function __construct($cfg)
{
$this->cfg = $cfg;
if(!$this->cfg['isopen']){
exit('Locoyspider Api Closed!');
}else if(!$Authorize = trim($_REQUEST['Authorize'])){
exit('Authorize error');
}else if($this->cfg['Authorize'] != $Authorize){
exit('Authorize error');
}else if(!$api = trim($_REQUEST['api'])){
$api = 'index';
}else if(!in_array($api, array('index', 'article', 'cate','city', 'area', 'shop', 'shopcate', 'hotel', 'product', 'tuan', 'photo', 'member'))){
exit('Api error');
}
$this->$api();
}
public function index()
{
echo "HQ Locoyspider Api success";
}
public function article()
{
if(!$data = K::$system->_gpc->p('data')){
exit('data error');
}else{
$data['from'] = 'article';
$attachcfg = K::$system->config->get('attach');
if(preg_match('/attachs\/photo\/\d \/\w \.(jpg|png|gif|jpeg)/i', $data['content'], $match)){
if($this->cfg['Autothumb']){
$thumb = substr($match[0], 8);
}
$data['content'] = preg_replace('/attachs\/photo\/(\d )\/(\w )\.(jpg|png|gif|jpeg)/i', $attachcfg['attachurl']."/photo/$1/$2.$3", $data['content']);
}
if(empty($data['thumb']) && $thumb){
$data['thumb'] = $thumb;
}
if($article_id = K::M('article/article')->create($data)){
echo 'success';
}else{
K::$system->error->json();
}
}
}
public function cate()
{
$tree = '';
if($cats = K::M('article/cate')->tree('article')){
foreach($cats as $v){
$tree .= $v['cat_id'].':'.$v['title'].';';
foreach((array)$v['children'] as $vv){
$tree .= $vv['cat_id'].': '.$vv['title'].';';
foreach((array)$vv['children'] as $vvv){
$tree .= $vvv['cat_id'].': '.$vvv['title'].';';
}
}
}
}
echo $tree;
}
public function shopcate()
{
$tree = '';
$pid = (int)K::$system->gpc->p('pid');
if($cats = K::M('shop/cate')->childrens($pid)){
foreach($cats as $v){
$tree .= $v['cat_id'].':'.$v['title'].';';
}
}
echo $tree;
}
$K = new Index('magic-shell');
$cfg = $K->config->get('locoyspider');
new locoyspider($cfg);
class locoyspider
{
public $cfg = array();
public function __construct($cfg)
{
$this->cfg = $cfg;
if(!$this->cfg['isopen']){
exit('Locoyspider Api Closed!');
}else if(!$Authorize = trim($_REQUEST['Authorize'])){
exit('Authorize error');
}else if($this->cfg['Authorize'] != $Authorize){
exit('Authorize error');
}else if(!$api = trim($_REQUEST['api'])){
$api = 'index';
}else if(!in_array($api, array('index', 'article', 'cate','city', 'area', 'shop', 'shopcate', 'hotel', 'product', 'tuan', 'photo', 'member'))){
exit('Api error');
}
$this->$api();
}
public function index()
{
echo "HQ Locoyspider Api success";
}
public function article()
{
if(!$data = K::$system->_gpc->p('data')){
exit('data error');
}else{
$data['from'] = 'article';
$attachcfg = K::$system->config->get('attach');
if(preg_match('/attachs\/photo\/\d \/\w \.(jpg|png|gif|jpeg)/i', $data['content'], $match)){
if($this->cfg['Autothumb']){
$thumb = substr($match[0], 8);
}
$data['content'] = preg_replace('/attachs\/photo\/(\d )\/(\w )\.(jpg|png|gif|jpeg)/i', $attachcfg['attachurl']."/photo/$1/$2.$3", $data['content']);
}
if(empty($data['thumb']) && $thumb){
$data['thumb'] = $thumb;
}
if($article_id = K::M('article/article')->create($data)){
echo 'success';
}else{
K::$system->error->json();
}
}
}
public function cate()
{
$tree = '';
if($cats = K::M('article/cate')->tree('article')){
foreach($cats as $v){
$tree .= $v['cat_id'].':'.$v['title'].';';
foreach((array)$v['children'] as $vv){
$tree .= $vv['cat_id'].': '.$vv['title'].';';
foreach((array)$vv['children'] as $vvv){
$tree .= $vvv['cat_id'].': '.$vvv['title'].';';
}
}
}
}
echo $tree;
}
public function shopcate()
{
$tree = '';
$pid = (int)K::$system->gpc->p('pid');
if($cats = K::M('shop/cate')->childrens($pid)){
foreach($cats as $v){
$tree .= $v['cat_id'].':'.$v['title'].';';
}
}
echo $tree;
}
代碼片段和文件信息
/**
?*?Copy?Right?IJH.CC553886243
?*?Each?engineer?has?a?duty?to?keep?the?code?elegant
?*?Author?shzhrui
?*?$Id:?index.php?3413?2014-02-21?09:10:43Z?youyi?$
?*/
define(‘IN_DIR‘?dirname(__FILE__).DIRECTORY_SEPARATOR);
require(IN_DIR.‘system/home/index.php‘);
new?Index();
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????764??2015-12-09?23:04??江湖婚慶門戶網站源碼\.htaccess
?????文件????????336??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\+.gif
?????文件????????213??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\-.gif
?????文件????????194??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\ar.gif
?????文件?????????62??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\bottom1.gif
?????文件?????????62??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\bottom2.gif
?????文件????????169??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\bt-big-bak.gif
?????文件???????1011??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\bt-big-bak2.gif
?????文件????????192??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\bt-mid-bak.gif
?????文件????????592??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\button.png
?????文件????????138??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\calendar.gif
?????文件???????1006??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\check.gif
?????文件???????1540??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-adm.gif
?????文件????????753??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-bottom-bak.gif
?????文件????????261??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-center-bak.gif
?????文件???????1415??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-error.gif
?????文件???????5886??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-load.gif
?????文件???????1540??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-notice.gif
?????文件???????1921??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-success.gif
?????文件????????754??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\clew-top-bak.gif
?????文件????????118??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\close.gif
?????文件????????118??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\close_over.gif
?????文件???????1136??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\data.jpg
?????文件?????????54??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\ddv_bak.gif
?????文件?????????78??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\ddv_inde_bak.gif
?????文件????????211??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\del.gif
?????文件????????190??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\down.gif
?????文件????????174??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\down_over.gif
?????文件????????124??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\down_time.gif
?????文件????????124??2015-04-17?18:27??江湖婚慶門戶網站源碼\admin\images\down_time_over.gif
............此處省略4184個文件信息
- 上一篇:jquery 多圖上傳
- 下一篇:php 圖片驗證碼 (隨機)
評論
共有 條評論