列印

[轉貼]解決[DST]勳章中心V1.0每天定時刪除勳章問題

[轉貼]解決[DST]勳章中心V1.0每天定時刪除勳章問題

原帖:http://www.discuz.net/viewthread ... p;page=2#pid6566060
原作者:dzxw

在plugins\medalcenter\medalcenter.func.php文件:

搜索:
複製內容到剪貼簿
代碼:
if(!function_exists('array_combine')) {
        function array_combine($keys, $values) {
                $result = array();

                if(is_array($keys) && is_array($values)) {                        
                        if(count($keys) >= count($values)) {
                                foreach($values as $value) {
                                        $key = $key ? next($keys) : current($keys);
                                        $result[] = array_combine($key, $value);
                                }                                
                        } else {
                                foreach($keys as $key) {
                                        $value = $value ? next($values) : current($values);
                                        $result[] = array_combine($key, $value);
                                }
                        }                        
                } elseif(!is_array($keys) && !is_array($values)) {

                        $keys = is_string($keys) ? '\''.addcslashes($keys, '\'\\').'\'' : $keys;
                        $values = (!preg_match("/^\-?[1-9]\d*$/", $values) || strlen($values) > 12) ? '\''.addcslashes($values, '\'\\').'\'' : $values;
                        $result = array($keys => $values);
                } elseif(is_array($keys) && !is_array($values)) {
                        
                        foreach($keys as $key) {
                                $result[] = array_combine($key, $values);
                        }                        
                } elseif(!is_array($keys) && is_array($values)) {
                                                
                        foreach($values as $value) {
                                $result[] = array_combine($keys, $value);
                        }                        
                }

                return $result;
        }
}
替換成:
複製內容到剪貼簿
代碼:
if(!function_exists('array_combine')) {
function array_combine($arr_key,$arr_val){
if( !is_array($arr_key) or !is_array($arr_val)){
    echo '<b>Warning</b>:    array_combine() expects all parameters to be array';
    return false;
}
if(count($arr_key) != count($arr_val)){
    echo '<b>Warning</b>:    array_combine() Both parameters should have an equal number of elements';
    return false;
}
$count = count($arr_key);
for($i=0;$i<$count;$i++){
    $key = $arr_key[$i];
    $val = $arr_val[$i];
    $arr_new[$key] = $val;
}
return $arr_new;
}
}
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)