<?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)
*
exit;
}
-var_dump($zipfiles);
-exit;
-
$zip = Horde_Compress::singleton('zip');
$body = @$zip->compress($zipfiles);
$browser->downloadHeaders($news_id . '.zip', 'application/zip', false, strlen($body));
/**
* 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
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 (?, ?)';
$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;
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);
/**
* 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)
*
}
$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));
' 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) {
/**
* 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
/**
* 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
/**
* 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
*/
/**
* 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
/**
* 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)
*
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']);
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"
"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 ""
"Link: %s"
msgstr ""
-#: templates/news/news.php:18
+#: templates/news/news.php:21
msgid "* Sponsored news"
msgstr ""
msgid "Activate"
msgstr ""
-#: lib/News.php:1123
+#: lib/News.php:1141
msgid "Add"
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 ""
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 ""
msgid "Cancel"
msgstr ""
-#: files.php:52
-#, php-format
-msgid "Cannot read file %s"
-msgstr ""
-
#: add.php:199
msgid "Caption"
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 ""
#: 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 ""
msgid "Description"
msgstr ""
-#: diff.php:14 templates/edit/info.php:100
+#: diff.php:14 templates/edit/info.php:103
msgid "Diff"
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"
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 ""
msgid "Editors"
msgstr ""
-#: lib/News.php:1130
+#: lib/News.php:1148
msgid "Editorship"
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 ""
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 ""
msgid "Info"
msgstr ""
-#: templates/edit/info.php:88
+#: templates/edit/info.php:91
msgid "Insert"
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."
msgid "News of this day."
msgstr ""
-#: add.php:532
+#: add.php:542
msgid "News published."
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 ""
msgid "Order by"
msgstr ""
-#: lib/News.php:1119
+#: lib/News.php:1137
msgid "Overview"
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 ""
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 ""
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 ""
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 ""
msgid "Search world"
msgstr ""
-#: add.php:153 templates/edit/info.php:13
+#: add.php:153 templates/edit/info.php:15
msgid "Secondary category"
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 ""
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 ""
msgid "Source deleted."
msgstr ""
-#: add.php:138 templates/edit/info.php:41
+#: add.php:138 templates/edit/info.php:43
msgid "Source link"
msgstr ""
msgid "Status"
msgstr ""
-#: lib/News.php:1126
+#: lib/News.php:1144
msgid "Tag cloud"
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 ""
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 ""
msgid "Trackback this blog on this site."
msgstr ""
-#: lib/News.php:703
+#: lib/News.php:715
#, php-format
msgid "URL already trackbacked: %s"
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 ""
msgid "User"
msgstr ""
-#: templates/edit/info.php:94
+#: templates/edit/info.php:97
msgid "View"
msgstr ""
msgid "View items"
msgstr ""
-#: templates/edit/info.php:21
+#: templates/edit/info.php:23
msgid "Yes"
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 ""
<?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/)
*
<?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.
$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" />
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)
);
<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'];