⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addlisttemp.php

📁 一、超强系统模型扩展功能 EmpireCMS卓越之处在于:不仅提供了网站管理功能
💻 PHP
字号:
<?php
require("../../class/connect.php");
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
$editor=1;
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"template");
$gid=(int)$_GET['gid'];
$gname=CheckTempGroup($gid);
$urlgname=$gname."&nbsp;->&nbsp;";
$mid=$_GET['mid'];
$cid=$_GET['cid'];
$enews=$_GET['enews'];
$r[subnews]=0;
$r[rownum]=1;
$r[subtitle]=0;
$r[showdate]="Y-m-d H:i:s";
$url=$urlgname."<a href=ListListtemp.php?gid=$gid>管理列表模板</a>&nbsp;->&nbsp;增加列表模板";
//复制
if($enews=="AddListtemp"&&$_GET['docopy'])
{
	$tempid=(int)$_GET['tempid'];
	$r=$empire->fetch1("select tempname,temptext,subnews,listvar,rownum,modid,showdate,subtitle,classid from ".GetDoTemptb("enewslisttemp",$gid)." where tempid='$tempid'");
	$url=$urlgname."<a href=ListListtemp.php?gid=$gid>管理列表模板</a>&nbsp;->&nbsp;复制列表模板:".$r[tempname];
}
//修改
if($enews=="EditListtemp")
{
	$tempid=(int)$_GET['tempid'];
	$r=$empire->fetch1("select tempname,temptext,subnews,listvar,rownum,modid,showdate,subtitle,classid from ".GetDoTemptb("enewslisttemp",$gid)." where tempid='$tempid'");
	$url=$urlgname."<a href=ListListtemp.php?gid=$gid>管理列表模板</a>&nbsp;->&nbsp;修改列表模板:".$r[tempname];
}
//系统模型
$msql=$empire->query("select mid,mname from {$dbtbpre}enewsmod order by mid");
while($mr=$empire->fetch($msql))
{
	if($mr[mid]==$r[modid])
	{$select=" selected";}
	else
	{$select="";}
	$mod.="<option value=".$mr[mid].$select.">".$mr[mname]."</option>";
}
//分类
$cstr="";
$csql=$empire->query("select classid,classname from {$dbtbpre}enewslisttempclass order by classid");
while($cr=$empire->fetch($csql))
{
	$select="";
	if($cr[classid]==$r[classid])
	{
		$select=" selected";
	}
	$cstr.="<option value='".$cr[classid]."'".$select.">".$cr[classname]."</option>";
}
db_close();
$empire=null;
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理列表模板</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function ReturnHtml(html)
{
document.form1.temptext.value=html;
}
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td>位置:<?=$url?></td>
  </tr>
