修复 随机一言无法禁用

This commit is contained in:
六零 2022-06-18 23:29:57 +08:00
parent bf8a4c4f23
commit 1807e424e9
5 changed files with 11 additions and 20 deletions

View File

@ -112,8 +112,8 @@ if(empty($sousw)||empty($soun)) {
</div>
<div class="foot">
<?php
if ($conf['yan']) {
echo '<p class="content">' . yan().'</p>';
if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>';
}
$i= 0;
$tagslists = $DB->query("SELECT * FROM `lylme_tags`");

View File

@ -146,8 +146,8 @@ while ($soulist = $DB->fetch($soulists)) {
<div class="site-main">
<?php
if ($conf['yan']) {
echo '<p class="content">[' . yan().']</p>';
if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>';
}

View File

@ -87,9 +87,9 @@ if ($conf['tq'] != 'false') {
<div class="container" style="margin-top:10vh; position: relative; z-index: 100;">
<?php
echo $conf['home-title'];
if ($conf['yan']) {
echo '<p class="content">' . yan().'</p>';
}
if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>';
}
?>
<!--搜索开始-->
<div id="search" class="s-search">

View File

@ -59,17 +59,8 @@ echo '<div id="he-plugin-simple"></div>
</div>
<?php
if ($conf['yan'] != 'false') {
$filename = './assets/data/data.dat'; //随机一言文件路径
if (file_exists($filename)) {
$data = explode(PHP_EOL, file_get_contents($filename));
$result = str_replace(array(
"\r",
"\n",
"\r\n"
) , '', $data[array_rand($data) ]);
echo '<p class="content">' . $result;
}
if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>';
}
?>
</p>

View File

@ -96,8 +96,8 @@ echo '<div id="he-plugin-simple"></div>
</div>
<?php
//调用随机一言
if ($conf['yan']) {
echo '<p class="content">' . yan().'</p>';
if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>';
}
?>
<!--搜索开始-->