📄 wiki_index.php
字号:
<?php
/*
百科全书插件 for UCH 1.5
版权所有: www.carqi.com 卡奇网——最互动、最娱乐的车友会
作者:Cody service@carqi.com
QQ:779626052
*/
if ( !defined( "IN_UCHOME" ) )
{
exit( "Access Denied" );
}
$perpage = 10;
$start = empty( $_GET['start'] ) ? 0 : intval( $_GET['start'] );
ckstart( $start, $perpage );
$uid = (int)$_GET['uid'];
if (empty($uid)) {
$uid = $_SGLOBAL['supe_uid']; //如果地址栏没有uid参数,默认就是自己
}
$type = empty( $_GET['type'] ) ? 0 : intval( $_GET['type'] );
$where = " WHERE 1 ";
if (!empty($type)) {
$where .= " AND typeid = {$type} ";
}
$actives = array( $type => " class=\"active\"" );
$theurl = "wiki.php?do=wiki&ac={$ac}&typeid={$typeid}";
$sql = "SELECT * FROM ".tname("app_wiki")." $where ORDER BY id DESC limit $start,$perpage";
$query = $_SGLOBAL['db']->query( $sql );
$list = array( );
$count = 0;
while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
{
$value['typename'] = $gEumsType[$value['typeid']];
$value['content'] = getstr(strip_tags($value['content']), 150);
$list[] = $value ;
$count ++ ;
}
$multi = smulti( $start, $perpage, $count, $theurl );
//取 hot
$filePath = S_ROOT."./data/wiki_hot_cache.php";
if ( file_exists($filePath) && (time() - filemtime($filePath)) < 60*3 )
{
$code = @file_get_contents($filePath); //获取缓存内容
$hotask = unserialize($code);
}
if (empty($hotask) ) {
$hotask = array();
$sql = "SELECT * FROM ".tname("app_wiki")." ORDER BY view_count DESC limit 10";
$query = $_SGLOBAL['db']->query( $sql );
while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
{
$hotask[] = $value ;
}
swritefile($filePath, serialize($hotask));
}
include_once( template( "wiki/view/wiki" ) );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -