Sync with my local svn in order to continue wokring only in Horde git
authorDuck (Jakob Munih) <duck@obala.net>
Sun, 1 Feb 2009 23:41:04 +0000 (00:41 +0100)
committerDuck (Jakob Munih) <duck@obala.net>
Sun, 1 Feb 2009 23:41:04 +0000 (00:41 +0100)
14 files changed:
news/files.php
news/lib/Categories.php
news/lib/News.php
news/lib/TagCloud.php
news/lib/View.php
news/lib/api.php
news/lib/base.php
news/locale/sl_SI/LC_MESSAGES/news.mo
news/note.php
news/po/news.pot
news/rss/comments.php
news/rss/news.php
news/scripts/sql/news.mysql.sql
news/templates/news/comments.php

index b26e3d9..b54fa0a 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Download and veiew files
+ * Download and view files
  *
- * $Id: files.php 1187 2009-01-21 10:33:06Z duck $
+ * $Id: files.php 1241 2009-01-29 23:27:58Z duck $
  *
  * Copyright Obala d.o.o. (www.obala.si)
  *
@@ -72,9 +72,6 @@ case 'download_zip_all':
         exit;
     }
 
-var_dump($zipfiles);
-exit;
-
     $zip = Horde_Compress::singleton('zip');
     $body = @$zip->compress($zipfiles);
     $browser->downloadHeaders($news_id . '.zip', 'application/zip', false, strlen($body));
