/**
* Add
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: add.php 1186 2009-01-21 10:24:00Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: add.php 750 2008-08-19 06:03:03Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
/**
* This routine removes all attributes from a given tag except
return $msg;
}
+/**
+ * Max upload size msg
+ */
+function _max_upload_size()
+{
+ static $msg;
+
+ if ($msg) {
+ return $msg;
+ }
+
+ $filesize = ini_get('upload_max_filesize');
+ if (substr($filesize, -1) == 'M') {
+ $filesize = $filesize * 1048576;
+ }
+ $filesize = News::format_filesize($filesize);
+
+ $postsize = ini_get('post_max_size');
+ if (substr($postsize, -1) == 'M') {
+ $postsize = $postsize * 1048576;
+ }
+ $postsize = News::format_filesize($postsize);
+
+ $msg = sprintf(_("Maximum file size: %s; with a total of: %s"),
+ $filesize, $postsize);
+
+ return $msg;
+}
+
// Is logged it?
if (!Auth::isAuthenticated()) {
$notification->push(_("Only authenticated users can post news."), 'horde.warning');
Horde::authenticationFailureRedirect();
}
-/* default vars */
+// Default vars
$title = _("Add news");
$default_lang = News::getLang();
$id = Util::getFormData('id', false);
$return = Util::getFormData('return', false);
-/* prepare form */
+// We just delete default image?
+if ($id && Util::getFormData('submitbutton') == _("Delete existing picture")) {
+ $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id));
+ if ($sources instanceof PEAR_Error) {
+ $notification->push($sources);
+ } else {
+ News::deleteImage($id);
+ header('Location: ' . News::getUrlFor('news', $id));
+ exit;
+ }
+}
+
+// Prepare form
$vars = Variables::getDefaultVariables();
-$form = &new Horde_Form($vars, '', 'addnews');
-$form->_submit = _("Save");
+$form = new Horde_Form($vars, '', 'addnews');
$form->addHidden('', 'return', 'text', false, true);
+if ($id) {
+ $form->setButtons(array(_("Update"), _("Delete existing picture")), _("Reset"));
+} else {
+ $form->setButtons(array(_("Save")), _("Reset"));
+}
// General
$form->setSection('content', _("Content"), '', false);
$v->setDefault(date('Y-m-d H:i:s'));
$form->addVariable(_("Primary category"), 'category1', 'enum', true, false, false, array($news_cat->getEnum(), _("-- select --")));
-/* Sources */
+// Sources
$sources = $GLOBALS['news']->getSources();
if ($sources instanceof PEAR_Error) {
- $notification->push($sources->getDebugInfo(), 'horde.error');
+ $notification->push($sources);
} elseif (!empty($sources)) {
$form->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --")));
}
$form->addVariable(_("Source link"), 'sourcelink', 'text', false, false);
-/* Picture */
-$form->addVariable(_("Picture"), 'picture', 'image', false, false, false, array('showUpload' => false));
-if ($id) {
- $form->addVariable(_("Picture delete"), 'picture_delete', 'boolean', false, false, _("Delete existing picture"));
-}
-
-/* Languages */
+// Languages
foreach ($conf['attributes']['languages'] as $key) {
$flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : '';
$form->addVariable($flag . _("Title"), "title_$key", 'text', ($key == $default_lang) ? true : false);
- $form->addVariable($flag . _("Picture comment"), "picture_comment_$key", 'text', false);
if ($conf['attributes']['tags']) {
$form->addVariable($flag . _("Tags"), "tags_$key", 'text', false, false, _("Enter one or more keywords that describe your news. Separate them by spaces."));
}
$form->addVariable($flag . _("Content"), "content_$key", 'longtext', ($key == $default_lang) ? true : false , false, false, array(20, 120));
- // TODO: tinymce is no longer available
- Horde_Editor::singleton('tinymce',
- array('id' => "content_$key",
- 'config' => array('mode'=> 'exact',
- 'elements' => "content_$key",
- 'theme' => 'advanced',
- 'plugins' => "xhtmlxtras,paste,media,fullscreen,wordfix",
- 'extended_valid_elements' => "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],object,iframe[src|width|height|frameborder]",
- 'paste_auto_cleanup_on_paste' => 'true',
- 'paste_convert_headers_to_strong' => 'true',
- 'theme_advanced_toolbar_location' => 'top',
- 'theme_advanced_toolbar_align' => 'left',
- 'theme_advanced_buttons1' => 'bold,italic,underline,fontsizeselect,separator,strikethrough,sub,sup,bullist,numlist,separator,link,unlink,image,separator,undo,redo,cleanup,code,hr,removeformat,wordfix,fullscreen',
- 'theme_advanced_buttons2' => '',
- 'theme_advanced_buttons3' => '',
- 'theme_advanced_path_location' => 'bottom',
- 'content_css' => '/include/tinymce/screen.css',
- //'cleanup_on_startup' => 'true',
- 'button_tile_map' => 'true',
- 'theme_advanced_buttons1_add' => 'media',
- 'language' => 'en',
- 'gecko_spellcheck' => 'true',
- 'entity_encoding' => 'raw'
- )));
-
}
// Additional
$form->addVariable(sprintf(_("Threads in %s"), $registry->get('name', 'agora')), 'threads', 'intList', false, false, _("Enter threads separated by commas."));
}
-/* Link to a gallery */
-if ($conf['attributes']['ansel-images']
+$form->setSection('images', _("Images"), '', true);
+$form->addVariable(_("News images"), 'content', 'header', false);
+$form->addVariable(_max_upload_size(), 'description', 'description', false);
+
+$form->addVariable(_("Picture"), 'picture_0', 'image', false, false, false, array(false));
+
+foreach ($conf['attributes']['languages'] as $key) {
+ $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : '';
+ $form->addVariable($flag . _("Picture comment"), "caption_0_$key", 'text', false);
+}
+
+// Link to a gallery
+if ($conf['attributes']['ansel-images']
&& $registry->hasMethod('images/listGalleries')
&& $registry->call('images/countGalleries', array()) > 0) {
- if ($registry->call('images/countGalleries', array()) > 30) {
- $form->addVariable(_("Gallery"), 'gallery', 'int', false);
+ $form->addVariable(_("Enter gallery ID or upload images below"), 'description', 'description', false);
+
+ if ($registry->call('images/countGalleries', array()) > 50) {
+ $form->addVariable(_("Gallery"), 'gallery', 'int', false, false);
} else {
$ansel_galleries = $registry->call('images/listGalleries', array());
$galleries = array();
foreach ($ansel_galleries as $gallery_id => $gallery) {
$galleries[$gallery_id] = $gallery['attribute_name'];
}
- $form->addVariable(_("Gallery"), 'gallery', 'enum', false, false, false, array('enum' => $galleries, 'prompt' => true));
+ $form->addVariable(_("Gallery"), 'gallery', 'enum', false, false, false, array($galleries, true));
+ }
+}
+
+if ($registry->hasMethod('images/listGalleries')) {
+ $images = 4;
+}
+
+if ($images > 1) {
+ $form->addVariable(_("Images will be added to a gallery linked with this article. You can edit and manage images in gallery."), 'description', 'description', false);
+ for ($i = 1; $i < $images; $i++) {
+ $form->addVariable(_("Picture") . ' ' . $i, 'picture_' . $i, 'image', false, false, false, array(false));
+ $form->addVariable(_("Caption") . ' ' . $i, 'caption_' . $i, 'text', false);
+ }
+}
+
+if ($conf['attributes']['attachments']) {
+ $form->setSection('files', _("Files"), '', true);
+
+ $form->addVariable(_max_upload_size(), 'description', 'description', false);
+
+ foreach ($conf['attributes']['languages'] as $key) {
+ $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : '';
+ for ($i = 1; $i < 6; $i++) {
+ $form->addVariable($flag . ' ' . _("File") . ' ' . $i, 'file_' . $key . '_' . $i, 'file', false);
+ }
}
}
if (Auth::isAdmin('news:admin')) {
+ $form->setSection('admin', _("Admin"), '', true);
+ $form->addVariable(_("News administrator options"), 'content', 'header', false);
+
if ($conf['attributes']['sponsored']) {
$form->addVariable(_("Sponsored"), 'sponsored', 'boolean', false);
}
- /* Allow commeting this content */
+ // Allow commeting this content
if ($conf['comments']['allow'] != 'never' && $registry->hasMethod('forums/doComments')) {
$form->addVariable(_("Disallow comments"), 'disable_comments', 'boolean', false, false);
}
- /* Link to selling */
+ // Link to selling
$apis = array();
foreach ($registry->listAPIs() as $api) {
if ($registry->hasMethod($api . '/getSellingForm')) {
$apis[$api] = array();
$articles = $registry->call($api . '/listCostObjects');
if ($articles instanceof PEAR_Error) {
- $notification->push($articles->getMessage(), 'horde.error');
+ $notification->push($articles);
} elseif (!empty($articles)) {
foreach ($articles[0]['objects'] as $item) {
$apis[$api][$item['id']] = $item['name'];
$v = &$form->addVariable(_("Selling item"), 'selling', 'mlenum', false, false, false, array($apis));
}
- /* Show from */
+ // Show from
$available = $GLOBALS['registry']->callByPackage('ulaform', 'getForms');
if (!($available instanceof PEAR_Error)) {
$forms = array();
}
}
-/* Files in gollem */
-if ($conf['attributes']['attachments'] && $registry->hasMethod('files/setSelectList')) {
- $selectid = Util::getFormData('selectlist_selectid', $registry->call('files/setSelectList'));
- $form->addVariable(_("Attachments"), 'attachments', 'selectfiles', false, false, false, array('link_text' => _("Select files"),
- 'link_style' => '',
- 'icon' => false,
- 'selectid' => $selectid));
-}
-
-/* Process form */
+// Process form
if ($form->validate()) {
$status_inserted = false;
$info['status'] = News::CONFIRMED;
}
- /* Multi language */
+ // Multi language
$info['chars'] = strlen(preg_replace('/\s\s+/', '', trim(strip_tags($info["content_$default_lang"]))));
foreach ($conf['attributes']['languages'] as $key) {
}
$info['body'][$key]['title'] = $info["title_$key"];
$info['body'][$key]['content'] = $info["content_$key"];
- $info['body'][$key]['picture_comment'] = $info["picture_comment_$key"];
+ $info['body'][$key]['caption'] = empty($info["caption_0_$key"]) ? '' : $info["caption_0_$key"];
$info['body'][$key]['tags'] = $conf['attributes']['tags'] ? $info["tags_$key"] : '';
unset($info["title_$key"]);
unset($info["content_$key"]);
- unset($info["picture_comment_$key"]);
+ unset($info["caption_$key"]);
unset($info["tags_$key"]);
if (strpos($info['body'][$key]['content'], '<') === FALSE) {
- $info['body'][$key]['content'] = nl2br($info['body'][$key]['content']);
+ $info['body'][$key]['content'] = nl2br(trim($info['body'][$key]['content']));
} else {
- $info['body'][$key]['content'] = stripeentag($info['body'][$key]['content'], 'p', array());
- $info['body'][$key]['content'] = stripeentag($info['body'][$key]['content'], 'font', array());
+ $info['body'][$key]['content'] = trim(stripeentag($info['body'][$key]['content'], 'p'));
+ $info['body'][$key]['content'] = trim(stripeentag($info['body'][$key]['content'], 'font'));
}
- $info['chars'] = strlen(strip_tags( $info['body'][$key]['content']));
+ $info['chars'] = strlen(strip_tags($info['body'][$key]['content']));
}
- /* Selling */
+ // Selling
if (empty($info['selling'][1])) {
$info['selling'] = '';
} else {
$info['selling'] = $info['selling'][1] . '|' . $info['selling'][2];
}
- /* Clean up parents ID */
+ // Clean up parents ID
if ($info['parents']) {
$info['parents'] = explode(',', trim($info['parents']));
foreach ($info['parents'] as $i => $parent_id) {
$info['parents'] = implode(',', array_unique($info['parents']));
}
- /* save as current version */
+ // Save as current version
if (empty($id)) {
+ $id = $news->write_db->nextID($news->prefix);
+ if ($id instanceof PEAR_Error) {
+ $notification->push($id);
+ header('Location: ' . Horde::applicationUrl('browse.php'));
+ exit;
+ }
+
$query = 'INSERT INTO ' . $news->prefix
. ' (sortorder, status, publish, submitted, updated, user, editor, sourcelink, source,'
. ' sponsored, parents, category1, category2, chars, attachments, gallery, selling,'
$info['threads'],
empty($info['form_id']) ? 0 : (int)$info['form_id'],
empty($info['form_ttl']) ? 0 : (int)$info['form_ttl']);
+
$status_inserted = true;
+
} else {
$query = 'UPDATE ' . $news->prefix . ' SET '
- . 'sortorder = ?, publish = ?, updated = NOW(), editor=?, sourcelink = ?, source = ?, '
+ . 'sortorder = ?, publish = ?, updated = NOW(), editor = ?, sourcelink = ?, source = ?, '
. 'sponsored = ?, parents = ?, category1 = ?, category2 = ?, '
. 'chars = ?, attachments = ?, gallery = ?, selling = ?, threads = ?, '
. 'form_id = ?, form_ttl = ? WHERE id = ?';
$id);
}
- $result = $news->writedb->query($query, $data);
+ $result = $news->write_db->query($query, $data);
if ($result instanceof PEAR_Error) {
$notification->push($result->getDebugInfo(), 'horde.error');
header('Location: ' . Horde::applicationUrl('edit.php'));
exit;
}
- if (!$id) {
- $id = $news->writedb->getOne('SELECT LAST_INSERT_ID()');
+ // Picture
+ $images_uploaded = array();
+ if (isset($info['picture_0']['uploaded'])) {
+ if ($info['picture_0']['uploaded'] instanceof PEAR_Error) {
+ if ($info['picture_0']['uploaded']->getCode() != UPLOAD_ERR_NO_FILE) {
+ $notification->push($info['picture_0']['uploaded']->getMessage(), 'horde.warning');
+ }
+ } else {
+ $images_uploaded[] = 0;
+ $result = News::saveImage($id, $info['picture_0']['file']);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(1, $id));
+ }
+ }
}
- /* picture */
- if (isset($info['picture_delete']) && $info['picture_delete']) {
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id));
- } elseif (getimagesize(@$info['picture']['file']) !== FALSE) {
- News::saveImage($id, $info['picture']['file']);
-
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(1, $id));
+ for ($i = 1; $i < $images; $i++) {
+ if (isset($info['picture_' . $i]['uploaded'])) {
+ if ($info['picture_' . $i]['uploaded'] instanceof PEAR_Error) {
+ if ($uploaded->getCode() != UPLOAD_ERR_NO_FILE) {
+ $notification->push($uploaded->getMessage(), 'horde.warning');
+ }
+ } else {
+ $images_uploaded[] = $i;
+ }
+ }
}
- /* comments */
- if (isset($info['disable_comments']) && $info['disable_comments']) {
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET comments = ? WHERE id = ?', array(-1, $id));
- }
+ // Don't create a galler if no picture or only default one was uploaded
+ if (!empty($images_uploaded) &&
+ !(count($images_uploaded) == 1 && $images_uploaded[0] == 0)) {
+
+ // Do we have a gallery?
+ if (empty($info['gallery'])) {
+ $abbr = String::substr(strip_tags($info['body'][$default_lang]['content']), 0, $conf['preview']['list_content']);
+ $result = $registry->call('images/createGallery',
+ array(null,
+ array('name' => $info['body'][$default_lang]['title'],
+ 'desc' => $abbr)));
+ if ($result instanceof PEAR_Error) {
+ $notification->push(_("There was an error creating gallery: ") . $result->getMessage(), 'horde.warning');
+ } else {
+ $info['gallery'] = $result;
+ }
+ }
- /* bodies */
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_body WHERE id=?', array($id));
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id=?', array($id));
+ if (!empty($info['gallery'])) {
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET gallery = ? WHERE id = ?', array($info['gallery'], $id));
+ foreach ($images_uploaded as $i) {
+ $result = $registry->call('images/saveImage',
+ array(null, $info['gallery'],
+ array('filename' => $info['picture_' . $i]['file'],
+ 'description' => $info['caption_' . ($i == 0 ? $i . '_' . $default_lang: $i)],
+ 'type' => $info['picture_' . $i]['type'],
+ 'data' => file_get_contents($info['picture_' . $i]['file']))));
+ if ($result instanceof PEAR_Error) {
+ $notification->push(_("There was an error with the uploaded image: ") . $result->getMessage(), 'horde.warning');
+ }
+ }
+ }
+ }
- $attachments = array();
- if (isset($info['attachments'])) {
- foreach ($info['attachments'] as $file) {
- $attachments[] = Util::realPath(key($file) . '/' . current($file));
+ // Files
+ if ($conf['attributes']['attachments']) {
+ $uploaded = false;
+ $form->setSection('files', _("Files"), '', true);
+ foreach ($conf['attributes']['languages'] as $key) {
+ for ($i = 1; $i < 6; $i++) {
+ $input = 'file_' . $key . '_' . $i;
+ $uploaded = Horde_Browser::wasFileUploaded($input);
+ if ($uploaded instanceof PEAR_Error) {
+ if ($uploaded->getCode() != UPLOAD_ERR_NO_FILE) {
+ $notification->push($uploaded->getMessage(), 'horde.warning');
+ }
+ } elseif ($uploaded) {
+ $file_id = $news->write_db->nextID($news->prefix . '_files');
+ if ($file_id instanceof PEAR_Error) {
+ $notification->push($file_id);
+ } else {
+ $result = News::saveFile($file_id, $info[$input]['file']);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result->getMessage(), 'horde.warning');
+ } else {
+ $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_files (file_id, news_id, news_lang, file_name, file_size, file_type) VALUES (?, ?, ?, ?, ?, ?)',
+ array($file_id, $id, $key, $info[$input]['name'], $info[$input]['size'], $info[$input]['type']));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result->getMessage(), 'horde.warning');
+ }
+ }
+ }
+ }
+ }
}
+ if ($uploaded) {
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(1, $id));
+ }
+ }
+
+ // Comments
+ if (isset($info['disable_comments']) && $info['disable_comments']) {
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET comments = ? WHERE id = ?', array(-1, $id));
}
- $query_attach = $news->writedb->prepare('INSERT INTO ' . $news->prefix . '_attachment (id, lang, filename, filesize) VALUES (?, ?, ?, ?)');
- $query_body = $news->writedb->prepare('INSERT INTO ' . $news->prefix . '_body '
+ // Bodies
+ $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
+ $query_body = $news->write_db->prepare('INSERT INTO ' . $news->prefix . '_body '
. '(id, lang, title, abbreviation, content, picture_comment, tags) VALUES (?, ?, ?, ?, ?, ?, ?)');
foreach ($info['body'] as $lang => $values) {
$abbr = String::substr(strip_tags($values['content']), 0, $conf['preview']['list_content']);
- $news->writedb->execute($query_body, array($id, $lang, $values['title'], $abbr, $values['content'], $values['picture_comment'], $values['tags']));
- if (isset($info['attachments'])) {
- for ($i = 0; $i < sizeof($info['attachments']); $i++) {
- $f = $conf['attributes']['attachments'] . $attachments[$i];
- $size = filesize($f);
- if ($size) {
- $news->writedb->execute($query_attach, array($id, $lang, $attachments[$i], $size));
- } else {
- $notification->push(sprintf(_("Cannot access file %s"), $f), 'horde.warning');
- }
- }
- }
+ $news->write_db->execute($query_body, array($id, $lang, $values['title'], $abbr, $values['content'], $values['caption'], $values['tags']));
}
- /* save as future version */
+ // Save as future version
if ($status_inserted === true) {
$status_version = 'insert';
} else {
$status_version = 'update';
}
$version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id));
- $result = $news->writedb->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid, content) VALUES (?,?,?,NOW(),?,?)',
+ $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid, content) VALUES (?, ?, ?, NOW(), ? ,?)',
array($id, $version + 1, $status_version, Auth::getAuth(), serialize($info['body'])));
if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage(), 'horde.error');
+ $notification->push($result);
}
- /* Expire newscache */
+ // Expire newscache
foreach ($conf['attributes']['languages'] as $key) {
- $cache->expire('news_' . $key . '_' . $id);
+ $cache->expire('news_' . $key . '_' . $id);
}
- /* return */
+ // Return
if ($return) {
$url = $return;
} elseif (in_array($info['category1'], $allowed_cats) ||
$vars->set('selling', array(1 => $value[0], 2 => $value[1]));
continue;
}
- }
+ }
$vars->set($key, $value);
}
foreach ($result as $row) {
$vars->set('title_' . $row['lang'], $row['title']);
$vars->set('content_' . $row['lang'], $row['content']);
- $vars->set('picture_comment_' . $row['lang'], $row['picture_comment']);
+ $vars->set('caption_0_' . $row['lang'], $row['picture_comment']);
if ($conf['attributes']['tags']) {
$vars->set('tags_' . $row['lang'], $row['tags']);
}
}
- if ($conf['attributes']['attachments'] && $registry->hasMethod('files/setSelectList')) {
- $sql = 'SELECT lang, filename FROM ' . $news->prefix . '_attachment WHERE id = ?';
- $result = $news->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC);
- $files = array();
- if (sizeof($result)>0) {
- foreach ($result as $row) {
- $files[] = array(dirname($row['filename']) => basename($row['filename']));
- }
- }
-
- $registry->call('files/setSelectList', array($selectid, $files));
- }
-
$form->_submit = _("Update");
$form->_reset = _("Reset");
}
-/* display */
+// Add editor now to avoud JS error notifications no redirect
+foreach ($conf['attributes']['languages'] as $key) {
+ Horde_Editor::singleton('fckeditor', array('id' => "content_$key"));
+}
+
require_once NEWS_TEMPLATES . '/common-header.inc';
require_once NEWS_TEMPLATES . '/menu.inc';
require_once NEWS_TEMPLATES . '/add/before.inc';
<?php
/**
- * $Id: tabs.php 22 2007-12-13 11:10:52Z duck $
+ * $Id: tabs.php 1175 2009-01-19 15:17:06Z duck $
*
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2007 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.
}
require_once 'Horde/Variables.php';
-require_once 'Horde/UI/Tabs.php';
-require_once 'Horde/Form.php';
$vars = Variables::getDefaultVariables();
$tabs = new Horde_UI_Tabs('admin', $vars);
/**
* Browse
*
- * Copyright 2007 Duck <duck@obala.net>
+ * $Id: browse.php 1179 2009-01-20 13:19:34Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: browse.php 210 2008-01-10 12:41:43Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
require_once NEWS_BASE . '/lib/Forms/Search.php';
// Default vars
$title = _("Browse");
$page = Util::getGet('news_page', 0);
$per_page = $prefs->getValue('per_page');
-$news_url = Horde::applicationUrl('news.php');
$browse_url = Horde::applicationUrl('browse.php');
$cid = Util::getGet('cid');
exit;
}
-
+// Get news
$rows = $news->listNews($criteria, $page*$per_page, $per_page);
if ($rows instanceof PEAR_Error) {
echo $rows->getMessage() . ': ' . $rows->getDebugInfo();
// If we have only one row redirect ot it
if ($count == 1 && sizeof($cats) < 2 && $page < 1) {
- header('Location: '. Util::addParameter($news_url, 'id', $rows[0]['id'], false));
+ header('Location: '. News::getUrlFor('news', $rows[0]['id']));
exit;
}
<?php
/**
-* $Id: index.php 31 2007-12-13 14:33:33Z duck $
-*
-* 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 Folks
-*/
-
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+ * $Id: index.php 31 2007-12-13 14:33:33Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * @author Duck <duck@obala.net>
+ * @package News
+ */
+require_once dirname(__FILE__) . '/lib/base.php';
$cloud = $news->getCloud();
if ($cloud instanceof PEAR_Error) {
- $notification->push($cloud->getMessage(), 'horde.error');
+ $notification->push($cloud);
$cloud = '';
}
</configsection>
<configsection name="images">
- <configheader>Images settigns</configheader>
- <configboolean name="ansel-images" desc="Link items to Ansel Galleries.">true</configboolean>
+ <configheader>Images settings</configheader>
+ <configboolean name="ansel-images" desc="Link items to Ansel Galleries.">true</configboolean>
<configvfs switchname="type">horde
<case name="sql">
<configstring name="table" desc="Table to use">horde_vfs</configstring>
<configstring name="direct" desc="If should images be viewed directly out of
the VFS, specify the alias pointing to the right place on your filesystem
defined in your webserver. Example: /schedul-images">/schedul-images</configstring>
- <configenum name="image_type" desc="What format should images be generated in? Make
+ <configenum name="image_type" desc="What format should images be generated in? Make
sure that your server supports whichever format you choose!">png
<values>
<value desc="JPEG">jpeg</value>
<?php
/**
- * $Id: content.php 479 2008-03-30 17:07:34Z duck $
+ * $Id: content.php 1162 2009-01-14 11:00:29Z duck $
*
- * Copyright 2007-2009 The Horde Project(http://www.horde.org/)
+ * Copyright 2007 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>
*/
-
require_once dirname(__FILE__) . '/lib/base.php';
// Default layout.
$layout = new Horde_Block_Layout_View(
unserialize($prefs->getValue('news_layout')),
- Horde::applicationUrl('content_edit.php'));
-$layout_html = $layout->toHtml();
+ Horde::applicationUrl('content_edit.php'),
+ Horde::applicationUrl('content.php'));
+$layout_html = $layout->toHtml();
$title = $registry->get('name');
require NEWS_TEMPLATES . '/common-header.inc';
require NEWS_TEMPLATES . '/menu.inc';
echo '<div id="menuBottom"><a href="' . Horde::applicationUrl('content_edit.php') . '">' . _("Add Content") . '</a></div><div class="clear"> </div>';
echo $layout_html;
-require $registry->get('templates', 'horde') . '/common-footer.inc';
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
<?php
/**
- * $Id: content_edit.php 229 2008-01-12 19:47:30Z duck $
+ * $Id: content_edit.php 803 2008-08-27 08:29:20Z duck $
*
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * $Id: content_edit.php 803 2008-08-27 08:29:20Z duck $
*
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://cvs.horde.org/co.php/thomas/LICENSE.
+ * Copyright Obala d.o.o. (www.obala.si)
*
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
+ * @package News
*/
-
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
// Instantiate the blocks objects.
$blocks = &Horde_Block_Collection::singleton('news_layout', array('news'));
<?php
/**
- * Delete an news
+ * Delete a news
*
- * $Id: delete.php 229 2008-01-12 19:47:30Z duck $
+ * $Id: delete.php 1184 2009-01-21 09:12:20Z duck $
*
- * NEWS: Copyright 2007 Duck <duck@obala.net>
+ * Copyright Obala d.o.o. (www.obala.si)
*
* @author Duck <duck@obala.net>
- * @package NEWS
-*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+ * @package News
+ */
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
if (!Auth::isAdmin('news:admin')) {
$notification->push(_("Only admin can delete a news."));
header('Location: ' . Horde::applicationUrl('edit.php'));
exit;
-};
-
-require_once 'Horde/Form.php';
-require_once 'Horde/Variables.php';
+}
$vars = Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Are you sure you want to delete this news?"), 'delete');
$id = (int)Util::getFormData('id');
$form->addHidden('', 'id', 'int', $id);
+$row = $news->get($id);
+$form->addVariable($row['title'], 'news', 'description', true);
+$form->addVariable($row['content'], 'content', 'description', true);
+
if ($form->validate()) {
if (Util::getFormData('submitbutton') == _("Remove")) {
- $news->writedb->query('DELETE FROM ' . $news->prefix . ' WHERE id=?', array($id));
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_version WHERE id=?', array($id));
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_body WHERE id=?', array($id));
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_user_reads WHERE id=?', array($id));
-
// Delete attachment
$sql = 'SELECT filename FROM ' . $news->prefix . '_attachment WHERE id = ?';
$files = $news->db->getCol($sql, 0, array($id));
foreach ($files as $file) {
unlink($conf['attributes']['attachments'] . $file);
}
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id=?', array($id));
+
+ // Delete image and gallery
+ $sql = 'SELECT picture, gallery FROM ' . $news->prefix . ' WHERE id = ?';
+ $image = $news->db->getRow($sql, array($id), DB_FETCHMODE_ASSOC);
+ if ($image['picture']) {
+ $result = News::deleteImage($id);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ }
+ }
+ if ($image['gallery']) {
+ $result = $registry->call('images/removeGallery', array(null, $image['gallery']));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ }
+ }
+
+ // Delete from DB
+ $news->write_db->query('DELETE FROM ' . $news->prefix . ' WHERE id = ?', array($id));
+ $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));
+
// Delete forum
if ($registry->hasMethod('forums/deleteForum')) {
$comments = $registry->call('forums/deleteForum', array('news', $id));
if ($comments instanceof PEAR_Error) {
- $notification->push($comments->getMessage(), 'horde.error');
+ $notification->push($comments);
}
}
$notification->push(sprintf(_("News %s: %s"), $id, _("deleted")), 'horde.success');
+
} else {
+
$notification->push(sprintf(_("News %s: %s"), $id, _("not deleted")), 'horde.warning');
}
+
header('Location: ' . Horde::applicationUrl('edit.php'));
exit;
}
/**
* Diff
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: diff.php 803 2008-08-27 08:29:20Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: diff.php 183 2008-01-06 17:39:50Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
$title = _("Diff");
$id = Util::getFormData('id', 0);
echo '<hr><strong>' . $nls['languages'][$k] . '</strong><hr>' . "\n";
$to = explode("\n", @htmlentities(strip_tags($v['content'])));
$from = explode("\n", @htmlentities(strip_tags($version_data[$k]['content'])));
- $diff = &new Text_Diff($from, $to);
+ $diff = new Text_Diff($from, $to);
if (!empty($diff)) {
echo nl2br($renderer->render($diff));
} else {
/**
* Edit browsing
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: edit.php 1188 2009-01-21 10:33:56Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: edit.php 372 2008-02-29 12:05:00Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-
-/* application include */
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
require_once NEWS_BASE . '/lib/Forms/Search.php';
-/* redirect if not an admin */
+// redirect if not an admin
$allowed_cats = $news_cat->getAllowed(PERMS_DELETE);
if (empty($allowed_cats)) {
$notification->push(_("You have not editor permission on any category."));
$id = Util::getFormData('id', 0);
$page = Util::getFormData('page', 0);
$browse_url = Horde::applicationUrl('edit.php');
-$news_url = Horde::applicationUrl('news.php');
$edit_url = Horde::applicationUrl('add.php');
$read_url = Horde::applicationUrl('reads.php');
$has_comments = $registry->hasMethod('forums/doComments');
$actionID = Util::getFormData('actionID');
+// save as future version
if (!empty($actionID) && $id > 0) {
- /* save as future version */
$version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id=?', array($id));
- $result = $news->writedb->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid) VALUES (?,?,?,NOW(),?)',
- array($id, $version + 1, $actionID, Auth::getAuth()));
+ $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid) VALUES (?,?,?,NOW(),?)',
+ array($id, $version + 1, $actionID, Auth::getAuth()));
}
-switch ($actionID) {
-case 'delete_attachments';
-
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id = ?', array($id));
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(0, $id));
-
- $notification->push(sprintf(_("News %s: %s"), $id, _("Attachment deleted")), 'horde.success');
- header('Location: ' . $browse_url);
- exit;
+if ($id) {
+ $article = $news->get($id);
+}
-break;
+switch ($actionID) {
case 'deactivate';
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id));
- $notification->push(sprintf(_("News %s: %s"), $id, _("deactivated")), 'horde.success');
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id));
+ $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("deactivated")), 'horde.success');
header('Location: ' . $browse_url);
exit;
break;
case 'activate';
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::CONFIRMED, $id));
- $notification->push(sprintf(_("News %s: %s"), $id, _("activated")), 'horde.success');
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::CONFIRMED, $id));
+ $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("activated")), 'horde.success');
header('Location: ' . $browse_url);
exit;
break;
case 'lock';
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::LOCKED, $id));
- $notification->push(sprintf(_("News %s: %s"), $id, _("locked")), 'horde.success');
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::LOCKED, $id));
+ $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("locked")), 'horde.success');
header('Location: ' . $browse_url);
exit;
break;
case 'unlock';
- $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id));
- $notification->push(sprintf(_("News %s: %s"), $id, _("unlocked")), 'horde.success');
+ $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id));
+ $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("unlocked")), 'horde.success');
header('Location: ' . $browse_url);
exit;
array($id, $version), DB_FETCHMODE_ASSOC);
$version_data['content'] = unserialize($version_data['content']);
- $news->writedb->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
+ $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id));
$new_version = array();
$sql = 'INSERT INTO ' . $news->prefix . '_body (id,lang,title,abbreviation,content) VALUES (?,?,?,?,?)';
$values['title'],
substr(strip_tags($values['content']), 0, $conf['preview']['list_content']),
$values['content']);
- $news->writedb->query($sql, $data);
+ $news->write_db->query($sql, $data);
}
/* save as future version */
$version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id)) + 1;
- $result = $news->writedb->query('INSERT INTO ' . $news->prefix . '_versions (id, version, created, user_uid, content) VALUES (?,?,NOW(),?,?)',
+ $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, created, user_uid, content) VALUES (?,?,NOW(),?,?)',
array($id, $version, Auth::getAuth(), serialize($new_version)));
- $notification->push(sprintf(_("News %s: %s"), $id, _("renewed")), 'horde.success');
+ $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("renewed")), 'horde.success');
header('Location: ' . $browse_url);
exit;
// Get pager
$pager = News_Search::getPager($binds[1], $count, $browse_url);
-/* Output */
+// Output
Horde::addScriptFile('tables.js', 'horde', true);
Horde::addScriptFile('popup.js', 'horde', true);
/**
* Show feed
*
- * Copyright 2007 Duck <duck@obala.net>
+ * $Id: feed.php 1179 2009-01-20 13:19:34Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: feed.php 183 2008-01-06 17:39:50Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
function _getStories($feed_id)
{
$GLOBALS['cache']->set('news_feed_' . $feed_id, serialize($stories));
return $stories;
} else {
- return unserialize($stories);
+ return unserialize($stories);
}
}
$df = $GLOBALS['prefs']->getValue('date_format');
foreach ($stories as $story) {
echo strftime($df, $story['story_published'])
- . ' <a href="' . $story['story_url'] . '" target="_blank" title="' . strip_tags($story['story_desc']) . '">' . $story['story_title'] . '</a><br />';
+ . ' <a href="' . $story['story_url'] . '" target="_blank" title="' . strip_tags($story['story_desc']) . '">'
+ . $story['story_title'] . '</a><br />';
}
<?php
/**
-* Download and veiew files
-*
- * Copyright 2006 Duck <duck@obala.net>
+ * Download and veiew files
*
- * 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.
+ * $Id: files.php 1187 2009-01-21 10:33:06Z duck $
*
- * $Id: files.php 183 2008-01-06 17:39:50Z duck $
+ * Copyright Obala d.o.o. (www.obala.si)
*
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-
-/* application include */
$no_compress = true;
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id', false);
+$news_id = Util::getFormData('news_id', false);
$actionID = Util::getFormData('actionID');
-$filedir = Util::getFormData('dir');
-$filename = Util::getFormData('file');
-$type = substr($filename, strpos($filename, '.'));
+$file_id = Util::getFormData('file_id');
+$file_name = Util::getFormData('file_name');
+$news_lang = Util::getFormData('news_lang', News::getLang());
+$file_type = Util::getFormData('file_type');
+$file_size = Util::getFormData('file_size');
/* Run through action handlers. */
switch ($actionID) {
case 'download_file':
- $browser->downloadHeaders($filename);
- readfile($conf['attributes']['attachments'] . $filedir . '/' . $filename);
+ $browser->downloadHeaders($file_name, $file_type, false, $file_size);
+ readfile($conf['attributes']['attachments'] . '/' . $file_id);
break;
case 'view_file':
- require_once 'Horde/MIME/Part.php';
- require_once 'Horde/MIME/Viewer.php';
- require_once 'Horde/MIME/Magic.php';
- require_once 'Horde/MIME/Contents.php';
-
- $data = file_get_contents($conf['attributes']['attachments'] . $filedir . '/' . $filename);
- $mime = &new MIME_Part(MIME_Magic::extToMIME($type), $data);
- $mime->setName($filename);
- $contents = &new MIME_Contents($mime);
- $body = $contents->renderMIMEPart($mime);
- $type = $contents->getMIMEViewerType($mime);
- $browser->downloadHeaders($mime->getName(true, true), $type, true, strlen($body));
- echo $body;
+ $data = file_get_contents($conf['attributes']['attachments'] . '/' . $file_id);
+
+ $mime_part = new Horde_Mime_Part();
+ $mime_part->setName($file_id);
+ $mime_part->setType($file_type);
+ $mime_part->setContents($data);
+
+ $viewer = Horde_Mime_Viewer::factory($mime_part);
+ if ($viewer) {
+ $render = $viewer->render('full');
+ if (!empty($render)) {
+ reset($render);
+ $key = key($render);
+ $browser->downloadHeaders($file_id, $render[$key]['type'], true, strlen($render[$key]['data']));
+ echo $render[$key]['data'];
+ }
+ } else {
+ // We cannnot see this file, so download it
+ $browser->downloadHeaders($file_name, $file_type, false, $file_size);
+ echo $data;
+ }
break;
-case 'download_zip':
+case 'download_zip_all':
+
+ $file_id = sprintf(_("FilesOfNews-%s"), $news_id);
+ $zipfiles = array();
+ foreach ($news->getFiles($news_id) as $file) {
- if ($id) {
- $filename = sprintf(_("FilesOfNews-%s"), $id);
- $zipfiles = array();
- foreach ($news->getFiles($id) as $file_data) {
- $zipfiles[] = array('data' => file_get_contents($conf['attributes']['attachments'] . $file_data['filename']),
- 'name' => basename($file_data['filename']));
+ $file_path = $conf['attributes']['attachments'] . '/' . $file['file_id'];
+ if (!file_exists($file_path)) {
+ continue;
}
- } else {
- $zipfiles = array('data' => file_get_contents($conf['attributes']['attachments'] . $filedir . '/' . $filename),
- 'name' => $filename);
+ $zipfiles[] = array('data' => $file_path,
+ 'name' => $file);
}
+ if (empty($zipfiles)) {
+ exit;
+ }
+
+var_dump($zipfiles);
+exit;
+
+ $zip = Horde_Compress::singleton('zip');
+ $body = @$zip->compress($zipfiles);
+ $browser->downloadHeaders($news_id . '.zip', 'application/zip', false, strlen($body));
+ echo $body;
+
+break;
+
+case 'download_zip':
+
+ $zipfiles = array('data' => file_get_contents($conf['attributes']['attachments'] . '/' . $file_id),
+ 'name' => $file_id);
+
$zip = Horde_Compress::singleton('zip');
- $body = $zip->compress($zipfiles);
- $browser->downloadHeaders($filename . '.zip', 'application/zip', false, strlen($body));
+ $body = @$zip->compress($zipfiles);
+ $browser->downloadHeaders($file_id . '.zip', 'application/zip', false, strlen($body));
echo $body;
break;
<?php
/**
- * Copyright 2006 Duck <duck@obala.net>
*
- * 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.
+ * $Id: index.php 1162 2009-01-14 11:00:29Z duck $
*
- * $Id: index.php 308 2008-01-31 13:20:46Z duck $
+ * Copyright Obala d.o.o. (www.obala.si)
*
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
is_readable(NEWS_BASE . '/config/prefs.php'));
if (!$news_configured) {
- define('HORDE_LIBS', '');
require NEWS_BASE . '/../lib/Test.php';
Horde_Test::configFilesMissing('news', NEWS_BASE,
array('conf.php', 'prefs.php', 'sources.php'));
$block_name = _("Categories");
/**
- * $Id: categories.php 22 2007-12-13 11:10:52Z duck $
+ * $Id: categories.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
require_once dirname(__FILE__) . '/../base.php';
return $GLOBALS['news_cat']->getHtml();
}
-
-}
+}
\ No newline at end of file
$block_name = _("Last news in category");
/**
- * $Id: category.php 201 2008-01-09 08:38:05Z duck $
+ * $Id: category.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
$view = new News_View();
$view->news = $rows;
- $view->news_url = Horde::applicationUrl('news.php');
$view->moreurl = Util::addParameter(Horde::applicationUrl('browse.php'), 'category', $this->_params['category']);
return $view->render('/block/news.php');
}
-
-}
+}
\ No newline at end of file
}
/**
- * $Id: jonah.php 201 2008-01-09 08:38:05Z duck $
+ * $Id: jonah.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
return $html;
}
-
-}
+}
\ No newline at end of file
$block_name = _("Last news");
/**
- * $Id: last.php 201 2008-01-09 08:38:05Z duck $
+ * $Id: last.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
$view = new News_View();
$view->news = $rows;
- $view->news_url = Horde::applicationUrl('news.php');
$view->moreurl = Horde::applicationUrl('browse.php');
return $view->render('/block/news.php');
}
-
-}
+}
\ No newline at end of file
$view = new News_View();
$view->news = $rows;
- $view->news_url = Horde::applicationUrl('news.php');
return $view->render('/block/news.php');
}
-
-}
+}
\ No newline at end of file
* thomas_Minisearch_Block:: Implementation of the Horde_Block API to
* allows searching of addressbooks from the portal.
*
- * $Id: last_comments.php 22 2007-12-13 11:10:52Z duck $
+ * $Id: last_comments.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
$comments = News::getLastComments($this->_params['limit']);
if ($comments instanceof PEAR_Error) {
- return $comments->getMessage();
+ return $comments;
}
$html = '';
}
return $html;
}
-
-}
+}
\ No newline at end of file
$block_name = _("Last most commented news");
/**
- * $Id: most_commented.php 201 2008-01-09 08:38:05Z duck $
+ * $Id: most_commented.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
$view = new News_View();
$view->news = $rows;
- $view->news_url = Horde::applicationUrl('news.php');
return $view->render('/block/titles.php');
}
-
-}
+}
\ No newline at end of file
$block_name = _("Last most read news");
/**
- * $Id: most_read.php 201 2008-01-09 08:38:05Z duck $
+ * $Id: most_read.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
$view = new News_View();
$view->news = $rows;
- $view->news_url = Horde::applicationUrl('news.php');
return $view->render('/block/titles.php');
}
-
-}
+}
\ No newline at end of file
return $threads->getMessage();
}
- $url = Util::addParameter(Horde::applicationUrl('news.php'), 'id', null);
foreach ($threads as $message) {
$html .= '<tr><td>'
- . '<a href="' . $url . $message['forum_name'] . '" title="' . $message['message_date'] . '">'
+ . '<a href="' . News::getUrlFor('news', $message['forum_name']) . '" title="' . $message['message_date'] . '">'
. $message['message_subject'] . '</a> '
. '</td><td>'
. $message['message_author'] . '</td></tr>';
$GLOBALS['cache']->set($cache_key, $html);
return $html;
}
-
-}
+}
\ No newline at end of file
$block_name = _("Sources");
/**
- * $Id: sources.php 22 2007-12-13 11:10:52Z duck $
+ * $Id: sources.php 890 2008-09-23 09:58:23Z duck $
*
* @package Horde_Block
*/
return $html;
}
-
-}
+}
\ No newline at end of file
return $GLOBALS['news']->getCloud(true);
}
-
-}
+}
\ No newline at end of file
/**
* News Tree Class.
*
- * $Id: Categories.php 268 2008-01-22 10:15:10Z mclion $
+ * $Id: Categories.php 1163 2009-01-14 17:47:23Z duck $
*
- * Copyright 2007-2008 Obala d.o.o. (http://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.
+ * Copyright Obala d.o.o. (www.obala.si)
*
* @author Duck <duck@obala.net>
* @package News
*/
public function getHtml()
{
- $this->_view_url = Horde::applicationUrl('browse.php');
+ $this->_view_url = News::getUrlFor('category', '');
$output = '';
foreach ($this->_root_nodes as $node_id) {
if ($this->_nodes[$node_id]['indent'] == 0) {
$output .= '<strong>';
}
- $url = Util::addParameter($this->_view_url, 'cid', $node_id);
+ $url = $this->_view_url . $node_id;
$output .= Horde::link($url) . $this->_nodes[$node_id]['category_name'] . '</a>, ';
if ($this->_nodes[$node_id]['indent'] == 0) {
$output .= '</strong><br />';
private function _connect()
{
$this->_db = $GLOBALS['news']->db;
- $this->_write_db = $GLOBALS['news']->writedb;
+ $this->_write_db = $GLOBALS['news']->write_db;
}
}
<?php
+
+require_once 'Horde/Variables.php';
+
/**
- * News search
+ * News search form
+ *
+ * $Id: Search.php 1175 2009-01-19 15:17:06Z duck $
*
- * Copyright 2006 Duck <duck@obala.net>
+ * Copyright Obala d.o.o. (www.obala.si)
*
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
class News_Search extends Horde_Form {
$s = array(News::UNCONFIRMED => _("Unconfirmed"),
News::CONFIRMED => _("Confirmed"),
News::LOCKED => _("Locked"));
- $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, true));
+ $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, _("-- select --")));
$allowed_cats = $GLOBALS['news_cat']->getAllowed(PERMS_DELETE);
- $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, true));
+ $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, _("-- select --")));
+
+ $sources = $GLOBALS['news']->getSources();
+ if (!empty($sources)) {
+ $this->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --")));
+ }
$this->addVariable(_("Order by"), 'sort_by', 'enum', false, false, false, array(array('n.publish' => _("Publish date"),
'n.id' => _("Id"),
*/
public function getPager($info, $count, $url)
{
- $pager = &new Horde_UI_Pager('news_page',
+ $pager = new Horde_UI_Pager('news_page',
Variables::getDefaultVariables(),
array('num' => $count,
'url' => $url,
continue;
}
- require_once 'Horde/Array.php';
if (Horde_Array::getArrayParts($var->getVarName(), $base, $keys)) {
if (!isset($info[$base])) {
$info[$base] = array();
/**
* News base calss
*
- * Copyright 2007 Obala d.o.o.
+ * $Id: News.php 1190 2009-01-21 16:10: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 Obala d.o.o. (www.obala.si)
*
- * $Id: News.php 287 2008-01-25 17:45:33Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
class News {
const UNCONFIRMED = 0;
const CONFIRMED = 1;
const LOCKED = 2;
+
const VFS_PATH = '.horde/news';
/**
*
* @var DB
*/
- public $writedb;
+ public $write_db;
/**
* Handle for the tables prefix.
public $prefix = 'news';
/**
+ * Constructor
*/
public function __construct()
{
}
/**
+ * Return a properly formatted link depending on the global pretty url
+ * configuration
+ *
+ * @param string $controller The controller to generate a URL for.
+ * @param array $data The data needed to generate the URL.
+ * @param boolean $full Generate a full URL.
+ * @param integer $append_session 0 = only if needed, 1 = always,
+ * -1 = never.
+ *
+ * @param string The generated URL
+ */
+ function getUrlFor($controller, $data, $full = false, $append_session = 0)
+ {
+ switch ($controller) {
+
+ case 'news':
+ if (empty($GLOBALS['conf']['urls']['pretty'])) {
+ return Util::addParameter(Horde::applicationUrl('news.php', $full, $append_session), 'id', $data);
+ } else {
+ return Horde::applicationUrl('article/' . $data, $full, $append_session);
+ }
+
+ case 'category':
+ if (empty($GLOBALS['conf']['urls']['pretty'])) {
+ return Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'category', $data);
+ } else {
+ return Horde::applicationUrl('category/' . $data, $full, $append_session);
+ }
+
+ case 'source':
+ if (empty($GLOBALS['conf']['urls']['pretty'])) {
+ return Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'source', $data);
+ } else {
+ return Horde::applicationUrl('source/' . $data, $full, $append_session);
+ }
+ }
+ }
+
+ /**
* Template path
*
* @param intiger $id $category id
/**
* Format file size
*
- * @param int filesize
+ * @param int $size File size
*
- * @return boolean formatted filesize.
+ * @return boolean formatted file_size.
*/
- static public function format_filesize($filesize)
+ static public function format_filesize($size)
{
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$pass = 0; // set zero, for Bytes
- while ($filesize >= 1024) {
- $filesize /= 1024;
+ while ($size >= 1024) {
+ $size /= 1024;
$pass++;
}
- return round($filesize, 2) . ' ' . $units[$pass];
+ return round($size, 2) . ' ' . $units[$pass];
}
/**
* Format file size
*
- * @param int filesize
+ * @param int $id News ID
*
- * @return boolean formatted filesize.
+ * @return boolean formatted file_size.
*/
- static public function format_attached($id)
+ public function format_attached($id)
{
- global $mime_drivers, $mime_drivers_map;
+ $files = $this->getFiles($id);
+ if (empty($files)) {
+ return '';
+ }
- require_once 'Horde/MIME/Part.php';
- require_once 'Horde/MIME/Viewer.php';
- require_once 'Horde/MIME/Magic.php';
- require_once 'Horde/MIME/Contents.php';
- require HORDE_BASE . '/config/mime_drivers.php';
+ if (Auth::isAdmin('news:admin')) {
+ $delete_img = Horde::img('delete.png', _("Delete"), ' style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde'));
+ $delete_url = Horde::applicationUrl('delete_file.php');
+ }
$dowload_img = Horde::img('save.png', _("Dowload"), ' style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde'));
$dowload_zip = Horde::img('mime/compressed.png', _("Dowload Zip Compressed"), 'style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde'));
$view_url = Horde::applicationUrl('files.php');
$html = '<table><tr valign="top"><td>';
- $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'dowload_zip', 'id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . '</a> ' . "\n";
+ $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'download_zip_all', 'news_id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . '</a> ' . "\n";
$html .= _("Attached files: ") . '</td><td>' . "\n";
- $sql = 'SELECT filename, filesize FROM ' . $this->prefix . '_attachment WHERE id = ? AND lang = ?';
- $files = $GLOBALS['news']->db->getAll($sql, array($id, NLS::select()), DB_FETCHMODE_ASSOC);
-
- foreach ($files as $file_data) {
+ foreach ($files as $file) {
+ $view_url = Util::addParameter($view_url, $file);
$html .= ' - ' . "\n";
- $file = basename($file_data['filename']);
- $dir = dirname($file_data['filename']);
-
- $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'dowload_zip', 'dir' => $dir, 'file' => $file)), sprintf(_("Compress and dowload %s"), $file)) . $dowload_zip . '</a> ' . "\n";
- $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'dowload_file', 'dir' => $dir, 'file' => $file)), sprintf(_("Dowload %s"), $file)) . $dowload_img . '</a> ' . "\n";
- $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'view_file', 'dir' => $dir, 'file' => $file)), sprintf(_("Preview %s"), $file), '', '_file_view');
- $html .= Horde::img(MIME_Viewer::getIcon(MIME_Magic::extToMIME(substr($file, strpos($file, '.')))), $file, 'width="16" height="16"', '') . ' ';
- $html .= $file . '</a> ' . "\n";
-
- $html .= ' (' . self::format_filesize($file_data['filesize']) . ')';
+ $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'download_zip'), sprintf(_("Compress and dowload %s"), $file['file_name'])) . $dowload_zip . '</a> ' . "\n";
+ $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . '</a> ' . "\n";
+ $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'view_file'), sprintf(_("Preview %s"), $file['file_name']), '', '_file_view');
+ $html .= Horde::img(Horde_Mime_Viewer::getIcon($file['file_type']), $file['file_name'], 'width="16" height="16"', '') . ' ';
+ if (Auth::isAdmin('news:admin')) {
+ $html .= Horde::link(Util::addParameter($delete_url, $file), sprintf(_("Delete %s"), $file['file_name'])) . $delete_img . '</a> ' . "\n";
+ }
+ $html .= $file['file_name'] . '</a> ' . "\n";
+ $html .= ' (' . self::format_filesize($file['file_size']) . ')';
$html .= '<br /> ' . "\n";
}
*/
static public function loadVFS()
{
+ static $vfs;
+
+ if ($vfs) {
+ return $vfs;
+ }
+
$v_params = Horde::getVFSConfig('images');
if ($v_params instanceof PEAR_Error) {
return $v_params;
}
require_once 'VFS.php';
- return VFS::singleton($v_params['type'], $v_params['params']);
+ $vfs = VFS::singleton($v_params['type'], $v_params['params']);
+ return $vfs;
}
/**
* Store image
*
- * @param $id Image id (item id)
- * @param $file Image file
+ * @param $id Image owner record id
+ * @param $file['file_name'] Horde_Form_Type_image::getInfo() result
* @param $type Image type ('events', 'categories' ...)
* @param $resize Resize the big image?
*/
{
global $conf;
- if ($file['uploaded'] instanceof PEAR_Error) {
- return $file['uploaded'];
- }
-
$vfs = self::loadVFS();
if ($vfs instanceof PEAR_Error) {
return $vfs;
$vfspath = self::VFS_PATH . '/images/' . $type;
$vfs_name = $id . '.' . $conf['images']['image_type'];
- require_once 'Horde/Image.php';
- $img = Horde_Image::factory('gd', array('type' => $conf['images']['image_type'],
- 'temp' => Horde::getTempDir()));
+ $driver = empty($conf['image']['convert']) ? 'gd' : 'im';
+ $img = Horde_Image::factory($driver,
+ array('type' => $conf['images']['image_type'],
+ 'temp' => Horde::getTempDir()));
if ($img instanceof PEAR_Error) {
return $img;
// Store big image for articles
if ($type == 'news') {
+ // Store full image
+ $result = $vfs->writeData($vfspath . '/full/', $vfs_name, $img->raw(), true);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
// Resize big image?
if ($resize) {
$dimensions = $img->getDimensions();
*/
static public function deleteImage($id)
{
- global $conf;
+ $vfs = self::loadVFS();
+ if ($vfs instanceof PEAR_Error) {
+ return $vfs;
+ }
- $vfs = NEWS::loadVFS();
+ $vfs_name = $id . '.' . $GLOBALS['conf']['images']['image_type'];
+ $vfs->deleteFile(self::VFS_PATH . '/images/small/', $vfs_name);
+ $vfs->deleteFile(self::VFS_PATH . '/images/big/', $vfs_name);
+ $vfs->deleteFile(self::VFS_PATH . '/images/full/', $vfs_name);
+ }
+
+ /**
+ * Store file
+ *
+ * @param $file_id Image owner record id
+ * @param $file_src File path
+ */
+ static public function saveFile($file_id, $file_src)
+ {
+ $vfs = self::loadVFS();
if ($vfs instanceof PEAR_Error) {
return $vfs;
}
- $vfspath = self::VFS_PATH . '/images/' . $type;
- $vfs_name = $id . '.' . $conf['images']['image_type'];
+ return $vfs->writeData(self::VFS_PATH . '/files/', $file_id, file_get_contents($file_src), true);
+ }
+
+ /**
+ * Delete file
+ *
+ * @param $id Image owner record id
+ */
+ static public function deleteFile($file_id)
+ {
+ $vfs = self::loadVFS();
+ if ($vfs instanceof PEAR_Error) {
+ return $vfs;
+ }
+
+ if ($vfs->exists(self::VFS_PATH . '/files/', $file_id)) {
+ return $vfs->deleteFile(self::VFS_PATH . '/files/', $file_id);
+ }
- $vfs->deleteFile($vfspath . '/small/', $vfs_name);
- $vfs->deleteFile($vfspath . '/big/', $vfs_name);
+ return true;
}
/**
- * get Image path
+ * Returns image path
*/
static public function getImageUrl($id, $view = 'small', $type = 'news')
{
}
/**
- * get gallery images
+ * Returns gallery images
*/
static public function getGalleyImages($id)
{
$sql = 'SELECT MIN(YEAR(publish)) FROM ' . $this->prefix;
$params = array('start_year' => $GLOBALS['news']->db->getOne($sql),
'end_year' => date('Y') + 1,
- 'picker' => true,
+ 'picker' => true,
'format_in' => '%Y-%m-%d %H:%M:%S',
'format_out' => '%Y-%m-%d %H:%M:%S');
}
return $threads;
}
- $read_url = Horde::applicationUrl('news.php', true);
foreach ($threads as $id => $message) {
$news_id = $registry->call('forums/getForumName', array('news', $message['forum_id']));
if ($news_id instanceof PEAR_Error) {
}
$threads[$id]['news_id'] = $news_id;
- $threads[$id]['read_url'] = Util::addParameter($read_url, 'id', $news_id);
+ $threads[$id]['read_url'] = self::getUrlFor('news', $news_id);
}
$GLOBALS['cache']->set($cache_key, serialize($threads));
*/
public function updateComments($id, $count)
{
- return $this->writedb->query('UPDATE ' . $this->prefix . ' SET comments = ? WHERE id = ?', array($count, $id));
+ return $this->write_db->query('UPDATE ' . $this->prefix . ' SET comments = ? WHERE id = ?', array($count, $id));
}
/**
}
/**
- * Updates news comments counter
+ * Get news attached files
*
- * @param int $news news id
+ * @param int $news_id news id
+ * @param string $news_lang news language
*
* @return true on succes PEAR_Error on failure
*/
- public function getFiles($id)
+ public function getFiles($news_id, $news_lang = null)
{
- $sql = 'SELECT filename, filesize FROM ' . $this->prefix . '_attachment WHERE id=? AND lang=?';
- return $this->db->getAll($sql, array($id, self::getLang()), DB_FETCHMODE_ASSOC);
+ 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);
}
/**
*/
public function getVerisons($id)
{
- $sql = 'SELECT version, created, user_uid,content,action FROM ' . $this->prefix . '_versions WHERE id = ? ORDER BY version DESC';
+ $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);
}
$_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);
+ $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->writedb->query($sql, array($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->writedb->query($sql, array($id,Auth::getAuth(),$_SERVER['REMOTE_ADDR'],$_SERVER["HTTP_USER_AGENT"]));
+ $result = $this->write_db->query($sql, array($id,Auth::getAuth(),$_SERVER['REMOTE_ADDR'],$_SERVER["HTTP_USER_AGENT"]));
if ($result instanceof PEAR_Error) {
return $result;
}
'created' => date('Y-m-d H:i:s'));
$sql = 'INSERT INTO ' . $this->prefix . '_trackback (' . implode(',', array_keys($params)) . ') VALUES (?, ?, ?, ?, ?, ?)';
- $result = $this->writedb->query($sql, $params);
+ $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->writedb->query('UPDATE ' . $this->prefix . ' SET trackbacks = trackbacks + 1 WHERE id = ?', array($id));
+ return $this->write_db->query('UPDATE ' . $this->prefix . ' SET trackbacks = trackbacks + 1 WHERE id = ?', array($id));
}
/**
$GLOBALS['cache']->expire('newsSources');
$this->deleteImage($id, 'sources');
$sql = 'DELETE FROM ' . $this->prefix . '_sources WHERE sources_id = ?';
- return $this->writedb->query($sql, array($id));
+ return $this->write_db->query($sql, array($id));
}
/**
}
$sql = 'UPDATE ' . $this->prefix . '_sources SET source_image = ? WHERE source_id = ?';
- $this->writedb->query($sql, array(1, $info['source_id']));
+ $this->write_db->query($sql, array(1, $info['source_id']));
}
$GLOBALS['cache']->expire('newsSources');
*/
private function _insertSource($data)
{
- $new_id = $this->writedb->nextId('news_sources');
+ $new_id = $this->write_db->nextId('news_sources');
$sql = 'INSERT INTO ' . $this->prefix . '_sources' .
' (source_id, source_name, source_url)' .
$data['source_name'],
$data['source_url']);
- $source = $this->writedb->query($sql, $values);
+ $source = $this->write_db->query($sql, $values);
if ($source instanceof PEAR_Error) {
Horde::logMessage($source, __FILE__, __LINE__, PEAR_LOG_ERR);
return $source;
$data['source_url'],
$source_id);
- $source = $this->writedb->query($sql, $values);
+ $source = $this->write_db->query($sql, $values);
if ($source instanceof PEAR_Error) {
Horde::logMessage($source, __FILE__, __LINE__, PEAR_LOG_ERR);
return $source;
/* Connect to the SQL server using the supplied parameters. */
require_once 'DB.php';
- $this->writedb = &DB::connect($this->_params,
+ $this->write_db = &DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
- if ($this->writedb instanceof PEAR_Error) {
- Horde::fatal($this->writedb, __FILE__, __LINE__);
+ if ($this->write_db instanceof PEAR_Error) {
+ Horde::fatal($this->write_db, __FILE__, __LINE__);
}
// Set DB portability options.
- switch ($this->writedb->phptype) {
+ switch ($this->write_db->phptype) {
case 'mssql':
- $this->writedb->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
+ $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
break;
default:
- $this->writedb->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
+ $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
}
/* Check if we need to set up the read DB connection seperately. */
} else {
/* Default to the same DB handle for the writer too. */
- $this->db =& $this->writedb;
+ $this->db =& $this->write_db;
}
return true;
$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 = ?)';
<?php
/**
-* extend Horde TagCloud to allow complete css font sizes
-*/
+ * extend Horde TagCloud to allow complete css font sizes
+ */
class Oscar_TagCloud extends Horde_UI_TagCloud {
/**
/**
* News General View Class
*
- * $Id: View.php 250 2008-01-18 15:31:32Z duck $
+ * $Id: View.php 1118 2008-12-04 19:10:41Z duck $
*
- * Copyright 2007-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.
+ * Copyright Obala d.o.o. (www.obala.si)
*
* @author Duck <duck@obala.net>
* @package News
/* Set parents defualt data */
parent::__construct(array('templatePath' => NEWS_TEMPLATES,
'encoding' => NLS::select()));
-
- $this->list_url = Horde::applicationUrl('list.php');
- }
-
- /**
- * Format value accoring to currency
- *
- * @param float $price The price value to format.
- *
- * @return Currency formatted price string.
- */
- public public function format_price($price)
- {
- if (empty($price)) {
- return '';
- }
-
- static $currency;
-
- if (is_null($currency)) {
- $currencies = new Horde_CurrenciesMapper();
- $currency = $currencies->getDefault('data');
- }
-
- return Horde_Currencies::formatPrice($price, $currency);
}
/**
return $html;
}
-}
+}
\ No newline at end of file
/**
* News api
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: api.php 970 2008-10-07 17:11:59Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: api.php 730 2008-08-10 09:52:55Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
return $news['user'];
case 'link':
- return Util::addParameter(Horde::applicationUrl('news.php', true, -1), 'id', $id);
+ return News::getUrlFor('news', $id, true, -1);
case 'messages':
$GLOBALS['news']->updateComments($id, $params);
+
+ if ($GLOBALS['registry']->hasMethod('logActivity', 'folks')) {
+ $link = '<a href="' . News::getUrlFor('news', $id) . '">' . $news['title'] . '</a>';
+ $message = sprintf(_("Has commented news \"%s\""), $link);
+ $GLOBALS['registry']->callByPackage('folks', 'logActivity', array($message, 'news'));
+ }
+
return true;
default:
{
require_once dirname(__FILE__) . '/base.php';
- return $GLOBALS['news']->listNews($criteria, $perms);
+ return $GLOBALS['news']->listNews($criteria, $from, $count, $perms);
}
/**
* 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.
*
- * $Id: base.php 200 2008-01-09 08:29:52Z duck $
+ * $Id: base.php 1174 2009-01-19 15:11:03Z duck $
*
* @author Duck <duck@obala.net>
* @package News
// Load the Horde Framework core, and set up inclusion paths.
require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/Loader.php';
// Registry.
$registry = &Registry::singleton();
if (!Util::nonInputVar('no_compress')) {
Horde::compressOutput();
}
-
+++ /dev/null
-<?php define('NEWS_VERSION', 'H4 (0.2-git)') ?>
/**
* News
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: mail.php 1174 2009-01-19 15:11:03Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: mail.php 183 2008-01-06 17:39:50Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
$id = Util::getFormData('id');
$row = $news->get($id);
if ($row instanceof PEAR_Error) {
- $notification->push($row->getMessage(), 'horde.error');
+ $notification->push($row);
header('Location: ' . Horde::applicationUrl('browse.php'));
exit;
}
function _error($msg)
{
$GLOBALS['notification']->push($msg, 'horde.error');
- $news_url = Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $GLOBALS['id']);
- header('Location: ' . $news_url);
+ header('Location: ' . News::getUrlFor('news', $GLOBALS['id']));
exit;
}
Auth::getAuth(),
$row['title'],
$row['publish'],
- Util::addParameter(Horde::applicationUrl('news.php', true, -1), 'id', $id));
+ News::getUrlFor('news', $id, true, -1));
-require_once 'Horde/MIME/Mail.php';
-$mail = new MIME_Mail($row['title'], $body, $to, $from, NLS::getCharset());
+$mail = new Horde_Mime_Mail($row['title'], $body, $to, $from, NLS::getCharset());
$result = $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
if ($result instanceof PEAR_Error) {
- $notification->push($result->getMessage(), 'horde.error');
+ $notification->push($result);
} else {
$notification->push(sprintf(_("News succesfully send to %s"), $to), 'horde.success');
}
-header('Location: ' . Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $id));
-exit;
+header('Location: ' . News::getUrlFor('news', $id));
+exit;
\ No newline at end of file
/**
* News
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: news.php 1190 2009-01-21 16:10: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 Obala d.o.o. (www.obala.si)
*
- * $Id: news.php 229 2008-01-12 19:47:30Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
$id = Util::getFormData('id');
$row = $news->get($id);
-// check if the news eyists
+// check if the news exists
if ($row instanceof PEAR_Error) {
- $notification->push($row->getMessage(), 'horde.error');
+ $notification->push($row);
header('Location: ' . Horde::applicationUrl('index.php'));
exit;
}
$version_data['content'] = unserialize($version_data['content']);
$row['content'] = $version_data['content'][NLS::select()]['content'];
$row['title'] = $version_data['content'][NLS::select()]['title'] .
- '<span class="small"> - v.' . $version . ' from ' . $version_data['user_uid'] .
- ' @ ' . $version_data['created'] . ' </span>';
+ ' (v.' . $version . _(" by ") . $version_data['user_uid'] .
+ ' @ ' . $news->dateFormat($version_data['created']) . ')';
}
} else {
$news->logView($id);
$title = $row['title'];
$template_path = News::getTemplatePath($row['category1'], 'news');
$browse_url = Horde::applicationUrl('browse.php');
-$news_url = Horde::applicationUrl('news.php', true);
Horde::addScriptFile('popup.js', 'horde', true);
require_once NEWS_TEMPLATES . '/common-header.inc';
require $template_path . 'news.php';
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
-
+require_once $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
/**
* News
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: note.php 890 2008-09-23 09:58:23Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: note.php 183 2008-01-06 17:39:50Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
$id = Util::getFormData('id');
$row = $news->get($id);
if ($row instanceof PEAR_Error) {
- $notification->push($row->getMessage(), 'horde.error');
+ $notification->push($row);
header('Location: ' . Horde::applicationUrl('browse.php'));
exit;
}
-$news_url = Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $id);
-$body = $row['title'] . "\n\n"
+$body = $row['title'] . "\n\n"getUrlFor
. _("On") . ': ' . $news->dateFormat($row['publish']) . "\n"
- . _("Link") . ': ' . $news_url . "\n\n"
+ . _("Link") . ': ' . News::getUrlFor('news', $id) . "\n\n"
. strip_tags($row['content']);
/* Create a new vNote object using this message's contents. */
$res = $registry->call('notes/import', array($vNote, 'text/x-vnote'));
if ($res instanceof PEAR_Error) {
- $notification->push($res->getMessage(), 'horde.error');
- header('Location: ' . $news_url);
+ $notification->push($res);
+ header('Location: ' . News::getUrlFor('news', $id));
exit;
} else {
$notification->push(_("News sucessfuly added to you notes."), 'horde.success');
header('Location: ' . $registry->getInitialPage('mnemo'));
exit;
-}
+}
\ No newline at end of file
# SOME DESCRIPTIVE TITLE.
-# Copyright YEAR Horde Project
+# Copyright (C) YEAR Horde Project
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2008-03-30 19:15+0200\n"
+"POT-Creation-Date: 2009-01-21 01:31+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.inc:86 templates/edit/info.php:91
+#: templates/edit/info.php:91
msgid " at "
msgstr ""
-#: templates/edit/info.inc:86 templates/edit/info.php:91
+#: templates/edit/info.php:91
msgid " by "
msgstr ""
-#: content_edit.php:28
+#: content_edit.php:26
#, php-format
msgid "%s :: Add Content"
msgstr ""
-#: mail.php:51
+#: mail.php:46
#, php-format
msgid ""
"%s would you like to invite you to read the news\n"
msgid "* Sponsored news"
msgstr ""
-#: add.php:87 add.php:94 add.php:142
+#: add.php:129 add.php:136 add.php:153 lib/Forms/Search.php:31
+#: lib/Forms/Search.php:34 lib/Forms/Search.php:38
msgid "-- select --"
msgstr ""
msgid "Activate"
msgstr ""
-#: lib/News.php:1048
+#: lib/News.php:1123
msgid "Add"
msgstr ""
msgid "Add New"
msgstr ""
-#: lib/Categories.php:474 lib/Categories.php:488
+#: lib/Categories.php:471 lib/Categories.php:485
msgid "Add New Item"
msgstr ""
msgid "Add category"
msgstr ""
-#: add.php:69
+#: add.php:95
msgid "Add news"
msgstr ""
-#: templates/news/tools.php:16
+#: templates/news/tools.php:18
msgid "Add to bookmarks."
msgstr ""
-#: templates/news/tools.php:22
+#: templates/news/tools.php:24
msgid "Add to notes."
msgstr ""
-#: add.php:141
+#: add.php:152
msgid "Additional news attributes"
msgstr ""
-#: lib/api.php:52
+#: add.php:218 lib/api.php:49
msgid "Admin"
msgstr ""
-#: lib/News.php:1056
+#: lib/News.php:1131
msgid "Administration"
msgstr ""
-#: templates/edit/info.inc:21 templates/edit/info.php:21
+#: templates/edit/info.php:21
msgid "Allow comments"
msgstr ""
-#: lib/News.php:1046
+#: lib/News.php:1121
msgid "Archive"
msgstr ""
-#: delete.php:25
+#: delete_file.php:22
+msgid "Are you sure you want to delete file?"
+msgstr ""
+
+#: delete.php:22
msgid "Are you sure you want to delete this news?"
msgstr ""
-#: lib/Forms/Search.php:39
+#: lib/Forms/Search.php:49
msgid "Ascending"
msgstr ""
msgid "Ascesending"
msgstr ""
-#: lib/News.php:175
+#: lib/News.php:216
msgid "Attached files: "
msgstr ""
-#: edit.php:51
+#: edit.php:44
msgid "Attachment deleted"
msgstr ""
-#: add.php:214 lib/Forms/Search.php:36
+#: lib/Forms/Search.php:46
msgid "Attachments"
msgstr ""
-#: add.php:140
+#: add.php:151
msgid "Attributes"
msgstr ""
msgid "Besed"
msgstr ""
-#: trackback.php:67
+#: trackback.php:65
#, php-format
msgid "Blog entry %s does not exist."
msgstr ""
msgid "Blogs"
msgstr ""
-#: browse.php:20 search.php:21
+#: browse.php:16 search.php:16
msgid "Browse"
msgstr ""
msgid "By"
msgstr ""
-#: delete.php:26 admin/categories/delete.php:18 admin/sources/delete.php:19
+#: delete_file.php:23 delete.php:23 admin/categories/delete.php:18
+#: admin/sources/delete.php:19
msgid "Cancel"
msgstr ""
-#: add.php:387
+#: files.php:52
#, php-format
-msgid "Cannot access file %s"
+msgid "Cannot read file %s"
msgstr ""
-#: admin/tabs.php:27 lib/api.php:60 lib/Block/categories.php:3
-#: lib/Block/categories.php:21 templates/categories/edit.html:5
-#: templates/categories/index.html:4 templates/categories/delete.html:5
+#: add.php:199
+msgid "Caption"
+msgstr ""
+
+#: admin/tabs.php:25 lib/api.php:57 lib/Block/categories.php:3
+#: lib/Block/categories.php:21
msgid "Categories"
msgstr ""
-#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:29
+#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:34
#: lib/Block/category.php:35
msgid "Category"
msgstr ""
msgstr ""
#: templates/browse/row.inc:10 templates/edit/header.inc:13
-#: lib/Forms/Search.php:34
+#: lib/Forms/Search.php:44
msgid "Comments"
msgstr ""
-#: lib/News.php:411
+#: lib/News.php:487
msgid "Comments are not supported."
msgstr ""
-#: lib/News.php:185
+#: lib/News.php:222
#, php-format
msgid "Compress and dowload %s"
msgstr ""
-#: lib/News.php:174
+#: lib/News.php:215
msgid "Compress and dowload all files at once"
msgstr ""
-#: templates/edit/row.php:43 lib/Forms/Search.php:24
+#: templates/edit/row.php:46 lib/Forms/Search.php:29
msgid "Confirmed"
msgstr ""
-#: add.php:82 add.php:112
+#: add.php:124 add.php:147
msgid "Content"
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
+#: admin/sources/index.php:34 lib/News.php:206
msgid "Delete"
msgstr ""
-#: add.php:101
+#: lib/News.php:227
+#, php-format
+msgid "Delete %s"
+msgstr ""
+
+#: add.php:101 add.php:118
msgid "Delete existing picture"
msgstr ""
-#: lib/Forms/Search.php:38
+#: lib/Forms/Search.php:48
msgid "Descending"
msgstr ""
msgid "Description"
msgstr ""
-#: diff.php:18 templates/edit/info.inc:95 templates/edit/info.php:100
+#: diff.php:14 templates/edit/info.php:100
msgid "Diff"
msgstr ""
-#: add.php:175
+#: add.php:227
msgid "Disallow comments"
msgstr ""
msgid "Do you really wont to delete this source?"
msgstr ""
-#: lib/News.php:169
+#: lib/News.php:210
msgid "Dowload"
msgstr ""
-#: lib/News.php:186
+#: lib/News.php:223
#, php-format
msgid "Dowload %s"
msgstr ""
-#: lib/News.php:170
+#: lib/News.php:211
msgid "Dowload Zip Compressed"
msgstr ""
-#: edit.php:123 templates/edit/row.php:6 templates/edit/row.php:7
+#: edit.php:116 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.inc:75 templates/edit/info.php:80
+#: templates/edit/info.php:80
msgid "Edit history: "
msgstr ""
-#: add.php:434
+#: add.php:542
msgid "Edit news"
msgstr ""
-#: templates/edit/info.inc:25 templates/edit/info.php:25
-#: lib/Forms/Search.php:46
+#: templates/edit/info.php:25 lib/Forms/Search.php:56
msgid "Editor"
msgstr ""
-#: lib/api.php:55
+#: lib/api.php:52
msgid "Editors"
msgstr ""
-#: lib/News.php:1055
+#: lib/News.php:1130
msgid "Editorship"
msgstr ""
-#: add.php:144
+#: add.php:177
+msgid "Enter gallery ID or upload images below"
+msgstr ""
+
+#: add.php:155
msgid "Enter news ids separated by commas."
msgstr ""
-#: add.php:110
+#: add.php:145
msgid ""
"Enter one or more keywords that describe your news. Separate them by spaces."
msgstr ""
-#: add.php:147
+#: add.php:158
msgid "Enter threads separated by commas."
msgstr ""
+#: delete_file.php:44
+#, php-format
+msgid "Error deleteing file \"%s\" from news \"%s\""
+msgstr ""
+
#: templates/news/today.php:11
msgid "Events on this day."
msgstr ""
-#: files.php:56
+#: add.php:211
+msgid "File"
+msgstr ""
+
+#: delete_file.php:49
+#, php-format
+msgid "File \"%s\" was deleted from news \"%s\""
+msgstr ""
+
+#: delete_file.php:53
+#, php-format
+msgid "File \"%s\" was not deleted from news \"%s\""
+msgstr ""
+
+#: add.php:204 add.php:458
+msgid "Files"
+msgstr ""
+
+#: files.php:60
#, php-format
msgid "FilesOfNews-%s"
msgstr ""
-#: add.php:206
+#: add.php:258
msgid "Form ID"
msgstr ""
-#: add.php:207
+#: add.php:259
msgid "Form to"
msgstr ""
msgid "From: "
msgstr ""
-#: add.php:156 add.php:163
+#: add.php:180 add.php:187
msgid "Gallery"
msgstr ""
+#: lib/api.php:101
+#, php-format
+msgid "Has commented news \"%s\""
+msgstr ""
+
#: lib/Block/most_commented.php:26 lib/Block/most_read.php:26
msgid "How many days back to check?"
msgstr ""
msgstr ""
#: templates/categories/index.php:5 templates/sources/index.php:5
-#: lib/Forms/Search.php:32 config/prefs.php.dist:29
+#: lib/Forms/Search.php:42 config/prefs.php.dist:29
msgid "Id"
msgstr ""
msgid "Image"
msgstr ""
+#: add.php:161
+msgid "Images"
+msgstr ""
+
+#: add.php:196
+msgid ""
+"Images will be added to a gallery linked with this article. You can edit and "
+"manage images in gallery."
+msgstr ""
+
#: templates/edit/row.php:9 templates/edit/row.php:10
msgid "Info"
msgstr ""
-#: templates/edit/info.inc:83 templates/edit/info.php:88
+#: templates/edit/info.php:88
msgid "Insert"
msgstr ""
msgid "Last news in category"
msgstr ""
-#: note.php:29 pdf.php:51
+#: note.php:24 pdf.php:51
msgid "Link"
msgstr ""
msgid "Lock"
msgstr ""
-#: templates/edit/row.php:44 lib/Forms/Search.php:25
+#: templates/edit/row.php:50 lib/Forms/Search.php:30
msgid "Locked"
msgstr ""
+#: add.php:82
+#, php-format
+msgid "Maximum file size: %s; with a total of: %s"
+msgstr ""
+
#: templates/categories/index.php:6 templates/sources/index.php:6
#: admin/categories/edit.php:31 admin/sources/edit.php:32
msgid "Name"
msgid "News"
msgstr ""
-#: reads.php:33
+#: reads.php:28
#, php-format
msgid "News %s"
msgstr ""
-#: edit.php:51 edit.php:59 edit.php:67 edit.php:75 edit.php:83 edit.php:116
-#: delete.php:55 delete.php:57
+#: edit.php:44 edit.php:52 edit.php:60 edit.php:68 edit.php:76 edit.php:109
+#: delete.php:73 delete.php:75
#, php-format
msgid "News %s: %s"
msgstr ""
-#: add.php:422
+#: add.php:530
msgid ""
"News added. The editors will check the entry and confirm it if they find it "
"suitable."
msgstr ""
-#: add.php:83
+#: add.php:219
+msgid "News administrator options"
+msgstr ""
+
+#: add.php:125
msgid "News content"
msgstr ""
msgid "News data"
msgstr ""
+#: add.php:162
+msgid "News images"
+msgstr ""
+
#: templates/news/today.php:5
msgid "News of this day."
msgstr ""
-#: add.php:424
+#: add.php:532
msgid "News published."
msgstr ""
-#: mail.php:63
+#: mail.php:57
#, php-format
msgid "News succesfully send to %s"
msgstr ""
-#: note.php:45
+#: note.php:40
msgid "News sucessfuly added to you notes."
msgstr ""
-#: add.php:426
+#: add.php:534
msgid "News updated."
msgstr ""
-#: templates/edit/info.inc:21 templates/edit/info.php:21
+#: templates/edit/info.php:21
msgid "No"
msgstr ""
-#: diff.php:59
+#: diff.php:55
msgid "No change."
msgstr ""
-#: mail.php:41
+#: mail.php:36
msgid "No mail entered."
msgstr ""
msgid "Number of comments to display"
msgstr ""
-#: note.php:28 pdf.php:50 templates/news/info.php:5
+#: note.php:23 pdf.php:50 templates/news/info.php:5
msgid "On"
msgstr ""
msgid "On this day"
msgstr ""
-#: delete.php:16
+#: delete_file.php:16 delete.php:16
msgid "Only admin can delete a news."
msgstr ""
-#: add.php:64
+#: add.php:90
msgid "Only authenticated users can post news."
msgstr ""
-#: mail.php:36
+#: mail.php:31
msgid "Only authenticated users can send mails."
msgstr ""
-#: lib/Forms/Search.php:31
+#: lib/Forms/Search.php:41
msgid "Order by"
msgstr ""
-#: lib/News.php:1044
+#: lib/News.php:1119
msgid "Overview"
msgstr ""
msgid "Parent"
msgstr ""
-#: add.php:144 templates/news/parents.php:5 templates/edit/info.inc:33
-#: templates/edit/info.php:33
+#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:33
msgid "Parents"
msgstr ""
-#: add.php:99
+#: add.php:165 add.php:198
msgid "Picture"
msgstr ""
-#: add.php:108
+#: add.php:169
msgid "Picture comment"
msgstr ""
-#: add.php:101
-msgid "Picture delete"
-msgstr ""
-
#: lib/Block/jonah.php:4 lib/Block/jonah.php:24
msgid "Press overview"
msgstr ""
msgid "Preview"
msgstr ""
-#: lib/News.php:187
+#: lib/News.php:224
#, php-format
msgid "Preview %s"
msgstr ""
-#: add.php:87 templates/edit/info.inc:10 templates/edit/info.php:10
+#: add.php:129 templates/edit/info.php:10
msgid "Primary category"
msgstr ""
msgid "Printer firendly"
msgstr ""
-#: add.php:85 lib/Forms/Search.php:41
+#: add.php:127 lib/Forms/Search.php:51
msgid "Publish"
msgstr ""
msgid "Publish at"
msgstr ""
-#: lib/Forms/Search.php:31 config/prefs.php.dist:28
+#: lib/Forms/Search.php:41 config/prefs.php.dist:28
msgid "Publish date"
msgstr ""
-#: templates/news/parents.php:8 templates/edit/row.php:48
+#: templates/news/parents.php:8 templates/edit/row.php:54
msgid "Read"
msgstr ""
-#: templates/edit/header.inc:10 lib/Forms/Search.php:35
+#: templates/edit/header.inc:10 lib/Forms/Search.php:45
msgid "Reads"
msgstr ""
-#: delete.php:26 delete.php:33 admin/categories/delete.php:18
-#: admin/categories/delete.php:24 admin/sources/delete.php:19
-#: admin/sources/delete.php:25
+#: delete_file.php:23 delete_file.php:41 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.inc:92 templates/edit/info.php:97
+#: templates/edit/info.php:97
msgid "Renew"
msgstr ""
-#: add.php:482
+#: add.php:118 add.php:120 add.php:577
msgid "Reset"
msgstr ""
msgid "Resize Image"
msgstr ""
-#: add.php:77
+#: add.php:120
msgid "Save"
msgstr ""
-#: lib/News.php:1047 lib/Forms/Search.php:17 lib/Forms/Search.php:19
+#: lib/News.php:1122 lib/Forms/Search.php:22 lib/Forms/Search.php:24
msgid "Search"
msgstr ""
-#: lib/Forms/Search.php:21
+#: lib/Forms/Search.php:26
msgid "Search world"
msgstr ""
-#: add.php:142 templates/edit/info.inc:13 templates/edit/info.php:13
+#: add.php:153 templates/edit/info.php:13
msgid "Secondary category"
msgstr ""
-#: lib/Categories.php:481
+#: lib/Categories.php:478
msgid "Select Category"
msgstr ""
msgid "Select a feed."
msgstr ""
-#: add.php:214
-msgid "Select files"
-msgstr ""
-
-#: add.php:195 templates/edit/info.inc:47 templates/edit/info.php:47
+#: add.php:247 templates/edit/info.php:47
msgid "Selling item"
msgstr ""
msgid "Send by mail"
msgstr ""
-#: lib/News.php:101
+#: lib/News.php:100
msgid "Services/Trackback is not installed."
msgstr ""
msgid "Sort news by"
msgstr ""
-#: add.php:143 templates/edit/info.inc:29 templates/edit/info.php:29
-#: lib/Forms/Search.php:38
+#: add.php:154 templates/edit/info.php:29 lib/Forms/Search.php:48
msgid "Sort order"
msgstr ""
-#: add.php:94 templates/edit/info.inc:37 templates/edit/info.php:37
+#: add.php:136 templates/edit/info.php:37 lib/Forms/Search.php:38
msgid "Source"
msgstr ""
msgid "Source deleted."
msgstr ""
-#: add.php:96 templates/edit/info.inc:41 templates/edit/info.php:41
+#: add.php:138 templates/edit/info.php:41
msgid "Source link"
msgstr ""
msgid "Source was not deleted."
msgstr ""
-#: admin/tabs.php:26 lib/Block/sources.php:3 lib/Block/sources.php:21
+#: admin/tabs.php:24 lib/Block/sources.php:3 lib/Block/sources.php:21
msgid "Sources"
msgstr ""
msgid "Sources Administration"
msgstr ""
-#: add.php:170
+#: add.php:222
msgid "Sponsored"
msgstr ""
-#: templates/edit/header.inc:6 lib/Forms/Search.php:26
+#: templates/edit/header.inc:6 lib/Forms/Search.php:31
msgid "Status"
msgstr ""
-#: lib/News.php:1051
+#: lib/News.php:1126
msgid "Tag cloud"
msgstr ""
-#: add.php:110 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24
+#: add.php:145 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24
msgid "Tags"
msgstr ""
msgid "There are no news to display."
msgstr ""
-#: lib/News.php:482
+#: lib/News.php:557
#, php-format
msgid "There requested news %s don't exist."
msgstr ""
-#: news.php:34
+#: news.php:29
msgid "There requested version don't exist."
msgstr ""
-#: add.php:147 templates/news/threads.php:6
+#: add.php:433
+msgid "There was an error creating gallery: "
+msgstr ""
+
+#: add.php:449
+msgid "There was an error with the uploaded image: "
+msgstr ""
+
+#: add.php:158 templates/news/threads.php:6
#, php-format
msgid "Threads in %s"
msgstr ""
-#: add.php:107 templates/edit/header.inc:7 lib/Forms/Search.php:33
+#: add.php:143 templates/edit/header.inc:7 lib/Forms/Search.php:43
#: lib/Block/my_comments.php:56 config/prefs.php.dist:30
msgid "Title"
msgstr ""
msgid "Trackback this blog on this site."
msgstr ""
-#: lib/News.php:628
+#: lib/News.php:703
#, php-format
msgid "URL already trackbacked: %s"
msgstr ""
-#: templates/edit/row.php:42 lib/Forms/Search.php:23
+#: templates/edit/row.php:42 lib/Forms/Search.php:28
msgid "Unconfirmed"
msgstr ""
msgid "Unlock"
msgstr ""
-#: lib/Forms/Search.php:42
+#: lib/Forms/Search.php:52
msgid "Unpublish"
msgstr ""
-#: templates/edit/info.inc:17 templates/edit/info.php:17
+#: templates/edit/info.php:17
msgid "Unpublish date"
msgstr ""
-#: add.php:481 templates/edit/info.inc:81 templates/edit/info.php:86
+#: add.php:118 add.php:576 templates/edit/info.php:86
msgid "Update"
msgstr ""
msgstr ""
#: templates/reads/header.inc:6 templates/edit/header.inc:9
-#: lib/Forms/Search.php:43 lib/Block/my_comments.php:57
+#: lib/Forms/Search.php:53 lib/Block/my_comments.php:57
msgid "User"
msgstr ""
-#: templates/edit/info.inc:89 templates/edit/info.php:94
+#: templates/edit/info.php:94
msgid "View"
msgstr ""
msgid "View items"
msgstr ""
-#: templates/edit/info.inc:21 templates/edit/info.php:21
+#: templates/edit/info.php:21
msgid "Yes"
msgstr ""
msgid "You are not authorised for this action."
msgstr ""
-#: mail.php:47
+#: mail.php:42
msgid "You have no email set."
msgstr ""
-#: edit.php:24
+#: edit.php:18
msgid "You have not editor permission on any category."
msgstr ""
-#: edit.php:67
+#: edit.php:60
msgid "activated"
msgstr ""
-#: edit.php:59
+#: edit.php:52
msgid "deactivated"
msgstr ""
-#: delete.php:55
+#: delete.php:73
msgid "deleted"
msgstr ""
-#: edit.php:75
+#: edit.php:68
msgid "locked"
msgstr ""
-#: delete.php:57
+#: delete.php:75
msgid "not deleted"
msgstr ""
-#: edit.php:116
+#: edit.php:109
msgid "renewed"
msgstr ""
-#: edit.php:83
+#: edit.php:76
msgid "unlocked"
msgstr ""
msgstr ""
"Project-Id-Version: sl_SI\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
-"POT-Creation-Date: 2008-01-15 13:59+0100\n"
+"POT-Creation-Date: 2009-01-21 01:31+0100\n"
"PO-Revision-Date: 2008-01-15 14:13+0100\n"
"Last-Translator: Marko Milost <marko.milost@obala.si>\n"
"Language-Team: Slovene <sl@li.org>\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=3;\n"
-#: templates/edit/info.inc:86 templates/edit/info.php:91
+#: templates/edit/info.php:91
msgid " at "
msgstr " ob "
-#: templates/edit/info.inc:86 templates/edit/info.php:91
+#: templates/edit/info.php:91
msgid " by "
msgstr " od "
-#: content_edit.php:28
+#: content_edit.php:26
#, php-format
msgid "%s :: Add Content"
msgstr "%s :: Dodaj vsebino"
-#: mail.php:51
+#: mail.php:46
#, php-format
msgid ""
"%s would you like to invite you to read the news\n"
" Objavljeno: %s\n"
" Povezava: %s"
-#: templates/news/news.inc:18 templates/news/news.php:18
+#: templates/news/news.php:18
msgid "* Sponsored news"
msgstr "* Komercialna objava"
-#: add.php:87 add.php:94 add.php:142
+#: add.php:129 add.php:136 add.php:153 lib/Forms/Search.php:31
+#: lib/Forms/Search.php:34 lib/Forms/Search.php:38
msgid "-- select --"
msgstr "-- izberi --"
msgid "Action"
msgstr "Ukaz"
-#: templates/edit/row.inc:20 templates/edit/row.php:20
+#: templates/edit/row.php:20
msgid "Activate"
msgstr "Aktiviraj"
-#: lib/News.php:451
+#: lib/News.php:1123
msgid "Add"
msgstr "Vpis"
-#: content.php:23
+#: content.php:24
msgid "Add Content"
msgstr "Dodaj vsebino"
msgid "Add New"
msgstr "Dodaj novo"
+#: lib/Categories.php:471 lib/Categories.php:485
+msgid "Add New Item"
+msgstr "Dodaj novo"
+
#: admin/sources/edit.php:19
msgid "Add Source"
msgstr "Dodaj vir"
msgid "Add category"
msgstr "Dodaj kategorije"
-#: add.php:69
+#: add.php:95
msgid "Add news"
msgstr "Dodaj novice"
-#: templates/news/tools.inc:16 templates/news/tools.php:16
+#: templates/news/tools.php:18
msgid "Add to bookmarks."
msgstr "Dodaj med priljubljene"
-#: templates/news/tools.inc:22 templates/news/tools.php:22
+#: templates/news/tools.php:24
msgid "Add to notes."
msgstr "Dodaj med zapiske"
-#: add.php:141
+#: add.php:152
msgid "Additional news attributes"
msgstr "Dodatne lastnosti novice"
-#: lib/api.php:52
+#: add.php:218 lib/api.php:49
msgid "Admin"
msgstr "Administracija"
-#: lib/News.php:459
+#: lib/News.php:1131
msgid "Administration"
msgstr "Administracija"
-#: templates/edit/info.inc:21 templates/edit/info.php:21
+#: templates/edit/info.php:21
msgid "Allow comments"
msgstr "Dovoli komentarje"
-#: lib/News.php:449
+#: lib/News.php:1121
msgid "Archive"
msgstr "Arhiv"
-#: delete.php:25
+#: delete_file.php:22
+msgid "Are you sure you want to delete file?"
+msgstr "Resnično želite to datoteko?"
+
+#: delete.php:22
msgid "Are you sure you want to delete this news?"
msgstr "Resnično želite izbrisati to novico?"
-#: lib/Forms/Search.php:40
+#: lib/Forms/Search.php:49
msgid "Ascending"
msgstr "Naraščajoče"
msgid "Ascesending"
msgstr "Naraščajoče"
-#: lib/News.php:175
+#: lib/News.php:216
msgid "Attached files: "
msgstr "Pripete datoteke: "
-#: edit.php:51
+#: edit.php:44
msgid "Attachment deleted"
msgstr "Pripeta datoteka je bila izbrisana"
-#: add.php:214 lib/Forms/Search.php:37
+#: lib/Forms/Search.php:46
msgid "Attachments"
msgstr "Pripete datoteke"
-#: add.php:140
+#: add.php:151
msgid "Attributes"
msgstr "Lastnosti"
-#: templates/news/info.inc:10 templates/news/info.php:10
+#: templates/news/info.php:10
msgid "Besed"
msgstr "Besed"
-#: trackback.php:67
+#: trackback.php:65
#, php-format
msgid "Blog entry %s does not exist."
msgstr "Blog vpis %s ne obstaja."
-#: templates/news/blog.inc:3 templates/news/blog.php:3
+#: templates/news/blog.php:3
msgid "Blogs"
msgstr "Blogi"
-#: browse.php:20 search.php:21
+#: browse.php:16 search.php:16
msgid "Browse"
msgstr "Prebrskaj"
-#: templates/news/info.inc:4 templates/news/info.php:4
+#: templates/news/info.php:4
msgid "By"
msgstr "Od"
-#: delete.php:26 admin/categories/delete.php:18 admin/sources/delete.php:19
+#: delete_file.php:23 delete.php:23 admin/categories/delete.php:18
+#: admin/sources/delete.php:19
msgid "Cancel"
msgstr "Prekliči"
-#: add.php:387
+#: files.php:52
#, php-format
-msgid "Cannot access file %s"
-msgstr "Ne morem odpreti datoteke %s"
+msgid "Cannot read file %s"
+msgstr "Ne morem prebrati datoteke %s"
+
+#: add.php:199
+msgid "Caption"
+msgstr "Komentar k sliki"
-#: admin/tabs.php:27 lib/api.php:60 lib/Block/categories.php:3
-#: lib/Block/categories.php:21 templates/categories/edit.html:5
-#: templates/categories/index.html:4 templates/categories/delete.html:5
+#: admin/tabs.php:25 lib/api.php:57 lib/Block/categories.php:3
+#: lib/Block/categories.php:21
msgid "Categories"
msgstr "Kategorije"
-#: lib/Forms/Search.php:30 lib/Block/category.php:35 templates/menu.inc:4
-#: templates/news/info.inc:6 templates/news/info.php:6
+#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:34
+#: lib/Block/category.php:35
msgid "Category"
msgstr "Kategorija"
msgid "Category deleted."
msgstr "Kategorija je bila izbrisana."
-#: admin/categories/edit.php:44
+#: admin/categories/edit.php:46
#, php-format
msgid "Category succesfully saved."
msgstr "Kategorija je bila uspešno shranjena."
msgid "Category was not deleted."
msgstr "Kategorija ni bila izbrisana."
-#: templates/browse/row.inc:9 templates/news/info.inc:9
-#: templates/news/info.php:9
+#: templates/browse/row.inc:9 templates/news/info.php:9
msgid "Chars"
msgstr "Znakov"
-#: lib/Forms/Search.php:35 templates/browse/row.inc:10
-#: templates/edit/header.inc:13
+#: templates/browse/row.inc:10 templates/edit/header.inc:13
+#: lib/Forms/Search.php:44
msgid "Comments"
msgstr "Komentarjev"
-#: lib/News.php:411
+#: lib/News.php:487
msgid "Comments are not supported."
msgstr "Komentarji niso podprti."
-#: lib/News.php:185
+#: lib/News.php:222
#, php-format
msgid "Compress and dowload %s"
msgstr "Kompresiraj in prenesi datoteko %s"
-#: lib/News.php:174
+#: lib/News.php:215
msgid "Compress and dowload all files at once"
msgstr "Kompresiraj in prenesi vse datoteke naenkrat"
-#: lib/Forms/Search.php:25 templates/edit/row.inc:43 templates/edit/row.php:43
+#: templates/edit/row.php:46 lib/Forms/Search.php:29
msgid "Confirmed"
msgstr "Potrjena"
-#: add.php:82 add.php:112
+#: add.php:124 add.php:147
msgid "Content"
msgstr "Vsebina"
msgid "Date"
msgstr "Datum"
-#: templates/edit/row.inc:17 templates/edit/row.php:17
+#: templates/edit/row.php:17
msgid "Deactivate"
msgstr "Deaktiviraj"
-#: admin/categories/index.php:29 admin/categories/index.php:32
-#: admin/sources/index.php:27 admin/sources/index.php:34
-#: templates/edit/row.inc:23 templates/edit/row.php:23
+#: 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
msgid "Delete"
msgstr "Izbriši"
-#: add.php:101
+#: lib/News.php:227
+#, php-format
+msgid "Delete %s"
+msgstr "Izbriši %s"
+
+#: add.php:101 add.php:118
msgid "Delete existing picture"
msgstr "Zbriši obstoječo sliko"
-#: lib/Forms/Search.php:39
+#: lib/Forms/Search.php:48
msgid "Descending"
msgstr "Padajoče"
msgid "Descesending"
msgstr "Padajoče"
-#: admin/categories/edit.php:31 templates/categories/index.php:8
+#: templates/categories/index.php:8 admin/categories/edit.php:32
msgid "Description"
msgstr "Opis"
-#: diff.php:18 templates/edit/info.inc:95 templates/edit/info.php:100
+#: diff.php:14 templates/edit/info.php:100
msgid "Diff"
msgstr "Razlike"
-#: add.php:175
+#: add.php:227
msgid "Disallow comments"
msgstr "Ne dovoli komentarjev"
msgid "Do you really wont to delete this source?"
msgstr "Resnično želite izbrisati ta vir?"
-#: lib/News.php:169
+#: lib/News.php:210
msgid "Dowload"
msgstr "Prenesi"
-#: lib/News.php:186
+#: lib/News.php:223
#, php-format
msgid "Dowload %s"
msgstr "Prenesi datoteko %s"
-#: lib/News.php:170
+#: lib/News.php:211
msgid "Dowload Zip Compressed"
msgstr "Presnemi Zip kompresirano datoteko"
-#: edit.php:123 admin/categories/index.php:27 admin/categories/index.php:34
+#: edit.php:116 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
-#: templates/edit/row.inc:6 templates/edit/row.inc:7 templates/edit/row.php:6
-#: templates/edit/row.php:7
msgid "Edit"
msgstr "Uredi"
msgid "Edit category"
msgstr "Uredi kategoijo"
-#: templates/edit/info.inc:75 templates/edit/info.php:80
+#: templates/edit/info.php:80
msgid "Edit history: "
msgstr "Zgodovina urejanja:"
-#: add.php:434
+#: add.php:542
msgid "Edit news"
msgstr "Uredi novico"
-#: lib/Forms/Search.php:47 templates/edit/info.inc:25
-#: templates/edit/info.php:25
+#: templates/edit/info.php:25 lib/Forms/Search.php:56
msgid "Editor"
msgstr "Urednik"
-#: lib/api.php:55
+#: lib/api.php:52
msgid "Editors"
msgstr "Uredniki"
-#: lib/News.php:458
+#: lib/News.php:1130
msgid "Editorship"
msgstr "Uredništvo"
-#: add.php:144
+#: add.php:177
+msgid "Enter gallery ID or upload images below"
+msgstr "Vnesite ID galerija ali naložite slike"
+
+#: add.php:155
msgid "Enter news ids separated by commas."
msgstr "Vnesi id-je novic ločene z vejico."
-#: add.php:110
-msgid "Enter one or more keywords that describe your news. Separate them by spaces."
-msgstr ""
+#: add.php:145
+msgid ""
+"Enter one or more keywords that describe your news. Separate them by spaces."
+msgstr "Vnesite eno ali več besed ločenih s presledki."
-#: add.php:147
+#: add.php:158
msgid "Enter threads separated by commas."
msgstr "Vnesi id-je debat ločene z vejico."
-#: templates/news/today.inc:11 templates/news/today.php:11
+#: delete_file.php:44
+#, php-format
+msgid "Error deleteing file \"%s\" from news \"%s\""
+msgstr "Napaka pri brisanju datoteke \"%s\" z novice \"%s\""
+
+#: templates/news/today.php:11
msgid "Events on this day."
msgstr "Dogodki tega dne"
-#: files.php:56
+#: add.php:211
+msgid "File"
+msgstr "Datoteka"
+
+#: delete_file.php:49
+#, php-format
+msgid "File \"%s\" was deleted from news \"%s\""
+msgstr "Datoteke \"%s\" je bila odstranjena od novice \"%s\""
+
+#: delete_file.php:53
+#, php-format
+msgid "File \"%s\" was not deleted from news \"%s\""
+msgstr "Datoteke \"%s\" ni bila odstranjena od novice \"%s\""
+
+#: add.php:204 add.php:458
+msgid "Files"
+msgstr "Datoteke"
+
+#: files.php:60
#, php-format
msgid "FilesOfNews-%s"
msgstr "DatotekeNovice-%s"
-#: add.php:206
+#: add.php:258
msgid "Form ID"
msgstr "Formular"
-#: add.php:207
+#: add.php:259
msgid "Form to"
msgstr "Veljavnost formularja "
-#: templates/news/blog.inc:10 templates/news/blog.php:10
+#: templates/news/blog.php:10
msgid "From: "
msgstr "Od: "
-#: add.php:156 add.php:163
+#: add.php:180 add.php:187
msgid "Gallery"
msgstr "Galerija"
+#: lib/api.php:101
+#, php-format
+msgid "Has commented news \"%s\""
+msgstr "Je komentiral novico \"%s\""
+
#: lib/Block/most_commented.php:26 lib/Block/most_read.php:26
msgid "How many days back to check?"
msgstr "Koliko dni stare novice naj pregledam?"
msgid "IP"
msgstr "ID"
-#: lib/Forms/Search.php:33 templates/categories/index.php:5
-#: templates/sources/index.php:5 config/prefs.php.dist:29
+#: templates/categories/index.php:5 templates/sources/index.php:5
+#: lib/Forms/Search.php:42 config/prefs.php.dist:29
msgid "Id"
msgstr "Id"
-#: admin/categories/edit.php:36 admin/sources/edit.php:37
+#: admin/categories/edit.php:38 admin/sources/edit.php:37
msgid "Image"
msgstr "Slika"
-#: templates/edit/row.inc:9 templates/edit/row.inc:10 templates/edit/row.php:9
-#: templates/edit/row.php:10
+#: add.php:161
+msgid "Images"
+msgstr "Slike"
+
+#: add.php:196
+msgid ""
+"Images will be added to a gallery linked with this article. You can edit and "
+"manage images in gallery."
+msgstr ""
+"Slike bodo naložene v galerijo, ki bo povezana z člankom. Slike lahko "
+"urajate v galeriji"
+
+#: templates/edit/row.php:9 templates/edit/row.php:10
msgid "Info"
msgstr "Info"
-#: templates/edit/info.inc:83 templates/edit/info.php:88
+#: templates/edit/info.php:88
msgid "Insert"
msgstr "Dodana"
+#: templates/common-header.inc:27 rss/index.php:44 rss/comments.php:22
#: lib/Block/last_comments.php:3 lib/Block/last_comments.php:31
-#: templates/common-header.inc:27
msgid "Last comments"
msgstr "Zadnji komentarji"
+#: lib/Block/my_comments.php:3
+msgid "Last comments on my news"
+msgstr "Zadnji komentarji na moje novice"
+
#: lib/Block/most_commented.php:3 lib/Block/most_commented.php:17
msgid "Last most commented news"
msgstr "Zadnje najbolj komentirane"
msgid "Last most read news"
msgstr "Zadnje najbolj brane"
-#: lib/Block/last.php:3 lib/Block/last.php:17 templates/common-header.inc:26
+#: templates/common-header.inc:26 rss/index.php:38 rss/news.php:33
+#: lib/Block/last.php:3 lib/Block/last.php:17
+#, php-format
msgid "Last news"
msgstr "Zadnje novice"
msgid "Last news in category"
msgstr "Zadnje novice v kategoriji"
-#: note.php:29 pdf.php:51
+#: note.php:24 pdf.php:51
msgid "Link"
msgstr "Povezava"
-#: templates/edit/row.inc:30 templates/edit/row.php:30
+#: templates/edit/row.php:30
msgid "Lock"
msgstr "Zakleni"
-#: lib/Forms/Search.php:26 templates/edit/row.inc:44 templates/edit/row.php:44
+#: templates/edit/row.php:50 lib/Forms/Search.php:30
msgid "Locked"
msgstr "Zaklenjena"
-#: admin/categories/edit.php:30 admin/sources/edit.php:32
+#: add.php:82
+#, php-format
+msgid "Maximum file size: %s; with a total of: %s"
+msgstr "Največja velikost datoteke: %s; skupno: %s"
+
#: templates/categories/index.php:6 templates/sources/index.php:6
+#: admin/categories/edit.php:31 admin/sources/edit.php:32
msgid "Name"
msgstr "Ime"
msgid "News"
msgstr "Novica"
-#: reads.php:33
+#: reads.php:28
#, php-format
msgid "News %s"
msgstr "Novica %s"
-#: edit.php:51 edit.php:59 edit.php:67 edit.php:75 edit.php:83 edit.php:116
-#: delete.php:55 delete.php:57
+#: edit.php:44 edit.php:52 edit.php:60 edit.php:68 edit.php:76 edit.php:109
+#: delete.php:73 delete.php:75
#, php-format
msgid "News %s: %s"
msgstr "Novica %s: %s"
-#: add.php:422
+#: add.php:530
msgid ""
"News added. The editors will check the entry and confirm it if they find it "
"suitable."
"Novica je bila vpisana. Uredniki bodo pregledali vaš vpis in ga potrdili, če "
"je le-ta primeren za objavo pri nas."
-#: add.php:83
+#: add.php:219
+msgid "News administrator options"
+msgstr "Adminstratorske lastnosti"
+
+#: add.php:125
msgid "News content"
msgstr "Vsebina novice"
-#: templates/news/info.inc:3 templates/news/info.php:3
+#: templates/news/info.php:3
msgid "News data"
msgstr "O novici"
-#: templates/news/today.inc:5 templates/news/today.php:5
+#: add.php:162
+msgid "News images"
+msgstr "Slike k novici"
+
+#: templates/news/today.php:5
msgid "News of this day."
msgstr "Novice tega dne"
-#: add.php:424
+#: add.php:532
msgid "News published."
msgstr "Novica objavljena."
-#: mail.php:63
+#: mail.php:57
#, php-format
msgid "News succesfully send to %s"
msgstr "Novice je bila uspešno poslana na %s."
-#: note.php:45
+#: note.php:40
msgid "News sucessfuly added to you notes."
msgstr "Novica je bila uspešno dodana med vaše zapiske"
-#: add.php:426
+#: add.php:534
msgid "News updated."
msgstr "Novica osvežena."
-#: templates/edit/info.inc:21 templates/edit/info.php:21
+#: templates/edit/info.php:21
msgid "No"
msgstr "Št."
-#: diff.php:59
+#: diff.php:55
msgid "No change."
msgstr "Ni spremembe."
-#: mail.php:41
+#: mail.php:36
msgid "No mail entered."
msgstr "Pozabili ste vnesti email."
-#: lib/Block/last_comments.php:19
+#: lib/Block/my_comments.php:19 lib/Block/last_comments.php:19
msgid "Number of comments to display"
msgstr "Število komentarjev"
-#: note.php:28 pdf.php:50 templates/news/info.inc:5 templates/news/info.php:5
+#: note.php:23 pdf.php:50 templates/news/info.php:5
msgid "On"
msgstr "Objavljena"
-#: templates/news/today.inc:3 templates/news/today.php:3
+#: templates/news/today.php:3
msgid "On this day"
msgstr "Na današnji dan"
-#: delete.php:16
+#: delete_file.php:16 delete.php:16
msgid "Only admin can delete a news."
msgstr "Samo administratorji lahko brišejo novice."
-#: add.php:64
+#: add.php:90
msgid "Only authenticated users can post news."
msgstr "Samo ragistrirani uporabniki lahko vpisujejo novice."
-#: mail.php:36
+#: mail.php:31
msgid "Only authenticated users can send mails."
msgstr "Samo ragistrirani uporabniki lahko pošiljajo novice."
-#: lib/Forms/Search.php:32
+#: lib/Forms/Search.php:41
msgid "Order by"
msgstr "Razvrsti po"
-#: lib/News.php:447
+#: lib/News.php:1119
msgid "Overview"
msgstr "Pregled"
-#: templates/news/tools.inc:9 templates/news/tools.php:9
+#: templates/news/tools.php:9
msgid "PDF"
msgstr "PDF"
-#: admin/categories/edit.php:32 templates/categories/index.php:7
+#: templates/categories/index.php:7 admin/categories/edit.php:35
msgid "Parent"
msgstr "Sorodne"
-#: add.php:144 templates/news/parents.inc:5 templates/news/parents.php:5
-#: templates/edit/info.inc:33 templates/edit/info.php:33
+#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:33
msgid "Parents"
msgstr "Sorodne novice"
-#: add.php:99
+#: add.php:165 add.php:198
msgid "Picture"
msgstr "Slika"
-#: add.php:108
+#: add.php:169
msgid "Picture comment"
msgstr "Komentar k sliki"
-#: add.php:101
-msgid "Picture delete"
-msgstr "Izbriši sliko"
-
#: lib/Block/jonah.php:4 lib/Block/jonah.php:24
msgid "Press overview"
msgstr "Pregled tiska"
msgid "Preview"
msgstr "Pregled %s"
-#: lib/News.php:187
+#: lib/News.php:224
#, php-format
msgid "Preview %s"
msgstr "Pregled %s"
-#: add.php:87 templates/edit/info.inc:10 templates/edit/info.php:10
+#: add.php:129 templates/edit/info.php:10
msgid "Primary category"
msgstr "Primarna kategorija"
-#: templates/news/tools.inc:6 templates/news/tools.php:6
+#: templates/news/tools.php:6
msgid "Printer firendly"
msgstr "Tiskanju prijazen izpis"
-#: add.php:85 lib/Forms/Search.php:42
+#: add.php:127 lib/Forms/Search.php:51
msgid "Publish"
msgstr "Objavi ob"
msgid "Publish at"
msgstr "Objavi ob"
-#: lib/Forms/Search.php:32 config/prefs.php.dist:28
+#: lib/Forms/Search.php:41 config/prefs.php.dist:28
msgid "Publish date"
msgstr "Objavi ob"
-#: templates/news/parents.inc:8 templates/news/parents.php:8
-#: templates/edit/row.inc:48 templates/edit/row.php:48
+#: templates/news/parents.php:8 templates/edit/row.php:54
msgid "Read"
msgstr "Preberi"
-#: lib/Forms/Search.php:36 templates/edit/header.inc:10
+#: templates/edit/header.inc:10 lib/Forms/Search.php:45
msgid "Reads"
msgstr "Branj"
-#: delete.php:26 delete.php:33 admin/categories/delete.php:18
-#: admin/categories/delete.php:24 admin/sources/delete.php:19
-#: admin/sources/delete.php:25
+#: delete_file.php:23 delete_file.php:41 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 "Odstrani"
-#: templates/edit/info.inc:92 templates/edit/info.php:97
+#: templates/edit/info.php:97
msgid "Renew"
msgstr "Obnovi"
-#: add.php:482
+#: add.php:118 add.php:120 add.php:577
msgid "Reset"
msgstr "Povrni"
-#: admin/categories/edit.php:34 admin/sources/edit.php:35
+#: admin/categories/edit.php:36 admin/sources/edit.php:35
msgid "Resize Image"
msgstr "Spremeni velikost slike"
-#: add.php:77
+#: add.php:120
msgid "Save"
msgstr "Shrani"
-#: lib/News.php:450 lib/Forms/Search.php:18 lib/Forms/Search.php:20
+#: lib/News.php:1122 lib/Forms/Search.php:22 lib/Forms/Search.php:24
msgid "Search"
msgstr "Najdi"
-#: lib/Forms/Search.php:22
+#: lib/Forms/Search.php:26
msgid "Search world"
msgstr "Iskana beseda"
-#: add.php:142 templates/edit/info.inc:13 templates/edit/info.php:13
+#: add.php:153 templates/edit/info.php:13
msgid "Secondary category"
msgstr "Pomožna kategorija"
+#: lib/Categories.php:478
+msgid "Select Category"
+msgstr "Izberite kategorijo"
+
#: lib/Block/jonah.php:35
msgid "Select a feed."
msgstr "Izberite vir."
-#: add.php:214
-msgid "Select files"
-msgstr "Izberi datoteke"
-
-#: add.php:195 templates/edit/info.inc:47 templates/edit/info.php:47
+#: add.php:247 templates/edit/info.php:47
msgid "Selling item"
msgstr "Prodajani artikel"
-#: templates/news/mail.inc:2 templates/news/mail.php:2
+#: templates/news/mail.php:2
msgid "Send by mail"
msgstr "Pošlji po emailu"
-#: lib/News.php:101
+#: lib/News.php:100
msgid "Services/Trackback is not installed."
msgstr "Services/Trackback ni nameščen."
msgid "Sort news by"
msgstr "Razvrsti novice po"
-#: add.php:143 lib/Forms/Search.php:39 templates/edit/info.inc:29
-#: templates/edit/info.php:29
+#: add.php:154 templates/edit/info.php:29 lib/Forms/Search.php:48
msgid "Sort order"
msgstr "Vrstni red"
-#: add.php:94 templates/edit/info.inc:37 templates/edit/info.php:37
+#: add.php:136 templates/edit/info.php:37 lib/Forms/Search.php:38
msgid "Source"
msgstr "Vir"
msgid "Source deleted."
msgstr "Vir je bil izbrisan."
-#: add.php:96 templates/edit/info.inc:41 templates/edit/info.php:41
+#: add.php:138 templates/edit/info.php:41
msgid "Source link"
msgstr "Izvirna novica"
-#: templates/news/info.inc:18 templates/news/info.php:18
+#: templates/news/info.php:18
msgid "Source media"
msgstr "Vir novice"
-#: templates/news/info.inc:13 templates/news/info.php:13
+#: templates/news/info.php:13
msgid "Source news"
msgstr "Izvirna novica"
msgid "Source was not deleted."
msgstr "Vir ni bil izbrisan."
-#: admin/tabs.php:26 lib/Block/sources.php:3 lib/Block/sources.php:21
+#: admin/tabs.php:24 lib/Block/sources.php:3 lib/Block/sources.php:21
msgid "Sources"
msgstr "Viri"
msgid "Sources Administration"
msgstr "Urejanje virov"
-#: add.php:170
+#: add.php:222
msgid "Sponsored"
msgstr "Komercialna"
-#: lib/Forms/Search.php:27 templates/edit/header.inc:6
+#: templates/edit/header.inc:6 lib/Forms/Search.php:31
msgid "Status"
msgstr "Status"
-#: lib/News.php:454
+#: lib/News.php:1126
msgid "Tag cloud"
msgstr "Tagi novic"
-#: add.php:110 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24
+#: add.php:145 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24
msgid "Tags"
msgstr "Tagi"
-#: templates/news/blog.inc:7 templates/news/blog.php:7
+#: templates/news/blog.php:7
msgid "Talkbacks to this article:"
msgstr "Talkback na to novico:"
msgid "There are no news to display."
msgstr "Ni novic za prikaz."
-#: lib/News.php:508
+#: lib/News.php:557
#, php-format
msgid "There requested news %s don't exist."
msgstr "Izbrana novica ne %s obstaja."
-#: news.php:34
+#: news.php:29
msgid "There requested version don't exist."
msgstr "Izbrana verzja ne obstaja."
-#: add.php:147 templates/news/threads.inc:6 templates/news/threads.php:6
+#: add.php:433
+msgid "There was an error creating gallery: "
+msgstr "Prišlo je do napake pri tvorjenju galerije: "
+
+#: add.php:449
+#, fuzzy
+msgid "There was an error with the uploaded image: "
+msgstr "Pršlo je do napake pri nalaganju slike: "
+
+#: add.php:158 templates/news/threads.php:6
#, php-format
msgid "Threads in %s"
msgstr "Debate v %s"
-#: add.php:107 lib/Forms/Search.php:34 templates/edit/header.inc:7
-#: config/prefs.php.dist:30
+#: add.php:143 templates/edit/header.inc:7 lib/Forms/Search.php:43
+#: lib/Block/my_comments.php:56 config/prefs.php.dist:30
msgid "Title"
msgstr "Naslov"
-#: templates/news/tools.inc:3 templates/news/tools.php:3
+#: templates/news/tools.php:3
msgid "Tools"
msgstr "Orodja"
-#: templates/news/blog.inc:22 templates/news/blog.php:22
+#: templates/news/blog.php:22
msgid "Trackback this blog on this site."
msgstr "Vpišite blog na to novico."
-#: lib/News.php:652
+#: lib/News.php:703
#, php-format
msgid "URL already trackbacked: %s"
msgstr "URL je bil že zapisan: %s"
-#: lib/Forms/Search.php:24 templates/edit/row.inc:42 templates/edit/row.php:42
+#: templates/edit/row.php:42 lib/Forms/Search.php:28
msgid "Unconfirmed"
msgstr "Nepotrjena"
-#: templates/edit/row.inc:27 templates/edit/row.php:27
+#: templates/edit/row.php:27
msgid "Unlock"
msgstr "Odkleni"
-#: lib/Forms/Search.php:43
+#: lib/Forms/Search.php:52
msgid "Unpublish"
msgstr "Odstrani ob"
-#: templates/edit/info.inc:17 templates/edit/info.php:17
+#: templates/edit/info.php:17
msgid "Unpublish date"
msgstr "Odstrani dne"
-#: add.php:481 templates/edit/info.inc:81 templates/edit/info.php:86
+#: add.php:118 add.php:576 templates/edit/info.php:86
msgid "Update"
msgstr "Ažuriraj"
-#: admin/sources/edit.php:33 templates/sources/index.php:7
+#: templates/sources/index.php:7 admin/sources/edit.php:33
msgid "Url"
msgstr "Url"
-#: templates/news/blog.inc:16 templates/news/blog.php:16
+#: templates/news/blog.php:16
msgid "Use the following link to trackback from your own site: "
msgstr "Uporabite sledeči naslov za trakback z vaše strani: "
-#: lib/Forms/Search.php:44 templates/reads/header.inc:6
-#: templates/edit/header.inc:9
+#: templates/reads/header.inc:6 templates/edit/header.inc:9
+#: lib/Forms/Search.php:53 lib/Block/my_comments.php:57
msgid "User"
msgstr "Uporabnik"
-#: templates/edit/info.inc:89 templates/edit/info.php:94
+#: templates/edit/info.php:94
msgid "View"
msgstr "Preglej"
msgid "View items"
msgstr "Preglej novice"
-#: templates/edit/info.inc:21 templates/edit/info.php:21
+#: templates/edit/info.php:21
msgid "Yes"
msgstr "Da"
msgid "You are not authorised for this action."
msgstr "Niste avtorizirani za ta ukaz."
-#: mail.php:47
+#: mail.php:42
msgid "You have no email set."
msgstr "Nimate nastavljenega email naslova."
-#: edit.php:24
+#: edit.php:18
msgid "You have not editor permission on any category."
msgstr "Nimate uredniških pravic do nobene kategorije."
-#: edit.php:67
+#: edit.php:60
msgid "activated"
msgstr "aktivirana"
-#: edit.php:59
+#: edit.php:52
msgid "deactivated"
msgstr "deaktivirana"
-#: delete.php:55
+#: delete.php:73
msgid "deleted"
msgstr "izbrisana"
-#: edit.php:75
+#: edit.php:68
msgid "locked"
msgstr "zaklenjena"
-#: delete.php:57
+#: delete.php:75
msgid "not deleted"
msgstr "ni zbrisana"
-#: edit.php:116
+#: edit.php:109
msgid "renewed"
msgstr "povrnjena"
-#: edit.php:83
+#: edit.php:76
msgid "unlocked"
msgstr "odklenjena"
-
/**
* Print news
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: print.php 803 2008-08-27 08:29:20Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: print.php 183 2008-01-06 17:39:50Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
$id = Util::getFormData('id');
$version = Util::getFormData('version', false);
/**
* News reads
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: reads.php 803 2008-08-27 08:29:20Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: reads.php 183 2008-01-06 17:39:50Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
if (!Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
<?php
/**
- * $Id: comments.php 183 2008-01-06 17:39:50Z duck $
+ * $Id: comments.php 1179 2009-01-20 13:19:34Z duck $
*
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2007 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.
require_once NEWS_BASE . '/lib/base.php';
$cache_key = 'news_rss_comments';
-//$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
+$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
if (!$rss) {
$list = News::getLastComments(50);
$title = _("Last comments");
-
$rss = '<?xml version="1.0" encoding="' . NLS::getCharset() . '" ?>
<rss version="2.0">
<channel>
/**
* $Id: index.php 183 2008-01-06 17:39:50Z duck $
*
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2007 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.
<?php
/**
- * $Id: news.php 183 2008-01-06 17:39:50Z duck $
+ * $Id: news.php 1191 2009-01-21 16:45:21Z duck $
*
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2007 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.
$categories = $news_cat->getCategories(false);
$title = sprintf(_("Last news"), $registry->get('name', 'horde'));
- $read_url = Horde::applicationUrl('news.php', true, -1);
$lastnewstime = 0;
foreach ($list as $news_id => $news) {
- $news_link = Util::addParameter($read_url, 'id', $news_id);
+ $news_link = News::getUrlFor('news', $news_id);
$rssbody .= '
<item>
+ <enclosure url="http://' . $_SERVER['SERVER_NAME'] . News::getImageUrl($news_id) . '" type="image/jpg" />
<title>' . htmlspecialchars($news['title']) . ' </title>
<dc:creator>' . htmlspecialchars($news['user']). '</dc:creator>
<link>' . $news_link . '</link>
$lastnewstime = strtotime($news['publish']);
}
}
-
+
// Wee need the last published news time
$rssheader = '<?xml version="1.0" encoding="' . NLS::getCharset() . '" ?>
<rss version="2.0"
<link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
<generator>' . htmlspecialchars($registry->get('name')) . '</generator>';
-
-
$rssfooter = '
</channel>
</rss>';
$cache->set($cache_key, $rss);
}
-
header('Content-type: text/xml; charset=utf-8');
echo $rss;
CREATE TABLE news (
id smallint(5) UNSIGNED NOT NULL auto_increment,
- sortorder tinyint(2) NOT NULL default '0',
- status tinyint(1) UNSIGNED NOT NULL default '0',
- view_count smallint(5) UNSIGNED NOT NULL default '0',
- publish datetime default NULL,
- unpublish datetime default NULL,
- submitted datetime NOT NULL default '0000-00-00 00:00:00',
- updated timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- user varchar(11) NOT NULL default '',
- editor varchar(11) NOT NULL default '',
- sourcelink varchar(34) NOT NULL default '',
- source varchar(11) default NULL,
- category1 smallint(5) UNSIGNED NOT NULL default '0',
- category2 smallint(5) UNSIGNED NOT NULL default '0',
- comments smallint(5) NOT NULL default '0',
- chars smallint(5) UNSIGNED NOT NULL default '0',
- attachments tinyint(1) UNSIGNED NOT NULL default '0',
- picture int(4) NOT NULL default '0',
- gallery int(10) UNSIGNED NOT NULL default '0',
- selling varchar(50) default NULL,
- trackbacks int(10) UNSIGNED NOT NULL default '0',
- form_id smallint(5) UNSIGNED NOT NULL default '0',
- form_ttl int(10) UNSIGNED NOT NULL default '0',
+ sortorder tinyint(2) NOT NULL DEFAULT '0',
+ status tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
+ view_count smallint(5) UNSIGNED NOT NULL DEFAULT '0',
+ publish datetime DEFAULT NULL,
+ unpublish datetime DEFAULT NULL,
+ submitted datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ user varchar(11) NOT NULL DEFAULT '',
+ editor varchar(11) NOT NULL DEFAULT '',
+ sourcelink varchar(34) NOT NULL DEFAULT '',
+ source varchar(11) DEFAULT NULL,
+ category1 smallint(5) UNSIGNED NOT NULL DEFAULT '0',
+ category2 smallint(5) UNSIGNED NOT NULL DEFAULT '0',
+ comments smallint(5) NOT NULL DEFAULT '0',
+ chars smallint(5) UNSIGNED NOT NULL DEFAULT '0',
+ attachments tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
+ picture int(4) NOT NULL DEFAULT '0',
+ gallery int(10) UNSIGNED NOT NULL DEFAULT '0',
+ selling varchar(50) DEFAULT NULL,
+ trackbacks int(10) UNSIGNED NOT NULL DEFAULT '0',
+ form_id smallint(5) UNSIGNED NOT NULL DEFAULT '0',
+ form_ttl int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (id),
KEY datum (publish),
KEY sortorder (sortorder),
- KEY STATUS (status),
+ KEY status (status),
+ KEY user (user),
KEY cat (category1)
);
-CREATE TABLE news_attachment (
- id int(10) UNSIGNED NOT NULL default '0',
- lang varchar(5) NOT NULL,
- filename varchar(85) NOT NULL default '',
- filesize int(10) UNSIGNED NOT NULL default '0',
- KEY news (id,lang)
+CREATE TABLE news_files (
+ file_id int(10) UNSIGNED NOT NULL DEFAULT '0',
+ news_id int(10) UNSIGNED NOT NULL DEFAULT '0',
+ news_lang varchar(5) NOT NULL,
+ file_name varchar(85) NOT NULL DEFAULT '',
+ file_size int(10) UNSIGNED NOT NULL DEFAULT '0',
+ file_type varchar(85) NOT NULL DEFAULT '',
+ PRIMARY KEY (file_id),
+ KEY news (news_id, news_lang)
);
CREATE TABLE news_body (
- id smallint(5) UNSIGNED NOT NULL default '0',
- lang varchar(5) NOT NULL default '0',
- title varchar(67) NOT NULL default '',
+ id smallint(5) UNSIGNED NOT NULL DEFAULT '0',
+ lang varchar(5) NOT NULL DEFAULT '0',
+ title varchar(67) NOT NULL DEFAULT '',
abbreviation text NOT NULL,
content text NOT NULL,
picture_comment varchar(255);
CREATE TABLE news_categories (
category_id int(10) UNSIGNED NOT NULL auto_increment,
category_name varchar(50) NOT NULL,
- category_description varchar(255) default NULL,
+ category_description varchar(255) DEFAULT NULL,
category_parentid int(10) UNSIGNED NOT NULL,
category_form varchar(50) NOT NULL,
category_image int(1) UNSIGNED NOT NULL,
);
CREATE TABLE news_user_reads (
- id int(10) UNSIGNED NOT NULL default '0',
- user varchar(85) NOT NULL default '',
- ip varchar(9) NOT NULL default '',
- readdate datetime NOT NULL default '0000-00-00 00:00:00',
+ id int(10) UNSIGNED NOT NULL DEFAULT '0',
+ user varchar(85) NOT NULL DEFAULT '',
+ ip varchar(9) NOT NULL DEFAULT '',
+ readdate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
KEY id (id)
);
CREATE TABLE news_versions (
- id int(10) UNSIGNED NOT NULL default '0',
- version float UNSIGNED NOT NULL default '0',
- created datetime NOT NULL default '0000-00-00 00:00:00',
- user_uid varchar(85) NOT NULL default '',
+ id int(10) UNSIGNED NOT NULL DEFAULT '0',
+ version float UNSIGNED NOT NULL DEFAULT '0',
+ created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ user_uid varchar(85) NOT NULL DEFAULT '',
content text NOT NULL,
PRIMARY KEY (id,version)
);
/**
* Search
*
- * Copyright 2006 Duck <duck@obala.net>
+ * $Id: search.php 889 2008-09-23 09:52:06Z 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 Obala d.o.o. (www.obala.si)
*
- * $Id: search.php 210 2008-01-10 12:41:43Z duck $
- *
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
* @package News
*/
-
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
require_once NEWS_BASE . '/lib/Forms/Search.php';
// Default vars
$title = _("Browse");
$page = Util::getGet('news_page', 0);
$per_page = $prefs->getValue('per_page');
-$news_url = Horde::applicationUrl('news.php');
$browse_url = Horde::applicationUrl('browse.php');
$cid = Util::getGet('cid');
// If we have only one row redirect ot it
if ($count == 1 && sizeof($cats) < 2 && $page < 1) {
- header('Location: '. Util::addParameter($news_url, 'id', $rows[0]['id'], false));
+ header('Location: '. News::getUrlFor('news', $rows[0]['id']));
exit;
}
}
require_once $browse_template_path . '/footer.inc';
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+require_once $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
<?php foreach ($this->news as $news_id => $news) { ?>
<p>
<?php
+echo Horde::link(News::getUrlFor('news', $news['id']), $news['title']);
if ($news['picture']) {
echo Horde::img(News::getImageUrl($news['id']), $news['title'], 'style="float: left; padding-right: 3px;"','');
}
-echo Horde::link(Util::addParameter($this->news_url, 'id', $news['id']), $news['title']);
echo '<strong>' . $news['title'] . '</a></strong> - ' . $news['abbreviation'] . '... (' . $news['comments'] . ')<br /> ';
?>
</p>
<?php else: ?>
<p><?php echo _("There are no news to display.") ?></p>
-<?php endif; ?>
+<?php endif; ?>
\ No newline at end of file
<td>
<?php
echo strftime($GLOBALS['prefs']->getValue('date_format'), strtotime($news['publish'])) . ' - ';
-echo Horde::link(Util::addParameter($this->news_url, 'id', $news['id']), $news['abbreviation']);
+echo Horde::link(News::getUrlFor('news', $news['id']), $news['abbreviation']);
echo $news['title'] . '</a>';
?>
</td>
-<div class="header"><?php echo $title ?> (<?php echo $count ?>)</div>
+<div class="header"><?php echo $title ?> (<?php echo number_format($count) ?>)</div>
<?php echo $pager->render(); ?>
<p style="clear: both;">
<img src="<?php echo News::getImageUrl($row['id'], 'small'); ?>" style="float: left; margin: 5px;" />
<strong>
-<?php echo Horde::link(Util::addParameter($news_url, 'id', $row['id']), $row['title']) . $row['title'] . '</a>'; ?>
+<?php echo Horde::link(News::getUrlFor('news', $row['id']), $row['title']) . $row['title'] . '</a>'; ?>
</strong> - <?php echo News::dateFormat($row['publish'], false) ?>
<br />
<?php echo $row['abbreviation'] ?> ...<br />
<tr>
<td><?php foreach ($category['actions'] as $action ) { echo $action . ' '; } ?></td>
<td><?php echo $category_id ?></td>
-<td><?php echo $category['category_name'] ?></td>
+<td><a href="<?php echo News::getUrlFor('category', $category_id) ?>" target="_blank"><?php echo $category['category_name'] ?></a></td>
<td>
-<?php
+<?php
if ($category['category_parentid']) {
echo $this->categories[$category['category_parentid']]['category_name'] .
' - ' . $category['category_parentid'];
<tr valign="top">
<td colspan="7">
-<img src="<?php echo News::getImageUrl($id, 'small'); ?>" style="float: right; height: 50px; width: 50px;" />
<table style="width: 100%;">
<tr valign="top">
<td>
+<img src="<?php echo News::getImageUrl($id, 'small'); ?>" style="height: 50px; width: 50px;" />
+</td>
+<td>
<?php
echo _("Primary category") . ': ' . $allowed_cats[$row['category1']] . "<br />\n";
// Form
if (!empty($row['form'])) {
- //
+ //
}
if ($row['attachments']) {
- echo News::format_attached($id);
+ echo $news->format_attached($id);
}
?>
switch ($version['action']) {
case 'update':
echo _("Update");
+ break;
default:
echo _("Insert");
break;
<?php
switch ($row['status']) {
+case News::UNCONFIRMED:
+ echo _("Unconfirmed");
+ break;
-case News::UNCONFIRMED: echo _("Unconfirmed"); break;
-case News::CONFIRMED: echo _("Confirmed"); break;
-case News::LOCKED: echo _("Locked"); break;
+case News::CONFIRMED:
+ echo _("Confirmed");
+ break;
+case News::LOCKED:
+ echo _("Locked");
+ break;
}
?></td>
-<td><?php echo Horde::link(Util::addParameter($news_url, 'id', $row['id']), _("Read"), '', '_blank') . $row['title']; ?></a></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 $row['user'] ?></td>
<td>
<?php
if ($row['attachments']) {
- echo '<br /> <br />' . News::format_attached($id);
+ echo '<br /> <br />' . $news->format_attached($id);
}
echo Horde::link($blog_url) . '<strong>' . _("Trackback this blog on this site.") . '</strong></a><br/>';
}
-$read_url = Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $id);
+$read_url = News::getUrlFor('news', $id);
?>
<!--
<?php
if ($row['picture']) {
- echo '<div id="news_picture"><img src="' . News::getImageUrl($id, 'big') . '" /><br />';
- echo $row['picture_comment'] . '</div>';
+ echo '<div id="news_picture">'
+ . '<a href="' . News::getImageUrl($id, 'full') . '" title="' . _("Click for full picture") . '" target="_blank">'
+ . '<img src="' . News::getImageUrl($id, 'big') . '" /></a><br />'
+ . $row['picture_comment']
+ . '</div>';
}
$plain_text = trim(strip_tags($row['content']));
echo _("Parents") . ':<ul>';
foreach ($row['parents'] as $parent_id => $data) {
echo '<li>' . $news->dateFormat($data['publish']) . ' '
- . Horde::link(Util::addParameter($news_url, 'id', $parent_id), _("Read"))
+ . Horde::link(News::getUrlFor('news', $parent_id), _("Read"))
. $data['title'] . '</a> (' . ($data['comments']> -1 ? $data['comments'] : 0) . ')';
}
echo '</ul>';
$img = Horde::img('mime/pdf.png', '', '', $registry->getImageDir('horde'));
echo $img . ' ' . Horde::link(Util::addParameter(Horde::applicationUrl('pdf.php'), 'id', $id)) . _("PDF") . '</a><br />';
-if ($registry->hasInterface('bookmarks')) {
+/* Bookmark link */
+if ($registry->hasMethod('bookmarks/getAddUrl')) {
+ $api_params = array(
+ 'url' => News::getUrlFor('news', $id, true),
+ 'title' => $row['title']);
+ $url = $registry->call('bookmarks/getAddUrl', array($api_params));
$img = Horde::img('trean.png', '', '', $registry->getImageDir('trean'));
- $url = $registry->get('webroot', 'trean') . '/add.php';
- $url = Util::addParameter($url, array('url' => Util::addParameter($news_url, 'id', $id),
- 'title' => $row['title']));
echo $img . ' ' . Horde::link($url) . _("Add to bookmarks.") . '</a><br />';
}
$img = Horde::img('mnemo.png', '', '', $registry->getImageDir('mnemo'));
$url = Util::addParameter(Horde::applicationUrl('note.php', true), 'id', $id);
echo $img . ' ' . Horde::link($url) . _("Add to notes.") . '</a><br />';
-}
-
+}
\ No newline at end of file
<tr>
<td><?php foreach ($source['actions'] as $action ) { echo $action . ' '; } ?></td>
<td><?php echo $source_id ?></td>
-<td><?php echo $source['source_name'] ?></td>
+<td><a href="<?php echo News::getUrlFor('source', $source_id) ?>" target="_blank"><?php echo $source['source_name'] ?></a></td>
<td><?php echo $source['source_url'] ?></td>
</tr>
<?php } ?>
<?php
/**
- * $Id: trackback.php 183 2008-01-06 17:39:50Z duck $
+ * $Id: trackback.php 803 2008-08-27 08:29:20Z duck $
*
- * Copyright 2007-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.
+ * Copyright Obala d.o.o. (www.obala.si)
*
- * @author Duck <duck@obala.net>
+ * @author Duck <duck@obala.net>
+ * @package News
*/
define('AUTH_HANDLER', true);
-define('NEWS_BASE', dirname(__FILE__));
-require_once NEWS_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
if ($browser->isRobot()) {
exit;