@@ -0,0 +1 @@
|
||||
<?php
|
||||
@@ -0,0 +1,38 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<script>
|
||||
function insertMenu(){
|
||||
$("#before").before('<tr><td><input class="wd350" name="title[]" /></td><td><input class="wd350" name="url[]" /></td></tr>');
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include pubTemplate("plugin_menu")}
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=pubs&ac=plugin&plugin=wordad&in=edit&ts=do">
|
||||
<table class="table table-hover">
|
||||
|
||||
<thead class="thead-light">
|
||||
<tr><th>广告文字</th><th>广告URL</th></tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
{loop $arrData $key $item}
|
||||
<tr><td><input class="wd350" name="title[]" value="{$item['title']}" /></td><td><input class="wd350" name="url[]" value="{$item['url']}" /></td></tr>
|
||||
{/loop}
|
||||
|
||||
<tr id="before"><td><input type="submit" value="提 交" /></td><td><a href="javascript:void('0');" onclick="insertMenu();">点击增加文字广告</a>(说明:如需删除某一项,请将要删除的某项清空提交即可。)</td></tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件编辑
|
||||
switch($ts){
|
||||
//编辑
|
||||
case "set":
|
||||
|
||||
$strAbout = fileRead('plugins/pubs/wordad/about.php');
|
||||
|
||||
$arrData = fileRead('data/plugins_pubs_wordad.php');
|
||||
if($arrData==''){
|
||||
$arrData = $tsMySqlCache->get('plugins_pubs_wordad');
|
||||
}
|
||||
|
||||
include template('edit','wordad');
|
||||
break;
|
||||
//执行编辑
|
||||
case "do":
|
||||
$arrTitle = $_POST['title'];
|
||||
$arrUrl = $_POST['url'];
|
||||
foreach($arrTitle as $key=>$item){
|
||||
$title = tsTrim($item);
|
||||
$url = tsTrim($arrUrl[$key]);
|
||||
if($title && $url){
|
||||
$arrData[] = array(
|
||||
'title' => $title,
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fileWrite('plugins_pubs_wordad.php','data',$arrData);
|
||||
$tsMySqlCache->set('plugins_pubs_wordad',$arrData);
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=pubs&ac=plugin&plugin=wordad&in=edit&ts=set');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//统计代码
|
||||
function wordad(){
|
||||
global $tsMySqlCache;
|
||||
$arrData = fileRead('data/plugins_pubs_wordad.php');
|
||||
if($arrData==''){
|
||||
$arrData = $tsMySqlCache->get('plugins_pubs_wordad');
|
||||
}
|
||||
|
||||
echo '<div class="card"><div class="card-body pb-1 pt-1"><div class="row">';
|
||||
foreach($arrData as $key=>$item){
|
||||
echo '<div class="col-md-3"><a class="m-2 mt-2 mb-2 float-left" target="_blank" href="'.$item['url'].'">'.$item['title'].'</a></div>';
|
||||
}
|
||||
echo '</div></div></div>';
|
||||
}
|
||||
addAction('wordad','wordad');
|
||||
Reference in New Issue
Block a user