= array('cid'=>$prev_next_cid, 'id'=>array('>'=> $id)); }else{ $prev_where = array('id'=>array('<'=> $id)); $next_where = array('id'=>array('>'=> $id)); } // 上1条 $_show['prev'] = $run->cms_content->list_arr($prev_where, 'id', -1, 0, 1, 1, $extra); if($_show['prev']){ $_show['prev'] = current($_show['prev']); $run->cms_content->format($_show['prev'], $mid, $dateformat); } // 下1条 $_show['next'] = $run->cms_content->list_arr($next_where, 'id', 1, 0, 1, 1, $extra); if($_show['next']){ $_show['next'] = current($_show['next']); $run->cms_content->format($_show['next'], $mid, $dateformat); } }else{ $_show['prev'] = $_show['next'] = array(); } if($cache_key){ $run->runtime->set_block_data_cache($cache_key, $_show, $life); } return $_show; } $gdata = block_global_show(array ( 'show_prev_next' => '0', 'dateformat' => 'Y-m-d H:i', )); function block_tianqi_searchtq($conf) { global $run; $life = isset($conf['life']) ? (int)$conf['life'] : (isset($run->_cfg['life']) ? (int)$run->_cfg['life'] : 0); $orderby = isset($conf['orderby']) && in_array($conf['orderby'], array('id', 'orderby')) ? $conf['orderby'] : 'id'; $orderway = isset($conf['orderway']) && $conf['orderway'] == 1 ? 1 : -1; $start = _int($conf, 'start'); $limit = _int($conf, 'limit', 100); $cache_params = array($orderby, $orderway, $start, $limit); //优先从缓存表读取。加前缀,避免不同的block,相同的cache_params,导致缓存数据错乱 $cache_key = $life ? md5('tianqi_searchtq'.serialize($cache_params)) : ''; if($cache_key){ $cache_data = $run->runtime->get_block_data_cache($cache_key); if($cache_data){ return $cache_data; } } $ret['list'] = $run->tianqi_area->Getone_pArea(0, $orderby, $orderway, $start, $limit); if($cache_key){ $run->runtime->set_block_data_cache($cache_key, $ret, $life); } return $ret; } function block_tianqi_area_rand($conf) { global $run; $life = isset($conf['life']) ? (int)$conf['life'] : (isset($run->_cfg['life']) ? (int)$run->_cfg['life'] : 0); $_date = isset($_GET['date']) ? $_GET['date'] : ''; $limit = _int($conf, 'limit', 20); $cache_params = array($limit, $_date); //优先从缓存表读取。加前缀,避免不同的block,相同的cache_params,导致缓存数据错乱 $cache_key = $life ? md5('tianqi_area_rand'.serialize($cache_params)) : ''; if($cache_key){ $cache_data = $run->runtime->get_block_data_cache($cache_key); if($cache_data){ return $cache_data; } } $le_tianqi_days = $run->_cfg['le_tianqi_days']; $table_prefix = $_ENV['_config']['db']['master']['tablepre']; $table_full = $table_prefix.'tianqi_weather'; //tianqi_weather条数2069 $max = 2069-$limit; $rand = rand(1, $max); $sql = 'SELECT areaid FROM ' . $table_full . ' LIMIT '.$rand.','. $limit; $arr = $run->db->fetch_all($sql); $keys = array(); foreach($arr as $v){ $keys[] = $v['areaid']; } if($_date){ if(!isset($le_tianqi_days[$_date])){ core::error404(); } $ret['dateName'] = $le_tianqi_days[$_date]['name']; }else{ $ret['dateName'] = '天气30天'; } $ret['list'] = $run->tianqi_area->mget($keys); foreach($ret['list'] as $k=>&$v){ if(!isset($v['pinyin']) || empty($v['pinyin'])){ unset($ret['list'][$k]); continue; } $v['url'] = $run->tianqi_area->_url($v['pinyin'], $_date); $v['title'] = $v['Ab'].$ret['dateName']; } if($cache_key){ $run->runtime->set_block_data_cache($cache_key, $ret, $life); } return $ret; } function block_tianqi_area_by_pinyin($conf) { global $run; $life = isset($conf['life']) ? (int)$conf['life'] : (isset($run->_cfg['life']) ? (int)$run->_cfg['life'] : 0); $pinyin = empty($conf['pinyin']) ? '' : $conf['pinyin']; //多个用,隔开 $_date = isset($_GET['date']) ? $_GET['date'] : $run->_cfg['le_tianqi_default_day']; if(!$pinyin){ $pinyin = $run->_cfg['le_tianqi_hot_city']; } $cache_params = array($pinyin, $_date); //优先从缓存表读取。加前缀,避免不同的block,相同的cache_params,导致缓存数据错乱 $cache_key = $life ? md5('tianqi_area_by_pinyin'.serialize($cache_params)) : ''; if($cache_key){ $cache_data = $run->runtime->get_block_data_cache($cache_key); if($cache_data){ return $cache_data; } } $pinyin_arr = explode(',',$pinyin); $where = array('pinyin'=>array('IN'=> $pinyin_arr)); $le_tianqi_days = $run->_cfg['le_tianqi_days']; if(!isset($le_tianqi_days[$_date])){ core::error404(); } $ret['dateName'] = $le_tianqi_days[$_date]['name']; $ret['list'] = $run->tianqi_area->find_fetch($where); foreach($ret['list'] as &$v){ $v['url'] = $run->tianqi_area->_url($v['pinyin'], $_date); $v['title'] = $v['Ab'].$ret['dateName']; } if($cache_key){ $run->runtime->set_block_data_cache($cache_key, $ret, $life); } return $ret; } /** * 友情链接插件 * @param string cate 分类 * @param string orderby 排序方式 * @param int orderway 降序(-1),升序(1) * @param int start 开始位置 * @param int limit 显示几条 * @return array */ function block_links($conf) { global $run; // 兼容旧版表结构:确保 expire / position 字段存在 static $field_checked = false; if(!$field_checked) { $field_checked = true; $tablepre = $run->db->tablepre; $cols = $run->db->fetch_all("SHOW COLUMNS FROM {$tablepre}links"); $fields = array(); foreach($cols as $c) { $fields[$c['Field']] = 1; } if(!isset($fields['expire'])) { $run->db->query("ALTER TABLE {$tablepre}links ADD COLUMN expire int(10) unsigned NOT NULL DEFAULT '0' COMMENT '到期时间戳(0为永久)'"); } if(!isset($fields['position'])) { $run->db->query("ALTER TABLE {$tablepre}links ADD COLUMN position tinyint(3) unsigned NOT NULL DEFAULT '15' COMMENT '显示位置位掩码:1=PC首页2=PC内页4=手机首页8=手机内页15=全部'"); } } // 计算当前页面的位置 bitmask // 1=PC首页 2=PC内页 4=手机首页 8=手机内页 $cur_pos = 0; $is_mobile = is_mobile(); $uri = isset($_SERVER['REQUEST_URI']) ? ltrim(strtok($_SERVER['REQUEST_URI'], '?'), '/') : ''; $is_home = ($uri === '' || $uri === 'index.php'); if($is_mobile) { $cur_pos = $is_home ? 4 : 8; } else { $cur_pos = $is_home ? 1 : 2; } $where = array(); $orderby = isset($conf['orderby']) && in_array($conf['orderby'], array('id', 'orderby')) ? $conf['orderby'] : 'id'; $orderway = isset($conf['orderway']) && $conf['orderway'] == 1 ? 1 : -1; $start = _int($conf, 'start'); $limit = _int($conf, 'limit', 10); $arr = $run->links->find_fetch($where, array($orderby => $orderway), $start, $limit); // 已过期的友情链接自动删除 (同时从前台输出中剔除) $time = $_ENV['_time']; foreach($arr as $k => $v) { if(!empty($v['expire']) && $v['expire'] < $time) { $run->links->delete($v['id']); unset($arr[$k]); continue; } // 按显示位置过滤 $link_pos = isset($v['position']) ? (int)$v['position'] : 15; if($link_pos != 15 && !($link_pos & $cur_pos)) { unset($arr[$k]); } } return $arr; } ?> 陇南2026年10月20日天气及温度,生活指数,空气PM2.5质量情况 - 天气预报网
Lecms 3.0.3 错误

错误信息

错误位置

基本信息

程序流程

SQL

$_GET

$_POST

$_COOKIE

包含文件

其他信息