测试的时候,发表了内容,并在数据库成功插入,但是插件的列表页无法显示出来!!
如图:
请教 如何解决:?
HTM代码:
{subtemplate common/header}
<link type="text/css" rel="stylesheet" href="source/plugin/down_love/template/extend_common.css" />
<div id="ct" class="wp cl"><!--定义页面导航 -->
<div class="mn">
<div class="bm">
<ul class="tb cl">
<li<!--{if empty($_GET[mod])}--> class="current"<!--{/if}-->><a href="plugin.php?id=challenge">查看战书</a></li>
<li<!--{if $_GET[mod] == 'add_challenge'}--> class="current"<!--{/if}-->><a href="plugin.php?id=challenge&mod=add_challenge">下战书</a></li>
<li<!--{if $_GET[mod] == 'ask_challenge'}--> class="current"<!--{/if}-->><a href="plugin.php?id=challenge&mod=first_challenge">勇士排行</a></li>
</ul>
<!--{if empty($_GET[mod])}-->
<div class="content" style="background:url(source/plugin/challenge/template/images/zhanshu.jpg);height: 550px;width: 950px;">
<table width="100%" border="1" cellpadding="0" cellspacing="0" >
<tr class="colplural" align="center">
<td width="15%" >挑战者</td>
<td width="15%">挑战书</td>
<td width="55%">内容</td>
<td width="15%">联系我</td>
</tr>
<!--{if $rowlist }-->
<!--{loop $rowlist $rowlist_members}-->
<tr align="center">
<td width="15%" align="left">$rowlist_members[user]</td>
<td width="15%">$rowlist_members[title]</td>
<td width="55%">$rowlist_members[content]</td>
<td width="15%"><a target="_blank" title="发起QQ聊天">
<img src="static//image/common/qq.gif" alt="QQ" style="margin:0px;"/></a></td>
</tr>
<!--{/loop}-->
<!--{if !empty($multipage)}-->
<tr><td colspan="5"><div class="pages_btns">$multipage</div></td></tr><!--{/if}-->
<!--{else}-->
<tr>
<td colspan="5" align="center">只有这一页</td>
</tr>
<!--{/if}-->
</table>
</div></div></div>
<!--{elseif $_GET[mod] == 'add_challenge'}-->
<SCRIPT language=javascript>
function CheckPost()
{
if (myform.user.value=="")
{
alert("请填写用户名");
myform.user.focus();
return false;
}
if (myform.title.value.length<5)
{
alert("标题不能少于5个字符");
myform.title.focus();
return false;
}
if (myform.content.value=="")
{
alert("必须要填写留言内容");
myform.content.focus();
return false;
}
}
</SCRIPT>
<form action="plugin.php?id=challenge&mod=add_challenge" method="post" name="myform" align="center">
<b>挑战者</b>:<input type="text" size="10" name="user" align="center"/><br>
<b>战书名字</b>:<input type="text" name="title" align="center"/><br/>
填写勾起对手战意的内容吧:<br><textarea name="content" cols="60" rows="9" align="center"></textarea><br/>
<input type="submit" name="submit" value="下战书" align="center"/>
</form>
<!--{elseif $_GET[mod] == 'first_challenge'}-->
<table align="center">
<tr><td><font color="red"><b>第一名:</b></font></td><td></td></tr><br><br>
<tr><td><font color="red"><b>第二名:</b></font></td><td></td></tr><br>
<tr><td><font color="red"><b>第三名:</b></font></td><td></td></tr>
<tr><td><b>第四名:</b></td><td></td></tr>
<tr><td><b>第五名:</b></td><td></td></tr>
<tr><td><b>第六名:</b></td></tr><td></td>
<tr><td><b>第七名:</b></td><td></td></tr>
</table>
</div>
</div>
</div>
<!--{/if}-->
{subtemplate common/footer}
inc.php代码
<?php
if(!defined('IN_DISCUZ')){
exit('Access Denied');
}
if(empty($_G['uid']))
{
showmessage('抱歉,为了保障网站的良好运行 和会员的权益,请注册后再使用本功能,为您带来的不便深表歉意','member.php?id=challenge:challenge');
}
if(empty($_GET['mod']))
{
$qq=DB::result_first("select `qq` from ".DB::table('common_member_profile')." where uid='$_G[uid]'");
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('challenge')." WHERE uid='$_G[uid]'");//mysql_result为取得结果数据
$page = $_G['page'] > 10 ? 1 : $_G['page'];
$start_limit = ($page - 1) * 10;
$multipage = multi($num, 10, $page, "plugin.php?id=challenge&mod={$_GET[mod]}");
$query=DB::query("SELECT * FROM ".DB::table('challenge')." order by id desc ");
$rowlist = array();
while($row=DB::fetch($query))
{
$row['dateline'] = dgmdate($row['dateline'], 'dt', $_G['setting']['timeoffset']);//degdate为discuz 类函数
$rowlist[]=$rowlist_members;
}
}
elseif($_GET['mod'] == 'add_challenge')
{
if($_POST['submit'])
{
DB::query("INSERT INTO ".DB::table('challenge')."(id,uid,username,title,content,lasttime)
VALUES ('','$_G[uid]','$_G[username]','$_POST[title]','$_POST[content]',now())");
showmessage('发表成功',NULL);
}
}
/*function htmtocode($content)
{
$content = str_replace("\n", "<br>", str_replace(" ", " ", $content));
return $content;
}
*/
include template('challenge:challenge');
?>
插件地址:http://www.diqichengshi.com/plugin.php?id=challenge
|