index e888f1f..015f57f 100755 (executable)
@@ -2,9 +2,12 @@
 /**
  * News Tree Class.
  *
- * $Id: Categories.php 1163 2009-01-14 17:47:23Z duck $
+ * $Id: Categories.php 1261 2009-02-01 23:20:07Z duck $
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @author  Duck <duck@obala.net>
  * @package News
@@ -344,6 +347,10 @@ class News_Categories {
     private function _insertCategory($data)
     {
         $new_id = $this->_write_db->nextId('news_categories');
+        if ($new_id instanceof PEAR_Error) {
+            Horde::logMessage($new_id, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return $new_id;
+        }
 
         $sql = 'INSERT INTO ' . $this->prefix . '_categories' .
                ' (category_id, category_parentid) VALUES (?, ?)';
@@ -357,11 +364,16 @@ class News_Categories {
 
         $sql = 'INSERT INTO ' . $this->prefix . '_categories_nls VALUES (?, ?, ?, ?)';
         foreach ($GLOBALS['conf']['attributes']['languages'] as $lang) {
+
             $values = array($new_id,
                             $lang,
                             $data['category_name_' . $lang],
                             $data['category_description_' . $lang]);
-            $this->_write_db->query($sql, $values);
+            $result = $this->_write_db->query($sql, $values);
+            if ($result instanceof PEAR_Error) {
+                Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
+                return $result;
+            }
         }
 
         return $new_id;
@@ -535,7 +547,7 @@ class News_Categories {
     public function getCategories($flat = true)
     {
         $lang = News::getLang();
-        $cache_key = 'NewsCategories_' . $lang . '_'$flat;
+        $cache_key = 'NewsCategories_' . $lang . '_' . (int)$flat;
         $categories = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
         if ($categories) {
             return unserialize($categories);
index 4d46a11..3799b03 100755 (executable)
@@ -2,7 +2,7 @@
 /**
  * News base calss
  *
- * $Id: News.php 1190 2009-01-21 16:10:50Z duck $
+ * $Id: News.php 1263 2009-02-01 23:25:56Z duck $
  *
  * Copyright Obala d.o.o. (www.obala.si)
  *
@@ -504,7 +504,7 @@ class News {
             }
 
             $threads[$id]['news_id'] = $news_id;
-            $threads[$id]['read_url'] = self::getUrlFor('news', $news_id);
+            $threads[$id]['read_url'] = self::getUrlFor('news', $news_id, true);
         }
 
         $GLOBALS['cache']->set($cache_key, serialize($threads));
@@ -545,11 +545,13 @@ class News {
                 ' n.category2, n.attachments, n.picture, n.comments, n.gallery, n.sponsored, ' .
                 ' l.title, l.content, l.picture_comment, l.tags, n.selling, n.trackbacks, n.threads, ' .
                 ' n.form_id, n.form_ttl FROM ' . $this->prefix . ' AS n, ' . $this->prefix . '_body AS l ' .
-                ' WHERE n.id=? AND n.id=l.id AND l.lang=?';
+                ' WHERE n.id = ? AND n.id=l.id AND l.lang = ?';
 
+        /** TODO Allow for now to allow static linked news, but not shown in list
         if (!Auth::isAdmin('news:admin')) {
             $query .= ' AND n.status = ' . self::CONFIRMED;
         }
+        */
 
         $data = $this->db->getRow($query, array($id, self::getLang()), DB_FETCHMODE_ASSOC);
         if ($data instanceof PEAR_Error) {
index e8ddac5..2c3bff4 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * extend Horde TagCloud to allow complete css font sizes
  */
-class Oscar_TagCloud extends Horde_UI_TagCloud {
+class News_TagCloud extends Horde_UI_TagCloud {
 
     /**
      * create a Element of HTML part
index 5f55064..137cab3 100755 (executable)
@@ -2,9 +2,12 @@
 /**
  * News General View Class
  *
- * $Id: View.php 1118 2008-12-04 19:10:41Z duck $
+ * $Id: View.php 1260 2009-02-01 23:15:50Z duck $
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @author  Duck <duck@obala.net>
  * @package News
index 126a491..101db35 100755 (executable)
@@ -2,11 +2,14 @@
 /**
  * News api
  *
- * $Id: api.php 970 2008-10-07 17:11:59Z duck $
+ * $Id: api.php 1260 2009-02-01 23:15:50Z duck $
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
- * @author  Duck <duck@obala.net>
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
  * @package News
  */
 
index dbf5a3f..38c87e0 100755 (executable)
@@ -2,12 +2,12 @@
 /**
  * News base
  *
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: base.php 1260 2009-02-01 23:15:50Z duck $
  *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE.
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
- * $Id: base.php 1174 2009-01-19 15:11:03Z duck $
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @author Duck <duck@obala.net>
  * @package News
index 8df9f2c..3f6a2eb 100755 (executable)
Binary files a/news/locale/sl_SI/LC_MESSAGES/news.mo and b/news/locale/sl_SI/LC_MESSAGES/news.mo differ
index 58d7292..d5fe2f0 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * News
  *
- * $Id: note.php 890 2008-09-23 09:58:23Z duck $
+ * $Id: note.php 1241 2009-01-29 23:27:58Z duck $
  *
  * Copyright Obala d.o.o. (www.obala.si)
  *
@@ -19,7 +19,7 @@ if ($row instanceof PEAR_Error) {
     exit;
 }
 
-$body = $row['title'] . "\n\n"getUrlFor
+$body = $row['title'] . "\n\n"
        . _("On") . ': ' . $news->dateFormat($row['publish']) . "\n"
        . _("Link") . ': ' . News::getUrlFor('news', $id) . "\n\n"
        . strip_tags($row['content']);
index ab702bd..b384686 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2009-01-21 01:31+0100\n"
+"POT-Creation-Date: 2009-01-30 16:08+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,11 +16,11 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: templates/edit/info.php:91
+#: templates/edit/info.php:94
 msgid " at "
 msgstr ""
 
-#: templates/edit/info.php:91
+#: news.php:35 templates/edit/info.php:94
 msgid " by "
 msgstr ""
 
@@ -39,7 +39,7 @@ msgid ""
 "Link: %s"
 msgstr ""
 
-#: templates/news/news.php:18
+#: templates/news/news.php:21
 msgid "* Sponsored news"
 msgstr ""
 
@@ -56,7 +56,7 @@ msgstr ""
 msgid "Activate"
 msgstr ""
 
-#: lib/News.php:1123
+#: lib/News.php:1141
 msgid "Add"
 msgstr ""
 
@@ -100,15 +100,15 @@ msgstr ""
 msgid "Admin"
 msgstr ""
 
-#: lib/News.php:1131
+#: lib/News.php:1149
 msgid "Administration"
 msgstr ""
 
-#: templates/edit/info.php:21
+#: templates/edit/info.php:23
 msgid "Allow comments"
 msgstr ""
 
-#: lib/News.php:1121
+#: lib/News.php:1139
 msgid "Archive"
 msgstr ""
 
@@ -128,14 +128,10 @@ msgstr ""
 msgid "Ascesending"
 msgstr ""
 
-#: lib/News.php:216
+#: lib/News.php:215
 msgid "Attached files: "
 msgstr ""
 
-#: edit.php:44
-msgid "Attachment deleted"
-msgstr ""
-
 #: lib/Forms/Search.php:46
 msgid "Attachments"
 msgstr ""
@@ -170,11 +166,6 @@ msgstr ""
 msgid "Cancel"
 msgstr ""
 
-#: files.php:52
-#, php-format
-msgid "Cannot read file %s"
-msgstr ""
-
 #: add.php:199
 msgid "Caption"
 msgstr ""
@@ -210,21 +201,25 @@ msgstr ""
 msgid "Chars"
 msgstr ""
 
+#: templates/news/news.php:10
+msgid "Click for full picture"
+msgstr ""
+
 #: templates/browse/row.inc:10 templates/edit/header.inc:13
 #: lib/Forms/Search.php:44
 msgid "Comments"
 msgstr ""
 
-#: lib/News.php:487
+#: lib/News.php:490
 msgid "Comments are not supported."
 msgstr ""
 
-#: lib/News.php:222
+#: lib/News.php:220
 #, php-format
 msgid "Compress and dowload %s"
 msgstr ""
 
-#: lib/News.php:215
+#: lib/News.php:214
 msgid "Compress and dowload all files at once"
 msgstr ""
 
@@ -246,11 +241,11 @@ msgstr ""
 
 #: templates/edit/row.php:23 admin/categories/index.php:29
 #: admin/categories/index.php:32 admin/sources/index.php:27
-#: admin/sources/index.php:34 lib/News.php:206
+#: admin/sources/index.php:34 lib/News.php:205
 msgid "Delete"
 msgstr ""
 
-#: lib/News.php:227
+#: lib/News.php:225
 #, php-format
 msgid "Delete %s"
 msgstr ""
@@ -271,7 +266,7 @@ msgstr ""
 msgid "Description"
 msgstr ""
 
-#: diff.php:14 templates/edit/info.php:100
+#: diff.php:14 templates/edit/info.php:103
 msgid "Diff"
 msgstr ""
 
@@ -287,20 +282,20 @@ msgstr ""
 msgid "Do you really wont to delete this source?"
 msgstr ""
 
-#: lib/News.php:210
+#: lib/News.php:209
 msgid "Dowload"
 msgstr ""
 
-#: lib/News.php:223
+#: lib/News.php:221
 #, php-format
 msgid "Dowload %s"
 msgstr ""
 
-#: lib/News.php:211
+#: lib/News.php:210
 msgid "Dowload Zip Compressed"
 msgstr ""
 
-#: edit.php:116 templates/edit/row.php:6 templates/edit/row.php:7
+#: edit.php:110 templates/edit/row.php:6 templates/edit/row.php:7
 #: admin/categories/index.php:27 admin/categories/index.php:34
 #: admin/sources/index.php:25 admin/sources/index.php:36
 msgid "Edit"
@@ -314,15 +309,15 @@ msgstr ""
 msgid "Edit category"
 msgstr ""
 
-#: templates/edit/info.php:80
+#: templates/edit/info.php:82
 msgid "Edit history: "
 msgstr ""
 
-#: add.php:542
+#: add.php:552
 msgid "Edit news"
 msgstr ""
 
-#: templates/edit/info.php:25 lib/Forms/Search.php:56
+#: templates/edit/info.php:27 lib/Forms/Search.php:56
 msgid "Editor"
 msgstr ""
 
@@ -330,7 +325,7 @@ msgstr ""
 msgid "Editors"
 msgstr ""
 
-#: lib/News.php:1130
+#: lib/News.php:1148
 msgid "Editorship"
 msgstr ""
 
@@ -351,7 +346,7 @@ msgstr ""
 msgid "Enter threads separated by commas."
 msgstr ""
 
-#: delete_file.php:44
+#: delete_file.php:53
 #, php-format
 msgid "Error deleteing file \"%s\" from news \"%s\""
 msgstr ""
@@ -364,21 +359,21 @@ msgstr ""
 msgid "File"
 msgstr ""
 
-#: delete_file.php:49
+#: delete_file.php:72
 #, php-format
 msgid "File \"%s\" was deleted from news \"%s\""
 msgstr ""
 
-#: delete_file.php:53
+#: delete_file.php:79
 #, php-format
 msgid "File \"%s\" was not deleted from news \"%s\""
 msgstr ""
 
-#: add.php:204 add.php:458
+#: add.php:204 add.php:463
 msgid "Files"
 msgstr ""
 
-#: files.php:60
+#: files.php:59
 #, php-format
 msgid "FilesOfNews-%s"
 msgstr ""
@@ -448,7 +443,7 @@ msgstr ""
 msgid "Info"
 msgstr ""
 
-#: templates/edit/info.php:88
+#: templates/edit/info.php:91
 msgid "Insert"
 msgstr ""
 
@@ -518,18 +513,22 @@ msgstr ""
 msgid "News"
 msgstr ""
 
+#: edit.php:46 edit.php:54 edit.php:62 edit.php:70 edit.php:103
+#, php-format
+msgid "News \"%s\" (%s): %s"
+msgstr ""
+
 #: reads.php:28
 #, php-format
 msgid "News %s"
 msgstr ""
 
-#: edit.php:44 edit.php:52 edit.php:60 edit.php:68 edit.php:76 edit.php:109
-#: delete.php:73 delete.php:75
+#: delete.php:74 delete.php:78
 #, php-format
 msgid "News %s: %s"
 msgstr ""
 
-#: add.php:530
+#: add.php:540
 msgid ""
 "News added. The editors will check the entry and confirm it if they find it "
 "suitable."
@@ -555,7 +554,7 @@ msgstr ""
 msgid "News of this day."
 msgstr ""
 
-#: add.php:532
+#: add.php:542
 msgid "News published."
 msgstr ""
 
@@ -568,11 +567,11 @@ msgstr ""
 msgid "News sucessfuly added to you notes."
 msgstr ""
 
-#: add.php:534
+#: add.php:544
 msgid "News updated."
 msgstr ""
 
-#: templates/edit/info.php:21
+#: templates/edit/info.php:23
 msgid "No"
 msgstr ""
 
@@ -612,7 +611,7 @@ msgstr ""
 msgid "Order by"
 msgstr ""
 
-#: lib/News.php:1119
+#: lib/News.php:1137
 msgid "Overview"
 msgstr ""
 
@@ -624,7 +623,7 @@ msgstr ""
 msgid "Parent"
 msgstr ""
 
-#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:33
+#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:35
 msgid "Parents"
 msgstr ""
 
@@ -644,12 +643,12 @@ msgstr ""
 msgid "Preview"
 msgstr ""
 
-#: lib/News.php:224
+#: lib/News.php:222
 #, php-format
 msgid "Preview %s"
 msgstr ""
 
-#: add.php:129 templates/edit/info.php:10
+#: add.php:129 templates/edit/info.php:12
 msgid "Primary category"
 msgstr ""
 
@@ -677,17 +676,17 @@ msgstr ""
 msgid "Reads"
 msgstr ""
 
-#: delete_file.php:23 delete_file.php:41 delete.php:23 delete.php:34
+#: delete_file.php:23 delete_file.php:49 delete.php:23 delete.php:34
 #: admin/categories/delete.php:18 admin/categories/delete.php:24
 #: admin/sources/delete.php:19 admin/sources/delete.php:25
 msgid "Remove"
 msgstr ""
 
-#: templates/edit/info.php:97
+#: templates/edit/info.php:100
 msgid "Renew"
 msgstr ""
 
-#: add.php:118 add.php:120 add.php:577
+#: add.php:118 add.php:120 add.php:587
 msgid "Reset"
 msgstr ""
 
@@ -699,7 +698,7 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
-#: lib/News.php:1122 lib/Forms/Search.php:22 lib/Forms/Search.php:24
+#: lib/News.php:1140 lib/Forms/Search.php:22 lib/Forms/Search.php:24
 msgid "Search"
 msgstr ""
 
@@ -707,7 +706,7 @@ msgstr ""
 msgid "Search world"
 msgstr ""
 
-#: add.php:153 templates/edit/info.php:13
+#: add.php:153 templates/edit/info.php:15
 msgid "Secondary category"
 msgstr ""
 
@@ -719,7 +718,7 @@ msgstr ""
 msgid "Select a feed."
 msgstr ""
 
-#: add.php:247 templates/edit/info.php:47
+#: add.php:247 templates/edit/info.php:49
 msgid "Selling item"
 msgstr ""
 
@@ -743,11 +742,11 @@ msgstr ""
 msgid "Sort news by"
 msgstr ""
 
-#: add.php:154 templates/edit/info.php:29 lib/Forms/Search.php:48
+#: add.php:154 templates/edit/info.php:31 lib/Forms/Search.php:48
 msgid "Sort order"
 msgstr ""
 
-#: add.php:136 templates/edit/info.php:37 lib/Forms/Search.php:38
+#: add.php:136 templates/edit/info.php:39 lib/Forms/Search.php:38
 msgid "Source"
 msgstr ""
 
@@ -755,7 +754,7 @@ msgstr ""
 msgid "Source deleted."
 msgstr ""
 
-#: add.php:138 templates/edit/info.php:41
+#: add.php:138 templates/edit/info.php:43
 msgid "Source link"
 msgstr ""
 
@@ -791,7 +790,7 @@ msgstr ""
 msgid "Status"
 msgstr ""
 
-#: lib/News.php:1126
+#: lib/News.php:1144
 msgid "Tag cloud"
 msgstr ""
 
@@ -811,7 +810,7 @@ msgstr ""
 msgid "There are no news to display."
 msgstr ""
 
-#: lib/News.php:557
+#: lib/News.php:562
 #, php-format
 msgid "There requested news %s don't exist."
 msgstr ""
@@ -820,11 +819,11 @@ msgstr ""
 msgid "There requested version don't exist."
 msgstr ""
 
-#: add.php:433
+#: add.php:438
 msgid "There was an error creating gallery: "
 msgstr ""
 
-#: add.php:449
+#: add.php:454
 msgid "There was an error with the uploaded image: "
 msgstr ""
 
@@ -846,7 +845,7 @@ msgstr ""
 msgid "Trackback this blog on this site."
 msgstr ""
 
-#: lib/News.php:703
+#: lib/News.php:715
 #, php-format
 msgid "URL already trackbacked: %s"
 msgstr ""
@@ -863,11 +862,11 @@ msgstr ""
 msgid "Unpublish"
 msgstr ""
 
-#: templates/edit/info.php:17
+#: templates/edit/info.php:19
 msgid "Unpublish date"
 msgstr ""
 
-#: add.php:118 add.php:576 templates/edit/info.php:86
+#: add.php:118 add.php:586 templates/edit/info.php:88
 msgid "Update"
 msgstr ""
 
@@ -884,7 +883,7 @@ msgstr ""
 msgid "User"
 msgstr ""
 
-#: templates/edit/info.php:94
+#: templates/edit/info.php:97
 msgid "View"
 msgstr ""
 
@@ -896,7 +895,7 @@ msgstr ""
 msgid "View items"
 msgstr ""
 
-#: templates/edit/info.php:21
+#: templates/edit/info.php:23
 msgid "Yes"
 msgstr ""
 
@@ -912,30 +911,30 @@ msgstr ""
 msgid "You have not editor permission on any category."
 msgstr ""
 
-#: edit.php:60
+#: edit.php:54
 msgid "activated"
 msgstr ""
 
-#: edit.php:52
+#: edit.php:46
 msgid "deactivated"
 msgstr ""
 
-#: delete.php:73
+#: delete.php:74
 msgid "deleted"
 msgstr ""
 
-#: edit.php:68
+#: edit.php:62
 msgid "locked"
 msgstr ""
 
-#: delete.php:75
+#: delete.php:78
 msgid "not deleted"
 msgstr ""
 
-#: edit.php:109
+#: edit.php:103
 msgid "renewed"
 msgstr ""
 
-#: edit.php:76
+#: edit.php:70
 msgid "unlocked"
 msgstr ""
index 636421c..685439f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * $Id: comments.php 1179 2009-01-20 13:19:34Z duck $
+ * $Id: comments.php 1263 2009-02-01 23:25:56Z duck $
  *
  * Copyright 2007 The Horde Project (http://www.horde.org/)
  *
index 00bb853..c7ce066 100755 (executable)
@@ -1,8 +1,8 @@
 <?php
 /**
- * $Id: news.php 1191 2009-01-21 16:45:21Z duck $
+ * $Id: news.php 1263 2009-02-01 23:25:56Z duck $
  *
- * Copyright 2007 The Horde Project (http://www.horde.org/)
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -34,7 +34,7 @@ if (empty($rss)) {
 
     $lastnewstime = 0;
     foreach ($list as $news_id => $news) {
-        $news_link = News::getUrlFor('news', $news_id);
+        $news_link = News::getUrlFor('news', $news_id, true);
         $rssbody .= '
     <item>
         <enclosure url="http://' . $_SERVER['SERVER_NAME']  . News::getImageUrl($news_id) . '" type="image/jpg" />
index 5533689..261cf70 100644 (file)
@@ -67,7 +67,7 @@ CREATE TABLE news_categories_nls (
   category_nls char(5) NOT NULL,
   category_name varchar(50) NOT NULL,
   category_description varchar(255) NOT NULL,
-  PRIMARY KEY  (category_id, category_nls)
+  PRIMARY KEY  (category_id, category_nls),
   KEY category_nls (category_nls)
 );
 
index b99f778..482f939 100644 (file)
@@ -1,14 +1,17 @@
 <br />
 <?php
 // show comments only of allowd for api, for current news and if agora exists
-if ($conf['comments']['allow'] != 'never' && 
-    $row['comments']>-1 && 
+if ($conf['comments']['allow'] != 'never' &&
+    $row['comments']>-1 &&
     $registry->hasMethod('forums/doComments')) {
 
     $params = array('news', $id, 'commentCallback', true, null, null,
                     array('message_subject' => $row['title']), $conf['comments']['comment_template']);
 
     $comments = $registry->call('forums/doComments', $params);
+    if ($comments instanceof PEAR_Error) {
+        return $comments;
+    }
 
     if (!empty($comments['threads'])) {
         echo $comments['threads'];