Exemplo n.º 1
0
 public static function getInstance()
 {
     if (!pinyin) {
         self::$instance = new pinyin();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
    function url($tag,$page=1) {
    	if(front::$get['t'] == 'wap'){
    		
    		if(config::get('tag_html')){
    			$otag = new tag();
    			$row = $otag->getrow("tagname='$tag'");
    			$tagid= $row['tagid'];
    			$pinyin = pinyin::get($tag);
    			return config::get('base_url').'/tags_wap/'.$pinyin.'_'.$tagid.'_'.$page.'.html';
    		}
    		if(front::$rewrite){
    			return config::get('base_url').'/tags_wap_'.urlencode($tag).'_'.$page.'.htm';
    		}
    		return url::create('tag/show/t/wap/tag/'.urlencode($tag).($page>1?'/page/'.$page:''),false);

    	}
    	if(config::get('tag_html')){
    		$otag = new tag();
    		$row = $otag->getrow("tagname='$tag'");
    		$tagid= $row['tagid'];
    		$pinyin = pinyin::get($tag);
    		return config::get('base_url').'/tags/'.$pinyin.'_'.$tagid.'_'.$page.'.html';
    	}
    	if(front::$rewrite){
    		return config::get('base_url').'/tags_'.urlencode($tag).'_'.$page.'.htm';
    	}
    	return url::create('tag/show/tag/'.urlencode($tag).($page>1?'/page/'.$page:''),false);
    }
Exemplo n.º 3
0
 function vaild() {
     if(!front::post('typename')) {
         front::flash('请填写类别标题等!');
         return false;
     }
     if(!front::post('htmldir'))
         front::$post['htmldir']=pinyin::get(front::post('typename'));
     return true;
 }
Exemplo n.º 4
0
function environment($city, $openweathermap = false)
{
    if (preg_match('/shi$/', $py = pinyin::encode($city))) {
        $py = substr($py, 0, strlen($py) - 3);
    }
    if ($openweathermap) {
        $citys = json_decode(file_get_contents('citys.json'), true);
        $weather = json_decode(file_get_contents('http://api.openweathermap.org/data/2.5/weather?id=' . $citys[$py] . '&units=metric&lang=zh_cn&APPID=' . APPID), true);
        $AQI = aqi($city);
        $weather['AQI'] = $AQI;
        return $weather;
    } else {
        return aqi($city);
    }
}
Exemplo n.º 5
0
 /**
  * 中文转拼音或者英文
  *
  */
 public function zh2pinyin()
 {
     import("@.ORG.pinyin");
     $pinyin = new pinyin();
     if ($_REQUEST['type'] == 'pinyin') {
         echo $pinyin->zh($_REQUEST['text']);
     } elseif ($_REQUEST['type'] == 'pinyin_first_letter') {
         echo $pinyin->first_letter($_REQUEST['text']);
     } else {
         import("@.ORG.GoogleTranslate");
         $GoogleTranslate = new GoogleTranslate();
         echo $GoogleTranslate->code($_REQUEST['text']);
     }
 }
Exemplo n.º 6
0
 /**
  * ajax方式检查应用是否存在
  *
  */
 public function check_module()
 {
     $title = $this->_get('title');
     $module_name = $this->_get('module_name');
     if ($_REQUEST['type'] == 'pinyin') {
         import('@.ORG.pinyin');
         $pinyin = new pinyin();
         if ($title) {
             $module_name = $pinyin->zh($title);
         } else {
             $module_name = $pinyin->zh($module_name);
         }
     } else {
         import('@.ORG.GoogleTranslate');
         $GoogleTranslate = new GoogleTranslate();
         if ($title) {
             $module_name = $GoogleTranslate->code($title);
         } else {
             $module_name = $GoogleTranslate->code($module_name);
         }
     }
     $db_node = M('node');
     $count = $db_node->where("name='{$module_name}' AND level=2")->count();
     if ($count < 1) {
         $match = eregi("^[A-Za-z][A-Za-z0-9_]+\$", $module_name);
         if ($match) {
             $module_name = ucfirst($module_name);
             $this->ajaxReturn($module_name, '输入正确', 1);
         } else {
             $this->ajaxReturn('', '只能输入字母、数字和_,第一个字符必需是字母。', 2);
         }
     } else {
         $this->ajaxReturn('', '应用已存在,请重新输入', 3);
     }
 }
Exemplo n.º 7
0
    function add_action() {
    	if($this->table == 'category'){
    		chkpw('category_add');
    	}
    	if($this->table == 'archive'){
    		chkpw('archive_add');
    	}
    	if($this->table == 'type'){
    		chkpw('type_add');
    		front::$post['typecontent'] = htmlspecialchars_decode(front::$post['typecontent']);
    	}
    	if($this->table == 'special'){
    		chkpw('special_add');
    		front::$post['description'] = htmlspecialchars_decode(front::$post['description']);
    	}
    	if($this->table == 'user'){
    		chkpw('user_add');
    	}
    	if($this->table == 'usergroup'){
    		chkpw('usergroup_add');
    	}
    	if($this->table == 'ballot'){
    		chkpw('func_ballot_add');
    	}
    	if($this->table == 'announcement'){
    		chkpw('func_announc_add');
    		front::$post['content'] = htmlspecialchars_decode(front::$post['content']);
    	}
    	if($this->table == 'templatetag' && front::get('tagfrom') == 'define'){
    		chkpw('templatetag_add_define');
    	}
    	if($this->table == 'templatetag' && front::get('tagfrom') == 'category'){
    		chkpw('templatetag_add_category');
    	}
    	if($this->table == 'templatetag' && front::get('tagfrom') == 'content'){
    		chkpw('templatetag_add_content');
    	}
    	if($this->table == 'linkword'){
    		chkpw('seo_linkword_add');
    	}
    	if($this->table == 'friendlink'){
    		chkpw('seo_friendlink_add');
    	}
    	
    	//用户异步提取图库图片
    	if(front::$get['ajax']){
            front::$get['dir'] = front::$get['ajax'];
            $img_arr = image_admin::listimg_action();
            foreach($img_arr as $v){
            	echo '<img src="upload/images/'.front::$get['dir'].'/'.$v.'" id="img'.str_replace('.','',$v).'" onClick="select_img(\'img'.str_replace('.','',$v).'\');" />';
            }
            exit();
        }
       
        
        if (front::post('submit') &&$this->manage->vaild()) {
            $this->manage->filter($this->Exc);
            $this->manage->add_before($this);
            $this->manage->save_before();
            front::$post['catname']=str_replace(' ','&nbsp;',front::$post['catname']);
            front::$post['htmldir']=str_replace(' ','_',front::$post['htmldir']);
            if(front::$post['introduce'] == ''){
                front::$post['introduce'] = tool::cn_substr(preg_replace('/&(.*?);/is','', strip_tags(front::$post['content'])),200);
            }
            if($this->table == 'user'){
            	//var_dump($_SESSION);
            	if(!Phpox_token::is_token('user_add', front::$post['token'])){
            		exit('非法参数');
            	}
            }
            if ($this->table == 'templatetag') {
            	if(front::$post['tagfrom']!='define' && !preg_match('/^tag_(.*?)+\.html$/is', front::$post['tagtemplate'])){
            		exit('参数非法');
            	}
            }
            if($this->table == 'category'){
	            if (front::$post['addtype'] == 'single') {
	            	if (!front::$post['htmldir']) {
	            		front::$post['htmldir'] = pinyin::get(front::$post['catname']);
	            	}
	            	$insert=$this->_table->rec_insert(front::$post);
		            if ($insert <1) {
		                front::flash("{$this->tname}添加失败!");
		            }else{
		            	$_insertid=$this->_table->insert_id();
		            	$this->manage->save_after($_insertid);
		            }
	            } else {
	            	$catearr = explode("\n", front::$post['batch_add']);
	            	foreach ($catearr as $cates) {
	            		$catetmp = explode("|", $cates);
	            		if ($catetmp[0] != '') {
	            			front::$post['catname'] = $catetmp[0];
	            			front::$post['htmldir'] = $catetmp[1];
	            			if ($catetmp[1] == '') {
	            				front::$post['htmldir'] = pinyin::get($catetmp[0]);
	            			}
	            			$insert = $this->_table->rec_insert(front::$post);
	            			if ($insert <1) {
	            				front::flash("{$this->tname}添加失败!");
	            			}else{
	            				$_insertid=$this->_table->insert_id();
	            				$this->manage->save_after($_insertid);
	            			}
	            		}
	            	}
	            }
	            front::refresh(url::modify('act/list',true));
            }else{
	            $insert = $this->_table->rec_insert(front::$post);
	            $_insertid=$this->_table->insert_id();
	            $this->manage->save_after($_insertid);
	            if ($insert <1) {
	                front::flash("{$this->tname}添加失败!");
	            }else {
	                event::log("添加".$this->tname,'成功');  
	                $info='';
	                if ($this->table == 'archive') {
	                    $url=url('archive/show/aid/'.$_insertid,false);
	                    if (front::get('site') == 'default'||front::get('site') == '') {
	                        $info='<a href="'.$url.'" target="_blank">查看</a>';
	                    }
	                }
	                front::flash("{$this->tname}添加成功!$info");
	                if (front::get('type') == 'dialog') {
	                    if ($this->table == 'option') {
	                        front::flash();
	                        exit('添加成功!');
	                    }
	                }
	                if ($this->table == 'templatetag') {
	                    front::refresh(url::modify('act/list/tagfrom/content',true));
	                }
	                else {
	                    front::refresh(url::modify('act/list',true));
	                }
	            }
            }
        }
        //$tag_option_info = settings::getInstance()->getrow(array('tag'=>'table-hottag'));
        //$tag_option_arr = unserialize($tag_option_info['value']);
        $this->_view_table=array();
        $this->_view_table['data']=array();
        $this->view->image_dir = image_admin::listdir_action();
        $this->view->token = Phpox_token::grante_token('user_add');
        //$this->view->tag_opton = explode("\n",$tag_option_arr['hottag']);
    }
Exemplo n.º 8
0
 function make_tag_action() {
 	chkpw('cache_tag');
 	header('Cache-control: private, must-revalidate');
 	set_time_limit(0);
 	if(!front::$get['tag']){
 		front::$get['tag'] = front::$post['tag'];
 	}
 	if(!front::$get['submit']){
 		front::$get['submit'] = front::$post['submit'];
 	}
 	$otag=new tag();
 	$tags=$otag->getrows("",0);
 	//var_dump($tags);
 	$tags = $this->view->hottags = array_to_hashmap($tags,'tagid','tagname');
 	
 	if (!front::get('submit'))
 		return;
 	if(!config::get('tag_html')||!front::$get['tag']){
 		front::flash("没有设置生成html!");
 		front::redirect(front::$from);
 		return;
 	}
 	$tagid = front::$get['tag'];
 	$tag = $tags[$tagid];
 	$pinyin = pinyin::get($tag);
 	
 	$arctag=new arctag();
 	$archive_num=$arctag->rec_count('tagid='.$tagid);
 	front::$record_count = $archive_num;
 	$pagesize = config::get('list_pagesize');
 	front::$pages = $pagesize;
 	$cpage = ceil($archive_num/$pagesize);
 	$j=0;
 	for($i=1;$i<=$cpage;$i++){
 		$path = 'tags/'.$pinyin.'_'.$tagid.'_'.$i.'.html';
 		tool::mkdir(dirname($path));
 		$data = file_get_contents(config::get('site_url').'index.php?case=tag&act=show&tag='.urlencode($tag).'&page='.$i);
 		if(file_put_contents($path, $data)){
 			$j++;
 		}
 	}
 	if ($j > 0){
 		front::flash("成功生成html <b>$j</b> 页!");
 		front::redirect(front::$from);
 	}else{
 		front::flash("没有数据生成html!");
 		front::redirect(front::$from);
 	}
 }
Exemplo n.º 9
0
function get_pinyin($str, $charset = "utf-8")
{
    $pinyin = new pinyin();
    return $pinyin->get_pinyin($str, $charset);
}
Exemplo n.º 10
0
    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.'条数据');
         }
    }