[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_comment/ -> class.comment.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Comment
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  /** ensure this file is being included by a parent file */
  18  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  19  
  20  class moscomment extends mosDBTable {
  21      /** @var int Primary key */
  22      var $id=null;
  23      /** @var int */
  24      var $articleid=null;
  25      /** @var varchar */
  26      var $ip=null;
  27      /** @var varchar */
  28      var $name=null;
  29      /** @var text */
  30      var $comments=null;
  31      /** @var datetime */
  32      var $startdate=null;
  33      /** @var tinyint */
  34      var $published=null;
  35  
  36      /**
  37      * @param database
  38      * A database connector object
  39      */
  40    function moscomment( &$db ) {
  41      $this->mosDBTable( '#__comment', 'id', $db );
  42    }
  43  }
  44  class mosCommentConfig {
  45      var $auto_publish_comments = 1;
  46      var $allow_anonymous_entries = 1;
  47      var $notify_new_entries = 0;
  48      var $allow_comments_in_sections = "0,4";
  49      var $comments_per_page = 10;
  50      var $admin_comments_length = 100;
  51  	function __construct() {
  52          global $mosConfig_absolute_path;
  53          require ($mosConfig_absolute_path."/administrator/components/com_comment/config.comment.php");
  54  
  55          $auto_publish_comments = isset($auto_publish_comments) ? abs(intval($auto_publish_comments)) : $this->auto_publish_comments;
  56          $this->auto_publish_comments = $auto_publish_comments > 1 ? $this->auto_publish_comments : $auto_publish_comments;
  57  
  58          $allow_anonymous_entries = isset($allow_anonymous_entries) ? abs(intval($allow_anonymous_entries)) : $this->allow_anonymous_entries;
  59          $this->allow_anonymous_entries = $allow_anonymous_entries > 1 ? $this->allow_anonymous_entries : $allow_anonymous_entries;
  60  
  61          $notify_new_entries = isset($notify_new_entries) ? abs(intval($notify_new_entries)) : $this->notify_new_entries;
  62          $this->notify_new_entries = $notify_new_entries > 1 ? $this->notify_new_entries : $notify_new_entries;
  63  
  64          $allow_comments_in_sections = isset($allow_comments_in_sections) ? $allow_comments_in_sections : $this->allow_comments_in_sections;
  65          $this->allow_comments_in_sections = trim(str_replace(' ', '', $allow_comments_in_sections));
  66  
  67          $comments_per_page = isset($comments_per_page) ? abs(intval($comments_per_page)) : $this->comments_per_page;
  68          $this->comments_per_page = $comments_per_page < 1 ? $this->comments_per_page : $comments_per_page;
  69  
  70          $admin_comments_length = isset($admin_comments_length) ? abs(intval($admin_comments_length)) : $this->admin_comments_length;
  71          $this->admin_comments_length = $admin_comments_length < 1 ? $this->admin_comments_length : $admin_comments_length;
  72      }
  73  	function mosCommentConfig() {
  74          $this->__construct();
  75      }
  76  }
  77  ?>