當前位置: 首頁>>代碼示例>>PHP>>正文


PHP settings::getInstance方法代碼示例

本文整理匯總了PHP中settings::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP settings::getInstance方法的具體用法?PHP settings::getInstance怎麽用?PHP settings::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在settings的用法示例。


在下文中一共展示了settings::getInstance方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: name

 function name($id) {
 	$name = '';
 	$attr1 = settings::getInstance()->getrow(array('tag'=>'table-archive'));
 	if ($attr1['value'])
         self::$var = @unserialize($attr1['value']);
     else
         self::$var = array();
     preg_match_all('/\(([\d\w]+)\)(\S+)/is',self::$var['attr1'],$result,PREG_SET_ORDER);
     $id_arr = explode(',',$id);
     foreach($result as $v){
    	    foreach($id_arr as $t_v){
    	    	if(in_array($t_v,$v))
    	    	   $name .= $v[2].' / ';
    	    }
     }
     return $name;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:17,代碼來源:attr1.php

示例2: list_action

 function list_action() {
 	chkpw('union_list');
     $set1=settings::getInstance();
     $sets1=$set1->getrow(array('tag'=>'table-'.$this->table));
     $setsdata1=unserialize($sets1['value']);
     $this->view->settings=$setsdata1;
     $where=null;
     $ordre='`userid` DESC';
     $limit=((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize;
     $this->_view_table=$this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage'));
     $this->view->record_count=$this->_table->record_count;
     $this->_view_user = new user;
     foreach($this->_view_table as $key=>$val) {
         $userunion = $this->_view_user->getrow(array('userid'=>$val['userid']));
         $val['point'] = $userunion['point'];
         $this->_view_table[$key] = $val;
     }
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:18,代碼來源:union_admin.php

示例3: getTags

 static function getTags() {
 	$data=array();
 	$data[0] = '請選擇';
 	$otag = new tag();
 	$row = $otag->getrows('',0,'tagid ASC');
 	if(is_array($row)){
 		foreach ($row as $arr){
 			$data[$arr['tagname']] = $arr['tagname'];
 		}
 	}
 	//return $data;
 	$sets=settings::getInstance()->getrow(array('tag'=>'table-hottag'));
 	if (!is_array($sets)){
 		return $data;
 	}
 	$data1=unserialize($sets['value']);
 	preg_match_all('%\(([\d\w\/\.-]+)\)(\S+)%m',$data1['hottag'],$result,PREG_SET_ORDER);
 	foreach ($result as $res)
 		$data[$res[2]]=$res[2];
 	
 	return $data;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:22,代碼來源:tag.php

示例4: gettypes

 function gettypes() {
     $sets=settings::getInstance()->getrow(array('tag'=>'table-friendlink'));
     if (!is_array($sets))
         return;
     $data=unserialize($sets['value']);
     preg_match_all('%\(([\d\w\/\.-]+)\)(\S+)%m',$data['types'],$result,PREG_SET_ORDER);
     $data=array();
     foreach ($result as $res) $data[$res[1]]=$res[2];
     return $data;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:10,代碼來源:front_class.php

示例5: setting_action

 function setting_action() {
     $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'=>serialize($var),'tag'=>'table-'.$this->table,'array'=>var_export($var,true)));
         front::flash("{$this->tname}配置成功!");
     }
     $this->view->settings=$data;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:13,代碼來源:logistics_admin.php

示例6: esearch_action

    function esearch_action() {
    	front::check_type(front::get('keyword'), 'safe');
    	$this->view->keyword = trim(front::get('keyword'));
    	if($this->view->keyword){
	    	$path = ROOT . '/data/hotsearch/' . urlencode($this->view->keyword) . '.txt';
	    	$mtime = @filemtime($path);
	    	$time = intval(config::get('search_time'))?intval(config::get('search_time')):30;
	        if(time() - $mtime < $time && !front::get('page')){
	        	alertinfo($time.'秒內不能重複搜索','index.php?t='.front::get('t'));
	        }
	    	$keywordcount = @file_get_contents($path);
	    	$keywordcount = $keywordcount + 1;
	    	file_put_contents($path, $keywordcount);
	    	$type = $this->view->category;
	    	$condition = "";
	    	if (front::get('catid')) {
	    		$condition .= "catid = '" . front::get('catid') . "' AND ";
	    	}
	    	$condition .= "(title like '%" . $this->view->keyword . "%'";
	    	$sets = settings::getInstance()->getrow(array('tag' => 'table-fieldset'));
	    	$arr = unserialize($sets['value']);
	    	if (is_array($arr['archive']) && !empty($arr['archive'])) {
	    		foreach ($arr['archive'] as $v) {
	    			if ($v['issearch'] == '1' && front::get($v['name'])) {
	    				if($v['selecttype']){
	    					$condition .= " AND {$v['name']} = '".front::get($v['name'])."'";
	    				}else{
	    					$condition .= " AND {$v['name']} like '%".front::get($v['name'])."%'";
	    				}
	    			}
	    		}
	    	}
	    	$condition .= ")";
	    	$order = "`listorder`,1 DESC";
	    	$limit = (($this->view->page - 1) * $this->pagesize) . ',' . $this->pagesize;
	    	$articles = $this->archive->getrows($condition, $limit, $order);
	    	foreach ($articles as $order => $arc) {
	    		$articles[$order]['url'] = archive::url($arc);
	    		$articles[$order]['catname'] = category::name($arc['catid']);
	    		$articles[$order]['caturl'] = category::url($arc['catid']);
	    		$articles[$order]['adddate'] = sdate($arc['adddate']);
	    		$articles[$order]['stitle'] = strip_tags($arc['title']);
	    	}
	    	$this->view->articles = $articles;
	    	$this->view->archives = $articles;
	    	$this->view->record_count = $this->archive->record_count;
    	}
    	$this->view->field = $this->archive->getFields();
    }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:49,代碼來源:archive_act.php

示例7: setting_action

 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;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:20,代碼來源:table_admin.php

示例8: search_action

 function search_action() {
     if(front::get('keyword') &&!front::post('keyword'))
         front::$post['keyword']=front::get('keyword');
     front::check_type(front::post('keyword'),'safe');
     if(front::post('keyword')) {
         $this->view->keyword=trim(front::post('keyword'));
         session::set('keyword',$this->view->keyword);
     }
     else {
         session::set('keyword',null);
         $this->view->keyword=session::get('keyword');
     }
     $type = $this->view->type;
     $condition = "";
     if(front::post('catid')) {
         $condition .= "catid = '".front::post('catid')."' AND ";
     }
     $condition .= "(title like '%".$this->view->keyword."%'";
     $sets=settings::getInstance()->getrow(array('tag'=>'table-fieldset'));
     $arr = unserialize($sets['value']);
     if(is_array($arr['archive']) &&!empty($arr['archive'])) {
         foreach ($arr['archive'] as $v) {
             if($v['issearch'] == '1') {
                 $condition .= " OR {$v['name']} like '%{$this->view->keyword}%'";
             }
         }
     }
     $condition .= ")";
     $order = "`listorder` desc,1 DESC";
     $limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
     $articles=$this->archive->getrows($condition,$limit,$order);
     foreach($articles as $order=>$arc) {
         $articles[$order]['url']=archive::url($arc);
         $articles[$order]['catname']=category::name($arc['catid']);
         $articles[$order]['caturl']=category::url($arc['catid']);
         $articles[$order]['adddate']= sdate($arc['adddate']);
         $articles[$order]['stitle']= strip_tags($arc['title']);
     }
     $this->view->articles=$articles;
     $this->view->archives=$articles;
     $this->view->record_count=$this->archive->record_count;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:42,代碼來源:form_act.php

示例9: getattrs

 function getattrs($att_order=1) {
     $attr='attr'.$att_order;
     $sets=settings::getInstance()->getrow(array('tag'=>'table-archive'));
     if (!is_array($sets)) return;
     $data=unserialize($sets['value']);
     preg_match_all('%\(([\d\w\/\.-]+)\)(\S+)%m',$data[$attr],$result,PREG_SET_ORDER);
     $data=array();
     foreach ($result as $res)
         $data[$res[1]]=$res[2];
     return $data;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:11,代碼來源:archive.php

示例10: phpwebinsert_action

    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;
//.........這裏部分代碼省略.........
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:101,代碼來源:database_admin.php

示例11: array

        echo '<td width="19%" align="right">調用置頂內容<td width="1%">&nbsp;</td><td width="70%">';
        echo form::select('istop', $tag_config['istop'],
                array(
			'1'=>'是',
            '0'=>'否',
        ));
         echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">調用記錄條數<td width="1%">&nbsp;</td><td width="70%">';
        echo form::input('limit', $tag_config['limit'], 'class="input_c"');
         echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">縮略圖<td width="1%">&nbsp;</td><td width="70%">';
		if($tag_config['thumb'] == 'on') $checked = 'checked';
        echo '<input type="checkbox" name="thumb" id="thumb" '.$checked.' />';
         echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">推薦位<td width="1%">&nbsp;</td><td width="70%">';
		$set=settings::getInstance();
        $sets=$set->getrow(array('tag'=>'table-archive'));
        $ds=unserialize($sets['value']);
		preg_match_all('%\(([\d\w\/\.-]+)\)(\S+)%s',$ds['attr1'],$result,PREG_SET_ORDER);
        $sdata=array();
        foreach ($result as $res) $sdata[$res[1]]=$res[2];
        echo form::select('attr1', $tag_config['attr1'], $sdata);
        echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">標簽模板<td width="1%">&nbsp;</td><td width="70%">';
        echo form::select('tagtemplate', $tag_config['tagtemplate'], $tplarray);
        echo '<span class="hotspot" onmouseover="tooltip.show(\'標簽模板文件存放在&nbsp;template/當前使用模板目錄/tpltag/tag_content_*.html!\');" onmouseout="tooltip.hide();"><img src="images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span><br/><div style="display:none">';

        //echo form::getform('tagcontent',$form,$field,$data);
        echo form::textarea('tagcontent', 'null', 'cols="70" rows="20"');
		echo '</td></tr>';
        
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:30,代碼來源:listtag_helper_edit.php

示例12: init

 function init() {
 }
 
 function getcnzz_action(){
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:4,代碼來源:config_admin.php


注:本文中的settings::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。