begin of thinksaas 3.68

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2023-06-22 13:33:25 +08:00
commit 963ec1b2ea
2746 changed files with 331806 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
defined('IN_TS') or die('Access Denied.');
return array(
'name' => '头部导航插件',
'version' => '1.0',
'desc' => '扩展网站顶部主导航链接',
'url' => 'http://www.thinksaas.cn',
'email' => 'thinksaas@qq.com',
'author' => '邱君',
'author_url' => 'http://www.thinksaas.cn',
'isedit' => '1',
);
+43
View File
@@ -0,0 +1,43 @@
<?php
defined('IN_TS') or die('Access Denied.');
//插件编辑
switch($ts){
case "set":
$strAbout = fileRead('plugins/pubs/navs/about.php');
$arrNav = fileRead('data/plugins_pubs_navs.php');
if($arrNav==''){
$arrNav = $tsMySqlCache->get('plugins_pubs_navs');
}
include template('edit_set','navs');
break;
case "do":
$arrNavName = $_POST['navname'];
$arrNavUrl = $_POST['navurl'];
$arrNewPage = $_POST['newpage'];
foreach($arrNavName as $key=>$item){
$navname = tsTrim($item);
$navurl = tsTrim($arrNavUrl[$key]);
$newpage = tsTrim($arrNewPage[$key]);
if($navname && $navurl){
$arrNav[] = array(
'navname' => $navname,
'navurl' => $navurl,
'newpage' => $newpage,
);
}
}
fileWrite('plugins_pubs_navs.php','data',$arrNav);
$tsMySqlCache->set('plugins_pubs_navs',$arrNav);
header('Location: '.SITE_URL.'index.php?app=pubs&ac=plugin&plugin=navs&in=edit&ts=set');
break;
}
+38
View File
@@ -0,0 +1,38 @@
{php include pubTemplate("header_admin")}
<script>
function insertMenu(){
$("#before").before('<tr><td><input name="navname[]" /></td><td><input name="navurl[]" style="width:350px;" /></td><td><input type="checkbox" name="newpage[]" value="1">打开</td></tr>');
}
</script>
<div class="midder">
{php include pubTemplate("plugin_menu")}
<form method="POST" action="{SITE_URL}index.php?app=pubs&ac=plugin&plugin=navs&in=edit&ts=do">
<table class="table table-hover">
<thead class="thead-light">
<tr><th>链接名字</th><th>链接URL</th><th>新页面打开</th></tr>
</thead>
<tbody>
{loop $arrNav $key $item}
<tr><td><input name="navname[]" value="{$item['navname']}" /></td><td><input name="navurl[]" style="width:350px;" value="{$item['navurl']}" /></td><td><input type="checkbox" name="newpage[]" value="1" {if $item['newpage']}checked{/if}>打开</td></tr>
{/loop}
<tr id="before"><td><input type="submit" value="提 交" /></td><td><a href="javascript:void('0');" onclick="insertMenu();">点我增加链接</a>(说明:如需删除某一项,请将要删除的某项清空提交即可。)</td>
<td></td>
</tr>
</tbody>
</table>
</form>
</div>
{php include pubTemplate("footer_admin")}
+21
View File
@@ -0,0 +1,21 @@
<?php
defined('IN_TS') or die('Access Denied.');
//头部导航插件
function navs_html(){
global $tsMySqlCache;
$arrNav = fileRead('data/plugins_pubs_navs.php');
if($arrNav==''){
$arrNav = $tsMySqlCache->get('plugins_pubs_navs');
}
foreach($arrNav as $item){
echo '<li class="nav-item active"><a class="nav-link" ';
if($item['newpage']){
echo 'target="_blank"';
}
echo ' href="'.$item['navurl'].'">'.$item['navname'].'</a></li>';
}
}
addAction('pub_header_nav','navs_html');