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

 找回密码
 立即注册
搜索

[求助] 插件模版中的表格项,显示不出来,求教是什么原因

[复制链接]
风清扬丶 发表于 2013-5-25 23:24:33 | 显示全部楼层 |阅读模式
在插件首页,本应显示,用户发表内容的列表,但是显示不正确

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;">

  <!--{loop $row $challenge}-->
        <table width=600px height="550px" border="1" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
                <tr bgcolor="#eff3ff">
                <td>战书:$challenge[title] 挑战者:$challenge[username]</td>
                </tr>
                <tr bgColor="#ffffff">
                <td>内容:$challenge[content]</td>
                </tr>
        </table>
  <!--{/loop}-->   
  <!--{if !empty($multipage)}-->
  <table>
                <tr>
                        <td>$multipage</td>
                </tr>

  <!--{else}-->
  <tr>
    <td colspan="5" align="center">{lang moodwall:moodwall_htm_44}</td>
  </tr>
  </table>
  <!--{/if}-->

  </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: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>


</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($_GET['mod'] == 'add_challenge')
{
        if($_POST['submit'])
        {
                   DB::query("INSERT INTO ".DB::table('challenge')."(id,uid,usernazme,title,content,lasttime)
                VALUES ('','$_G[uid]','$_G[username]','$_POST[title])','($_POST[content])',now())");
                showmessage('发表成功',NULL);
        }       
}


if(empty($_GET['mod']))
{
        $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  ");
        while($row=DB::fetch($query))
        {
                $mood['dateline'] = dgmdate($mood['dateline'], 'dt', $_G['setting']['timeoffset']);//degdate为discuz 类函数
                $rowlist[]=$row;
        }
}

/*function htmtocode($content)
{
        $content = str_replace("\n", "<br>", str_replace(" ", "&nbsp;", $content));
        return $content;
}
*/

include template('challenge:challenge');

?>  


插件地址:http://www.diqichengshi.com/challenge-challenge.html



回复

使用道具 举报

1314学习网 发表于 2013-5-26 08:26:48 | 显示全部楼层
说实话你站注册要填写的信息太多完全没兴趣注册,不注册也就看不了你给的插件演示
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-11-15 21:26 , Processed in 0.107938 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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