优化网站
This commit is contained in:
1 parent
9bb6e6a41e
commit
0e7265481f
22 files changed
+1071
-238
No files matched your search
@@ -146,28 +146,6 @@ function layout_footer(): void
|
||||
echo '</div></footer>' . "\n";
|
||||
}
|
||||
|
||||
/** 读取首页展示的名言(quota.txt 随机一行) */
|
||||
function home_quote(): string
|
||||
{
|
||||
$file = DATA_DIR . '/quota.txt';
|
||||
$lines = [];
|
||||
if (is_file($file)) {
|
||||
$raw = @file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
if (is_array($raw)) {
|
||||
foreach ($raw as $ln) {
|
||||
$ln = trim($ln);
|
||||
if ($ln !== '' && strpos($ln, '#') !== 0) {
|
||||
$lines[] = $ln;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$lines) {
|
||||
return '知识就是力量。';
|
||||
}
|
||||
return $lines[array_rand($lines)];
|
||||
}
|
||||
|
||||
/** 首页访客信息(hero 信息模式):IP 与浏览器/系统/内核由服务端解析 UA 提供,屏幕/语言由前端补齐 */
|
||||
function visitor_brief(): array
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user