Assign copyright to horde.
authorDuck (Jakob Munih) <duck@obala.net>
Sat, 7 Feb 2009 17:41:54 +0000 (18:41 +0100)
committerDuck (Jakob Munih) <duck@obala.net>
Sat, 7 Feb 2009 17:41:54 +0000 (18:41 +0100)
Use autoloader.
Split News class into driver based class

32 files changed:
news/add.php
news/browse.php
news/cloud.php
news/content.php
news/content_edit.php
news/delete.php
news/delete_file.php
news/diff.php
news/edit.php
news/feed.php
news/files.php
news/index.php
news/lib/Categories.php [changed mode: 0755->0644]
news/lib/News.php [changed mode: 0755->0644]
news/lib/TagCloud.php
news/lib/View.php [changed mode: 0755->0644]
news/lib/api.php [changed mode: 0755->0644]
news/lib/base.php [changed mode: 0755->0644]
news/mail.php
news/news.php
news/note.php
news/pdf.php
news/print.php
news/reads.php
news/search.php
news/templates/common-header.inc [changed mode: 0755->0644]
news/templates/edit/row.php
news/templates/menu.inc [changed mode: 0755->0644]
news/templates/news/attachments.php
news/templates/news/info.php
news/templates/news/parents.php
news/trackback.php

index 161eb7e..7cd11b1 100644 (file)
@@ -4,7 +4,10 @@
  *
  * $Id: add.php 1186 2009-01-21 10:24:00Z 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
@@ -124,7 +127,7 @@ if ($id) {
 $form->setSection('content', _("Content"), '', false);
 $form->addVariable(_("News content"), 'content', 'header', false);
 
-$v = &$form->addVariable(_("Publish"), 'publish', 'datetime', true, false, false, $news->datetimeParams());
+$v = &$form->addVariable(_("Publish"), 'publish', 'datetime', true, false, false, News::datetimeParams());
 $v->setDefault(date('Y-m-d H:i:s'));
 $form->addVariable(_("Primary category"), 'category1', 'enum', true, false, false, array($news_cat->getEnum(), _("-- select --")));
 
@@ -489,9 +492,12 @@ if ($form->validate()) {
             }
         }
         if ($uploaded) {
-            $news->write_db->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(1, $id));
+            $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(1, $id));
+            if ($result instanceof PEAR_Error) {
+                $notification->push($result->getMessage(), 'horde.warning');
+            }
         }
