70 lines
2.5 KiB
PHP
70 lines
2.5 KiB
PHP
<?php
|
|
include_once($GG['Config']['Folder']."../ppxq/Smarty.class.php");
|
|
include_once($GG['Config']['Folder']."../ppxq/Config_File.class.php");
|
|
include_once($GG['Config']['Folder']."../ppxq/Smarty_Compiler.class.php");
|
|
$ppxq = new Smarty;
|
|
$ppxq -> template_dir = $GG['Config']['Folder']."m/"; //模板存放目录
|
|
$ppxq -> compile_dir = $GG['Config']['Folder']."m_c/"; //编译目录
|
|
$ppxq -> config_dir = $GG['Config']['Folder']."configs/"; //常量 {config_load file='foo.conf'}
|
|
$ppxq -> cache_dir = $GG['Config']['Folder']."cache/";//缓存目录
|
|
$ppxq -> left_delimiter = "<!--{"; //左定界符
|
|
$ppxq -> right_delimiter = "}-->"; //右定界符
|
|
//时间函数
|
|
function timename($params){
|
|
extract($params);
|
|
$dqt=date("Ymd",$time);
|
|
if($dqt==date("Ymd")){
|
|
$sjs='<font color=red>今天</font> ';
|
|
}elseif($dqt==date("Ymd",mktime(0,0,0,date("m"),date("d")-1,date("Y")))){
|
|
$sjs='<font color=#ff6600>昨天</font> ';
|
|
}elseif($dqt==date("Ymd",mktime(0,0,0,date("m"),date("d")-2,date("Y")))){
|
|
$sjs='<font color=#996600>前天</font> ';
|
|
}else{
|
|
$d=round((time()-$time)/3600/24);
|
|
if($d<999){
|
|
$sjs=$d."天前 ".date("Y",$time);
|
|
}else{
|
|
$sjs="很久".date("Y",$time);
|
|
}
|
|
}
|
|
if($duan)$sjs.="<br><font color=#999999>";
|
|
return $sjs." ".date("m-d H:i:s",$time)."</font>";
|
|
}
|
|
//经验值等级 hd 做活动奖励局数
|
|
$GradeArr = [
|
|
['title'=>'雀蛋','min'=>0,'max'=>199,'hd'=>0],
|
|
['title'=>'雀仔','min'=>200,'max'=>499,'hd'=>20],
|
|
['title'=>'雀头','min'=>500,'max'=>999,'hd'=>50],
|
|
['title'=>'铜雀','min'=>1000,'max'=>1999,'hd'=>80],
|
|
['title'=>'银雀','min'=>2000,'max'=>3999,'hd'=>120],
|
|
['title'=>'金雀','min'=>4000,'max'=>5999,'hd'=>160],
|
|
['title'=>'雀王','min'=>6000,'max'=>9999,'hd'=>200],
|
|
['title'=>'雀皇','min'=>10000,'max'=>14999,'hd'=>250],
|
|
['title'=>'雀仙','min'=>15000,'max'=>19999,'hd'=>300],
|
|
['title'=>'雀圣','min'=>20000,'max'=>29999,'hd'=>400],
|
|
['title'=>'雀神','min'=>30000,'hd'=>500]
|
|
];
|
|
$hd_day = [100,90,80,70,60,50,40,30,20,10];
|
|
$hd_month = [8888,5000,3000,2000,1500,1000,900,800,700,600,500,480,450,420,400,380,360,340,320,300,280,260,240,220,200,180,160,140,120,100];
|
|
function gradetit($params){
|
|
extract($params);
|
|
foreach($GradeArr as $k => $v){
|
|
if($gjf>=$v['min'] && $gjf<=$v['max']){
|
|
return $v['title'];
|
|
}elseif(!$v['max'] && $gjf>=$v['min']){
|
|
return $v['title'];
|
|
}
|
|
}
|
|
}
|
|
//排序
|
|
function arraySequence($array, $field, $sort = 'SORT_DESC'){
|
|
$arrSort = array();
|
|
foreach ($array as $uniqid => $row) {
|
|
foreach ($row as $key => $value) {
|
|
$arrSort[$key][$uniqid] = $value;
|
|
}
|
|
}
|
|
array_multisort($arrSort[$field], constant($sort), $array);
|
|
return $array;
|
|
}
|
|
?>
|