框架的缺陷
1、<list>标签没起到循环的作用,例子: <list>  <?php $num++;  ?> </list>  $num根本没起到依次加1的效果解决方法  凡是二维数组都存在 $this->array_two  数组中,只能用foreach($this->array_two['模板变量']  as $v) {  }  这种做法2、php语法不能使用括号判断
<?php
  if(){
?><?php
  }
?>会报错,解决方法
<?php
if(){
 echo 
<<<EOF
   
EOF;
}
?>虽然都有解决方法,但是这2点居然没完美解决,,,谁有好的想法也可以提供一下,,记得thinkphp可以在模板中使用括号判断的,低一点还没什么,,主要是第二点,搞得焦头烂额下面我给2个模板参考,
第一个模板,列表页,,还算清晰第二个内容页模板,,就是第二点没实现的苦恼当然现在都按照解决方法解决了,只是不方便。。

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="keywords" content="人文常熟论坛,常熟论坛,常熟交友,常熟,大学生原创论坛,www.stu80.com" />
    <meta name="description" content="常熟大学生自制论坛系统,专注于原创,不依赖于任何cms。" />
    <script src="/Public/JS/jquery-1.4.2.js"></script>
    <title>人文常熟--<?php echo getparent($_SESSION['f']);?>--V0.10</title>
    <style type="text/css">
    html{-webkit-text-size-adjust: none;}
    a:active{color:#545ce4}
    a:visited{color:#545ce4}
    a:link{color:#545ce4}
    a:hover{color:#993300}
    a{text-decoration:none;}
    table{ border-collapse:collapse;}
    #menu{clear:both;width:90%;height:30px;background:#4cbb00;line-height:30px;margin-bottom:10px;overflow:hidden;}
    #search img{float:left;}
    .searchspan{float:left;margin:20px 0 10px 20px}
    #menu ul{margin-left:30px;padding:0px;height:30px;}
    #one,#two{margin:0px;padding:0px}
    #menu ul li{list-style-type:none;float:left;width:70px;height:30px;text-align:center;line-height:32px;}
    #menu li a{color:white;font-size:18px;font-weight:bold;text-decoration:none;}
    #tablelist td{border-bottom:1px solid #a7a6aa;border-right:1px solid #a7a6aa}
    .icolor td{width: 15px;height: 15px;border: solid 1px #000000; cursor:pointer;}
    </style>
    <!--[if IE 8]>
    <style type="text/css">
     #menu ul li{list-style-type:none;float:left;width:70px;height:30px;text-align:center;line-height:34px;}
    </style>
    <![endif]-->
    <script type="text/javascript" src="/Public/images/index/index2.js" ></script>
    <script type="text/javascript" src="/Public/images/index/index2_1.js" ></script>
    <script type="text/javascript">
    $(function(){
    <?php
     if("{bz}"=="0")
     {
      echo '$("#one").show();$("#two").hide();';
    }
    ?>
    <?php
     if("{bz}"=="1")
     {
      echo '$("#one").hide();$("#two").show();';
    }
    ?>
    })
    </script>
    </head>
    <body bgcolor="#f5f9fa" style="font-family:Arial;">
    <script type="text/javascript" src="/Public/images/xiangxi/Tip/Tip.js" ></script>
    <div id="register" style="display:none;">
    <div id="rt" align=right style="width:400px;height:20px;background-color:#f1f7da;cursor:move;"><b style="cursor:pointer;">关闭</b></div>
    <iframe src="/zhuce.php" width=400 height=180 frameBorder=0></iframe>
    </div>
    <div id="login" style="display:none;">
    <div id="lt" align=right style="width:400px;height:20px;background-color:#f1f7da;cursor:move;"><b style="cursor:pointer;">关闭</b></div>
    <iframe src="/denglu.php" width=400 height=180 frameBorder=0></iframe>
    </div>

    <div id="notice" style="display:none;">
    <div align=right style="width:500px;height:20px;background-color:#f1f7da;"><b style="cursor:pointer;">关闭</b></div>
    <iframe src="/notice.html" width=500 height=250 frameBorder=0 scrolling=no></iframe>
    </div>

    <div id="wrapper" style="display:none;">
    <div id="search">
    <img src="/Public/images/logo.gif" onclick="window.location.href='http://www.stu80.com';" style="margin-top:12px;cursor:pointer;">
    <form name=form action="{TP_SITE}/Forum/search.html" method=post  onsubmit="return onsub()">
    <span class="searchspan">
    <input id=t name=text style="height:36px;font-size:30px;" size=30><br><input type=submit name=sub value="搜索帖子" style="height:30px;width:100px;margin-top:4px;">
    </span>
    </form>
    </div>
    <div id="menu">
    <ul id="one"><li><a href="javascript:void(0)">注册</a></li><li><a href="javascript:void(0)">登陆</a></li><li><a href="javascript:void(0)">短消息</a></li><li><a href="{TP_SITE}/game.html">游戏</a></li><li><a href="{TP_SITE}">主页</a></li><li><a href="{TP_SITE}/f/22">精华区</a></li><li><a href="{TP_SITE}/wish.html">许愿</a></li><li><a href="{TP_SITE}/FAQ">问答</a></li>
    </ul>
    <ul id="two" style="display:none;"><span style="display:inline-block;line-height:32px;*line-height:34px;float:left;color:#ffffff;font-size:18px;font-weight:bold;">{$user}</span>
    <if condition="$xiaoxi.sign eq 1 "> <span id="email" style="display:inline-block;float:left;line-height:30px;*line-height:34px;"><img src="/images/email.png"  title="新消息" alt="新消息"></span></if>
    <li><a href="{TP_SITE}/self.html">资料</a></li>
    <li><a href="{TP_SITE}/Forum/logout.html">退出</a></li>
    <li><a href="{TP_SITE}/selectself/id/2">短消息</a></li><li><a href="{TP_SITE}/game.html">游戏</a></li><li><a href="{TP_SITE}">主页</a></li><li><a href="{TP_SITE}/f/22">精华区</a></li><li><a href="{TP_SITE}/wish.html">许愿</a></li><li><a href="{TP_SITE}/FAQ">问答</a></li>
    </ul>
    </div>
    <table width=90% cellspacing="0" cellpadding="0"><tr><td align="center">

    </td></tr><tr><td height="10"></td></tr><tr><td>
    <?php
    if($_SESSION['f']!=22){
    echo '<a href="{TP_SITE}/fatie.html" ><span id="img" onmouseover="this.style.background=\'#d5ecbc\'" onmouseout="this.style.background=\'#c5e7aa\'"  style="width:96px;height:26px;cursor:pointer;display:inline-block;text-align:center;font-family:\'华文新魏\';font-size:18px;border:1px solid #bfd5f2;background:#c5e7aa;line-height:26px;">发表新帖</span></a>';
    }
    ?>
    </td>
    <td align=right>&nbsp;</td>
    </tr>
    <?php
    if(!empty($this->array_array['page'])){
    echo'
    <tr>
    <td colspan=2 width="100%">
      <div align="right" style="height:22px;overflow:hidden">
    <loop>&nbsp;{page}</loop>
      </div>
    </td>
    </tr>
    ';
    }
    ?>
    </table>
      

  2.   

    接上面<table id="tablelist" width=90% border=1 cellspacing=0 cellpadding=0 style="border:1px solid #a7a6aa;">
    <tr  height=30>
    <td width="50%"  style="background-image:url('/Public/images/bg1.gif');color:#334f67"><b>主题</b></td><td colspan=2 width="20%" style="background-image:url('/Public/images/bg1.gif');color:#334f67"><b>作者发表</b></td><td width="10%" style="background-image:url('/Public/images/bg1.gif');color:#334f67"><b>回复/浏览</b></td><td colspan=2 width="20%"  style="background-image:url('/Public/images/bg1.gif');color:#334f67"><b>最后发表</b></td>
    </tr>
    <tr height=30>
    <td style="background-color:#f8fcf3"><font id="tongzhi" color=red style="cursor:pointer;">(置顶)~~~~发帖须知~~~~~~</font></td><td style="background-color:#f8fcf3">&nbsp;</td><td align=center style="background-color:#f8fcf3">&nbsp;</td>
    <td style="background-color:#f8fcf3">&nbsp;</td><td style="background-color:#f8fcf3">&nbsp;</td><td align=center style="background-color:#f8fcf3">&nbsp;</td>
    </tr>
    <list>
    <tr height=30>
    <td style="background-color:#f8f8f8" onmouseover="document.getElementById('color'+{zhiding.id}).style.display='inline-block'"  onmouseout="document.getElementById('color'+{zhiding.id}).style.display='none'" >
    <a style="float:left" href="{TP_SITE}/xiangxi/{zhiding.id}.html">{zhiding.title}</a><span id="color{zhiding.id}" onclick="setColor({zhiding.id},'{zhiding.title|strip_tags}')" style="display:none;width:30px;height:18px;float:right;background:#dddddd;font-family:Arial;font-size:12px;color:#666666;cursor:pointer">设置</span>
    </td>
    <td width="90" style="background-color:#f0efee;font-family:Arial;font-size:14px;color:#030e22">{zhiding.zuozhe}</td><td width=70 align=center style="background-color:#f5f5f5"><b style="font-size:10px;">{zhiding.time1}</b></td>
    <?php if("{zhiding.num2}"!='')
    {
    echo '<td align=center style="background-color:#ffffff"><font color=red>{zhiding.num2}</font>/{zhiding.num1}</td>';
    }
    ?>
    <?php if("{zhiding.num2}"=='')
    {
    echo '<td align=center style="background-color:#ffffff">0/{zhiding.num1}</td>';
    }
    ?>
    <?php if("{zhiding.zuozhe1}"!='')
    {
    echo '<td   width="90" style="background-color:#f0efee;font-family:Arial;font-size:14px;color:#030e22">{zhiding.zuozhe1}</td><td width=70 align=center style="background-color:#f5f5f5"><b style="font-size:10px;">{zhiding.time2}</b></td>';
    }
    ?>
    <?php if("{zhiding.zuozhe1}"=='')
    {
    echo '<td   width="90" style="background-color:#f0efee;font-family:Arial;font-size:14px;color:#030e22">&nbsp;</td><td width=70 align=center style="background-color:#f5f5f5"><b style="font-size:10px;">&nbsp;</b></td>';
    }
    ?>
    </tr>
    </list>
    <list>
    <tr height=30>
    <td style="background-color:#f8f8f8" onmouseover="document.getElementById('color'+{data.id}).style.display='inline-block'"  onmouseout="document.getElementById('color'+{data.id}).style.display='none'" >
    <a style="float:left" href="{TP_SITE}/xiangxi/{data.id}.html">{data.title}</a><span id="color{data.id}" onclick="setColor({data.id},'{data.title|strip_tags}')" style="display:none;width:30px;height:18px;float:right;background:#dddddd;font-family:Arial;font-size:12px;color:#666666;cursor:pointer">设置</span>
    </td>
    <td   width="90" style="background-color:#f0efee;font-family:Arial;font-size:14px;color:#030e22">{data.zuozhe}</td><td width=70 align=center style="background-color:#f5f5f5"><b style="font-size:10px;">{data.time1}</b></td>
    <?php if("{data.num2}"!='')
    {
    echo '<td align=center style="background-color:#ffffff"><font color=red>{data.num2}</font>/{data.num1}</td>';
    }
    ?>
    <?php if("{data.num2}"=='')
    {
    echo '<td align=center style="background-color:#ffffff">0/{data.num1}</td>';
    }
    ?>
    <?php if("{data.zuozhe1}"!='')
    {
    echo '<td   width="90"  style="background-color:#f0efee;font-family:Arial;font-size:14px;color:#030e22">{data.zuozhe1}</td><td width=70 align=center style="background-color:#f5f5f5"><b style="font-size:10px;">{data.time2}</b></td>';
    }
    ?>
    <?php if("{data.zuozhe1}"=='')
    {
    echo '<td   width="90"  style="background-color:#f0efee;font-family:Arial;font-size:14px;color:#030e22">&nbsp;</td><td width=70 align=center style="background-color:#f5f5f5"><b style="font-size:10px;">&nbsp;</b></td>';
    }
    ?>
    </tr>
    </list>
    </table>
    <div id="footer" style="width:90%;margin:0 auto;float:left;">
    <table width=90% height=50 cellspacing=0 cellpadding=0 border=0 >
    <tr><td align=center><font style="font-size:12px;">Copyright &copy;  2010 人文常熟 版权所有</font></td></tr>
    </table>
    </div>
    </div>

    </body>
    </html>
      

  3.   

    内容页<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <link style="text/css" href="/UBB/ORG/UBB/edit.css" rel="stylesheet"></link>
    <script type="text/javascript" src="/UBB/ORG/UBB/edit1.js"></script>
    <style type="text/css">
    body{font-family:Arial;}
    a{color:#993399;text-decoration:none}
    table{ border-collapse:collapse;}
    td{text-align: left;}
      .no-user-select {
                  -moz-user-select: none; 
                  -webkit-user-select: none; 
                  -ms-user-select: none;
                }
    ::selection { color:#fff; background-color:#639631;}
    ::-moz-selection { color:#fff; background-color:#639631;}
    ::-webkit-selection { color:#fff; background-color:#639631;}
    </style>
    <title><?php echo strip_tags({data1_1->title}); ?></title>
    <script type="text/javascript" src="/Public/images/xiangxi/xiangxi2.js" ></script>
    <script type="text/javascript" src="/Public/images/xiangxi/cookie.js" ></script>
    </head>
    <body bgcolor="#fefcf4">
    <script type="text/javascript" src="/Public/images/xiangxi/Tip/Tip.js" ></script>
    <center>
    <?php  $num=0; ?>
    <table border=1 cellspacing=0 cellpadding=0 style="width:830px;border:1px solid #a7a6aa">
    <?php
     if(!empty($this->array_array['showx'])){
      echo '
    <tr>
    <td colspan=3  style="text-align:right;height:22px;overflow:hidden;margin:0px;padding:0px;">
    <loop>&nbsp;{showx}</loop>
      </td>
    </tr>';
    }
    ?>

    <?php 
    foreach($this->array_two['data1'] as $v)
    {
    if($num==0){
    echo 
    '
    <tr>
    <td colspan=3 style="background:#f0f0ee"><a href="{TP_SITE}">首页</a>&nbsp;>><a href="{TP_SITE}/f/{fqlink}">{fq}</a>&nbsp;>><b>标题:'.$v['title'].'</b></td>
    </tr>
    <tr>
    <td width=130 height=20 style="border-style:solid dotted dotted solid ;background-color:#f7f7ef">&nbsp;'.$v['zuozhe'].'</td>
    <td  align="right" width=650 height=20 style="text-align:right;border-style:solid dotted dotted dotted;background:#f7f7ef"><span style="font-size:12px;font-weight:bold;float:left">发表于:'.$v['time1'].'</span>
    <img  src="/Public/images/red.png" title="删除回复帖"  onclick="createDiv()">
    <img src="/Public/images/yellow2.png" title="显示10条记录" onclick="setcookie2(\'yellow2\')">
    <img  src="/Public/images/shallow.png" title="显示15条记录" onclick="setcookie2(\'shallow\')">
    <img src="/Public/images/blue.png" title="显示20条记录(默认)" onclick="setcookie2(\'blue\')">
    <img  src="/Public/images/green.png" title="主帖无滚动条" onclick="setcookie(\'green\')">
    <img src="/Public/images/yellow.png" title="主帖现滚动条" onclick="setcookie(\'yellow\')">
    ';
    echo
    <<<EOF
    <!--分享到tencent-->
    <span style="margin-right:5px;">
    <script type="text/javascript" charset="utf-8">
    (function(){
      var _w = 16 , _h = 16;
      var param = {
        url:location.href,
        type:'3',
        count:'', /**是否显示分享数,1显示(可选)*/
        appkey:'', /**您申请的应用appkey,显示分享来源(可选)*/
        title:'', /**分享的文字内容(可选,默认为所在页面的title)*/
        pic:'', /**分享图片的路径(可选)*/
        ralateUid:'1955839363', /**关联用户的UID,分享微博会@该用户(可选)*/
    language:'zh_cn', /**设置语言,zh_cn|zh_tw(可选)*/
        rnd:new Date().valueOf()
      }
      var temp = [];
      for( var p in param ){
        temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
      }
      document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')
    })()
    </script>
    <script type="text/javascript">document.write(['<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=',encodeURIComponent(location.href),'&title=',encodeURIComponent(document.title),'" target="_blank"  title="分享到QQ空间"><img border=0 src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/app_share/qz_logo.png" alt="分享到QQ空间" /><\/a>'].join(''));</script>
    <a href="javascript:;"  class="tmblog" id="share_btn_1328182983595" onclick="postToWb()"><img   src="http://static.bshare.cn/frame/images/logos/s4/qqmb.png" border="0" title="转播到腾讯微博"></a>
    <script>
    function postToWb(){
    var _url = encodeURIComponent(location.href);
    var _pic = encodeURI('');//(例如:var _pic='图片url1|图片url2|图片url3....)
    var _t = '';//标题和描述信息
    var metainfo = document.getElementsByTagName("meta");
    for(var metai = 0;metai < metainfo.length;metai++){
    if((new RegExp('description','gi')).test(metainfo[metai].getAttribute("name"))){
    _t = metainfo[metai].attributes["content"].value;
    }
    }
    _t =  document.title+_t;//请在这里添加你自定义的分享内容
    if(_t.length > 120){
    _t= _t.substr(0,117)+'...';
    }
    _t = encodeURI(_t);
    var _u = 'http://share.v.t.qq.com/index.php?c=share&a=index&url='+_url+'&appkey=801093235&pic='+_pic+'&assname=xjl756425616&title='+_t;
    window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
    };
    </script>
     </span>
      </td><td width=50  style="text-align:right;border-style:solid solid dotted dotted;background-color:#f7f7ef">楼主</td>
    </tr>
    EOF;
    echo 
    '
    <tr >
    <td  valign=top width=130  height=154 style="border-style:dotted dotted solid solid;background-color:#f8f8f8;"><a  target="_blank" href="/userinfo.html?username='.urlencode($v['zuozhe']).'"><img  src="/images/'.$v['face'].'" width=90 height=90 style="border:none"></a>
    <br><b style="font-size:12px;">军衔:
    ';
    if($v['fatieshu1']<30) echo '新兵';
    if($v['fatieshu1']>=30&&$v['fatieshu1']<80) echo '列兵';
    if($v['fatieshu1']>=80&&$v['fatieshu1']<150) echo '下士';
    if($v['fatieshu1']>=150&&$v['fatieshu1']<240) echo '中士';
    if($v['fatieshu1']>=240&&$v['fatieshu1']<350) echo '上士';
    if($v['fatieshu1']>=350&&$v['fatieshu1']<480) echo '准尉';
    if($v['fatieshu1']>=480&&$v['fatieshu1']<630) echo '少尉';
    if($v['fatieshu1']>=630&&$v['fatieshu1']<800) echo '中尉';
    if($v['fatieshu1']>=800&&$v['fatieshu1']<1000) echo '上尉';
    if($v['fatieshu1']>=1000&&$v['fatieshu1']<1200) echo '大尉';
    if($v['fatieshu1']>=1200&&$v['fatieshu1']<1400) echo '少校';
    if($v['fatieshu1']>=1400&&$v['fatieshu1']<1600) echo '中校';
    if($v['fatieshu1']>=1600&&$v['fatieshu1']<1800) echo '上校';
    if($v['fatieshu1']>=1800&&$v['fatieshu1']<2000) echo '大校';
    if($v['fatieshu1']>=2000&&$v['fatieshu1']<2500) echo '准将';
    if($v['fatieshu1']>=2500&&$v['fatieshu1']<3000) echo '少将';
    if($v['fatieshu1']>=3000&&$v['fatieshu1']<3500) echo '中将';
    if($v['fatieshu1']>=3500&&$v['fatieshu1']<4000) echo '上将';
    if($v['fatieshu1']>=4000&&$v['fatieshu1']<5000) echo '大将';
    if($v['fatieshu1']>=5000) echo '元帅';
    echo
    '
    <br><b style="font-size:12px;">注册时间:'.substr($v['timezc1'],0,10).'</b>
    <br><b style="font-size:12px;">发帖数:&nbsp;&nbsp;&nbsp;'.$v['fatieshu1'].'</b><br>
    <b style="font-size:12px;">活跃度:'.getlive($v['zuozhe']).'</b>&nbsp;&nbsp;
    <b onclick="show0()" style="font-size:12px;cursor:pointer;">消息</b>
    </td>
    <td colspan=2 valign=top style="background-color:#fafafa">
    <div style="width:698px;overflow:hidden">
    <table width=100% height=154 cellspacing=0 cellpadding=0 border=0>
    <tr><td  valign=top>
    ';
      

  4.   

    if($_COOKIE['scrollbar']=='yellow')
    {
    echo '
    <div id="swrap" style="width:698px;height:300px;overflow:hidden;">
    <div id="scon" style="width:690px;float:left;position:relative;">
    ';
    }
    //if($_SESSION['votebz']==1)
    //{
    // echo '<iframe id="showvote" width=700  src="'.$this->array['$TP_SITE'].'/toupiao/'.getparam("id").'" scrolling=no border=0 frameborder=0 onload="this.height=this.contentWindow.document.body.scrollHeight"></iframe><br>';
    //}
    echo $v['content'];
    if($_COOKIE['scrollbar']=='yellow')
    {
    echo '
      </div>
      <div id="slider" style="width:4px;height:300px;float:left;position:relative;left:4px;background:#ddd5be;">
     <div id="slider_btn" title="滚动条拖拽" style="cursor:s-resize;position:absolute;top:0;left:0;width:4px;background:#999999;height:50px; -moz-border-radius: 4px; -khtml-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></div>
      </div>   
    </div>
    <script type="text/javascript" src="/Public/images/xiangxi/scrollbar.js" ></script>';
    }
    echo '</td></tr>';echo '
    <tr><td  align=left valign=bottom>
    <div style="width:698px;text-align:right">
    ';
    $num=0;
    foreach($this->array_two['1'] as $11){
    if($11['tid']==$v['id']){
    $num++;
    echo '<img src="/images/'.$11['pic'].'" width=30 height=30 alt="'.$11['er'].'----'.$11['content'].'" title="'.$11['er'].'----'.$11['content'].'">';
    }
    }
     if($num!=0) 
      echo '<span title="评分次数" style="width:30px;height:30px;background-color:#fff4dd;color:#ff6600;text-align:center;font-size:30px;text-decoration:underline;cursor:pointer;">'.$num.'</span>'; 
    echo
    ' </div>
    </td></tr>';
    echo
     '
    <tr  height=14 style="background-color:#f7f7ef;font-weight:600;font-size:14px;">
    <td valign="bottom" style="width:100%;border-top:1px dotted #d1d7dc">
    <div style="width:698px;height:16px;text-align:right">
    <div style="float:left">
    <a style="color:#005d8c;" href="'.'{TP_SITE}'.'/Quote1/'.$v['id'].'.html">引用</a>&nbsp;&nbsp;
    '; 
    if($v['zuozhe']=="{user}"){
    echo '<a style="color:#005d8c;margin-left:4px;" href="'.'{TP_SITE}'.'/edit1/'.$v['id'].'.html">编辑</a>';
    }
    echo 
    '
    </div>
    <a  style="color:#005d8c;"  href="javascript:void(0)" onclick="showone()">评分</a>
    </div>
    </td>
    </tr>';
    echo '
    </table>
      </div>
    </td>
    </tr>
    ';
    }
    $num++;
    if(!empty($v['zuozhe1'])){
    echo
    '
    <tr><td colspan=3>&nbsp;</td></tr>
    <tr>
    <td width=130 height=20 style="border-right-style:dotted;border-bottom-style:dotted;background-color:#f7f7ef">&nbsp;'.$v['zuozhe1'].'</td><td align=left style="border-bottom-style:dotted;border-right-style:dotted;background-color:#f7f7ef"><b style="font-size:12px;">发表于'.$v['time2'].'</b></td><td style="text-align:right;border-bottom-style:dotted;background-color:#f7f7ef"><a style="color:#000000" name='.$v['num2'].'>'.$v['num2'].'楼</a></td>
    </tr>
    <tr >
    <td  valign=top width=130 height=154  style="border-right-style:dotted;background-color:#f8f8f8;"><a  target="_blank" href="/userinfo.html?username='.urlencode($v['zuozhe1']).'"><img  src="/images/'.$v['face1'].'" width=90 height=90 style="border:none"></a>
    <br><b style="font-size:12px;">军衔:
    ';
    if($v['fatieshu2']<30) echo '新兵';
    if($v['fatieshu2']>=30&&$v['fatieshu2']<80) echo '列兵';
    if($v['fatieshu2']>=80&&$v['fatieshu2']<150) echo '下士';
    if($v['fatieshu2']>=150&&$v['fatieshu2']<240) echo '中士';
    if($v['fatieshu2']>=240&&$v['fatieshu2']<350) echo '上士';
    if($v['fatieshu2']>=350&&$v['fatieshu2']<480) echo '准尉';
    if($v['fatieshu2']>=480&&$v['fatieshu2']<630) echo '少尉';
    if($v['fatieshu2']>=630&&$v['fatieshu2']<800) echo '中尉';
    if($v['fatieshu2']>=800&&$v['fatieshu2']<1000) echo '上尉';
    if($v['fatieshu2']>=1000&&$v['fatieshu2']<1200) echo '大尉';
    if($v['fatieshu2']>=1200&&$v['fatieshu2']<1400) echo '少校';
    if($v['fatieshu2']>=1400&&$v['fatieshu2']<1600) echo '中校';
    if($v['fatieshu2']>=1600&&$v['fatieshu2']<1800) echo '上校';
    if($v['fatieshu2']>=1800&&$v['fatieshu2']<2000) echo '大校';
    if($v['fatieshu2']>=2000&&$v['fatieshu2']<2500) echo '准将';
    if($v['fatieshu2']>=2500&&$v['fatieshu2']<3000) echo '少将';
    if($v['fatieshu2']>=3000&&$v['fatieshu2']<3500) echo '中将';
    if($v['fatieshu2']>=3500&&$v['fatieshu2']<4000) echo '上将';
    if($v['fatieshu2']>=4000&&$v['fatieshu2']<5000) echo '大将';
    if($v['fatieshu2']>=5000) echo '元帅';
    echo
    '
    <br><b style="font-size:12px;">注册时间:'.substr($v['timezc2'],0,10).'</b>
    <br><b style="font-size:12px;">发帖数:&nbsp;&nbsp;&nbsp;'.$v['fatieshu2'].'</b><br>
    <b style="font-size:12px;">活跃度:'.getlive($v['zuozhe1']).'</b>&nbsp;&nbsp;
    <b onclick="show('.$v['id2'].')" style="font-size:12px;cursor:pointer;">消息</b>
    </td>
    <td colspan=2 valign=top style="background-color:#fafafa">
    <div style="width:698px;overflow:hidden">
    <table width=100% height=154 cellspacing=0 cellpadding=0 border=0>
    <tr><td  valign=top>
    ';
    echo $v['content1'];
    echo '
    <tr><td  align=left valign=bottom>
    <div style="width:698px;text-align:right">
    ';
    $num=0;
    foreach($this->array_two['2'] as $22){
    if($22['rid']==$v['id2']){
    $num++;
    echo '<img src="/images/'.$22['pic'].'" width=30 height=30 alt="'.$22['er'].'----'.$22['content'].'" title="'.$22['er'].'----'.$22['content'].'">';
    }
    }
     if($num!=0) 
     echo '<span title="评分次数" style="width:30px;height:30px;background-color:#fff4dd;color:#ff6600;text-align:center;font-size:30px;text-decoration:underline;cursor:pointer;">'.$num.'</span>'; 
    echo
    ' </div>
    </td></tr>';
    echo
     '
    <tr  height=14 style="background-color:#f7f7ef;font-weight:600;font-size:14px;">
    <td valign="bottom" style="width:100%;border-top:1px dotted #d1d7dc">
    <div style="width:698px;height:16px;text-align:right">
    <div style="float:left">
    <a style="color:#005d8c;" href="'.'{TP_SITE}'.'/Quote2/'.$v['id2'].'-'.$v['id'].'.html">引用</a>&nbsp;&nbsp;
    '; 
    if($v['zuozhe1']=="{user}"){
    echo '<a style="color:#005d8c;margin-left:4px;" href="'.'{TP_SITE}'.'/edit2/'.$v['id2'].'.html">编辑</a>';
    }
    echo 
    '
    </div>
    <a  style="color:#005d8c;"  href="javascript:void(0)" onclick="showone('.$v['id2'].')">评分</a>
    </div>
    </td>
    </tr>';
    echo '
    </table>
      </div>
    </td>
    </tr>
    ';
      

  5.   

    echo
    '
    <form name="form" action="{TP_SITE}/sendemail" method=post  target="small"  onsubmit="return checkmail({user})">
      <div align=left id="content'.$v['id2'].'" style="display:none;">
       <b style="cursor:pointer;float:right;" onclick="turn('.$v['id2'].')">关闭</b><br>
    <font style="display:none;">收件人:</font><input name="to" value="'.$v['zuozhe1'].'" READONLY style="display:none;">
    <font style="display:none;">发件人:</font><input name="from" value="{user}" READONLY style="display:none;">
    标题:<input name=title  style="width:250px;margin-bottom:12px;"   maxlength=10>
     <textarea name=content style="width:350px;height:200px" onkeydown="if(this.value.length>=70){return false;}"></textarea><br>
     <input type="button"  value="发送" style="height:30px;width:50px" onclick="if(checkmail(\'{user}\')){var iTop = (window.screen.availHeight-150)/2;var iLeft = (window.screen.availWidth-300)/2;window.open( \'http://www.stu80.com/sendemail\', \'small\', \'width=300,height=150,top=\'+iTop+\',left=\'+iLeft);document.form.submit();}">  
      </div>
    </form>
    ';
    echo 
    '
    <div id="'.$v['id2'].'" style="display:none;">
    <div align=right style="width:200px;height:20px;background-color:#f1f7da;"><b onclick="turn('.$v['id2'].')" style="cursor:pointer;">关闭</b></div>
    <iframe src="/2.php?id2='.$v['id2'].'&id='. $_GET['id'].'" width=200 height=230 frameBorder=0></iframe>
    </div>
    ';
    }
    }
    ?>
    <?php
     if(!empty($this->array_array['showx'])){
      echo '
    <tr>
    <td colspan=3  style="text-align:right;height:22px;overflow:hidden;margin:0px;padding:0px;">
    <loop>&nbsp;{showx}</loop>
      </td>
    </tr>';
    }
    ?>
    <form name="formmail" action="{TP_SITE}/sendemail" method=post   target='small' >
      <div align=left id="con" style="display:none;">
    <b style="cursor:pointer;float:right;" onclick="turn0()">关闭</b><br>
    <font style="display:none;">收件人:</font><input name="to" value="{data1.zuozhe}" READONLY style="display:none;"><!--<br>-->
    <font style="display:none;">发件人:</font><input name="from" value="{$user}" READONLY style="display:none;"><!--<br>-->
    标题:<input name=title style="width:250px;margin-bottom:12px;"   maxlength=10>
     <textarea name=content style="width:350px;height:200px" onkeydown="if(this.value.length>=70){return false;}"></textarea><br>
     <input type="button"  value="发送" style="height:30px;width:50px" onclick="if(checkmail('{$user}')){var iTop = (window.screen.availHeight-150)/2;var iLeft = (window.screen.availWidth-300)/2;window.open( 'http://www.stu80.com/sendemail', 'small', 'width=300,height=150,top='+iTop+',left='+iLeft);document.formmail.submit();}">  
      </div>
    </form>

    </table>
    <p><p>
    <form name=form1 method=post action="{TP_SITE}/insert2" onsubmit="return check();">
    <table  border=1 style="width:830px;border:1px solid #a7a6aa">
    <tr style="display:none;">
    <td>回复人</td><td><input type=text READONLY name=zuozhe1 value="{user}"></td>
    </tr>
    <tr>
    <td>回复内容</td><td>
    <!--<textarea  name=content1 id=content1 style="width:750px;height:180px;resize:none"></textarea>-->
    <div id="edit" style="width:750px;background:#f9f9f9;margin:0 auto"> </div>
    <script>web_editor_init("edit","750","160","http://localhost/UBB")</script>
    </td>
    </tr>
    <tr>
    <td><input type=submit value="提交回复"></td><td><input type="reset"  value="重置"></td>
    <input type=hidden name=rid value="{data1_1->id}">
    </tr>
    </table>
    </form>

    <div id="one" style="display:none;">
    <div align=right style="width:200px;height:20px;background-color:#f1f7da;"><b onclick="turnone()" style="cursor:pointer;">关闭</b></div>
    <iframe src="/1.php?id=<?php echo getparam("id"); ?>" width=200 height=230 frameBorder=0></iframe>
    </div>

    </center>
    </body>
    </html>
      

  6.   

    做一些项目有感,,我试着写模板,发现一定要用到php,,这样一来,发现没有解析的必要了,因为我的框架是这样的一维数组 全部存到 $this->array_array二维数组全部存到  $this->array_two解析型模板碰到的最大问题是  模板中 没能很好解决php 判断问题中间嵌套html,只能把html全部看成php的字符串,,非常混淆
      

  7.   

    模板实现了书写时的php代码和html代码的分离
    使的模板文件可以用html可视化编辑器编辑
    实际执行的是php和html混编代码