-     }
+    }
 
     // Comments
     if (isset($info['disable_comments']) && $info['disable_comments']) {
index 7171c13..4f8fd5f 100644 (file)
@@ -4,13 +4,16 @@
  *
  * $Id: browse.php 1179 2009-01-20 13:19:34Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
-require_once NEWS_BASE . '/lib/Forms/Search.php';
 
 // Default vars
 $title = _("Browse");
index db35a80..28c071f 100644 (file)
@@ -2,11 +2,15 @@
 /**
  * $Id: index.php 31 2007-12-13 14:33:33Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $cloud = $news->getCloud();
index 8bcc847..96f0dda 100644 (file)
@@ -2,13 +2,15 @@
 /**
  * $Id: content.php 1162 2009-01-14 11:00:29Z 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
+ * 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>
+ * @author  Duck <duck@obala.net>
+ * @package News
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 // Default layout.
index 75895a1..75255f4 100644 (file)
@@ -2,13 +2,15 @@
 /**
  * $Id: content_edit.php 803 2008-08-27 08:29:20Z duck $
  *
- * $Id: content_edit.php 803 2008-08-27 08:29:20Z duck $
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 // Instantiate the blocks objects.
index bc17cdf..2694d30 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: delete.php 1184 2009-01-21 09:12:20Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 require_once 'Horde/Variables.php';
 
@@ -34,10 +38,13 @@ if ($form->validate()) {
     if (Util::getFormData('submitbutton') == _("Remove")) {
 
         // Delete attachment
-        $sql = 'SELECT filename FROM ' . $news->prefix . '_attachment WHERE id = ?';
+        $sql = 'SELECT file_id FROM ' . $news->prefix . '_files WHERE news_id = ?';
         $files = $news->db->getCol($sql, 0, array($id));
         foreach ($files as $file) {
-            unlink($conf['attributes']['attachments'] . $file);
+            $result = News::deleteFile($file_id);
+            if ($result instanceof PEAR_Error) {
+                $notification->push($result);
+            }
         }
 
         // Delete image and gallery
@@ -61,7 +68,7 @@ if ($form->validate()) {
         $news->write_db->query('DELETE FROM ' . $news->prefix . '_version WHERE id = ?', array($id));
         $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
         $news->write_db->query('DELETE FROM ' . $news->prefix . '_user_reads WHERE id = ?', array($id));
-        $news->write_db->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id=?', array($id));
+        $news->write_db->query('DELETE FROM ' . $news->prefix . '_files WHERE id = ?', array($id));
 
         // Delete forum
         if ($registry->hasMethod('forums/deleteForum')) {
index 93e8d04..8c5bbf5 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: delete_file.php 1186 2009-01-21 10:24:00Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 require_once 'Horde/Variables.php';
 
index 9ae454b..86eac00 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: diff.php 803 2008-08-27 08:29:20Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $title = _("Diff");
index 980eb9c..c558738 100644 (file)
@@ -4,13 +4,16 @@
  *
  * $Id: edit.php 1188 2009-01-21 10:33:56Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
-require_once NEWS_BASE . '/lib/Forms/Search.php';
 
 // redirect if not an admin
 $allowed_cats = $news_cat->getAllowed(PERMS_DELETE);
index 0922e33..b88e55e 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: feed.php 1179 2009-01-20 13:19:34Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 function _getStories($feed_id)
index b54fa0a..58a135c 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: files.php 1241 2009-01-29 23:27:58Z 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
  */
+
 $no_compress = true;
 require_once dirname(__FILE__) . '/lib/base.php';
 
index 9cc3b65..7b34d04 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 /**
- *
  * $Id: index.php 1162 2009-01-14 11:00:29Z 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
old mode 100755 (executable)
new mode 100644 (file)
index 015f57f..07baa8e
@@ -1,6 +1,6 @@
 <?php
 /**
- * News Tree Class.
+ * News Category Class.
  *
  * $Id: Categories.php 1261 2009-02-01 23:20:07Z duck $
  *
old mode 100755 (executable)
new mode 100644 (file)
index 3799b03..d18f2c0
@@ -1,10 +1,13 @@
 <?php
 /**
- * News base calss
+ * News base class
  *
  * $Id: News.php 1263 2009-02-01 23:25:56Z 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 inion (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @author  Duck <duck@obala.net>
  * @package News
@@ -18,44 +21,6 @@ class News {
     const VFS_PATH = '.horde/news';
 
     /**
-     * Hash containing connection parameters.
-     *
-     * @var array
-     */
-    private $_params = array();
-
-    /**
-     * Handle for the current database connection.
-     *
-     * @var DB
-     */
-    public $db;
-
-    /**
-     * Handle for the current database connection, used for writing. Defaults
-     * to the same handle as $db if a separate write database is not required.
-     *
-     * @var DB
-     */
-    public $write_db;
-
-    /**
-     * Handle for the tables prefix.
-     *
-     * @var prefix
-     */
-    public $prefix = 'news';
-
-    /**
-     * Constructor
-     */
-    public function __construct()
-    {
-        $this->_params = Horde::getDriverConfig('storage', 'sql');
-        $this->_connect();
-    }
-
-    /**
      * Returns the current language
      *
      * @return string  The current language.
@@ -123,7 +88,7 @@ class News {
      *
      * @param string  The generated URL
      */
-    function getUrlFor($controller, $data, $full = false, $append_session = 0)
+    static public function getUrlFor($controller, $data, $full = false, $append_session = 0)
     {
         switch ($controller) {
 
@@ -188,6 +153,31 @@ class News {
     }
 
     /**
+     * Formats time according to user preferences.
+     *
+     * @param int $timestamp  Message timestamp.
+     *
+     * @return string  Formatted date.
+     */
+    static public function dateFormat($timestamp)
+    {
+        static $df, $tf;
+
+        if ($df === null) {
+            $df = $GLOBALS['prefs']->getValue('date_format');
+            $tf = $GLOBALS['prefs']->getValue('twentyFour');
+        }
+
+        if (is_string($timestamp)) {
+            $timestamp = strtotime($timestamp);
+        }
+
+        return strftime($df, $timestamp)
+            . ' '
+            . (date($tf ? 'G:i' : 'g:ia', $timestamp));
+    }
+
+    /**
      * Format file size
      *
      * @param int $id News ID
@@ -196,7 +186,7 @@ class News {
      */
     public function format_attached($id)
     {
-        $files = $this->getFiles($id);
+        $files = $GLOBALS['news']->getFiles($id);
         if (empty($files)) {
             return '';
         }
@@ -423,30 +413,7 @@ class News {
         return $images;
     }
 
-    /**
-     * Formats time according to user preferences.
-     *
-     * @param int $timestamp  Message timestamp.
-     *
-     * @return string  Formatted date.
-     */
-    static public function dateFormat($timestamp)
-    {
-        static $df, $tf;
 
-        if ($df === null) {
-            $df = $GLOBALS['prefs']->getValue('date_format');
-            $tf = $GLOBALS['prefs']->getValue('twentyFour');
-        }
-
-        if (is_string($timestamp)) {
-            $timestamp = strtotime($timestamp);
-        }
-
-        return strftime($df, $timestamp)
-            . ' '
-            . (date($tf ? 'G:i' : 'g:ia', $timestamp));
-    }
 
     /**
      * Fomates time accoring to user prefs
@@ -460,7 +427,7 @@ class News {
         static $params;
 
         if (!is_array($params)) {
-            $sql = 'SELECT MIN(YEAR(publish)) FROM ' . $this->prefix;
+            $sql = 'SELECT MIN(YEAR(publish)) FROM ' . $GLOBALS['news']->prefix;
             $params = array('start_year' => $GLOBALS['news']->db->getOne($sql),
                             'end_year' => date('Y') + 1,
                             'picker' => true,
@@ -512,618 +479,6 @@ class News {
     }
 
     /**
-     * Updates schedul comments counter
-     *
-     * @param int $id schedul id
-     *
-     * @return true on succes PEAR_Error on failure
-     */
-    public function updateComments($id, $count)
-    {
-        return $this->write_db->query('UPDATE ' . $this->prefix . ' SET comments = ? WHERE id = ?', array($count, $id));
-    }
-
-    /**
-     * Get news
-     *
-     * @param int    $news news id
-     *
-     * @return true on succes PEAR_Error on failure
-     */
-    public function get($id)
-    {
-        // Admins bypass the cache (can read nonpublished and locked news)
-        if (!Auth::isAdmin('news:admin')) {
-            $key = 'news_'  . self::getLang() . '_' . $id;
-            $data = $GLOBALS['cache']->get($key, $GLOBALS['conf']['cache']['default_lifetime']);
-            if ($data) {
-                return unserialize($data);
-            }
-        }
-
-        $query = 'SELECT n.publish, n.user, n.source, n.sourcelink, n.category1, n.parents, ' .
-                ' 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 = ?';
-
-        /** 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) {
-            return $data;
-        }
-
-        if (empty($data)) {
-            return PEAR::raiseError(sprintf(_("There requested news %s don't exist."), $id));
-        }
-
-        /* Get talks backs */
-        if ($data['trackbacks']) {
-            $sql = 'SELECT excerpt, created, title, url, blog_name FROM ' . $this->prefix . '_trackback WHERE id = ?';
-            $data['trackback'] = $this->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC);
-            if ($data['trackback'] instanceof PEAR_Error) {
-                return $data['trackback'];
-            }
-        }
-
-        /* Get parents */
-        if ($data['parents']) {
-            $sql = 'SELECT n.id, n.publish, n.comments, l.title ' .
-                ' FROM ' . $this->prefix . ' AS n, ' . $this->prefix . '_body AS l ' .
-                ' WHERE n.id IN (' . $data['parents'] . ') AND n.id = l.id AND l.lang = ?';
-            $data['parents'] = $this->db->getAssoc($sql, false, array(self::getLang()), DB_FETCHMODE_ASSOC);
-            if ($data['parents'] instanceof PEAR_Error) {
-                return $data['parents'];
-            }
-        }
-
-        /* Get threads */
-        if ($data['threads']) {
-            $sql = 'SELECT message_id, forum_id, message_subject, message_seq ' .
-                ' FROM agora_messages WHERE message_id IN (' . $data['threads'] . ')';
-            $data['threads'] = $this->db->getAssoc($sql, false, null, DB_FETCHMODE_ASSOC);
-            if ($data['threads'] instanceof PEAR_Error) {
-                return $data['threads'];
-            }
-        }
-
-        if (!Auth::isAdmin('news:admin')) {
-            $GLOBALS['cache']->set($key, serialize($data));
-        }
-
-        return $data;
-    }
-
-    /**
-     * Get news attached files
-     *
-     * @param int $news_id      news id
-     * @param string $news_lang news language
-     *
-     * @return true on succes PEAR_Error on failure
-     */
-    public function getFiles($news_id, $news_lang = null)
-    {
-        if (is_null($news_lang)) {
-            $news_lang = self::getLang();
-        }
-
-        $sql = 'SELECT file_id, news_id, news_lang, file_name, file_size, file_type FROM ' . $this->prefix . '_files'
-                . ' WHERE news_id = ? AND news_lang = ?';
-
-        return $this->db->getAll($sql, array($news_id, $news_lang), DB_FETCHMODE_ASSOC);
-    }
-
-    /**
-     * Get version
-     *
-     * @param intiger    $id news id
-     * @param array      $info array with all news info
-     *
-     * @return result of the insert
-     */
-    public function getVerison($id, $version)
-    {
-        $sql = 'SELECT id, created, user_uid, content FROM ' . $this->prefix . '_versions WHERE id = ? AND version = ?';
-        $result = $this->db->getRow($sql, array($id, $version), DB_FETCHMODE_ASSOC);
-        $result['content'] = unserialize($result['content']);
-        return $result;
-    }
-
-    /**
-     * Get versions
-     *
-     * @param intiger    $id news id
-     * @param array      $info array with all news info
-     *
-     * @return result of the insert
-     */
-    public function getVerisons($id)
-    {
-        $sql = 'SELECT version, created, user_uid, content, action FROM ' . $this->prefix . '_versions WHERE id = ? ORDER BY version DESC';
-        return $this->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC);
-    }
-
-    /**
-     * Logs a news view.
-     *
-     * @return boolean True, if the view was logged, false if the message was aleredy seen
-     */
-    function logView($id)
-    {
-        if ($GLOBALS['browser']->isRobot()) {
-            exit;
-        }
-
-        /* We already read this story? */
-        if (isset($_COOKIE['news_viewed_news']) &&
-            strpos($_COOKIE['news_viewed_news'], ':' . $id . '|') !== false) {
-            return false;
-        }
-
-        /* Rembember when we see a story */
-        if (!isset($_COOKIE['news_viewed_news'])) {
-            $_COOKIE['news_viewed_news'] = ':';
-        }
-        $_COOKIE['news_viewed_news'] .= $id . '|' . $_SERVER['REQUEST_TIME'] . ':';
-
-        setcookie('news_viewed_news', $_COOKIE['news_viewed_news'], $_SERVER['REQUEST_TIME'] + 22896000, $GLOBALS['conf']['cookie']['path'],
-                  $GLOBALS['conf']['cookie']['domain'], $GLOBALS['conf']['use_ssl'] == 1 ? 1 : 0);
-
-        /* Update the count */
-        $sql = 'UPDATE ' . $this->prefix . ' SET view_count = view_count + 1 WHERE id = ?';
-        $result = $this->write_db->query($sql, array($id));
-        if ($result instanceof PEAR_Error) {
-            return $result;
-        }
-
-        /* Log it */
-        $sql = 'INSERT INTO ' . $this->prefix . '_user_reads (id,user,ip,useragent,readdate) VALUES (?,?,?,?,NOW())';
-        $result = $this->write_db->query($sql, array($id,Auth::getAuth(),$_SERVER['REMOTE_ADDR'],$_SERVER["HTTP_USER_AGENT"]));
-        if ($result instanceof PEAR_Error) {
-            return $result;
-        }
-
-        return true;
-    }
-
-    /**
-     * Remove from shop recursively by category ID: categories, articles, stocks and images
-     *
-     * @param mixed int Category ID
-     *
-     * @return mixed TRUE or PEAR error
-     */
-    public function removeByCategory($cid)
-    {
-        /*vse v kategoriji in pol delete povsot */
-    }
-
-    /**
-     * Attach a trackback
-     */
-    public function saveTrackback($id, $title, $url, $excerpt, $blog_name, $trackback_url)
-    {
-        $sql = 'SELECT COUNT(*) FROM ' . $this->prefix . '_trackback WHERE id = ? AND url = ?';
-        $result = $this->db->getOne($sql, array($id, $url));
-        if ($result > 0) {
-            return PEAR::raiseError(sprintf(_("URL already trackbacked: %s"), $url));
-        }
-
-        $params = array('id' => $id,
-                        'title' => $title,
-                        'url' => $url,
-                        'excerpt' => $excerpt,
-                        'blog_name' => $blog_name,
-                        'created' => date('Y-m-d H:i:s'));
-
-        $sql = 'INSERT INTO ' . $this->prefix . '_trackback (' . implode(',', array_keys($params)) . ') VALUES (?, ?, ?, ?, ?, ?)';
-        $result = $this->write_db->query($sql, $params);
-        if ($result instanceof PEAR_Error) {
-            return $result;
-        }
-
-        /* Update trackback count */
-        $GLOBALS['cache']->expire('news_'  . self::getLang() . '_' . $id);
-        return $this->write_db->query('UPDATE ' . $this->prefix . ' SET trackbacks = trackbacks + 1 WHERE id = ?', array($id));
-    }
-
-    /**
-     * Delete a source
-     *
-     * @param integer $id  The source id to delete.
-     *
-     * @return boolean
-     */
-    public function deleteSource($id)
-    {
-        $GLOBALS['cache']->expire('newsSources');
-        $this->deleteImage($id, 'sources');
-        $sql = 'DELETE FROM ' . $this->prefix . '_sources WHERE sources_id = ?';
-        return $this->write_db->query($sql, array($id));
-    }
-
-    /**
-     * Fetches sources list
-     *
-     * @return array  An array containing all sources names
-     */
-    public function getSources($flat = false)
-    {
-        $sources = $GLOBALS['cache']->get('newsSources');
-        if (empty($sources)) {
-            $sql = 'SELECT source_id, source_name, source_url FROM ' . $this->prefix . '_sources ORDER BY source_name ASC';
-            $sources = $this->db->getAssoc($sql, true, array(), DB_FETCHMODE_ASSOC);
-            $GLOBALS['cache']->set('newsSources', serialize($sources));
-        } else {
-            $sources = unserialize($sources);
-        }
-
-        if (!$flat) {
-            foreach ($sources as $source_id => $source) {
-                $sources[$source_id] = $source['source_name'];
-            }
-        }
-
-        return $sources;
-    }
-
-    /**
-     * Save a source data into the backend from edit form.
-     *
-     * @param array $info  The source data to save.
-     *
-     * @return mixed  PEAR error.
-     */
-    public function saveSource($info)
-    {
-        /* Update/Insert source. */
-        if (!empty($info['source_id'])) {
-            $result = $this->_updateSource($info['source_id'], $info);
-            if ($result instanceof PEAR_Error) {
-                return $result;
-            }
-        } else {
-            $info['source_id'] = $this->_insertSource($info);
-            if ($info['source_id'] instanceof PEAR_Error) {
-                return $info['source_id'];
-            }
-        }
-
-        /* If image uploaded save to backend. */
-        if (!empty($info['source_image']['name'])) {
-            $image = $this->_saveImage($info['source_id'], $info['source_image']['file'], 'sources', $info['source_image_resize']);
-            if ($image instanceof PEAR_Error) {
-                return $image;
-            }
-
-            $sql = 'UPDATE ' . $this->prefix . '_sources SET source_image = ? WHERE source_id = ?';
-            $this->write_db->query($sql, array(1, $info['source_id']));
-        }
-
-        $GLOBALS['cache']->expire('newsSources');
-        return $info['source_id'];
-    }
-
-    /**
-     * Insert source data.
-     *
-     * @param mixed $data  The source data to insert.
-     *
-     * @return array  Inserted ID or PEAR error.
-     */
-    private function _insertSource($data)
-    {
-        $new_id = $this->write_db->nextId('news_sources');
-
-        $sql = 'INSERT INTO ' . $this->prefix . '_sources' .
-               ' (source_id, source_name, source_url)' .
-               ' VALUES (?, ?, ?)';
-        $values = array($new_id,
-                        $data['source_name'],
-                        $data['source_url']);
-
-        $source = $this->write_db->query($sql, $values);
-        if ($source instanceof PEAR_Error) {
-            Horde::logMessage($source, __FILE__, __LINE__, PEAR_LOG_ERR);
-            return $source;
-        }
-
-        return $new_id;
-    }
-
-    /**
-     * Update source data.
-     *
-     * @param integer $source_id  The source id to update.
-     * @param array   $data       The source data to update.
-     *
-     * @return array  NULL or PEAR error.
-     */
-    private function _updateSource($source_id, $data)
-    {
-        $sql = 'UPDATE ' . $this->prefix . '_sources' .
-               ' SET source_name = ?, source_url = ?' .
-               ' WHERE source_id = ?';
-        $values = array($data['source_name'],
-                        $data['source_url'],
-                        $source_id);
-
-        $source = $this->write_db->query($sql, $values);
-        if ($source instanceof PEAR_Error) {
-            Horde::logMessage($source, __FILE__, __LINE__, PEAR_LOG_ERR);
-            return $source;
-        }
-    }
-
-    /**
-     * Attempts to open a persistent connection to the SQL server.
-     *
-     * @return boolean  True on success; exits (Horde::fatal()) on error.
-     */
-    private function _connect()
-    {
-        Horde::assertDriverConfig($this->_params, 'storage',
-                                  array('phptype', 'charset'));
-
-        if (!isset($this->_params['database'])) {
-            $this->_params['database'] = '';
-        }
-        if (!isset($this->_params['username'])) {
-            $this->_params['username'] = '';
-        }
-        if (!isset($this->_params['hostspec'])) {
-            $this->_params['hostspec'] = '';
-        }
-        if (isset($this->_params['prefix'])) {
-            $this->prefix = $this->_params['prefix'];
-        }
-
-        /* Connect to the SQL server using the supplied parameters. */
-        require_once 'DB.php';
-        $this->write_db = &DB::connect($this->_params,
-                                        array('persistent' => !empty($this->_params['persistent'])));
-        if ($this->write_db instanceof PEAR_Error) {
-            Horde::fatal($this->write_db, __FILE__, __LINE__);
-        }
-
-        // Set DB portability options.
-        switch ($this->write_db->phptype) {
-        case 'mssql':
-            $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
-            break;
-        default:
-            $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
-        }
-
-        /* Check if we need to set up the read DB connection seperately. */
-        if (!empty($this->_params['splitread'])) {
-            $params = array_merge($this->_params, $this->_params['read']);
-            $this->db = &DB::connect($params,
-                                      array('persistent' => !empty($params['persistent'])));
-            if ($this->db instanceof PEAR_Error) {
-                Horde::fatal($this->db, __FILE__, __LINE__);
-            }
-
-            // Set DB portability options.
-            switch ($this->db->phptype) {
-            case 'mssql':
-                $this->db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
-                break;
-            default:
-                $this->db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
-            }
-
-        } else {
-            /* Default to the same DB handle for the writer too. */
-            $this->db =& $this->write_db;
-        }
-
-        return true;
-    }
-
-   /**
-     * Build whare search
-     */
-    public function buildQuery($perms = PERMS_READ, $criteria = array())
-    {
-        static $parts;
-
-        $id = serialize($criteria);
-        if (isset($parts[$id])) {
-            return $parts[$id];
-        }
-
-        $sql = 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS l '
-            . ' WHERE n.id = l.id AND l.lang = ?';
-        $params = array('_lang' => NLS::select());
-
-        if ($perms == PERMS_READ) {
-            $sql .= ' AND n.publish <= ? ';
-            $params['_perms'] = date('Y-m-d H:i:s');
-            $sql .= ' AND n.status = ? ';
-            $params['_status'] = self::CONFIRMED;
-        }
-
-        if (empty($criteria)) {
-            $parts[$id] = array($sql, $params);
-            return $parts[$id];
-        }
-
-        /* check status */
-        if (isset($criteria['status'])) {
-            $sql .= ' AND n.status = ?';
-            $params['status'] = $criteria['status'];
-        }
-
-        /* check status */
-        if (isset($criteria['source'])) {
-            $sql .= ' AND n.source = ?';
-            $params['source'] = $criteria['source'];
-        }
-
-        /* get category */
-        if (isset($criteria['category'])) {
-            $sql .= ' AND (n.category1 = ? OR n.category2 = ?)';
-            $params['category'] = $criteria['category'];
-            $params['_category'] = $criteria['category'];
-        }
-
-        /* seaching for a pericolar word */
-        if (isset($criteria['word'])) {
-            $sql .= ' AND (l.title LIKE ? OR l.content LIKE ? OR l.tags LIKE ?)';
-            $params['word'] = '%' . $criteria['word'] . '%';
-            $params['_word'] = '%' . $criteria['word'] . '%';
-            $params['tags'] = '%' . $criteria['word'] . '%';
-        }
-
-        /* submitter */
-        if (isset($criteria['user'])) {
-            $sql .= ' AND n.user = ? ';
-            $params['user'] = $criteria['user'];
-        }
-
-        /* editor */
-        if (isset($criteria['editor'])) {
-            $sql .= ' AND n.editor = ? ';
-            $params['editor'] = $criteria['editor'];
-        }
-
-        /* publish time */
-        if (isset($criteria['published_to'])) {
-            $sql .= ' AND n.publish <= ? ';
-            $params['published_to'] =  $criteria['published_to'];
-        }
-
-        if (isset($criteria['published_from'])) {
-            $sql .= ' AND n.publish >= ? ';
-            $params['published_from'] =  $criteria['published_from'];
-        }
-
-        $parts[$id] = array($sql, $params);
-
-        return $parts[$id];
-    }
-
-    /**
-     * Count news
-     *
-     * @param array $criteria Filter parameter
-
-     * @param int $perms Permissions filter
-     *
-     * @return Nimber of news
-     */
-    public function countNews($criteria = array(), $perms = PERMS_READ)
-    {
-        $binds = $this->buildQuery($perms, $criteria);
-        $binds[0] = 'SELECT COUNT(*) ' . $binds[0];
-
-        return $this->db->getOne($binds[0], $binds[1]);
-    }
-
-    /**
-     * List news
-     *
-     * @param array $criteria Filter parameter
-     * @param int $from Offset
-     * @param int $count Limit rows
-     * @param int $perms Permissions filter
-     *
-     * @return array of news data
-     */
-    public function listNews($criteria = array(), $from = 0, $count = 0, $perms = PERMS_READ)
-    {
-        $binds = $this->buildQuery($perms, $criteria);
-
-        if (!isset($criteria['sort_by'])) {
-            $criteria['sort_by'] = 'n.publish';
-        }
-        if (!isset($criteria['sort_dir'])) {
-            $criteria['sort_dir'] = 'DESC';
-        }
-
-        $binds[0] = 'SELECT n.id, n.publish, n.user, n.category1, n.category2, n.comments, '
-                    . ' n.picture, n.chars, l.title, l.abbreviation ' . $binds[0]
-                    . ' ORDER BY ' . $criteria['sort_by']
-                    . ' ' . $criteria['sort_dir'];
-
-        if ($count) {
-            $binds[0] = $this->db->modifyLimitQuery($binds[0], $from, $count);
-        }
-
-        return $this->db->getAll($binds[0], $binds[1], DB_FETCHMODE_ASSOC);
-    }
-
-    /**
-     * Construct tag cloud
-     *
-     * @param boolean $minimize  Minimize tag cloud
-     *                          (remove 1 length strings, and single occurrence)
-     *
-     * @return mixed  The HTML for the tag cloud | PEAR_Error
-     */
-    public function getCloud($minimize = false)
-    {
-        $cache_key = 'news_cloud_' . $minimize;
-        $cloud = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
-        if ($cloud) {
-            // return $cloud;
-        }
-
-        $sql = 'SELECT l.tags, n.publish FROM ' . $this->prefix . '_body AS l, '
-               . $this->prefix . ' AS n WHERE l.lang = ? AND n.id = l.id AND n.status = ? ORDER BY n.publish DESC LIMIT 0, '
-               . ($minimize ? '100' : '500');
-
-        $result = $this->db->query($sql, array(NLS::select(), self::CONFIRMED));
-        if ($result instanceof PEAR_Error) {
-            return $result;
-        }
-
-        $tags_elemets = array();
-        while ($news = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
-            foreach (explode(' ', $news['tags']) as $tag) {
-                if ($minimize && strlen($tag) < 2) {
-                    continue;
-                }
-                $tags_elemets[$tag][] = strtotime($news['publish']);
-            }
-        }
-
-        if ($minimize) {
-            foreach ($tags_elemets as $tag => $content) {
-                if (count($content) == 1) {
-                    unset($tags_elemets[$tag]);
-                }
-            }
-        }
-
-        if (empty($tags_elemets)) {
-            return '';
-        }
-
-        $i = 0;
-        require_once dirname(__FILE__) . '/TagCloud.php';
-        $tags = new Oscar_TagCloud();
-        $tag_link = Horde::applicationUrl('search.php');
-        foreach ($tags_elemets as $tag => $time) {
-            sort($time);
-            $tags->addElement($tag, Util::addParameter($tag_link, array('word' => $tag)),
-                              count($tags_elemets[$tag]), $time[0]);
-        }
-
-        $cloud = $tags->buildHTML();
-        $GLOBALS['cache']->set($cache_key, $cloud);
-
-        return $cloud;
-    }
-
-    /**
      * Build News's list of menu articles
      */
     static public function getMenu($returnType = 'object')
index afb1c1a..1d1e868 100644 (file)
@@ -2,7 +2,12 @@
 /**
  * Extend Horde TagCloud to allow complete css font sizes
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * $Id: News.php 1263 2009-02-01 23:25:56Z duck $
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license inion (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @author  Duck <duck@obala.net>
  * @package News
old mode 100755 (executable)
new mode 100644 (file)
index 137cab3..193e9db
@@ -55,7 +55,7 @@ class News_View extends Horde_View {
      *
      * @param string $tags Video's tags
      */
-    function getTagsLinks($tags)
+    public function getTagsLinks($tags)
     {
         if (empty($tags)) {
             return '';
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 38c87e0..c595d22
@@ -22,6 +22,10 @@ if (!defined('HORDE_BASE')) {
 // Load the Horde Framework core, and set up inclusion paths.
 require_once HORDE_BASE . '/lib/core.php';
 
+$news_dir = dirname(__FILE__);
+Horde_Autoloader::addClassPath($news_dir);
+Horde_Autoloader::addClassPattern('/^News/', $news_dir);
+
 // Registry.
 $registry = &Registry::singleton();
 if (($pushed = $registry->pushApp('news', !defined('AUTH_HANDLER'))) instanceof PEAR_Error) {
@@ -46,13 +50,8 @@ if (!defined('NEWS_BASE')) {
 $GLOBALS['cache'] = &Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
                                             Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
 
-// News base library
-require_once NEWS_BASE . '/lib/News.php';
-require_once NEWS_BASE . '/lib/Categories.php';
-require_once NEWS_BASE . '/lib/View.php';
-
 // Set up News drivers.
-$GLOBALS['news'] = new News();
+$GLOBALS['news'] = News_Driver::factory();
 $GLOBALS['news_cat'] = new News_Categories();
 
 // Start compression.
index d82d806..2ae563c 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: mail.php 1174 2009-01-19 15:11:03Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $id = Util::getFormData('id');
index 4c49b74..da83e76 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: news.php 1190 2009-01-21 16:10: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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $id = Util::getFormData('id');
@@ -33,7 +37,7 @@ if (($version = Util::getFormData('version')) !== null) {
         $row['content'] = $version_data['content'][NLS::select()]['content'];
         $row['title'] = $version_data['content'][NLS::select()]['title'] .
                         ' (v.' . $version . _(" by ") . $version_data['user_uid'] .
-                        ' @ ' . $news->dateFormat($version_data['created'])  . ')';
+                        ' @ ' . News::dateFormat($version_data['created'])  . ')';
     }
 } else {
     $news->logView($id);
index d5fe2f0..2383d62 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: note.php 1241 2009-01-29 23:27:58Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $id = Util::getFormData('id');
@@ -20,7 +24,7 @@ if ($row instanceof PEAR_Error) {
 }
 
 $body = $row['title'] . "\n\n"
-       . _("On") . ': ' . $news->dateFormat($row['publish']) . "\n"
+       . _("On") . ': ' . News::dateFormat($row['publish']) . "\n"
        . _("Link") . ': ' . News::getUrlFor('news', $id) . "\n\n"
        . strip_tags($row['content']);
 
index b60928d..fda14f6 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: pdf.php 1191 2009-01-21 16:45:21Z 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
  */
+
 $no_compress = true;
 require_once dirname(__FILE__) . '/lib/base.php';
 
@@ -47,7 +51,7 @@ $pdf->setFillColor('rgb', 200/255, 220/255, 255/255);
 $pdf->cell(0, 6, $row['title'], 0, 1, 'L', 1);
 $pdf->newLine(4);
 
-$pdf->write(12, _("On") . ': ' . $news->dateFormat($row['publish']) . "\n");
+$pdf->write(12, _("On") . ': ' . News::dateFormat($row['publish']) . "\n");
 $pdf->write(12, _("Link") . ': ' . News::getUrlFor('news', $id, true) . "\n\n", News::getUrlFor('news', $id, true));
 $pdf->multiCell(0, 12, String::convertCharset(strip_tags($row['content']), NLS::getCharset(), 'UTF-8'));
 
index efde21c..fca0961 100644 (file)
@@ -4,11 +4,15 @@
  *
  * $Id: print.php 803 2008-08-27 08:29:20Z 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $id = Util::getFormData('id');
index 6425f4f..11dc61a 100644 (file)
@@ -2,13 +2,15 @@
 /**
  * News reads
  *
- * $Id: reads.php 803 2008-08-27 08:29:20Z duck $
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
 
 if (!Auth::isAuthenticated()) {
index fafa49b..dfca090 100644 (file)
@@ -2,15 +2,16 @@
 /**
  * Search
  *
- * $Id: search.php 889 2008-09-23 09:52:06Z duck $
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * 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
  */
+
 require_once dirname(__FILE__) . '/lib/base.php';
-require_once NEWS_BASE . '/lib/Forms/Search.php';
 
 // Default vars
 $title = _("Browse");
@@ -37,11 +38,7 @@ if ($rows instanceof PEAR_Error) {
     exit;
 }
 
-$vars = Variables::getDefaultVariables();
-$pager = new Horde_UI_Pager('news_page',
-                            $vars, array('num' => $count,
-                                         'url' => 'search.php',
-                                         'perpage' => $per_page));
+$pager = News_Search::getPager($criteria, $count, 'search.php');
 
 $pager->preserve($criteria);
 
old mode 100755 (executable)
new mode 100644 (file)
index 5cf999f..20cf1ac 100644 (file)
@@ -52,7 +52,7 @@ case News::LOCKED:
 }
 ?></td>
 <td><?php echo Horde::link(News::getUrlFor('news', $row['id']), _("Read"), '', '_blank') . $row['title']; ?></a></td>
-<td><?php echo $news->dateFormat($row['publish']) ?></td>
+<td><?php echo News::dateFormat($row['publish']) ?></td>
 <td><?php echo $row['user'] ?></td>
 <td>
 <?php
old mode 100755 (executable)
new mode 100644 (file)
index c2edb97..5d04153 100644 (file)
@@ -1,5 +1,5 @@
 <?php
 
 if ($row['attachments']) {
-    echo '<br /> <br />' . $news->format_attached($id);
+    echo '<br /> <br />' . News::format_attached($id);
 }
index 3bdcd13..2bb07a1 100644 (file)
@@ -2,8 +2,8 @@
 
 echo '<div class="header">' . _("News data") . '</div>';
 echo _("By") . ': ' .  Horde::link(Util::addParameter($browse_url, 'user', $row['user'])) . $row['user'] . '</a><br />';
-echo _("On") . ': ' .  Horde::link(Util::addParameter($browse_url, 'publish', $row['publish'])) . $news->dateFormat($row['publish']) . '</a><br />';
-echo _("Category") . ': ' . Horde::link(Util::addParameter($browse_url, 'cid', $row['category1'])) . $news_cat->getName($row['category1']) . '</a><br />';
+echo _("On") . ': ' .  Horde::link(Util::addParameter($browse_url, 'publish', $row['publish'])) . News::dateFormat($row['publish']) . '</a><br />';
+echo _("Category") . ': ' . Horde::link(Util::addParameter($browse_url, 'cid', $row['category1'])) . $GLOBALS['news_cat']->getName($row['category1']) . '</a><br />';
 
 $plain = preg_replace('/\s\s+/', ' ', trim(strip_tags($row['content'])));
 echo _("Chars") . ': ' . number_format(strlen($plain)) . '<br />';
index 0549ceb..d4de7c1 100644 (file)
@@ -4,7 +4,7 @@
 if ($row['parents']) {
     echo _("Parents") .  ':<ul>';
     foreach ($row['parents'] as $parent_id => $data) {
-        echo '<li>' . $news->dateFormat($data['publish']) . ' ' 
+        echo '<li>' . News::dateFormat($data['publish']) . ' '
              . Horde::link(News::getUrlFor('news', $parent_id), _("Read"))
              . $data['title'] . '</a> (' . ($data['comments']> -1 ? $data['comments'] : 0) . ')';
     }
index 0bea179..0b454ce 100644 (file)
@@ -2,12 +2,15 @@
 /**
  * $Id: trackback.php 803 2008-08-27 08:29:20Z duck $
  *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
  *
- * Copyright Obala d.o.o. (www.obala.si)
+ * 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
  */
+
 define('AUTH_HANDLER', true);
 require_once dirname(__FILE__) . '/lib/base.php';