当前位置: 首页>>代码示例>>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;未经允许,请勿转载。