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.      * @subpackage basic
  18.      */
  19.     if!defined('DB_USER') ) die'Please, do not access this page directly.' );
  20.  
  21.     // --- //
  22.  
  23.     if$c 
  24.     {    // Comments not requested
  25.         $disp_comments 0;                    // DO NOT Display the comments if not requested
  26.         $disp_comment_form 0;            // DO NOT Display the comments form if not requested
  27.     }
  28.     
  29.     if( (!$tb|| (!$Blog->get'allowtrackbacks' )) ) 
  30.     {    // Trackback not requested or not allowed
  31.         $disp_trackbacks 0;                // DO NOT Display the trackbacks if not requested
  32.         $disp_trackback_url 0;        // DO NOT Display the trackback URL if not requested
  33.     }
  34.     
  35.     if( (!$pb|| (!$Blog->get'allowpingbacks' )) ) 
  36.     {    // Pingback not requested or not allowed
  37.         $disp_pingbacks 0;                // DO NOT Display the pingbacks if not requested
  38.     }
  39.  
  40.     ?>
  41.     <a name="feedbacks"></a>
  42.     <?php
  43.     
  44.     if($disp_comments || $disp_comment_form || $disp_trackbacks || $disp_trackback_url || $disp_pingbacks ) )
  45.     {    // Nothing more to do....
  46.         return false;
  47.     }
  48.     
  49.     $type_list array();
  50.     $disp_title array();
  51.     if(  $disp_comments )    
  52.     {    // We requested to display comments
  53.         if$Item->can_see_comments() )
  54.         // User can see a comments
  55.             $type_list["'comment'";
  56.             $disp_title[T_("Comments")
  57.         }
  58.         else
  59.         // Use cannot see comments
  60.             $disp_comments false;
  61.         }        
  62.         ?>
  63.         <a name="comments"></a>
  64.     <?php 
  65.     if$disp_trackbacks 
  66.         $type_list["'trackback'";
  67.         $disp_title[T_("Trackbacks")?>
  68.         <a name="trackbacks"></a>
  69.     <?php }
  70.     if$disp_pingbacks 
  71.         $type_list["'pingback'";
  72.         $disp_title[T_("Pingbacks")?>
  73.         <a name="pingbacks"></a>
  74.     <?php ?>
  75.     
  76.     <?php if$disp_trackback_url {    // 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.         if$disp_comments 
  85.     ?>
  86.     
  87.     <!-- Title for comments, tbs, pbs... -->
  88.     <h4><?php echo implode", "$disp_title?>:</h4>
  89.     
  90.     <?php
  91.     $CommentList new CommentList0implode(','$type_list)array()$id'''ASC' );
  92.     
  93.     $CommentList->display_if_empty
  94.                                 '<p>' 
  95.                                 sprintf/* TRANS: NO comments/trackabcks/pingbacks/ FOR THIS POST... */ 
  96.                                                     T_('No %s for this post yet...')implode"/"$disp_title) ) 
  97.                                 '</p>' );
  98.     
  99.     while$Comment $CommentList->get_next() )
  100.     {    // Loop through comments:    
  101.         ?>
  102.         <!-- ========== START of a COMMENT/TB/PB ========== -->
  103.         <?php $Comment->anchor(?>
  104.         <h5>
  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.         </h5>
  128.         <blockquote>
  129.             <small><?php $Comment->date(?> @ <?php $Comment->time'H:i' ?></small>
  130.             <div><?php $Comment->content(?></div>
  131.         </blockquote>
  132.         <!-- ========== END of a COMMENT/TB/PB ========== -->
  133.         <?php
  134.     
  135.     
  136.     if$disp_comment_form 
  137.     {    // We want to display the comments form: 
  138.         if$Item->can_comment() )
  139.         // User can leave a comment
  140.         ?>
  141.         <h4><?php echo T_('Leave a comment'?>:</h4>
  142.         
  143.         <?php
  144.             $comment_author = isset($_COOKIE[$cookie_name]trim($_COOKIE[$cookie_name]'';
  145.             $comment_author_email = isset($_COOKIE[$cookie_email]trim($_COOKIE[$cookie_email]'';
  146.             $comment_author_url = isset($_COOKIE[$cookie_url]trim($_COOKIE[$cookie_url]'';
  147.         ?>
  148.         
  149.         <!-- form to add a comment -->
  150.         <form action="<?php echo $htsrv_url ?>/comment_post.php" method="post">
  151.         
  152.             <input type="hidden" name="comment_post_ID" value="<?php echo $Item->ID(?>" />
  153.             <input type="hidden" name="redirect_to" value="<?php echo regenerate_url(?>" />
  154.  
  155.         <table>
  156.             <?php 
  157.             ifis_logged_in() ) 
  158.             // User is logged in: 
  159.                 ?>
  160.                 <tr valign="top" bgcolor="#eeeeee">
  161.                     <td align="right"><strong><?php echo T_('User'?>:</strong></td>
  162.                     <td align="left">
  163.                         <strong><?php $current_User->prefered_name()?></strong>
  164.                         <?php user_profile_link' ['']'T_('Edit profile') ) ?>
  165.                         </td>
  166.                 </tr>    
  167.                 <?php 
  168.             
  169.             else
  170.             // User is not loggued in: 
  171.                 ?>
  172.                 <tr valign="top" bgcolor="#eeeeee">
  173.                     <td align="right"><label for="author"><strong><?php echo T_('Name'?>:</strong></label></td>
  174.                     <td align="left"><input type="text" name="author" id="author" value="<?php echo $comment_author ?>" size="40" tabindex="1" /></td>
  175.                 </tr>    
  176.                 
  177.                 <tr valign="top" bgcolor="#eeeeee">
  178.                     <td align="right"><label for="email"><strong><?php echo T_('Email'?>:</strong></label></td>
  179.                     <td align="left"><input type="text" name="email" id="email" value="<?php echo $comment_author_email ?>" size="40" tabindex="2" /><br />
  180.                         <small><?php echo T_('Your email address will <strong>not</strong> be displayed on this site.'?></small>
  181.                     </td>
  182.                 </tr>
  183.                 
  184.                 <tr valign="top" bgcolor="#eeeeee">
  185.                     <td align="right"><label for="url"><strong><?php echo T_('Site/Url'?>:</strong></label></td>
  186.                     <td align="left"><input type="text" name="url" id="url" value="<?php echo $comment_author_url ?>" size="40" tabindex="3" /><br />
  187.                         <small><?php echo T_('Your URL will be displayed.'?></small>
  188.                     </td>
  189.                 </tr>
  190.                 <?php 
  191.                 
  192.             ?>
  193.                     
  194.             <tr valign="top" bgcolor="#eeeeee">
  195.                 <td align="right"><label for="comment"><strong><?php echo T_('Comment text'?>:</strong></label></td>
  196.                 <td align="left" width="450"><textarea cols="50" rows="12" name="comment" id="comment" tabindex="4"></textarea><br />
  197.                     <small><?php echo T_('Allowed XHTML tags')': 'htmlspecialchars(str_replace'><',', '$comment_allowed_tags)) ?></small>
  198.                 </td>
  199.             </tr>
  200.                     
  201.             <tr valign="top" bgcolor="#eeeeee">
  202.                 <td align="right"><strong><?php echo T_('Options'?>:</strong></td>
  203.                 <td align="left">
  204.                 
  205.                 <?php if(substr($comments_use_autobr,0,4== 'opt-'?>
  206.                     <input type="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"><strong><?php echo T_('Auto-BR'?></strong></label> <small>(<?php echo T_('Line breaks become &lt;br /&gt;'?>)</small><br />
  207.                 <?php 
  208.                 ifis_logged_in() ) 
  209.                 // User is not logged in: 
  210.                     ?>
  211.                     <input type="checkbox" name="comment_cookies" value="1" checked="checked" tabindex="7" id="comment_cookies" /> <label for="comment_cookies"><strong><?php echo T_('Remember me'?></strong></label> <small><?php echo T_('(Set cookies for name, email &amp; url)'?></small>
  212.                     <?php 
  213.                 ?>
  214.                 </td>
  215.             </tr>
  216.         
  217.             <tr valign="top" bgcolor="#eeeeee">
  218.                 <td colspan="2" align="center">
  219.                     <input type="submit" name="submit" value="<?php echo T_('Send comment'?>" tabindex="8" />
  220.                 </td>
  221.             </tr>
  222.         </table>    
  223.         
  224.         </form>
  225.     <?php 
  226.         
  227.     }
  228.     ?>
  229.  
  230. <?php // if you delete this the sky will fall on your head ?>

Documentation generated on Tue, 20 May 2008 01:53:59 +0200 by phpDocumentor 1.4.2