修复 随机一言无法禁用

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>
<div class="foot"> <div class="foot">
<?php <?php
if ($conf['yan']) { if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>'; echo '<p class="content">' . yan().'</p>';
} }
$i= 0; $i= 0;
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $DB->query("SELECT * FROM `lylme_tags`");

View File

@ -146,8 +146,8 @@ while ($soulist = $DB->fetch($soulists)) {
<div class="site-main"> <div class="site-main">
<?php <?php
if ($conf['yan']) { if ($conf['yan'] == 'true') {
echo '<p class="content">[' . yan().']</p>'; 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;"> <div class="container" style="margin-top:10vh; position: relative; z-index: 100;">
<?php <?php
echo $conf['home-title']; echo $conf['home-title'];
if ($conf['yan']) { if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan().'</p>'; echo '<p class="content">' . yan().'</p>';
} }
?> ?>
<!--搜索开始--> <!--搜索开始-->
<div id="search" class="s-search"> <div id="search" class="s-search">

View File

@ -59,17 +59,8 @@ echo '<div id="he-plugin-simple"></div>
</div> </div>
<?php <?php
if ($conf['yan'] != 'false') { if ($conf['yan'] == 'true') {
$filename = './assets/data/data.dat'; //随机一言文件路径 echo '<p class="content">' . yan().'</p>';
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;
}
} }
?> ?>
</p> </p>

View File

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