From 194f809d5cad76eb61fefd0db0154c7eeb1c14f8 Mon Sep 17 00:00:00 2001
From: tianya <yanghuxiao@vip.qq.com>
Date: Sun, 22 May 2022 10:36:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=E8=B0=83?=
 =?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/admin/templets/friendlink_type.htm |  2 +-
 src/apps/flink.php                     | 12 +++++++++---
 src/apps/flink_add.php                 | 13 -------------
 src/apps/vote.php                      |  4 ----
 src/install/sql-dfdata.txt             |  2 +-
 src/system/dedevote.class.php          |  9 ++++-----
 src/system/taglib/loop.lib.php         |  1 -
 src/theme/plus/flink-list.htm          |  8 ++++----
 8 files changed, 19 insertions(+), 32 deletions(-)
 delete mode 100755 src/apps/flink_add.php

diff --git a/src/admin/templets/friendlink_type.htm b/src/admin/templets/friendlink_type.htm
index de15dfab..74bf1178 100644
--- a/src/admin/templets/friendlink_type.htm
+++ b/src/admin/templets/friendlink_type.htm
@@ -17,7 +17,7 @@
           <a href="friendlink_main.php">友情链接管理</a>
           <a href="friendlink_add.php" class="btn btn-success btn-sm">增加链接</a>
           <a href="friendlink_type.php" class="btn btn-success btn-sm">网站类型管理</a>
-          <a href="../apps/flink_add.php" target="_blank" class="btn btn-success btn-sm">外部申请表单</a>
+          <a href="../apps/flink.php?dopost=add" target="_blank" class="btn btn-success btn-sm">外部申请表单</a>
         </td>
       </tr>
       <tr bgcolor="#F8FCF1">
diff --git a/src/apps/flink.php b/src/apps/flink.php
index 11f9141d..94c30986 100755
--- a/src/apps/flink.php
+++ b/src/apps/flink.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * 友情链接
  *
@@ -8,7 +9,7 @@
  * @license        https://www.dedebiz.com/license
  * @link           https://www.dedebiz.com
  */
