Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] discuz 插件 内容列表页的内容不显示 求教!!

[复制链接]
风清扬丶 发表于 2013-5-26 23:13:58 | 显示全部楼层 |阅读模式
测试的时候,发表了内容,并在数据库成功插入,但是插件的列表页无法显示出来!!
如图:


请教 如何解决:?

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(" ", "&nbsp;", $content));
        return $content;
}
*/

include template('challenge:challenge');

?>  


  插件地址:http://www.diqichengshi.com/plugin.php?id=challenge

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
1314学习网 发表于 2013-5-27 08:24:32 | 显示全部楼层
while($row = DB::fetch($query))
{
                $row['dateline'] = dgmdate($row['dateline'], 'dt', $_G['setting']['timeoffset']);//degdate为discuz 类函数
                $rowlist[] = $rowlist_members;
}
。。。
回复

使用道具 举报

 楼主| 风清扬丶 发表于 2013-5-27 10:18:53 | 显示全部楼层

要怎么改呢? 这里我已经改过了,看来还不对。。 请指教下
回复

使用道具 举报

1314学习网 发表于 2013-5-27 11:43:50 | 显示全部楼层
风清扬丶 发表于 2013-5-27 10:18
要怎么改呢? 这里我已经改过了,看来还不对。。 请指教下

改过就发改过后的代码
回复

使用道具 举报

 楼主| 风清扬丶 发表于 2013-5-27 11:56:55 | 显示全部楼层
1314学习网 发表于 2013-5-27 11:43
改过就发改过后的代码

这个就是改过后的呀!!  不太清楚哪里错了?
回复

使用道具 举报

 楼主| 风清扬丶 发表于 2013-5-27 16:01:49 | 显示全部楼层
1314学习网 发表于 2013-5-27 11:43
改过就发改过后的代码

请指点下!
回复

使用道具 举报

1314学习网 发表于 2013-5-27 16:04:28 | 显示全部楼层

自己仔细看沙发的回帖,颜色都标的很清楚了
回复

使用道具 举报

 楼主| 风清扬丶 发表于 2013-5-27 21:14:59 | 显示全部楼层

嗯 谢谢   
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-2-25 19:13 , Processed in 0.022188 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表