Updated for comments 1.3.0
authordmitry <dmitry@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 14 Feb 2008 14:23:04 +0000 (14:23 +0000)
committerdmitry <dmitry@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 14 Feb 2008 14:23:04 +0000 (14:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/comments_ic/trunk@8249 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
class.tx_commentsic_hooks.php
ext_emconf.php
ext_localconf.php

index 5cf0faf..964f9ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-14 Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Updated for comments 1.3.0
+
 2008-01-07 Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed: some system had problems with default value for tt_news item
index df7ebc2..d33198b 100644 (file)
  */
 class tx_commentsic_hooks {
        /**
-        * Provides comment closing date to comments extension for tt_news items
+        * Provides comment closing date to comments extension for various extensions
         *
         * @param       array   $params Parameters to the function
         * @param       tx_comments_pi1 $pObj   Parent object
+        * @return      mixed   Closing timestamp or false if unknown
+        * @see tx_comments_pi1::isCommentingClosed()
         */
-       function ttNewsHook(&$params, &$pObj) {
-               return $this->getCloseTime('tt_news', $params['uid'], $pObj->cObj);
-       }
-
-       /**
-        * Provides comment closing date to comments extension for commerce products
-        *
-        * @param       array   $params Parameters to the function
-        * @param       tx_comments_pi1 $pObj   Parent object
-        */
-       function commerceProductHook(&$params, &$pObj) {
-               return $this->getCloseTime('tx_commerce_products', $params['uid'], $pObj->cObj);
+       function hookFunc(&$params, &$pObj) {
+               $result = false;
+               switch ($params['table']) {
+                       case 'tt_news':
+                       case 'tx_commerce_products':
+                               $result = $this->getCloseTime($params['table'], $params['uid'], $pObj->cObj);
+                               break;
+               }
+               return $result;
        }
 
        /**
@@ -75,10 +74,10 @@ class tx_commentsic_hooks {
         * @param       string  $table  Table name
         * @param       int     $uid    UID of the record
         * @param       tslib_cObj      $cObj   COBJECT
-        * @return      int     Closing timestamp
+        * @return      mixed   Closing timestamp or false if unknown
         */
        private function getCloseTime($table, $uid, &$cObj) {
-               $result = 0;
+               $result = false;
                $recs = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('tx_commentsic_disable,tx_commentsic_closetime',
                                        $table, 'uid=' . intval($uid) . $cObj->enableFields($table));
                if (count($recs)) {
index dea86dd..c475256 100644 (file)
@@ -12,7 +12,7 @@
 
 $EM_CONF[$_EXTKEY] = array(
        'title' => 'Comments: individual closing',
-       'description' => 'Adds individual closing of comments for tt_news and commerce products',
+       'description' => 'Adds individual closing of comments for tt_news and commerce products. Public free support is provided only through TYPO3 mailing lists! Contact by e-mail for commercial support.',
        'category' => 'fe',
        'author' => 'Dmitry Dulepov [netcreators]',
        'author_email' => 'dmitry@typo3.org',
@@ -32,10 +32,11 @@ $EM_CONF[$_EXTKEY] = array(
        'version' => '1.0.3',
        'constraints' => array(
                'depends' => array(
-                       'php' => '5.0.0-0.0.0',
-                       'comments' => '0.9.0-',
+                       'php' => '5.1.0-0.0.0',
+                       'comments' => '1.3.0-',
                ),
                'conflicts' => array(
+                       'comments' => '0.0.0-1.2.999',
                ),
                'suggests' => array(
                        'tt_news' => '',
index 6c0f888..1a76328 100644 (file)
@@ -4,6 +4,7 @@
 if (!defined ('TYPO3_MODE')) die('Access denied.');
 
 // Hook to comments for comments closing
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['comments/pi1/class.tx_comments_pi1.php']['tt_news'] = 'EXT:comments_ic/class.tx_commentsic_hooks.php:tx_commentsic_hooks->ttNewsHook';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['comments/pi1/class.tx_comments_pi1.php']['tx_commerce_products'] = 'EXT:comments_ic/class.tx_commentsic_hooks.php:tx_commentsic_hooks->commerceProductHook';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['comments']['closeCommentsAfter'][$_EXTKEY] = 'EXT:comments_ic/class.tx_commentsic_hooks.php:tx_commentsic_hooks->hookFunc';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['comments']['closeCommentsAfter'][$_EXTKEY] = 'EXT:comments_ic/class.tx_commentsic_hooks.php:tx_commentsic_hooks->hookFunc';
+
 ?>
\ No newline at end of file