-require_once(dirname(__FILE__)."/../system/common.inc.php");
+require_once(dirname(__FILE__) . "/../system/common.inc.php");
 if (empty($dopost)) $dopost = '';
 if ($dopost == 'save') {
     $validate = isset($validate) ? strtolower(trim($validate)) : '';
@@ -27,7 +28,12 @@ if ($dopost == 'save') {
     $query = "INSERT INTO `#@__flink`(sortrank,url,webname,logo,msg,email,typeid,dtime,ischeck)
                     VALUES('50','$url','$webname','$logo','$msg','$email','$typeid','$dtime','0')";
     $dsql->ExecuteNoneQuery($query);
-    ShowMsg('成功增加一个链接,但需要审核后才能显示!', '-1', 1);
+    ShowMsg('成功增加一个链接,但需要审核后才能显示!', 'flink.php');
+    exit;
+} elseif ($dopost == 'add') {
+    //显示模板(简单PHP文件)
+    include_once(DEDETEMPLATE . '/plus/flink-add.htm');
+    exit;
 }
 //显示模板简单PHP文件
-include_once(DEDETEMPLATE.'/plus/flink-list.htm');
\ No newline at end of file
+include_once(DEDETEMPLATE . '/plus/flink-list.htm');
diff --git a/src/apps/flink_add.php b/src/apps/flink_add.php
deleted file mode 100755
index af7a57b2..00000000
--- a/src/apps/flink_add.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-/**
- * 增加友情链接
- *
- * @version        $Id: flink_add.php$
- * @package        DedeBIZ.Site
- * @copyright      Copyright (c) 2022, DedeBIZ.COM
- * @license        https://www.dedebiz.com/license
- * @link           https://www.dedebiz.com
- */
-require_once(dirname(__FILE__).'/../system/common.inc.php');
-//显示模板(简单PHP文件)
-include_once(DEDETEMPLATE.'/plus/flink-add.htm');
\ No newline at end of file
diff --git a/src/apps/vote.php b/src/apps/vote.php
index 806508fe..e849bd24 100755
--- a/src/apps/vote.php
+++ b/src/apps/vote.php
@@ -14,9 +14,6 @@ require(DEDEINC."/memberlogin.class.php");
 require(DEDEINC."/userlogin.class.php");
 $member = new MemberLogin;
 $memberID = $member->M_LoginID;
-$time = time();
-$content = $memberID.'|'.$time;
-$file = DEDEDATA.'/cache/vote_'.$aid.'_'.$member->M_ID.'.inc'; //存放会员投票记录的缓存文件
 $loginurl = $cfg_basehost."/user";
 $ENV_GOBACK_URL = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
 if (empty($dopost)) $dopost = '';
@@ -37,7 +34,6 @@ if ($row['isallow'] == 1) {
     }
 }
 if ($dopost == 'send') {
-
     if (!empty($voteitem)) {
         $rsmsg = "<br>您方才的投票状态:".$vo->SaveVote($voteitem)."<br>";
     } else {
diff --git a/src/install/sql-dfdata.txt b/src/install/sql-dfdata.txt
index 4ad28d88..d99565a8 100755
--- a/src/install/sql-dfdata.txt
+++ b/src/install/sql-dfdata.txt
@@ -591,7 +591,7 @@ INSERT INTO `#@__sys_set` VALUES('1','nature','性格外向,性格内向,活泼
 ('2','language','普通话,上海话,广东话,英语,日语,韩语,法语,意大利语,德语,西班牙语,俄语,阿拉伯语');
 
 
-INSERT INTO `#@__vote` VALUES('1','您是从哪儿得知本站的','1266336000','1584547200','0','0','1','1','0','0','<v:note id="1" count="1">朋友介绍</v:note>rn<v:note id="2" count="0">门户网站的搜索引擎</v:note>rn<v:note id="3" count="2">Google或百度搜索</v:note>rn<v:note id="4" count="2">别的网站上的链接</v:note>rn<v:note id="5" count="1">其它途径</v:note>rn');
+INSERT INTO `#@__vote` VALUES('1','您是从哪儿得知本站的','1266336000','1584547200','0','0','1','1','0','0','<v:note id="1" count="1">朋友介绍</v:note><v:note id="2" count="0">门户网站的搜索引擎</v:note><v:note id="3" count="2">Google或百度搜索</v:note><v:note id="4" count="2">别的网站上的链接</v:note><v:note id="5" count="1">其它途径</v:note>');
 
 INSERT INTO `#@__sys_enum` VALUES('139','cms制作','503','vocation','503','0'),
 ('39','租房','1','house','0','1'),
diff --git a/src/system/dedevote.class.php b/src/system/dedevote.class.php
index 50c01297..acb40385 100755
--- a/src/system/dedevote.class.php
+++ b/src/system/dedevote.class.php
@@ -147,7 +147,7 @@ class DedeVote
      */
     function SaveVote($voteitem)
     {
-        global $ENV_GOBACK_URL, $file, $memberID, $row, $content;
+        global $ENV_GOBACK_URL, $memberID, $row;
         if (empty($voteitem)) {
             return '您没选中任何项目';
         }
@@ -155,7 +155,6 @@ class DedeVote
         //检查投票是否已过期
         $nowtime = time();
         if ($nowtime > $this->VoteInfos['endtime']) {
-
             ShowMsg('投票已经过期', $ENV_GOBACK_URL);
             exit();
         }
@@ -176,7 +175,7 @@ class DedeVote
         }
         //检查用户是否已投过票
         $nowtime = time();
-        $VoteMem = $this->dsql->GetOne("SELECT * FROM #@__vote_member WHERE voteid = '$this->VoteID' and userid='$memberID'");
+        $VoteMem = $this->dsql->GetOne("SELECT * FROM `#@__vote_member` WHERE voteid = '$this->VoteID' and userid='$memberID'");
         if (!empty($memberID)) {
             if (isset($VoteMem['id'])) {
                 $voteday = date("Y-m-d", $VoteMem['uptime']);
@@ -186,14 +185,14 @@ class DedeVote
                     ShowMsg('在'.$row['spec'].'天内不能重复投票', $ENV_GOBACK_URL);
                     exit();
                 } else {
-                    $query = "UPDATE #@__vote_member SET uptime='$nowtime' WHERE voteid='$this->VoteID' AND userid='$memberID'";
+                    $query = "UPDATE `#@__vote_member` SET uptime='$nowtime' WHERE voteid='$this->VoteID' AND userid='$memberID'";
                     if ($this->dsql->ExecuteNoneQuery($query) == false) {
                         ShowMsg('插入数据过程中出现错误', $ENV_GOBACK_URL);
                         exit();
                     }
                 }
             } else {
-                $query = "INSERT INTO #@__vote_member(id,voteid,userid,uptime) VALUES('','$this->VoteID','$memberID','$nowtime')";
+                $query = "INSERT INTO `#@__vote_member`(id,voteid,userid,uptime) VALUES('','$this->VoteID','$memberID','$nowtime')";
                 if ($this->dsql->ExecuteNoneQuery($query) == false) {
                     ShowMsg('插入数据过程中出现错误', $ENV_GOBACK_URL);
                     exit();
diff --git a/src/system/taglib/loop.lib.php b/src/system/taglib/loop.lib.php
index 240dfd1b..996e5484 100755
--- a/src/system/taglib/loop.lib.php
+++ b/src/system/taglib/loop.lib.php
@@ -9,7 +9,6 @@ if (!defined('DEDEINC')) exit('dedebiz');
  * @license        https://www.dedebiz.com/license
  * @link           https://www.dedebiz.com
  */
-require_once(DEDEINC.'/dedevote.class.php');
 function lib_loop(&$ctag, &$refObj)
 {
     global $dsql;
diff --git a/src/theme/plus/flink-list.htm b/src/theme/plus/flink-list.htm
index 6678c5e1..5d57a70e 100644
--- a/src/theme/plus/flink-list.htm
+++ b/src/theme/plus/flink-list.htm
@@ -20,12 +20,12 @@
 						</li>
 					</ul>
 					<span class="navbar-text">
-						<a href="flink_add.php" class="btn btn-success btn-sm">申请链接</a>
+						<a href="flink.php?dopost=add" class="btn btn-success btn-sm">申请链接</a>
 					</span>
 				</nav>
 			</div>
 			<div class="flinkbox">
-				<ul class="f5">
+				<ul class="list-group list-group-horizontal">
 				<?php
 				$row = 180;
 				$titlelen = 50;
@@ -38,9 +38,9 @@
 					{
 						$wtitle = cn_substr($dbrow->webname,$titlelen);
 						if($dbrow->logo=="")
-						$revalue.= "<li><a href='".$dbrow->url."' target='_blank'>$wtitle</a></li>";
+						$revalue.= "<li class='list-group-item'><a href='".$dbrow->url."' target='_blank'>$wtitle</a></li>";
 					else
-						$revalue.= "<li><a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' alt='$wtitle' style='max-width:80px;max-height:60px'></a></li>";
+						$revalue.= "<li class='list-group-item'><a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' alt='$wtitle' style='max-width:80px;max-height:60px'></a></li>";
 					}
 					if(!$dbrow) break;
 				}