function protect_action() { chkpw('func_data_safe'); require_once ROOT.'/webscan360/webscan360.class.php'; $webscan_model = new webscan360(); $url = $webscan_model->getProtectUrl(); $this->view->iframe_url = $url; }
function listwebsite_action() { chkpw('website_list'); $path = ROOT.'/config/website'; $dir = opendir($path); $website_num = 0; $website = array(); while($file = readdir($dir)) { if(!($file == '..')) { if(!($file == '.')) { if(!is_dir($path.'/'.$file)) { $tmparr = include $path.'/'.$file; $website_num++; $tmparr['website']['id'] = $website_num; $tmparr['website']['url'] = $tmparr['site_url']; $args = array('username'=>$tmparr['site_username'],'password'=>md5($tmparr['site_password'])); $tmparr['website']['admindir'] = $tmparr['site_admindir']; $tmparr['website']['args'] = urlencode(base64_encode(xxtea_encrypt(serialize($args),$tmparr['cookie_password']))); $tmparr['website']['path'] = $file; $tmparr['website']['hostname'] = $tmparr['database']['hostname']; $tmparr['website']['user'] = $tmparr['database']['user']; $tmparr['website']['password'] = $tmparr['database']['password']; $website[] = $tmparr['website']; } } } } $this->view->data = $website; }
function manage_action() { chkpw('func_data_adminlogs'); $where = null; $ordre = '`id` DESC'; $limit = ((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize; $this->view->data = $this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage')); $this->view->record_count = $this->_table->record_count; }
function list_action() { chkpw('order_logistics'); $set1=settings::getInstance(); $sets1=$set1->getrow(array('tag'=>'table-'.$this->table)); $setsdata1=unserialize($sets1['value']); $this->view->settings=$setsdata1; $where=null; $ordre='`id` DESC'; $limit=((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize; $this->_view_table=$this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage')); }
function edit_action() { chkpw('template_edit'); if (front::post('submit')) { unset(front::$post['submit']); help::$_var[config::get('template_dir') .'_template_note'] = front::$post; help::save(); } $dir = ROOT .'/template/'.config::get('template_dir'); $_dir = dir($dir); while ($file = $_dir->read()) { if (!preg_match('/^\./',$file) &&is_dir($dir .'/'.$file) &&!preg_match('/[#@]/',$file) &&!preg_match('/^_/',$file)) { $this->view->tps[$file] = '<b>'.$file .'</b>'; $__dir = dir($dir .'/'.$file); while ($_file = $__dir->read()) { if (!preg_match('/^\./',$_file)) { if ($file=='skin'&&!preg_match('/\.(css|js)$/',$_file)) continue; $_file = str_replace('.','_',$_file); if (is_dir($dir .'/'.$file .'/'.$_file)){ $this->view->tps[$file .'/'.$_file] = " └<b>".$_file .'</b>'; }else{ $this->view->tps[$file .'/'.$_file] = " └".$_file; } } } }elseif (!preg_match('/^\./',$file) &&is_file($dir .'/'.$file)) { $file = str_replace('.','_',$file); $tps[$file] = $file; } } //$this->view->tps = array_merge($tps,$this->view->tps); $tps_arr = array_merge($tps,$this->view->tps); //分页 /*$limit = 20; if(!front::get('page')) $page = 1; else $page = front::get('page'); $total = ceil(count($tps_arr)/$limit); if($page < 1) $page = 1; if($page > $total) $page = $total; $start = ($page-1) * $limit; $end = $start+$limit-1; $tmp = range($start,$end); $list_tps_arr = array(); $i = 0; foreach($tps_arr as $k => $v){ if(in_array($i++,$tmp)){ $list_tps_arr[$k] = $v; } }*/ $this->view->tps = $tps_arr; //$this->view->link_str = listPage($total,$limit,$page); }
function list_action() { chkpw('order_pay'); $set1=settings::getInstance(); $sets1=$set1->getrow(array('tag'=>'table-'.$this->table)); $setsdata1=unserialize($sets1['value']); $this->view->settings=$setsdata1; $where = $pay_list = array(); $where['enabled'] = 1; $ordre='`pay_id` DESC'; $limit=((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize; $this->_view_table=$this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage')); $pay_list = $this->_view_table; foreach($pay_list as $key=>$value) { $pay_list[$value['pay_code']] = $value; unset($pay_list[$key]); } $modules = read_modules(ROOT.'/lib/plugins/pay/'); global $_LANG; for ($i = 0;$i <count($modules);$i++) { $code = $modules[$i]['code']; $modules[$i]['pay_code'] = $modules[$i]['code']; if (isset($pay_list[$code])) { $modules[$i]['id'] = $pay_list[$code]['pay_id']; $modules[$i]['name'] = $pay_list[$code]['pay_name']; $modules[$i]['pay_fee'] = $pay_list[$code]['pay_fee']; $modules[$i]['is_cod'] = $pay_list[$code]['is_cod']; $modules[$i]['desc'] = $pay_list[$code]['pay_desc']; $modules[$i]['pay_order'] = $pay_list[$code]['pay_order']; $modules[$i]['install'] = '1'; } else { $modules[$i]['name'] = $_LANG[$modules[$i]['code']]; if (!isset($modules[$i]['pay_fee'])) { $modules[$i]['pay_fee'] = 0; } $modules[$i]['desc'] = $_LANG[$modules[$i]['desc']]; $modules[$i]['install'] = '0'; } if ($modules[$i]['pay_code'] == 'tenpayc2c') { $tenpayc2c = $modules[$i]; } } $this->_view_table = $modules; }
function init() { $this->table=front::get('table'); chkpw('user_ologin'); if (preg_match('/^my_/',$this->table)) { form_admin::init(); $this->_table=new defind($this->table); } else $this->_table=new $this->table; $this->_table->getFields(); $this->view->form=$this->_table->get_form(); $this->tname=lang($this->table); if($this->table=='ologin') $this->tname='登录模块'; $this->_pagesize=config::get('manage_pagesize'); $this->view->table=$this->table; $this->view->primary_key=$this->_table->primary_key; if (!front::get('page')) front::$get['page']=1; $this->Exc=$this->table == 'templatetag'?true : false; $manage='table_'.$this->table; if (preg_match('/^my_/',$this->table)) $manage='table_form'; $this->manage=new $manage; }
function init() { chkpw('archive_image'); }
function setting_action() { if($this->table == 'archive'){ chkpw('archive_setting'); } if($this->table == 'friendlink'){ chkpw('seo_friendlink_setting'); } $this->_view_table=false; $set=settings::getInstance(); $sets=$set->getrow(array('tag'=>'table-'.$this->table)); $data=unserialize($sets['value']); if (front::post('submit')) { $var=front::$post; unset($var['submit']); $set->rec_replace(array('value'=>mysql_escape_string(serialize($var)),'tag'=>'table-'.$this->table,'array'=>mysql_escape_string(var_export($var,true)))); event::log("修改{$this->tname}配置",'成功'); front::flash("配置成功!"); } $this->view->settings=$data; }
function make_show_action() { header('Cache-control: private, must-revalidate'); @set_time_limit(0); $submit = front::post('submit') ? front::post('submit') : front::get('submit'); if (!$submit) return; chkpw('cache_content'); //time::start(); $post = front::$post + front::$get; unset($post['submit']); $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']); $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url); $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url); $c_url = preg_replace('#&catid=(\d+)#', '', $c_url); $c_url = preg_replace('#&submit=(\d+)#', '', $c_url); $c_url = 'index.php?' . $c_url; $c_url.='&submit=1'; $category = category::getInstance(); //实例化栏目类 if ($post['aid_start']) { $aid_start = $post['aid_start']; $aid_end = $post['aid_end']; $where = "aid>=$aid_start and aid<=$aid_end AND checked=1 AND (ishtml IS NULL OR ishtml!=2)"; $c_url.='&aid_start=' . $aid_start . '&aid_end=' . $aid_end; } elseif (isset($post['catid'])) { $catid = $post['catid']; $categories = $category->sons($catid); $categories[] = $catid; $categories = implode(',', $categories); $where = "catid in(" . $categories . ') and checked=1 AND (ishtml IS NULL OR ishtml!=2)'; $c_url.='&catid=' . $catid; }else return; $case = 'archive'; $act = 'show'; $_GET = array('case' => $case, 'act' => $act); $front = new front(); front::$admin = false; front::$html = true; front::$rewrite = false; $case = $case . '_act'; $case = new $case(); $case->init(); $method = $act . '_action'; //$time_start = time::getTime(); $archive = new archive(); //实例化文章类 if (config::get('group_on')) { //启用分组生成 $make_page = $post['make_page'] == '' ? 1 : $post['make_page']; $archive->getrows($where); $archive_num = $archive->record_count; $group_count = config::get('group_count'); $make_page_num = ceil($archive_num / $group_count); $totalpage = (($make_page - 1) * $group_count) . ',' . $group_count; $c_url.='&make_page=' . ($make_page + 1); } else { $totalpage = ""; } $archives = $archive->getrows($where, $totalpage, '1'); //取到要生成的所有文章 $cpage = 0; foreach ($archives as $arc) { if (!category::getarcishtml($arc)) //如果文章设置不生成则跳过 continue; if($arc['linkto']){ //如果有跳转连接则跳过生成 continue; } $case->view->archive = $arc; front::$get['aid'] = $case->view->aid = $case->view->archive['aid']; $case->view->catid = $case->view->archive['catid']; $case->view->topid = category::gettopparent($case->view->catid); $case->view->parentid = $category->getparent($case->view->catid); $template = $case->view->archive['template']; $content = $case->view->archive['content']; $case->view->categories = category::getpositionlink2($case->view->catid); //关键字连接 $linkword = new linkword(); $linkwords = $linkword->getrows(null, 1000, 'linkorder desc'); foreach ($linkwords as $linkword) { if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) { $linkword['linktimes'] = (int) $linkword['linktimes']; $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>"; } else { $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>"; } if (isset($link)) { $content = preg_replace("%(?!\"]*>)$linkword[linkword](?!\s*\")%i", "\\1$link\\2", $content, $linkword['linktimes']); } unset($link); } //相关文章 $case->view->likenews = $case->getLike($case->view->archive['tag'], $case->view->archive['keyword']); //内容分页 $contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content); if (!empty($contents)) { $case->view->pages = count($contents); front::$record_count = $case->view->pages * config::get('list_pagesize'); $case->view->pages = count($contents); } else { $case->view->pages = 1; } //标签连接 $taghtml = ''; $tag_table = new tag(); foreach ($tag_table->urls($case->view->archive['tag']) as $tag => $url) { $taghtml.="<a href='$url' target='_blank'>$tag</a> "; } $case->view->archive['tag'] = $taghtml; //专题连接 $case->view->archive['special'] = null; if ($case->view->archive['spid']) { $spurl = special::url($case->view->archive['spid'],special::getishtml($case->view->archive['spid'])); $sptitle = special::gettitle($case->view->archive['spid']); $case->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a> "; } //分类连接 $case->view->archive['type'] = null; if ($case->view->archive['typeid']) { $typeurl = type::url($case->view->archive['typeid'],1); $typetitle = type::name($case->view->archive['typeid']); $case->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a> "; } //地区连接 $case->view->archive['area'] = null; $case->view->archive['area'] = area::getpositonhtml($case->view->archive['province_id'], $case->view->archive['city_id'], $case->view->archive['section_id']); //$arc = $case->view->archive; for ($c = 1; $c <= $case->view->pages; $c++) { front::$get['page'] = $c; $case->view->page = $c; if (!empty($contents)) { $content = $contents[$c - 1]; } $case->view->archive['content'] = $content; //自定义字段 cb_data($case->view->archive); $str = ""; foreach( $case->view->archive as $key => $value){ if(!preg_match('/^my/',$key) || !$value) continue; $sonids = $category->sons(setting::$var['archive'][$key]['catid']); $sonids[] = setting::$var['archive'][$key]['catid']; if(!in_array($case->view->archive['catid'],$sonids) && intval(setting::$var['archive'][$key]['catid'])){ //unset($case->view->field[$key]); continue; } $str .= '<p> '.setting::$var['archive'][$key]['cname'].':'. $value.'</p>'; } $arc['my_fields'] = $str; //上一篇,下一篇 $aid = $case->view->archive['aid']; $catid = $case->view->archive['catid']; $sql1 = "SELECT * FROM `{$archive->name}` WHERE catid = '$catid' AND aid > '$aid' ORDER BY aid ASC LIMIT 0,1"; $sql2 = "SELECT * FROM `{$archive->name}` WHERE catid = '$catid' AND aid < '$aid' ORDER BY aid DESC LIMIT 0,1"; $n = $archive->rec_query_one($sql1); $p = $archive->rec_query_one($sql2); $case->view->archive['p'] = $p; $case->view->archive['n'] = $n; $case->view->archive['p']['url'] = archive::url($p); $case->view->archive['n']['url'] = archive::url($n); //评级 $case->view->archive['strgrade'] = archive::getgrade($arc['grade']); //图片 $case->view->archive['pics'] = unserialize($case->view->archive['pics']); if(is_array($case->view->archive['pics']) && !empty($case->view->archive['pics'])){ foreach ($case->view->archive['pics'] as $k => $v){ if(strtolower(substr($v,0,7)) == 'http://'){ $case->view->archive['pics'][$k] = $v; }else{ $case->view->archive['pics'][$k] = $v; } } } $case->view->archive['pics'] = serialize($case->view->archive['pics']); if ($template && file_exists(TEMPLATE . '/' . $case->view->_style . '/' . $template)) $tpl = $template; else $tpl = category::gettemplate($case->view->catid, 'showtemplate'); $content = $case->fetch($tpl); $path = ROOT . archive::url($case->view->archive, front::$get['page'] > 1 ? front::$get['page'] : null, true); if (!preg_match('/\.[a-zA-Z]+$/', $path)) $path = rtrim(rtrim($path, '/'), '\\') . '/index.html'; $path = rtrim($path, '/'); $path = rtrim($path, '\\'); $path = str_replace('//', '/', $path); tool::mkdir(dirname($path)); file_put_contents($path, $content); $cpage++; if ($case->view->pages > 1 && $c == 1) { $path = ROOT . archive::url($case->view->archive, 1, true); if (!preg_match('/\.[a-zA-Z]+$/', $path)) $path = rtrim(rtrim($path, '/'), '\\') . '/index.html'; $path = rtrim($path, '/'); $path = rtrim($path, '\\'); $path = str_replace('//', '/', $path); tool::mkdir(dirname($path)); //file_put_contents('logs.txt', file_get_contents('logs.txt')."\r\n".$path); $f = fopen($path,'w'); fwrite($f, $content); fclose($f); $cpage++; } } } $totalpage = count($archives); if (!isset($archives[0])) $totalpage = 0; if ($make_page >= $make_page_num) { $show_msg = "本组生成html <b>{$cpage}</b> 页! 生成html完毕,本次共生成 <b>{$archive_num}</b> 页! 3秒后自动返回内容生成首页面!\n"; $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']); $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url); $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url); $c_url = preg_replace('#&catid=(\d+)#', '', $c_url); $c_url = preg_replace('#&submit=(\d+)#', '', $c_url); $c_url = 'index.php?' . $c_url; } else { $show_msg = "第 <b>{$make_page}</b> 组成功生成html <b>{$cpage}</b> 页! 本次共需生成 <b>{$archive_num}</b> 页! 已经生成 <b>" . ($make_page * $group_count) . "</b> 页! 3秒后自动跳入下组生成!\n"; } $getnexturl = "<script>"; $getnexturl.="var t=4;\n"; $getnexturl.="setInterval('testTime()',3000);\n"; $getnexturl.="function testTime() \n"; $getnexturl.=" { \n"; $getnexturl.="if(t == 0) location = '" . $c_url . "'; \n"; $getnexturl.=" t--;\n"; $getnexturl.="}\n</script> \n"; if ($cpage > 0) { if (!config::get('group_on')) { front::flash("成功生成html <b>{$cpage}</b> 页!用时".time::getTime()."!\n"); } else { front::flash($show_msg . "\n" . $getnexturl); } } else { front::flash("没有需要生成的html,可能您选择的栏目暂无内容或者网站并未开启内容生成静态功能!"); } front::$admin = true; front::$post = $post; }
function delete_action() { if($this->table == 'user'){ chkpw('defined_field_user_del'); } if($this->table == 'archive'){ chkpw('defined_field_content_del'); } if(!preg_match('/^my_.+/',front::get('name'))) { front::flash('字段名称不正确!'); } $delete=$this->_table->query("ALTER TABLE `{$this->_table->name}` DROP `".front::get('name')."`"); if(!$delete) { front::flash('字段删除失败!'); }else { unset(setting::$var[$this->table][front::get('name')]); setting::save(); front::flash('字段删除成功!'); front::redirect(url::modify('act/list',true)); } }
function init() {
function config_action() { chkpw('union_config'); /*function str_replace_once($needle,$replace,$haystack) { $pos = @strpos($haystack,$needle); if ($pos === false) { return $haystack; } return substr_replace($haystack,$replace,$pos,strlen($needle)); }*/ if (front::post('submit') &&$this->manage->vaild()) { $this->manage->filter($this->Exc); $this->manage->add_before($this); $this->manage->save_before(); $path = ROOT.'/config/union.php'; $content = file_get_contents($path); foreach(front::$post['setting'] as $key=>$val) { $content = preg_replace("/'$key'=>'(.*?)',/is","'$key'=>'$val',", $content); //preg_match_all("/'".$key."'=>'(.*?)',/isu",$content,$out); //var_dump($out); //$content = str_replace_once($out[1][0],$val,$content); } //exit; file_put_contents(ROOT.'/config/union.tmp.php',$content); if($_GET['site']!='default') { set_time_limit(0); $ftp = new nobftp(); $ftpconfig = config::get('website'); $ftp->connect($ftpconfig['ftpip'],$ftpconfig['ftpuser'],$ftpconfig['ftppwd'],$ftpconfig['ftpport']); $ftperror = $ftp->returnerror(); if($ftperror) { exit($ftperror); }else { $ftp->nobchdir($ftpconfig['ftppath']); $ftp->nobput($ftpconfig['ftppath'].'/config/union.php',ROOT.'/config/union.tmp.php'); } }else { file_put_contents($path,$content); } unset($content); front::flash("{$this->tname}完成操作!"); front::redirect(url::modify('act/config/table/'.$this->table)); } $path = ROOT.'/config/union.php'; $config = include $path; $this->_view_table=$config; }
function listform_action() { chkpw('defined_form_list'); $this->view->tables=$this->tables; }
function phpwebinsert_action(){ chkpw('func_data_phpweb'); //插入数据库的总条目数 $total_num = 0; $set=settings::getInstance(); $set->name = $set->prefix.'user'; //目标表前缀 $d_prefix = $set->prefix; $user_info = $set->rec_select_one("`username`='{$_COOKIE['login_username']}'","*","`userid`"); if(!empty(front::$post['submit'])){ //判断是否填写原表前缀 if(!empty(front::$post['phpweb_prefix'])){ $s_prefix = front::$post['phpweb_prefix'].'_'; }else{ front::flash('请填写原表前缀'); return ; } //判断上传的数据库文件是否存在 $filename = ROOT.'/'.front::$post['data']; if(!file_exists(ROOT.'/'.front::$post['data'])){ front::flash('请检查是否正确上传数据库文件'); return ; } //记录前面插入的category的id $cat_id = array(); $sql_file = fopen($filename,'r'); while ($row = fgets($sql_file)){ //如果这一行不是INSERT语句就略过 if(!strstr($row,'INSERT')) continue; $tmp = strstr($row,'('); $tmp = trim($tmp,"\n\t\r\0\x0B(); "); $tmp_arr = explode('),(',$tmp); //如果是feedback_info表,则选择对应数据插入guestbook中 if(strstr($row,$s_prefix.'feedback_info')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'username' =>$arr[4], 'adddate' =>date('Y-m-d H:i:s',$arr[26]), 'state' =>$arr[29], 'guesttel' =>$arr[6], 'guestemail'=>$arr[8], 'guestqq' =>$arr[10], 'title' =>$arr[2], 'content' =>$arr[3], ); $id = put_into_db($d_prefix.'guestbook',$arr_data); if($id) $total_num++; } continue; } //如果是advs_link表,则选择对应数据插入linkword中 if(strstr($row,$s_prefix.'advs_link')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'linkword' =>$arr[2], 'linkurl' =>$arr[3], 'linktimes' =>mktime(), ); $id = put_into_db($d_prefix.'linkword',$arr_data); if($id) $total_num++; } continue; } //如果是pollindex表,则选择对应数据插入ballot中 if(strstr($row,$s_prefix.'tools_pollindex')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'id' =>$arr[0], 'title' =>$arr[1], 'type' =>'radio', ); $id = put_into_db($d_prefix.'ballot',$arr_data); if($id) $total_num++; } continue; } //如果是tools_polldata表,则选择对应数据插入option中 if(strstr($row,$s_prefix.'tools_polldata')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'bid' =>$arr[1], 'name' =>$arr[3], 'num' =>$arr[5], 'order'=>$arr[2], ); $id = put_into_db($d_prefix.'option',$arr_data); if($id) $total_num++; } continue; } //如果是product_cat表,则选择对应数据插入b_category中 if(strstr($row,$s_prefix.'product_cat')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'parentid' =>3, 'catname' =>$arr[2], 'listorder' => $arr[3], 'htmldir' =>pinyin::get($arr[2]), 'showtemplate' =>0, 'template' =>'archive/list_pic.html', 'listtemplate' =>'archive/list_pic.html', 'showtemplate' =>'archive/show_products.html', 'includecatarchives'=>1, 'ispages' =>1, 'ishtml' =>0, 'includecatarchives'=>1, 'thumb_width' =>0, 'thumb_height' =>0, 'isnav' =>0, //是否在导航栏显示字段 ); $id = put_into_db($d_prefix.'b_category',$arr_data); $cat_id['product_cat'][$arr[0]] = $id; if($id) $total_num++; } continue; } //如果是product_con表,则选择对应数据插入archive中 if(strstr($row,$s_prefix.'product_con')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'catid' =>isset($cat_id['product_cat'][$arr[1]]) ? $cat_id['product_cat'][$arr[1]] : -1, 'title' =>$arr[5], 'username' =>$user_info['username'], 'userid' =>$user_info['userid'], 'view' =>7,//确认首页是以图片的版面来显示 'spid' =>0, 'tag' =>$arr[43], 'keyword' =>$arr[43], 'listorder' =>0, 'adddate' =>date('Y-m-d H:i:s',$arr[16]), 'author' =>$arr[17], 'thumb' =>$arr[15],//列表显示的图片 'state' =>1, 'checked' =>1, 'introduce' =>$arr[22], 'introduce_len'=>200, 'content' =>$arr[6], 'template' =>'archive/show_products.html', 'ishtml' =>0, 'attr2' =>9,//产品金额 'pics' =>'a:1:{i:0;s:0:"";}',//内容多图 'city_id' =>0, 'section_id' =>0, ); $id = put_into_db($d_prefix.'archive',$arr_data); if($id) $total_num++; } continue; } //如果是news_cat表,则选择对应数据插入b_category中 if(strstr($row,$s_prefix.'news_cat')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'parentid' =>2, 'catname' =>$arr[2], 'listorder' =>$arr[3], 'htmldir' =>pinyin::get($arr[2]), 'template' =>'archive/list_text.html', 'listtemplate' =>'archive/list_text.html', 'showtemplate' =>0, 'includecatarchives'=>1, 'ispages' =>1, 'ishtml' =>0, 'includecatarchives'=>1, 'thumb_width' =>0, 'thumb_height' =>0, 'isnav' =>0, //是否在导航栏显示字段 ); $id = put_into_db($d_prefix.'b_category',$arr_data); $cat_id['news_cat'][$arr[0]] = $id; if($id) $total_num++; } continue; } //如果是news_con表,则选择对应数据插入archive中 if(strstr($row,$s_prefix.'news_con')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'catid' =>isset($cat_id['news_cat'][$arr[1]]) ? $cat_id['news_cat'][$arr[1]] : -1 , 'title' =>$arr[5], 'tag' =>$arr[46], 'username' =>$user_info['username'], 'userid' =>$user_info['userid'], 'view' =>0,//确认首页是以文本版面显示 'spid' =>0, 'keyword' =>$arr[46], 'listorder' =>0, 'adddate' =>date('Y-m-d H:i:s',$arr[16]), 'author' =>$arr[17], 'thumb' =>'',//列表显示的图片 'state' =>1, 'checked' =>1, 'introduce' =>$arr[22], 'introduce_len'=>200, 'content' =>$arr[6], 'template' =>0, 'ishtml' =>0, 'attr2' =>'',//产品金额 'pics' =>'a:0:{}', 'city_id' =>0, 'section_id' =>0, ); $id = put_into_db($d_prefix.'archive',$arr_data); if($id) $total_num++; } continue; } //如果是down_cat表,则选择对应数据插入b_category中 if(strstr($row,$s_prefix.'down_cat')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'parentid' =>6, 'catname' =>$arr[2], 'listorder' =>$arr[3], 'htmldir' =>pinyin::get($arr[2]), 'template' =>'archive/list_down.html', 'listtemplate' =>'archive/list_down.html', 'showtemplate' =>0, 'includecatarchives'=>1, 'ispages' =>1, 'ishtml' =>0, 'includecatarchives'=>1, 'thumb_width' =>0, 'thumb_height' =>0, 'isnav' =>0, //是否在导航栏显示字段 ); $id = put_into_db($d_prefix.'b_category',$arr_data); $cat_id['down_cat'][$arr[0]] = $id; if($id) $total_num++; } continue; } //如果是down_con表,则选择对应数据插入archive中 if(strstr($row,$s_prefix.'down_con')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'catid' =>isset($cat_id['down_cat'][$arr[1]]) ? $cat_id['down_cat'][$arr[1]] : -1 , 'title' =>$arr[5], 'tag' =>$arr[45], 'username' =>$user_info['username'], 'userid' =>$user_info['userid'], 'view' =>0,//确认首页是以文本版面显示 'spid' =>0, 'keyword' =>$arr[45], 'listorder' =>0, 'adddate' =>date('Y-m-d H:i:s',$arr[16]), 'author' =>$arr[17], 'thumb' =>'',//列表显示的图片 'state' =>1, 'checked' =>1, 'introduce' =>$arr[22], 'introduce_len'=>200, 'content' =>$arr[6], 'template' =>0, 'ishtml' =>0, 'linkto' =>$arr[43], 'attr1' =>$arr[44],//存放文件被下载的次数 'pics' =>'a:1:{i:0;s:0:"";}', 'city_id' =>0, 'section_id' =>0, ); $id = put_into_db($d_prefix.'archive',$arr_data); if($id) $total_num++; } continue; } //如果是photo_cat表,则选择对应数据插入b_category中 if(strstr($row,$s_prefix.'photo_cat')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'parentid' =>2, 'catname' =>$arr[2], 'listorder' => $arr[3], 'htmldir' =>pinyin::get($arr[2]), 'template' =>'archive/list_text.html', 'listtemplate' =>'archive/list_text.html', 'showtemplate' =>0, 'includecatarchives'=>1, 'ispages' =>1, 'ishtml' =>0, 'includecatarchives'=>1, 'thumb_width' =>0, 'thumb_height' =>0, 'isnav' =>0, //是否在导航栏显示字段 ); $id = put_into_db($d_prefix.'b_category',$arr_data); $cat_id['photo_cat'][$arr[0]] = $id; if($id) $total_num++; } continue; } //如果是photo_con表,则选择对应数据插入archive中 if(strstr($row,$s_prefix.'photo_con')){ foreach($tmp_arr as $v){ $arr = super_explode($v); $arr_data = array( 'catid' =>isset($cat_id['photo_cat'][$arr[1]]) ? $cat_id['photo_cat'][$arr[1]] : -1 , 'title' =>$arr[5], 'tag' =>$arr[22], 'username' =>$user_info['username'], 'userid' =>$user_info['userid'], 'view' =>0,//确认首页是以文本版面显示 'spid' =>0, 'keyword' =>$arr[22], 'listorder' =>0, 'adddate' =>date('Y-m-d H:i:s',$arr[16]), 'author' =>$arr[17], 'image' =>$arr[15],//列表显示的图片 'state' =>1, 'checked' =>1, 'introduce' =>$arr[22], 'introduce_len'=>200, 'content' =>$arr[6], 'template' =>0, 'ishtml' =>0, 'attr2' =>'',//产品金额 'pics' =>'a:0:{}', 'city_id' =>0, 'section_id' =>0, ); $id = put_into_db($d_prefix.'archive',$arr_data); if($id) $total_num++; } continue; } } front::flash('已共插入'.$total_num.'条数据'); } }
function hotsearch_action() { chkpw('archive_hotsearch'); }