14 changed files with 576 additions and 21 deletions
@ -0,0 +1,17 @@ |
|||
<?php |
|||
include_once(dirname(dirname(__FILE__))."/library/publicBase.php"); |
|||
|
|||
date_default_timezone_set("Asia/Shanghai"); |
|||
|
|||
$obj = new mBase(); |
|||
|
|||
$rdobj = $obj->initRedis(); |
|||
|
|||
$cookies[] = '_2A25FcbH_DeRhGeFG71sY9CbOyDuIHXVmD0s3rDV8PUNbmtB-LROgkW9NeUknrDWZVELgZ5_bHazkmfeqimpsJvrC'; // 吴龙超 |
|||
$cookies[] = '_2A25Fcc-2DeRhGeRJ6VAW9SvIzjiIHXVmD01-rDV8PUNbmtAYLRjzkW9NUqgeP0nu8ldMw0ltx31xfvHmVmqDM2xN'; // 王朋达 |
|||
$cookies[] = '_2A25FakNADeRhGedJ71UQ9S7PzjyIHXVmBtqIrDV8PUJbkNB-LRX_kW1NVhe7zEjMdJLzXvbT9ck1Q-L9YYtLiCpV'; // 张琪 |
|||
$cookies[] = '_2AkMfKU18f8NxqwFRmvoVzmPrZI11wwvEieKpdbynJRMxHRl-yT9xqmoitRB6NKljk7EQIbC2ibY-BOeJTItlu8LSPOXb'; // 刘梦琪 |
|||
$cookies[] = '_2A25FcbInDeRhGeFK4lEU9ijJwzSIHXVmD0vvrDV8PUNbmtAYLVLTkW9NQtaHPZxefLemxY2kP3YN6l7tyfSJeWvl'; // 张宇鹏 |
|||
|
|||
$rdobj->set(_RC_WEIBO_LOGIN_COOKIE2, json_encode($cookies)); |
|||
exit; |
@ -0,0 +1,17 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from snownlp import seg |
|||
from snownlp import SnowNLP |
|||
import pymysql |
|||
import configparser |
|||
import os |
|||
import re |
|||
|
|||
comment = ' <img alt="[赞]" title="[赞]" src="https://face.t.sinajs.cn/t4/appstyle/expression/ext/normal/e6/2018new_zan_org.png" /> <img alt="[赞]" title="[赞]" src="https://face.t.sinajs.cn/t4/appstyle/expression/ext/normal/e6/2018new_zan_org.png" /> ' |
|||
|
|||
non_img_pattern = re.compile(r'<img.*?\/>') |
|||
comment = re.sub(non_img_pattern, '', comment) |
|||
comment = re.sub(r'\s', '', comment) |
|||
|
|||
print(len(comment)) |
|||
print(comment) |
|||
|
@ -0,0 +1,210 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
|
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title>知识库</title> |
|||
<link rel="stylesheet" href="{$smarty.const.CSS_URL}/css/common.css?v={$smarty.const.CSS_JS_VERSION}"> |
|||
<link rel="stylesheet" href="{$smarty.const.CSS_URL}/css/index.css?v={$smarty.const.CSS_JS_VERSION}8"> |
|||
<script src="{$smarty.const.CSS_URL}/js/jquery-3.6.0.min.js"></script> |
|||
{literal} |
|||
<style> |
|||
.comment-con,.comment-detail,.small-image-wrapper,.small-video-cover{ |
|||
margin-top: 20px; |
|||
} |
|||
.comment-title{ |
|||
margin-bottom: 20px; |
|||
color: green; |
|||
} |
|||
.small-image-wrapper{ |
|||
margin-bottom: 20px; |
|||
} |
|||
.small-image-wrapper{ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
column-gap: 10px; |
|||
row-gap: 10px; |
|||
} |
|||
.comment-txt img{ |
|||
width: 20px; |
|||
height: 20px; |
|||
} |
|||
.small-image-img{ |
|||
width: 100%; |
|||
height: 100%; |
|||
margin-bottom: 20px; |
|||
} |
|||
#next-page,#prev-page{ |
|||
cursor: pointer; |
|||
} |
|||
</style> |
|||
{/literal} |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="home-page"> |
|||
{include file="include/header.html"} |
|||
<div class="home-main-content"> |
|||
<div class="tab-list index-nav-wrap flex"> |
|||
<ul class="tab-wrap"> |
|||
<li class="index-nav-wrap-li" type="1"><span {if $smarty.get.search_type == "1"}class="active"{/if}>选中评论</span></li> |
|||
<li class="index-nav-wrap-li" type="0"><span {if $smarty.get.search_type == "0"}class="active"{/if}>剔除评论</span></li> |
|||
<li class="index-nav-wrap-li" type="-1"><span {if $smarty.get.search_type == "-1"}class="active"{/if}>全部评论</span></li> |
|||
</ul> |
|||
</div> |
|||
|
|||
<div class="comment-con"> |
|||
<div class="comment-title">微博内容:</div> |
|||
|
|||
<div class="list_item_top flex"> |
|||
<div class="list_item_top_l"> |
|||
<span class="green">微博</span> |
|||
<b class="refer_text"></b> |
|||
<span class="name">张宝旬</span> |
|||
<span>录入:{$data.created_at}</span> |
|||
<a href="https://m.weibo.cn/detail/{$data.wid}" target="_blank">微博地址</a> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="comment-detail"> |
|||
{$data.text} |
|||
</div> |
|||
|
|||
{if $data.pic_arr} |
|||
<div class="small-image-wrapper"> |
|||
{foreach from=$data.pic_arr item=item} |
|||
<div class="small-image"> |
|||
<span class="small-image-desc">图片</span> |
|||
<img src="{$item}" alt="Small Image" class="small-image-img"> |
|||
<img class="delete-btn hide" src="../images/delete-icon.svg" alt="Small Image"> |
|||
</div> |
|||
{/foreach} |
|||
</div> |
|||
{/if} |
|||
|
|||
{if $data.video_url} |
|||
<div class="small-video-cover" href="{$data.video_url}"> |
|||
<span class="small-image-desc">视频</span> |
|||
<img class="small-video-show" src="{if $data.video_cover}{$data.video_cover}{else}'../images/vedio_img.png'{/if}" alt="Video Cover"> |
|||
<img src="../images/play.svg" class="play-video" alt="...丢了"> |
|||
</div> |
|||
{/if} |
|||
|
|||
{if $comment_list} |
|||
<div class="comment-list"> |
|||
<div class="comment-title">评论内容:</div> |
|||
{foreach from=$comment_list key=key item=item} |
|||
<div class="list_item_top flex" style="margin-top: 20px;" idattr="{$item.id}"> |
|||
<div class="list_item_top_l"> |
|||
<!-- <span class="green">评论</span> --> |
|||
<b class="refer_text"></b> |
|||
<span class="name">{$key+1}.{$item.screen_name}</span> |
|||
<span>{$item.comment_time} {$item.source}</span> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="list_item_top flex" style="margin-top: 10px;"> |
|||
<div class="list_item_top_l"> |
|||
<span class="green">评论</span> |
|||
<b class="refer_text"></b> |
|||
<span class="name comment-txt">{$item.content}</span> |
|||
<span class="{if $item.is_search==1}green{elseif $item.is_search==0}red{elseif $item.is_search==0}grey{/if}">{$search_status_list[$item.is_search]}</span> |
|||
</div> |
|||
</div> |
|||
{/foreach} |
|||
</div> |
|||
{/if} |
|||
</div> |
|||
|
|||
<div class="pagination" v-if="total > 0"> |
|||
<img id="prev-page" src="/images/prev.svg" alt=""> |
|||
|
|||
<ul id="page-numbers"> |
|||
{if $last_page <= 6} |
|||
{section name=num loop=$last_page} |
|||
<span class="{if $cur_page == ($smarty.section.num.index+1)}pagActive{/if}" page="{$smarty.section.num.index+1}">{$smarty.section.num.index+1}</span> |
|||
{/section} |
|||
{/if} |
|||
|
|||
{if $last_page > 6} |
|||
{if $cur_page <= 5} |
|||
{section name=num loop=5} |
|||
<span class="{if $cur_page == ($smarty.section.num.index+1)}pagActive{/if}" page="{$smarty.section.num.index+1}">{$smarty.section.num.index+1}</span> |
|||
{/section} |
|||
<span>...</span> |
|||
<span page="{$last_page}">{$last_page}</span> |
|||
{elseif $cur_page > $last_page-5} |
|||
<span page="1">1</span> |
|||
<span>...</span> |
|||
|
|||
{section name=num loop=5} |
|||
<span class="{if $cur_page == ($last_page-5+$smarty.section.num.index+1)}pagActive{/if}" page="{$last_page-5+$smarty.section.num.index+1}">{$last_page-5+$smarty.section.num.index+1}</span> |
|||
{/section} |
|||
|
|||
{else} |
|||
<span page="1">1</span> |
|||
<span>...</span> |
|||
{section name=num loop=5} |
|||
<span class="{if $cur_page == ($cur_page-2+$smarty.section.num.index)}pagActive{/if}" page="{$cur_page-2+$smarty.section.num.index}">{$cur_page-2+$smarty.section.num.index}</span> |
|||
{/section} |
|||
<span>...</span> |
|||
<span page="{$last_page}">{$last_page}</span> |
|||
{/if} |
|||
{/if} |
|||
</ul> |
|||
|
|||
<img id="next-page" src="/images/next.svg" alt=""> |
|||
<div class="input-page"> |
|||
<span>前往</span> |
|||
<input type="number" id="jump-to-page" min="1" placeholder="页码"> |
|||
<span>页</span> |
|||
</div> |
|||
<button id="go-to-page">跳转</button> |
|||
</div> |
|||
|
|||
</div> |
|||
{include file="include/footer.html"} |
|||
</div> |
|||
|
|||
<div id="hidecomments" style="display: none;"></div> |
|||
<div id="last_page" style="display: none;">{$last_page}</div> |
|||
|
|||
</body> |
|||
|
|||
{literal} |
|||
<script> |
|||
$('.index-nav-wrap-li').click(function(){ |
|||
var type = $(this).attr('type') |
|||
window.location.href = location.href.replace(/\&search\_type=(\-)?\d+/, '').replace(/\&page=\d+/, '') +'&search_type='+type |
|||
}) |
|||
|
|||
$('#page-numbers span').click(function(){ |
|||
var page = $(this).attr('page') |
|||
if(!page) return; |
|||
location.href = location.href.replace(/\&page=\d+/, '') +'&page='+page |
|||
}) |
|||
|
|||
$('#next-page').click(function(){ |
|||
var page = parseInt($('#page-numbers span.pagActive').attr('page')) + 1 |
|||
if(page > parseInt($('#last_page').text())) return; |
|||
|
|||
location.href = location.href.replace(/\&page=\d+/, '') +'&page='+page |
|||
}) |
|||
|
|||
$('#prev-page').click(function(){ |
|||
var page = parseInt($('#page-numbers span.pagActive').attr('page')) - 1 |
|||
if(page < 1) return; |
|||
location.href = location.href.replace(/\&page=\d+/, '') +'&page='+page |
|||
}) |
|||
|
|||
$('#go-to-page').click(function(){ |
|||
var page = $('#jump-to-page').val() |
|||
if(page > parseInt($('#last_page').text())) page = parseInt($('#last_page').text()) |
|||
if(page < 1) page = 1 |
|||
location.href = location.href.replace(/\&page=\d+/, '') +'&page='+page |
|||
}) |
|||
</script> |
|||
{/literal} |
|||
|
|||
</html> |
@ -0,0 +1,170 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
|
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title>知识库</title> |
|||
<link rel="stylesheet" href="{$smarty.const.CSS_URL}/css/common.css?v={$smarty.const.CSS_JS_VERSION}"> |
|||
<link rel="stylesheet" href="{$smarty.const.CSS_URL}/css/index.css?v={$smarty.const.CSS_JS_VERSION}"> |
|||
<script src="{$smarty.const.CSS_URL}/js/jquery-3.6.0.min.js"></script> |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="home-page"> |
|||
{include file="include/header.html"} |
|||
|
|||
<div class="home-main-content"> |
|||
<div class="home-main"> |
|||
<div class="tab-list index-nav-wrap flex"> |
|||
<ul class="tab-wrap" style="display: none;"> |
|||
<li class="index-nav-wrap-li" type="1"><span class="active">待审批</span></li> |
|||
<li class="index-nav-wrap-li" type="2"><span>已审批</span></li> |
|||
<li class="index-nav-wrap-li" type="3"><span>已删除</span></li> |
|||
</ul> |
|||
<button class="addNewBtn" style="display: none;"> |
|||
<img src="{$smarty.const.CSS_URL}/images/add.svg" alt="">新增自录入 |
|||
</button> |
|||
</div> |
|||
|
|||
|
|||
<div class="list_all" id="data-list"> |
|||
</div> |
|||
|
|||
|
|||
<!-- 数据列表 --> |
|||
<!-- <ul id="data-list"></ul> --> |
|||
|
|||
<!-- 分页控件 --> |
|||
<div class="pagination hide"> |
|||
<img id="prev-page" src="{$smarty.const.CSS_URL}/images/prev.svg" alt=""> |
|||
<ul id="page-numbers"></ul> |
|||
<img id="next-page" src="{$smarty.const.CSS_URL}/images/next.svg" alt=""> |
|||
<div class="input-page"> |
|||
<span>前往</span> |
|||
<input type="number" id="jump-to-page" min="1" placeholder="页码"> |
|||
<span>页</span> |
|||
</div> |
|||
<button id="go-to-page">跳转</button> |
|||
</div> |
|||
|
|||
<!-- 放大后的图片容器 --> |
|||
<div id="large-image-container"> |
|||
<h2>预览</h2> |
|||
<img id="large-image" src="{$smarty.const.CSS_URL}/images/viewimg1.png" alt="Large Image"> |
|||
<span id="close-btn2">×</span> |
|||
</div> |
|||
|
|||
<!-- 放大后的视频容器 --> |
|||
<div id="large-video-container"> |
|||
<video id="large-video" controls> |
|||
<source id="large-viedo-url" src="" type="video/mp4"> |
|||
Your browser does not support the video tag. |
|||
</video> |
|||
<button id="close-btn">×</button> |
|||
</div> |
|||
|
|||
<!-- 弹框 --> |
|||
<div class="modal-overlay"></div> |
|||
<div class="modal"> |
|||
<div class="modal_top"> |
|||
<b id="header_title">编辑</b> |
|||
<img src="{$smarty.const.CSS_URL}/images/close_modal.svg" id="close_modal" alt=""> |
|||
</div> |
|||
|
|||
<div class="add-form"> |
|||
<div class="form-item radio-form"> |
|||
<input type="hidden" id="id" value=""> |
|||
<div class="form-left"> |
|||
录入形式 |
|||
</div> |
|||
<div class="form-right radio-wrap flex"> |
|||
<div class="radio_box radio_box_active"> |
|||
<input value="1" type="radio"id="edu1"> |
|||
<div></div> |
|||
<label >信息段录入</label> |
|||
</div> |
|||
<div class="radio_box"> |
|||
<input value="2" type="radio"id="edu2"> |
|||
<div></div> |
|||
<label >问答式录入</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-item normal-form" style="display: none;"> |
|||
<div class="form-left"> |
|||
提问信息 |
|||
</div> |
|||
<div class="form-right"> |
|||
<div class="text-area-container"> |
|||
<textarea class="edit-input normal-input" ></textarea> |
|||
<div class="char-count wordNum">0/200</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-item"> |
|||
<div class="form-left common-input"> |
|||
回答信息 |
|||
</div> |
|||
<div class="form-right"> |
|||
<div class="text-area-container"> |
|||
<textarea class="edit-input answer-input" ></textarea> |
|||
<div class="char-count1 wordNum">0/200</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{literal} |
|||
<script> |
|||
const maxLength = 100; // 设置最大字数限制 |
|||
$('.normal-input').on('input', function () { |
|||
var currentLength = $(this).val().length; |
|||
$('.char-count').text(currentLength + '/' + maxLength); |
|||
if (currentLength > maxLength) { |
|||
$('.normal-input').val($('.normal-input').val().slice(0, maxLength)) |
|||
$('.char-count').text(maxLength + '/' + maxLength); |
|||
} |
|||
}); |
|||
$('.answer-input').on('input', function () { |
|||
var currentLength = $(this).val().length; |
|||
$('.char-count1').text(currentLength + '/' + maxLength); |
|||
if (currentLength > maxLength) { |
|||
$('.answer-input').val($('.answer-input').val().slice(0, maxLength)) |
|||
$('.char-count1').text(maxLength + '/' + maxLength); |
|||
} |
|||
}); |
|||
</script> |
|||
{/literal} |
|||
<div class="img_list2" style="display: none;"></div> |
|||
<div class="preview"></div> |
|||
|
|||
<div class="modal_upload_btn flex hide"> |
|||
<div class="flex modal_btns"> |
|||
<button id="upload-image-btn" class="button upload_btn"> |
|||
<img src="{$smarty.const.CSS_URL}/images/img_upload.svg" alt="">上传图片 |
|||
</button> |
|||
<button id="upload-video-btn" class="button upload_btn"> |
|||
<img src="{$smarty.const.CSS_URL}/images/vedio_upload.svg" alt="">上传视频 |
|||
</button> |
|||
</div> |
|||
<p>支持 jpg、png、mp4 格式,单个文件不超过 10MB</p> |
|||
</div> |
|||
<input type="file" id="upload-image" accept="image/*" style="display: none;" multiple> |
|||
<input type="file" id="upload-video" accept="video/*" style="display: none;" multiple> |
|||
<div class="buttons flex"> |
|||
<button id="submit" class="button ">仅保存</button> |
|||
<button id="savePass" class="button button-primary">保存并通过审批</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{include file="include/footer.html"} |
|||
</div> |
|||
|
|||
<div id="hidecomments" style="display: none;"></div> |
|||
|
|||
</body> |
|||
<script src="{$smarty.const.CSS_URL}/js/index.js?v={$smarty.const.CSS_JS_VERSION}89"></script> |
|||
|
|||
</html> |
Loading…
Reference in new issue