Login   Register  
PHP Classes
elePHPant
Icontem

File: replies.ctp

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of lijun wang  >  blog  >  replies.ctp  >  Download  
File: replies.ctp
Role: Auxiliary script
Content type: text/plain
Description: replies view
Class: blog
A blog system implemented with CakePHP framework
Author: By
Last change:
Date: 2009-07-24 01:12
Size: 4,585 bytes
 

Contents

Class file image Download
<?php 
/**
 * 日志(blog)查看(内容和回复)既快速回复文件
 *
 * @author wlj lesorb <lesorb@gmail.com>
 * @version 1.0
 */    
?>

<?php 

    $this
->pageTitle '--欢迎访问--'.$commuser['Commuser']['commerName'].'--博客--';

?>
    <div class="list_path_links"><h3>你现在的位置:<?php echo $html->link(__($commuser['Commuser']['commerName'], true), array('controller'=>'commusers','action'=>'view',$commuser['Commuser']['id']));?><span>&gt;</span><a href="/blogs/lists/<?php echo $commuser['Commuser']['id'];?>">惠民博客</a>之
    <span>&gt;</span><?php __($blog['Blog']['title']);?></h3></div>
        
                <div class="title"><span class="bg_t"><span class="bg_tl"><a class="mod_icon" href="#"><img src="/img/rizhi.gif"></a><span class="mod_title">日志</span></span><span class="bg_tr"></span></span></div>

    <div class="f">
        
        <div id="fr1">
        <h3 style="position: relative;">
         <span class="fr_bt2"><?php echo $html->link(__$blog['Blog']['title'], true), array('controller'=>'BlogReplies','action'=>'replies',$blog['Blog']['commuser_id'].'/'.$blog['Blog']['id']));?></span>
        </h3>          
          <p class="fr_bt1"><label>分类:</label>【<?php echo $html->link(__($blog['Blogclass']['name'], true), array('controller'=>'blogs','action'=>'classes',$blog['Blog']['commuser_id'].'/'.$blog['Blog']['blogclass_id'])); ?>
                    
         <span class="fr_bt3">(发布于<?php echo round((time()-strtotime($blog['Blog']['modified']))/86400);?>天前)</span></p>
                
                <span class="fr_tt"><?php echo $blog['Blog']['description']; ?></span>

                <span>标签:<?php echo $blog['Blog']['tag']; ?></span>
                <div>查看数:      <?php echo $blog['Blog']['view_count']; ?></div>
                <div>回复数:      <?php echo $blog['Blog']['replay_count']; ?></div>

       </div>

<div id='blog_replay'>
    <?php
    
if(!empty($blogReplies))
        echo 
$this->renderElement('..\blog_replies\elements\replies');
    
?>
</div>
    <!-- 回复button onclick -->
    <span style="float:left;"><input type="button" value="回 复" onclick="displayOnOff('bolg_replay_form');"></span>

    <!-- 回复区 replay form start-->
     <div style="border:1px #c3c3c3 solid; width:70%; padding:5px;display:none" id="bolg_replay_form" >

    <?php if($blog['Blog']['replay_status'] === 'open') { ?>

        <?php echo $form->create('BlogReply',array('url'=>'/manage/BlogReplies/ajaxReplay'));?>

        <?php
            
echo $form->input('BlogReply.title', array('label'=>'标题','value'=>'RE:'.$blog['Blog']['title'],'style'=>'width:300px'));
            echo 
$form->input('BlogReply.description', array('label'=>'内容''type'=>'textarea'));
            echo 
$form->input('BlogReply.blog_id', array('type'=>'hidden''value'=>$blog['Blog']['id']));
        
?>
        <!-- 验证码-->
        <div class='input text'>
            <?php
                
echo $form->input('BlogReply.captcha', array('label'=>'验证码:''size'=>5'div'=>false));
                echo 
$html->image('/users/captcha', array('alt'=>'点击刷新验证码!''id'=>'captcha''style'=>'padding:0; margin-left:10px;')); ?>
            <a href="javascript:void(0);" onclick="javascript:document.images.captcha.src='<?php echo '/users/captcha';?>?' + Math.round(Math.random(0)*1000)+1">看不清楚?</a><span> 防止灌水,请填写验证码。</span><font color="red"> *</font>
        </div>
        <!-- 验证码-->
        <?php            
            $remoteFunction 
$ajax->remoteFunction
            array( 
            
'url' => array( 'controller' => 'BlogReplies''action' => 'showBlogReplies',$blog['Blog']['id'] ),
            
'update' => 'blog_replay' 
            ); 
        
?>

            <div style="margin-top:8px;">
            <?php
                $options 
= array(
                    
'url' => array('controller'=>'BlogReplies''action'=>'ajaxReplay''manage'=>true),
                    
'update' => 'blogreplayview',
                    
'loading' => 'blogreplayloading',
                    
'complete' => "$remoteFunction"
                
);
                echo 
$ajax->submit('好 了'$options);
            
?>
            <?php echo "<div id=\"blogreplayview\" style=\"font-size:14px;color:#f00;\">  </div>";
            echo 
"<div id=\"blogreplayloading\" style=\"font-size:14px;color:#f00;display:none\">".$html->image('/img/mini/mini_status.gif')."</div>";?>
    
        <?php }else{ ?>
            <div style="font-size:14px;color:#f00;">  该日志不允许回复  </div>;
        <?php ?>
        </div>
    </div>

<script type="text/javascript">
 <!--
     function displayOnOff(id)
    {
        element = document.getElementById(id);
        if(element.style.display == 'none')
            element.style.display = 'block';
        else
            element.style.display = 'none';
    }
  //-->

</script>
<!--  回复区 replay form end-->