b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: evoskins ] [ index: evoskins ] [ all elements ]

Source for file _feedback.php

Documentation is available at _feedback.php

  1. <?php
  2.     /**
  3.      * This is the template that displays the feedback for a post
  4.      * (comments, trackbak, pingback...)
  5.      *
  6.      * This file is not meant to be called directly.
  7.      * It is meant to be called by an include in the _main.php template.
  8.      * To display a feedback, you should call a stub AND pass the right parameters
  9.      * For example: /blogs/index.php?p=1&more=1&c=1&tb=1&pb=1
  10.      * Note: don't code this URL by hand, use the template functions to generate it!
  11.      *
  12.      * b2evolution - {@link http://b2evolution.net/}
  13.      * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  14.      * @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
  15.      *
  16.      * @package evoskins
  17.      */
  18.     if!defined('DB_USER') ) die'Please, do not access this page directly.' );
  19.  
  20.     // --- //
  21.  
  22.     if$c 
  23.     {    // Comments not requested
  24.         $disp_comments 0;                    // DO NOT Display the comments if not requested
  25.         $disp_comment_form 0;            // DO NOT Display the comments form if not requested
  26.     }
  27.     
  28.     if( (!$tb|| (!$Blog->get'allowtrackbacks' )) ) 
  29.     {    // Trackback not requested or not allowed
  30.         $disp_trackbacks 0;                // DO NOT Display the trackbacks if not requested
  31.         $disp_trackback_url 0;        // DO NOT Display the trackback URL if not requested
  32.     }
  33.     
  34.     if( (!$pb|| (!$Blog->get'allowpingbacks' )) ) 
  35.     {    // Pingback not requested or not allowed
  36.         $disp_pingbacks 0;                // DO NOT Display the pingbacks if not requested
  37.     }
  38.     
  39.     if($disp_comments || $disp_comment_form || $disp_trackbacks || $disp_trackback_url || $disp_pingbacks ) )
  40.     {    // Nothing more to do....
  41.         return false;
  42.     }
  43.     
  44.     ?>
  45.     <a name="feedbacks"></a>
  46.     <?php
  47.  
  48.     $type_list array();
  49.     $disp_title array();
  50.     if$disp_comments 
  51.     {    // We requested to display comments
  52.         if$Item->can_see_comments() )
  53.         // User can see a comments
  54.             $type_list["'comment'";
  55.             $disp_title[T_("Comments")
  56.         }
  57.         else
  58.         // Use cannot see comments
  59.             $disp_comments false;
  60.         }        
  61.         ?>
  62.         <a name="comments"></a>
  63.     <?php 
  64.     if$disp_trackbacks 
  65.         $type_list["'trackback'";
  66.         $disp_title[T_("Trackbacks")?>
  67.         <a name="trackbacks"></a>
  68.     <?php }
  69.     if$disp_pingbacks 
  70.         $type_list["'pingback'";
  71.         $disp_title[T_("Pingbacks")?>
  72.         <a name="pingbacks"></a>
  73.     <?php ?>
  74.     
  75.     <?php if$disp_trackback_url 
  76.     {    // We want to display the trackback URL: ?>
  77.     <h4><?php echo T_('Trackback address for this post:'?></h4>
  78.     <code><?php $Item->trackback_url(?></code>
  79.     <?php ?>
  80.     
  81.     <?php
  82.     if$disp_comments || $disp_trackbacks || $disp_pingbacks  )
  83.     {
  84.     ?>
  85.     
  86.     <!-- Title for comments, tbs, pbs... -->
  87.     <h4><?php echo implode", "$disp_title?>:</h4>
  88.     
  89.     <?php
  90.     $CommentList new CommentList0implode(','$type_list)array()$id'''ASC' );
  91.     
  92.     $CommentList->display_if_empty
  93.                                 '<div class="bComment"><p>' 
  94.                                 sprintf/* TRANS: NO comments/trackabcks/pingbacks/ FOR THIS POST... */ 
  95.                                                     T_('No %s for this post yet...')implode"/"$disp_title) ) 
  96.                                 '</p></div>' );
  97.  
  98.     while$Comment $CommentList->get_next() )
  99.     {    // Loop through comments:    
  100.         ?>
  101.         <!-- ========== START of a COMMENT/TB/PB ========== -->
  102.         <?php $Comment->anchor(?>
  103.         <div class="bComment">
  104.             <div class="bCommentTitle">
  105.             <?php
  106.                 switch$Comment->get'type' ) )
  107.                 {
  108.                     case 'comment'// Display a comment: 
  109.                         echo T_('Comment from:'?> 
  110.                         <?php $Comment->author(?> 
  111.                         <?php $Comment->author_url''' &middot; ''' ?>
  112.                         <?php break;
  113.  
  114.                     case 'trackback'// Display a trackback:
  115.                         echo T_('Trackback from:'?> 
  116.                         <?php $Comment->author'''#''''#''htmlbody'true ?>
  117.                         <?php break;
  118.  
  119.                     case 'pingback'// Display a pingback:
  120.                         echo T_('Pingback from:'?> 
  121.                         <?php $Comment->author'''#''''#''htmlbody'true ?>
  122.                         <?php break;
  123.                 
  124.  
  125.                 $Comment->edit_link' &middot; ' // Link to backoffice for editing
  126.             ?>
  127.             </div>
  128.             <div class="bCommentText">
  129.                 <?php $Comment->content(?>
  130.             </div>
  131.             <div class="bCommentSmallPrint">
  132.                 <a href="<?php $Comment->permalink(?>" title="<?php echo T_('Permanent link to this comment'?>" class="permalink_right"><img src="<?php imgbase(?>chain_link.gif" alt="<?php echo T_('Permalink'?>" width="14" height="14" border="0" class="middle" /></a>
  133.                 <?php $Comment->date(?> @ <?php $Comment->time'H:i' ?>
  134.             </div>
  135.         </div>
  136.         <!-- ========== END of a COMMENT/TB/PB ========== -->
  137.         <?php
  138.     
  139.     
  140.     if$disp_comment_form 
  141.     {    // We want to display the comments form: 
  142.         if$Item->can_comment() )
  143.         // User can leave a comment
  144.         ?>
  145.         <h4><?php echo T_('Leave a comment'?>:</h4>
  146.         
  147.         <?php
  148.             $comment_author = isset($_COOKIE[$cookie_name]trim($_COOKIE[$cookie_name]'';
  149.             $comment_author_email = isset($_COOKIE[$cookie_email]trim($_COOKIE[$cookie_email]'';
  150.             $comment_author_url = isset($_COOKIE[$cookie_url]trim($_COOKIE[$cookie_url]'';
  151.         ?>
  152.         
  153.         <!-- form to add a comment -->
  154.         <form action="<?php echo $htsrv_url ?>/comment_post.php" method="post" class="bComment">
  155.         
  156.             <input type="hidden" name="comment_post_ID" value="<?php $Item->ID(?>" />
  157.             <input type="hidden" name="redirect_to" value="<?php echo regenerate_url(?>" />
  158.  
  159.             <?php 
  160.             ifis_logged_in() ) 
  161.             // User is logged in: 
  162.                 ?>
  163.                 <fieldset>
  164.                     <div class="label"><?php echo T_('User'?>:</div>
  165.                     <div class="info">
  166.                         <strong><?php $current_User->prefered_name()?></strong>
  167.                         <?php user_profile_link' ['']'T_('Edit profile') ) ?>
  168.                         </div>
  169.                 </fieldset>
  170.                 <?php 
  171.             
  172.             else
  173.             // User is not loggued in: 
  174.                 form_text'author'$comment_author40T_('Name')''100'bComment' );
  175.  
  176.                 form_text'email'$comment_author_email40T_('Email')T_('Your email address will <strong>not</strong> be displayed on this site.')100'bComment' );
  177.  
  178.                 form_text'url'$comment_author_url40T_('Site/Url')T_('Your URL will be displayed.')100'bComment' );
  179.             
  180.  
  181.             form_textarea'comment'''12T_('Comment text'),
  182.                                         T_('Allowed XHTML tags').': '.htmlspecialchars(str_replace'><',', '$comment_allowed_tags))40'bComment' );
  183.             ?>
  184.                     
  185.             <fieldset>
  186.                 <div class="label"><?php echo T_('Options'?>:
  187.                 <?php if( (substr($comments_use_autobr,0,4== 'opt-'&& (is_logged_in()) )
  188.                 // Ladies and gentlemen, check out the biggest piece of anti IE-layout-bugs 
  189.                     // crap you've ever seen: 
  190.                     echo '<br />&nbsp;'// make the float a little higher
  191.                 ?>
  192.                 </div>
  193.                 <div class="input">
  194.                 <?php ifsubstr($comments_use_autobr,0,4== 'opt-'?>
  195.                 <input type="checkbox" class="checkbox" name="comment_autobr" value="1" <?php if($comments_use_autobr == 'opt-out'echo ' checked="checked"' ?> tabindex="6" id="comment_autobr" /> <label for="comment_autobr"><?php echo T_('Auto-BR'?></label> <span class="notes">(<?php echo T_('Line breaks become &lt;br /&gt;'?>)</span><br />
  196.                 <?php 
  197.                 ifis_logged_in() ) 
  198.                 // User is not logged in: 
  199.                     ?>
  200.                     <input type="checkbox" class="checkbox" name="comment_cookies" value="1" checked="checked" tabindex="7" id="comment_cookies" /> <label for="comment_cookies"><?php echo T_('Remember me'?></label> <span class="notes"><?php echo T_('(Set cookies for name, email &amp; url)'?></span>
  201.                     <?php 
  202.                 ?>
  203.                 </div>
  204.             </fieldset>
  205.         
  206.             <fieldset>
  207.                 <div class="input">
  208.                     <input type="submit" name="submit" class="submit" value="<?php echo T_('Send comment'?>" tabindex="8" />
  209.                 </div>
  210.             </fieldset>
  211.         
  212.             <div class="clear"></div>
  213.         
  214.         </form>
  215.         <?php 
  216.         
  217.     }
  218.     ?>
  219.  
  220. <?php // if you delete this the sky will fall on your head ?>

Documentation generated on Tue, 20 May 2008 01:54:02 +0200 by phpDocumentor 1.4.2