</table>
<form name="form1" method="post" action="ListListtemp.php">
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <tr class="header"> 
      <td height="25" colspan="2">增加模板 
        <input type=hidden name=enews value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>"> 
        <input name="cid" type="hidden" id="cid" value="<?=$cid?>">
		<input name="mid" type="hidden" id="mid" value="<?=$mid?>">
		<input name="gid" type="hidden" id="gid" value="<?=$gid?>"> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="31%" height="25">模板名</td>
      <td width="69%" height="25"><input name="tempname" type="text" id="tempname" value="<?=$r[tempname]?>" size="36">
        * </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">所属系统模型</td>
      <td height="25"><select name="modid" id="modid">
          <?=$mod?>
        </select>
        <input type="button" name="Submit6" value="管理系统模型" onclick="window.open('../db/ListTable.php');">
        *</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">所属分类</td>
      <td height="25"><select name="classid" id="classid">
          <option value="0">不隶属于任何分类</option>
          <?=$cstr?>
        </select>
        <input type="button" name="Submit6222322" value="管理分类" onclick="window.open('ListtempClass.php');"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">新闻简介截取字数</td>
      <td height="25"><input name="subnews" type="text" id="subnews" value="<?=$r[subnews]?>" size="6">
        个字节(为0时不截取)</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">标题截取字数</td>
      <td height="25"><input name="subtitle" type="text" id="subtitle" value="<?=$r[subtitle]?>" size="6">
        个字节(为0时不截取)</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">每行显示</td>
      <td height="25"><input name="rownum" type="text" id="rownum" value="<?=$r[rownum]?>" size="6">
        条记录</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">时间显示格式:</td>
      <td> <input name="showdate" type="text" id="showdate" value="<?=$r[showdate]?>" size="20"> 
        <select name="select4" onchange="document.form1.showdate.value=this.value">
          <option value="Y-m-d H:i:s">选择</option>
          <option value="Y-m-d H:i:s">2005-01-27 11:04:27</option>
          <option value="Y-m-d">2005-01-27</option>
          <option value="m-d">01-27</option>
        </select> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" valign="top"><p>页面模板内容<br>
          <br>
          <input type="button" name="Submit33" value="页面在线编辑" onclick="window.open('editor.php?getvar=opener.document.form1.temptext.value&returnvar=opener.document.form1.temptext.value&fun=ReturnHtml','edittemp','width=880,height=600');">
          <br>
          <br>
          <strong>变量说明:</strong><br>
          <font color="#FF0000">导行条:</font>[!--newsnav--]<br>
          <br>
          <font color="#FF0000">页面标题:</font>[!--pagetitle--]<br>
          栏目/专题关键字:[!--class.keywords--]<br>
          栏目/专题简介:[!--class.intro--]<br>
          栏目/专题缩略图:[!--class.classimg--]<br>
          <br>
          本栏目/专题ID:[!--self.classid--]<br>
          <br>
          父栏目ID:[!--bclass.id--]<br>
          父栏目名称:[!--bclass.name--] <br>
          <br>
          热门信息:[!--hotnews--]<br>
          本栏目热门:[!--self.hotnews--] <br>
          <br>
          最新信息:[!--newnews--]<br>
          本栏目最新:[!--self.newnews--] <br>
          <br>
          推荐信息:[!--goodnews--]<br>
          本栏目推荐:[!--self.goodnews--]<br>
          <br>
          评论排行:[!--hotplnews--]<br>
          本栏目评论热门:[!--self.hotplnews--]<br>
          <br>
          最新头条:[!--firstnews--]<br>
          本栏目头条:[!--self.firstnews--]<br>
          <font color="#FF0000"><br>
          分页导行(下拉式):</font>[!--show.page--]<br>
          <br>
          <font color="#FF0000">分页导行(列表式):</font>[!--show.listpage--] <br>
          <br>
          <font color="#FF0000">当前分页号:</font>[!--list.pageno--]<br>
          <br>
          统计访问:[!--page.stats--]<br>
          <br>
          内容变量: <strong><font color="#FF0000">&lt;!--list.var编号--&gt;</font></strong> 
          (如:&lt;!--list.var1--&gt;,&lt;!--list.var2--&gt;) </p></td>
      <td> <textarea name="temptext" cols="90" rows="50"><?=htmlspecialchars(stripSlashes($r[temptext]))?></textarea> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td rowspan="2" valign="top">列表内容模板<br>
        (list.var) </td>
      <td height="25"><textarea name="listvar" cols="90" rows="10" id="listvar"><?=htmlspecialchars(stripSlashes($r[listvar]))?></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25"><strong>变量说明:</strong><br> <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="50%">加入收藏链接: 
              <input name="textfield" type="text" value="[!--fava.url--]"></td>
            <td>信息ID: 
              <input name="textfield2" type="text" value="[!--id--]"></td>
          </tr>
          <tr> 
            <td>栏目名称: 
              <input name="textfield3" type="text" value="[!--class.name--]"></td>
            <td>标题链接: 
              <input name="textfield4" type="text" value="[!--titleurl--]"></td>
          </tr>
          <tr> 
            <td>信息编号: 
              <input name="textfield5" type="text" value="[!--no.num--]"></td>
            <td>评论数: 
              <input name="textfield6" type="text" value="[!--plnum--]"></td>
          </tr>
          <tr> 
            <td>网站地址: 
              <input name="textfield7" type="text" value="[!--news.url--]"></td>
            <td>发布者ID: 
              <input name="textfield8" type="text" value="[!--userid--]"></td>
          </tr>
          <tr> 
            <td>点击: 
              <input name="textfield9" type="text" value="[!--onclick--]"></td>
            <td>发布者: 
              <input name="textfield10" type="text" value="[!--username--]"></td>
          </tr>
          <tr> 
            <td>标题ALT: 
              <input name="textfield92" type="text" value="[!--oldtitle--]"></td>
            <td>下载次数: 
              <input name="textfield132" type="text" value="[!--totaldown--]"></td>
          </tr>
          <tr> 
            <td>查看扣除点数: 
              <input name="textfield133" type="text" value="[!--userfen--]"></td>
            <td>栏目ID号: 
              <input name="textfield1322" type="text" value="[!--classid--]"></td>
          </tr>
          <tr> 
            <td>栏目链接: 
              <input name="textfield1332" type="text" value="[!--this.classlink--]"></td>
            <td>栏目名称: 
              <input name="textfield1333" type="text" value="[!--this.classname--]"></td>
          </tr>
          <tr> 
            <td colspan="2">购物车地址:[!--news.url--]e/ShopSys/buycar?classid=[!--classid--]&amp;id=[!--id--]</td>
          </tr>
          <tr> 
            <td colspan="2">其他变量请点击 
              <input type="button" name="Submit3" value="这里" onclick="window.open('ShowVar.php?modid='+document.form1.modid.value,'','width=300,height=520,scrollbars=yes');">
              (因为不同模型有不同的变量)</td>
          </tr>
          <tr> 
            <td colspan="2">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">&nbsp;</td>
      <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" valign="top">增加说明</td>
      <td height="25"><p>格式:<br>
          <strong>页面模板内容:</strong>列表头[!--empirenews.listtemp--]列表内容[!--empirenews.listtemp--]列表尾<br>
          列表内容格式举列:&lt;table&gt;[!--empirenews.listtemp--]&lt;tr&gt;&lt;td&gt;&lt;!--list.var1--&gt;&lt;/td&gt;&lt;td&gt;&lt;!--list.var2--&gt;&lt;/td&gt;&lt;/tr&gt;[!--empirenews.listtemp--]&lt;/table&gt;<font color="#FF0000">(一行显示2条记录)</font><br>
          <br>
          <strong>列表内容模板:</strong>就是上面&lt;!--list.var1--&gt;与&lt;!--list.var2--&gt;显示的内容<br>
          <br>
          <br>
        </p></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" valign="top">&nbsp;</td>
      <td height="25">说明:具体标签介绍请点 
        <input type="button" name="Submit32" value="这里" onclick="window.open('EnewsBq.php','','width=600,height=500,scrollbars=yes');">
        或JS调用点 
        <input type="button" name="Submit322" value="这里" onclick="window.open('../ListClass.php','','width=800,height=600,scrollbars=yes');">
        。</td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -