|
From: <be...@us...> - 2013-09-26 15:56:41
|
Revision: 12097
http://sourceforge.net/p/xoops/svn/12097
Author: beckmi
Date: 2013-09-26 15:56:34 +0000 (Thu, 26 Sep 2013)
Log Message:
-----------
Updating to News 1.70 RC2
Modified Paths:
--------------
XoopsModules/news/trunk/news/admin/about.php
XoopsModules/news/trunk/news/admin/admin_footer.php
XoopsModules/news/trunk/news/admin/admin_header.php
XoopsModules/news/trunk/news/admin/amsimport.php
XoopsModules/news/trunk/news/admin/functions.php
XoopsModules/news/trunk/news/admin/groupperms.php
XoopsModules/news/trunk/news/admin/index.php
XoopsModules/news/trunk/news/admin/menu.php
XoopsModules/news/trunk/news/admin/upgrade.php
XoopsModules/news/trunk/news/archive.php
XoopsModules/news/trunk/news/article.php
XoopsModules/news/trunk/news/backendt.php
XoopsModules/news/trunk/news/blocks/news_archives.php
XoopsModules/news/trunk/news/blocks/news_bigstory.php
XoopsModules/news/trunk/news/blocks/news_block_tag.php
XoopsModules/news/trunk/news/blocks/news_moderate.php
XoopsModules/news/trunk/news/blocks/news_randomnews.php
XoopsModules/news/trunk/news/blocks/news_top.php
XoopsModules/news/trunk/news/blocks/news_topics.php
XoopsModules/news/trunk/news/blocks/news_topicsnav.php
XoopsModules/news/trunk/news/class/blacklist.php
XoopsModules/news/trunk/news/class/class.mimetype.php
XoopsModules/news/trunk/news/class/class.newsstory.php
XoopsModules/news/trunk/news/class/class.newstopic.php
XoopsModules/news/trunk/news/class/class.sfiles.php
XoopsModules/news/trunk/news/class/keyhighlighter.class.php
XoopsModules/news/trunk/news/class/news_stories.php
XoopsModules/news/trunk/news/class/news_topics.php
XoopsModules/news/trunk/news/class/registryfile.php
XoopsModules/news/trunk/news/class/tree.php
XoopsModules/news/trunk/news/class/wideimage/Canvas.class.php
XoopsModules/news/trunk/news/class/wideimage/Dimension.class.php
XoopsModules/news/trunk/news/class/wideimage/Exception.class.php
XoopsModules/news/trunk/news/class/wideimage/FileMapperFactory.class.php
XoopsModules/news/trunk/news/class/wideimage/Image.class.php
XoopsModules/news/trunk/news/class/wideimage/OpFactory.class.php
XoopsModules/news/trunk/news/class/wideimage/PaletteImage.class.php
XoopsModules/news/trunk/news/class/wideimage/TrueColorImage.class.php
XoopsModules/news/trunk/news/class/wideimage/WideImage.inc.php
XoopsModules/news/trunk/news/class/wideimage/fonts/Font_GDF.class.php
XoopsModules/news/trunk/news/class/wideimage/fonts/Font_TTF.class.php
XoopsModules/news/trunk/news/class/wideimage/mappers/ImageFileMapper_GD.class.php
XoopsModules/news/trunk/news/class/wideimage/mappers/ImageFileMapper_GD2.class.php
XoopsModules/news/trunk/news/class/wideimage/mappers/ImageFileMapper_GIF.class.php
XoopsModules/news/trunk/news/class/wideimage/mappers/ImageFileMapper_JPEG.class.php
XoopsModules/news/trunk/news/class/wideimage/mappers/ImageFileMapper_PNG.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/ApplyConvolution.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/ApplyFilter.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/ApplyMask.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/AsGrayscale.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/CopyChannelsPalette.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/CopyChannelsTrueColor.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/CorrectGamma.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Crop.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Flip.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/GetMask.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Merge.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Mirror.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Resize.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Rotate.class.php
XoopsModules/news/trunk/news/class/wideimage/operations/Unsharp.class.php
XoopsModules/news/trunk/news/class/xoopsstory.php
XoopsModules/news/trunk/news/class/xoopstopic.php
XoopsModules/news/trunk/news/class/xoopstree.php
XoopsModules/news/trunk/news/comment_delete.php
XoopsModules/news/trunk/news/comment_edit.php
XoopsModules/news/trunk/news/comment_new.php
XoopsModules/news/trunk/news/comment_post.php
XoopsModules/news/trunk/news/comment_reply.php
XoopsModules/news/trunk/news/config.php
XoopsModules/news/trunk/news/docs/changelog.txt
XoopsModules/news/trunk/news/header.php
XoopsModules/news/trunk/news/include/comment_functions.php
XoopsModules/news/trunk/news/include/functions.php
XoopsModules/news/trunk/news/include/install_function.php
XoopsModules/news/trunk/news/include/notification.inc.php
XoopsModules/news/trunk/news/include/pagenav.php
XoopsModules/news/trunk/news/include/search.inc.php
XoopsModules/news/trunk/news/include/storyform.inc.php
XoopsModules/news/trunk/news/include/storyform.original.php
XoopsModules/news/trunk/news/include/update_function.php
XoopsModules/news/trunk/news/index.php
XoopsModules/news/trunk/news/list.tag.php
XoopsModules/news/trunk/news/makepdf.php
XoopsModules/news/trunk/news/micro_summary.php
XoopsModules/news/trunk/news/newsbythisauthor.php
XoopsModules/news/trunk/news/notification_update.php
XoopsModules/news/trunk/news/print.php
XoopsModules/news/trunk/news/ratenews.php
XoopsModules/news/trunk/news/submit.php
XoopsModules/news/trunk/news/templates/blocks/news_block_randomnews.html
XoopsModules/news/trunk/news/templates/blocks/news_block_top.html
XoopsModules/news/trunk/news/topics_directory.php
XoopsModules/news/trunk/news/view.tag.php
XoopsModules/news/trunk/news/visit.php
XoopsModules/news/trunk/news/whoswho.php
XoopsModules/news/trunk/news/xoops_version.php
Added Paths:
-----------
XoopsModules/news/trunk/news/include/plugin.tag.php
Removed Paths:
-------------
XoopsModules/news/trunk/news/extra/modules/tag/plugin/news.php
Modified: XoopsModules/news/trunk/news/admin/about.php
===================================================================
--- XoopsModules/news/trunk/news/admin/about.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/about.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -19,10 +19,10 @@
include_once dirname(__FILE__) . '/admin_header.php';
xoops_cp_header();
-
+
$aboutAdmin = new ModuleAdmin();
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include 'admin_footer.php';
Modified: XoopsModules/news/trunk/news/admin/admin_footer.php
===================================================================
--- XoopsModules/news/trunk/news/admin/admin_footer.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/admin_footer.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -1,24 +1,24 @@
-<?php
-/**
- * News module
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
- * @package News
- * @since 1.6.7
- * @author Mamba (www.xoops.org)
- * @version $Id $
-**/
-
-echo"<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n"
- . " <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
- . " </div>\n" . " " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . "</div>";
-
-xoops_cp_footer();
\ No newline at end of file
+<?php
+/**
+ * News module
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
+ * @package News
+ * @since 1.6.7
+ * @author Mamba (www.xoops.org)
+ * @version $Id $
+**/
+
+echo"<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n"
+ . " <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
+ . " </div>\n" . " " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . "</div>";
+
+xoops_cp_footer();
Modified: XoopsModules/news/trunk/news/admin/admin_header.php
===================================================================
--- XoopsModules/news/trunk/news/admin/admin_header.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/admin_header.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -45,7 +45,6 @@
redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, FALSE);
}
-
$topicsHandler=& xoops_getModuleHandler('news_topics','news');
$storiesHandler=& xoops_getModuleHandler('news_stories','news');
@@ -63,8 +62,8 @@
}
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
- include_once(XOOPS_ROOT_PATH."/class/template.php");
- $xoopsTpl = new XoopsTpl();
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ $xoopsTpl = new XoopsTpl();
}
-$xoopsTpl->assign('pathIcon16', $pathIcon16);
\ No newline at end of file
+$xoopsTpl->assign('pathIcon16', $pathIcon16);
Modified: XoopsModules/news/trunk/news/admin/amsimport.php
===================================================================
--- XoopsModules/news/trunk/news/admin/amsimport.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/amsimport.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -44,210 +44,209 @@
include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
- if(!isset($_POST['go']) ) {
- echo '<h1>Welcome to the AMS 2.41 import script</h1>';
- echo '<br /><br />Select the import options you wan to use :';
- echo "<form method='post' action='amsimport.php'>";
- echo "<br /><input type='checkbox' name='useforum' value='1' /> Import forums links inside news (at the bottom of the news)";
- echo "<br /><input type='checkbox' name='useextlinks' value='1' /> Import external links inside news (at the bottom of the news)";
- echo "<br /><br /><input type='submit' name='go' value='Import' />";
- echo '</form>';
- echo "<br /><br />If you check the two last options then the forum's link and all the external links will be added at the end of the body text.";
- } else {
- // Launch the import
- if (file_exists(XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/main.php')) {
- include_once XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/main.php';
- } else {
- include_once XOOPS_ROOT_PATH.'/modules/AMS/language/english/main.php';
- }
- if (file_exists(XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/admin.php')) {
- include_once XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/admin.php';
- } else {
- include_once XOOPS_ROOT_PATH.'/modules/AMS/language/english/admin.php';
- }
- $db =& XoopsDatabaseFactory::getDatabaseConnection();
- // User's choices
- $use_forum = (isset($_POST['useforum']) && $_POST['useforum']==1) ? 1 : 0;
- $use_extlinks = (isset($_POST['useextlinks']) && $_POST['useextlinks']==1) ? 1 : 0;
- // Retreive News module's ID
- $module_handler =& xoops_gethandler('module');
- $newsModule =& $module_handler->getByDirname('news');
- $news_mid = $newsModule->getVar('mid');
- // Retreive AMS module's ID
- $AmsModule =& $module_handler->getByDirname('AMS');
- $ams_mid = $AmsModule->getVar('mid');
+ if (!isset($_POST['go']) ) {
+ echo '<h1>Welcome to the AMS 2.41 import script</h1>';
+ echo '<br /><br />Select the import options you wan to use :';
+ echo "<form method='post' action='amsimport.php'>";
+ echo "<br /><input type='checkbox' name='useforum' value='1' /> Import forums links inside news (at the bottom of the news)";
+ echo "<br /><input type='checkbox' name='useextlinks' value='1' /> Import external links inside news (at the bottom of the news)";
+ echo "<br /><br /><input type='submit' name='go' value='Import' />";
+ echo '</form>';
+ echo "<br /><br />If you check the two last options then the forum's link and all the external links will be added at the end of the body text.";
+ } else {
+ // Launch the import
+ if (file_exists(XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/main.php')) {
+ include_once XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/main.php';
+ } else {
+ include_once XOOPS_ROOT_PATH.'/modules/AMS/language/english/main.php';
+ }
+ if (file_exists(XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/admin.php')) {
+ include_once XOOPS_ROOT_PATH.'/modules/AMS/language/'.$xoopsConfig['language'].'/admin.php';
+ } else {
+ include_once XOOPS_ROOT_PATH.'/modules/AMS/language/english/admin.php';
+ }
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
+ // User's choices
+ $use_forum = (isset($_POST['useforum']) && $_POST['useforum']==1) ? 1 : 0;
+ $use_extlinks = (isset($_POST['useextlinks']) && $_POST['useextlinks']==1) ? 1 : 0;
+ // Retreive News module's ID
+ $module_handler =& xoops_gethandler('module');
+ $newsModule =& $module_handler->getByDirname('news');
+ $news_mid = $newsModule->getVar('mid');
+ // Retreive AMS module's ID
+ $AmsModule =& $module_handler->getByDirname('AMS');
+ $ams_mid = $AmsModule->getVar('mid');
- // Retreive AMS tables names
- $ams_topics = $xoopsDB->prefix('ams_topics');
- $ams_articles = $xoopsDB->prefix('ams_article');
- $ams_text = $xoopsDB->prefix('ams_text');
- $ams_files = $xoopsDB->prefix('ams_files');
- $ams_links = $xoopsDB->prefix('ams_link');
- $ams_rating = $xoopsDB->prefix('ams_rating');
- // Retreive News tables names
- $news_stories_votedata = $xoopsDB->prefix('mod_news_stories_votedata');
- // Misc
- $comment_handler =& xoops_gethandler('comment');
- $notification_handler =& xoops_gethandler('notification');
- $ams_news_topics=array(); // Key => AMS Id, Value => News ID
+ // Retreive AMS tables names
+ $ams_topics = $xoopsDB->prefix('ams_topics');
+ $ams_articles = $xoopsDB->prefix('ams_article');
+ $ams_text = $xoopsDB->prefix('ams_text');
+ $ams_files = $xoopsDB->prefix('ams_files');
+ $ams_links = $xoopsDB->prefix('ams_link');
+ $ams_rating = $xoopsDB->prefix('ams_rating');
+ // Retreive News tables names
+ $news_stories_votedata = $xoopsDB->prefix('mod_news_stories_votedata');
+ // Misc
+ $comment_handler =& xoops_gethandler('comment');
+ $notification_handler =& xoops_gethandler('notification');
+ $ams_news_topics=array(); // Key => AMS Id, Value => News ID
// The import by itself
// Read topics by their order
$mytree = new XoopsTree($ams_topics,'topic_id','topic_pid');
$ams_topics = $mytree->getChildTreeArray(0,'weight');
- foreach($ams_topics as $one_amstopic) {
- // First we create the topic
- $topicpid=0;
- if($one_amstopic['topic_pid']!=0) { // Search for its the parent
- if(array_key_exists($one_amstopic['topic_pid'],$ams_news_topics)) {
- $topicpid=$ams_news_topics[$one_amstopic['topic_pid']];
- }
- }
- $news_topic = new NewsTopic();
- $news_topic->setTopicPid($topicpid);
- $news_topic->setTopicTitle($one_amstopic['topic_title']);
- $news_topic->setTopicImgurl($one_amstopic['topic_imgurl']);
- $news_topic->setMenu(0);
- $news_topic->setTopicFrontpage(1);
- $news_topic->Settopic_rssurl('');
- $news_topic->setTopicDescription('');
- $news_topic->setTopic_color('000000');
- $news_topic->store();
- echo '<br>- The following topic was imported : '.$news_topic->topic_title();
- $ams_topicid = $one_amstopic['topic_id'];
- $news_topicid = $news_topic->topic_id();
- $ams_news_topics[$ams_topicid] = $news_topicid;
+ foreach ($ams_topics as $one_amstopic) {
+ // First we create the topic
+ $topicpid=0;
+ if ($one_amstopic['topic_pid']!=0) { // Search for its the parent
+ if (array_key_exists($one_amstopic['topic_pid'],$ams_news_topics)) {
+ $topicpid=$ams_news_topics[$one_amstopic['topic_pid']];
+ }
+ }
+ $news_topic = new NewsTopic();
+ $news_topic->setTopicPid($topicpid);
+ $news_topic->setTopicTitle($one_amstopic['topic_title']);
+ $news_topic->setTopicImgurl($one_amstopic['topic_imgurl']);
+ $news_topic->setMenu(0);
+ $news_topic->setTopicFrontpage(1);
+ $news_topic->Settopic_rssurl('');
+ $news_topic->setTopicDescription('');
+ $news_topic->setTopic_color('000000');
+ $news_topic->store();
+ echo '<br>- The following topic was imported : '.$news_topic->topic_title();
+ $ams_topicid = $one_amstopic['topic_id'];
+ $news_topicid = $news_topic->topic_id();
+ $ams_news_topics[$ams_topicid] = $news_topicid;
- // Then we insert all its articles
- $result = $db->query('SELECT * FROM '.$ams_articles.' WHERE topicid='.$ams_topicid.' ORDER BY created');
- while ( $article = $db->fetchArray($result) ) {
- $ams_newsid = $article['storyid'];
+ // Then we insert all its articles
+ $result = $db->query('SELECT * FROM '.$ams_articles.' WHERE topicid='.$ams_topicid.' ORDER BY created');
+ while ( $article = $db->fetchArray($result) ) {
+ $ams_newsid = $article['storyid'];
- // We search for the last version
- $result2 = $db->query('SELECT * FROM '.$ams_text.' WHERE storyid='.$ams_newsid.' AND current=1');
- $text_lastversion = $db->fetchArray($result2);
+ // We search for the last version
+ $result2 = $db->query('SELECT * FROM '.$ams_text.' WHERE storyid='.$ams_newsid.' AND current=1');
+ $text_lastversion = $db->fetchArray($result2);
- // We search for the number of votes
- $result3 = $db->query('SELECT count(*) as cpt FROM '.$ams_rating.' WHERE storyid='.$ams_newsid);
- $votes = $db->fetchArray($result3);
+ // We search for the number of votes
+ $result3 = $db->query('SELECT count(*) as cpt FROM '.$ams_rating.' WHERE storyid='.$ams_newsid);
+ $votes = $db->fetchArray($result3);
- // The links
- $links='';
- if($use_extlinks) {
- $result7 = $db->query('SELECT * FROM '.$ams_links.' WHERE storyid='.$ams_newsid.' ORDER BY linkid');
- while ( $link = $db->fetchArray($result7) ) {
- if(trim($links)=='') {
- $links="\n\n"._AMS_NW_RELATEDARTICLES."\n\n";
- }
- $links .= _AMS_NW_EXTERNALLINK.' [url='.$link['link_link'].']'.$link['link_title'].'[/url]'."\n";
- }
- }
+ // The links
+ $links='';
+ if ($use_extlinks) {
+ $result7 = $db->query('SELECT * FROM '.$ams_links.' WHERE storyid='.$ams_newsid.' ORDER BY linkid');
+ while ( $link = $db->fetchArray($result7) ) {
+ if (trim($links)=='') {
+ $links="\n\n"._AMS_NW_RELATEDARTICLES."\n\n";
+ }
+ $links .= _AMS_NW_EXTERNALLINK.' [url='.$link['link_link'].']'.$link['link_title'].'[/url]'."\n";
+ }
+ }
- // The forum
- $forum='';
- if($use_forum && $one_amstopic['forum_id']!=0) {
- $forum = "\n\n".'[url='.XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$one_amstopic['forum_id'].']'._AMS_AM_LINKEDFORUM.'[/url]'."\n";
- }
+ // The forum
+ $forum='';
+ if ($use_forum && $one_amstopic['forum_id']!=0) {
+ $forum = "\n\n".'[url='.XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$one_amstopic['forum_id'].']'._AMS_AM_LINKEDFORUM.'[/url]'."\n";
+ }
- // We create the story
- $news = new NewsStory();
- $news->setUid($text_lastversion['uid']);
- $news->setTitle($article['title']);
- $news->created=$article['created'];
- $news->setPublished($article['published']);
- $news->setExpired($article['expired']);
- $news->setHostname($article['hostname']);
- $news->setNohtml($article['nohtml']);
- $news->setNosmiley($article['nosmiley']);
- $news->setHometext($text_lastversion['hometext']);
- $news->setBodytext($text_lastversion['bodytext'].$links.$forum);
- $news->setKeywords('');
- $news->setDescription('');
- $news->counter=$article['counter'];
- $news->setTopicId($news_topicid);
- $news->setIhome($article['ihome']);
- $news->setNotifyPub($article['notifypub']);
- $news->story_type=$article['story_type'];
- $news->setTopicdisplay($article['topicdisplay']);
- $news->setTopicalign($article['topicalign']);
- $news->setComments($article['comments']);
- $news->rating=$article['rating'];
- $news->votes=$votes['cpt'];
- $approved = $article['published']>0 ? true : false;
- $news->approved=$approved;
- $news->store($approved);
- echo '<br> This story was imported : '.$news->title();
- $news_newsid=$news->storyid(); // ********************
+ // We create the story
+ $news = new NewsStory();
+ $news->setUid($text_lastversion['uid']);
+ $news->setTitle($article['title']);
+ $news->created=$article['created'];
+ $news->setPublished($article['published']);
+ $news->setExpired($article['expired']);
+ $news->setHostname($article['hostname']);
+ $news->setNohtml($article['nohtml']);
+ $news->setNosmiley($article['nosmiley']);
+ $news->setHometext($text_lastversion['hometext']);
+ $news->setBodytext($text_lastversion['bodytext'].$links.$forum);
+ $news->setKeywords('');
+ $news->setDescription('');
+ $news->counter=$article['counter'];
+ $news->setTopicId($news_topicid);
+ $news->setIhome($article['ihome']);
+ $news->setNotifyPub($article['notifypub']);
+ $news->story_type=$article['story_type'];
+ $news->setTopicdisplay($article['topicdisplay']);
+ $news->setTopicalign($article['topicalign']);
+ $news->setComments($article['comments']);
+ $news->rating=$article['rating'];
+ $news->votes=$votes['cpt'];
+ $approved = $article['published']>0 ? true : false;
+ $news->approved=$approved;
+ $news->store($approved);
+ echo '<br> This story was imported : '.$news->title();
+ $news_newsid=$news->storyid(); // ********************
- // The files
- $result4 = $db->query('SELECT * FROM '.$ams_files.' WHERE storyid='.$ams_newsid);
- while ( $file = $db->fetchArray($result4) ) {
- $sfile = new sFiles();
- $sfile->setFileRealName($file['filerealname']);
- $sfile->setStoryid($news_newsid);
- $sfile->date=$file['date'];
- $sfile->setMimetype($file['mimetype']);
- $sfile->setDownloadname($file['downloadname']);
- $sfile->counter=$file['counter'];
- $sfile->store();
- echo '<br> This file was imported : '.$sfile->getDownloadname();
- $news_fileid=$sfile->fileid;
- }
+ // The files
+ $result4 = $db->query('SELECT * FROM '.$ams_files.' WHERE storyid='.$ams_newsid);
+ while ( $file = $db->fetchArray($result4) ) {
+ $sfile = new sFiles();
+ $sfile->setFileRealName($file['filerealname']);
+ $sfile->setStoryid($news_newsid);
+ $sfile->date=$file['date'];
+ $sfile->setMimetype($file['mimetype']);
+ $sfile->setDownloadname($file['downloadname']);
+ $sfile->counter=$file['counter'];
+ $sfile->store();
+ echo '<br> This file was imported : '.$sfile->getDownloadname();
+ $news_fileid=$sfile->fileid;
+ }
- // The ratings
- $result5 = $db->query('SELECT * FROM '.$ams_rating.' WHERE storyid='.$ams_newsid);
- while ( $ratings = $db->fetchArray($result5) ) {
- $result6 = $db->queryF('INSERT INTO '.$news_stories_votedata." (storyid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (".$news_newsid.','.$ratings['ratinguser'].','.$ratings['rating'].','.$ratings['ratinghostname'].','.$ratings['ratingtimestamp'].')');
- }
+ // The ratings
+ $result5 = $db->query('SELECT * FROM '.$ams_rating.' WHERE storyid='.$ams_newsid);
+ while ( $ratings = $db->fetchArray($result5) ) {
+ $result6 = $db->queryF('INSERT INTO '.$news_stories_votedata." (storyid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (".$news_newsid.','.$ratings['ratinguser'].','.$ratings['rating'].','.$ratings['ratinghostname'].','.$ratings['ratingtimestamp'].')');
+ }
- // The comments
- $comments =& $comment_handler->getByItemId($ams_mid, $ams_newsid, 'ASC');
- if(is_array($comments) && count($comments)>0) {
- foreach($comments as $onecomment) {
- $onecomment->setNew();
- $onecomment->setVar('com_modid',$news_mid);
- $onecomment->setVar('com_itemid',$news_newsid);
- $comment_handler->insert($onecomment);
- }
- }
- unset($comments);
+ // The comments
+ $comments =& $comment_handler->getByItemId($ams_mid, $ams_newsid, 'ASC');
+ if (is_array($comments) && count($comments)>0) {
+ foreach ($comments as $onecomment) {
+ $onecomment->setNew();
+ $onecomment->setVar('com_modid',$news_mid);
+ $onecomment->setVar('com_itemid',$news_newsid);
+ $comment_handler->insert($onecomment);
+ }
+ }
+ unset($comments);
- // The notifications of this news
- //$notifications =& $notification_handler->getByItemId($ams_mid, $ams_newsid, 'ASC');
- $criteria = new CriteriaCompo(new Criteria('not_modid', $ams_mid));
- $criteria->add(new Criteria('not_itemid', $ams_newsid));
- $criteria->setOrder('ASC');
- $notifications = $notification_handler->getObjects($criteria);
- if(is_array($notifications) && count($notifications)>0) {
- foreach($notifications as $onenotification) {
- $onenotification->setNew();
- $onenotification->setVar('not_modid',$news_mid);
- $onenotification->setVar('not_itemid',$news_newsid);
- $notification_handler->insert($onenotification);
- }
- }
- unset($notifications);
- }
- }
- // Finally, import all the globals notifications
- $criteria = new CriteriaCompo(new Criteria('not_modid', $ams_mid));
- $criteria->add(new Criteria('not_category', 'global'));
- $criteria->setOrder('ASC');
- $notifications = $notification_handler->getObjects($criteria);
- if(is_array($notifications) && count($notifications)>0) {
- foreach($notifications as $onenotification) {
- $onenotification->setNew();
- $onenotification->setVar('not_modid',$news_mid);
- $onenotification->setVar('not_itemid',$news_newsid);
- $notification_handler->insert($onenotification);
- }
- }
- unset($notifications);
- echo "<p><a href='".XOOPS_URL."/modules/news/admin/groupperms.php'>The import is finished, don't forget to verify and set the topics permissions !</a></p>";
- }
+ // The notifications of this news
+ //$notifications =& $notification_handler->getByItemId($ams_mid, $ams_newsid, 'ASC');
+ $criteria = new CriteriaCompo(new Criteria('not_modid', $ams_mid));
+ $criteria->add(new Criteria('not_itemid', $ams_newsid));
+ $criteria->setOrder('ASC');
+ $notifications = $notification_handler->getObjects($criteria);
+ if (is_array($notifications) && count($notifications)>0) {
+ foreach ($notifications as $onenotification) {
+ $onenotification->setNew();
+ $onenotification->setVar('not_modid',$news_mid);
+ $onenotification->setVar('not_itemid',$news_newsid);
+ $notification_handler->insert($onenotification);
+ }
+ }
+ unset($notifications);
+ }
+ }
+ // Finally, import all the globals notifications
+ $criteria = new CriteriaCompo(new Criteria('not_modid', $ams_mid));
+ $criteria->add(new Criteria('not_category', 'global'));
+ $criteria->setOrder('ASC');
+ $notifications = $notification_handler->getObjects($criteria);
+ if (is_array($notifications) && count($notifications)>0) {
+ foreach ($notifications as $onenotification) {
+ $onenotification->setNew();
+ $onenotification->setVar('not_modid',$news_mid);
+ $onenotification->setVar('not_itemid',$news_newsid);
+ $notification_handler->insert($onenotification);
+ }
+ }
+ unset($notifications);
+ echo "<p><a href='".XOOPS_URL."/modules/news/admin/groupperms.php'>The import is finished, don't forget to verify and set the topics permissions !</a></p>";
+ }
} else {
redirect_header(XOOPS_URL.'/modules/news/index.php', 3, _NOPERM);
exit();
}
xoops_cp_footer();
-?>
Modified: XoopsModules/news/trunk/news/admin/functions.php
===================================================================
--- XoopsModules/news/trunk/news/admin/functions.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/functions.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -36,51 +36,51 @@
* @author Herv\xE9 Thouzard (http://www.herve-thouzard.com) & Dojo Javscript Toolkit
* @copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
*/
-
+
function news_collapsableBar($tablename = '', $iconname = '')
{
?>
- <script type="text/javascript"><!--
- function goto_URL(object)
- {
- window.location.href = object.options[object.selectedIndex].value;
- }
+ <script type="text/javascript"><!--
+ function goto_URL(object)
+ {
+ window.location.href = object.options[object.selectedIndex].value;
+ }
- function toggle(id)
- {
- if (document.getElementById) { obj = document.getElementById(id); }
- if (document.all) { obj = document.all[id]; }
- if (document.layers) { obj = document.layers[id]; }
- if (obj) {
- if (obj.style.display == "none") {
- obj.style.display = "";
- } else {
- obj.style.display = "none";
- }
- }
- return false;
- }
+ function toggle(id)
+ {
+ if (document.getElementById) { obj = document.getElementById(id); }
+ if (document.all) { obj = document.all[id]; }
+ if (document.layers) { obj = document.layers[id]; }
+ if (obj) {
+ if (obj.style.display == "none") {
+ obj.style.display = "";
+ } else {
+ obj.style.display = "none";
+ }
+ }
- var iconClose = new Image();
- iconClose.src = '../images/icons/close12.gif';
- var iconOpen = new Image();
- iconOpen.src = '../images/icons/open12.gif';
+ return false;
+ }
- function toggleIcon ( iconName )
- {
- if ( document.images[iconName].src == window.iconOpen.src ) {
- document.images[iconName].src = window.iconClose.src;
- } else if ( document.images[iconName].src == window.iconClose.src ) {
- document.images[iconName].src = window.iconOpen.src;
- }
- return;
- }
+ var iconClose = new Image();
+ iconClose.src = '../images/icons/close12.gif';
+ var iconOpen = new Image();
+ iconOpen.src = '../images/icons/open12.gif';
- //-->
- </script>
- <?php
+ function toggleIcon ( iconName )
+ {
+ if (document.images[iconName].src == window.iconOpen.src) {
+ document.images[iconName].src = window.iconClose.src;
+ } elseif (document.images[iconName].src == window.iconClose.src) {
+ document.images[iconName].src = window.iconOpen.src;
+ }
+
+ return;
+ }
+
+ //-->
+ </script>
+ <?php
echo "<h4 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
}
-
-?>
\ No newline at end of file
Modified: XoopsModules/news/trunk/news/admin/groupperms.php
===================================================================
--- XoopsModules/news/trunk/news/admin/groupperms.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/groupperms.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -41,8 +41,7 @@
echo "<form method='post' name='fselperm' action='groupperms.php'><select name='permtoset' onChange='javascript: document.fselperm.submit()'><option value='1'".$selected[0].">"._AM_APPROVEFORM."</option><option value='2'".$selected[1].">"._AM_SUBMITFORM."</option><option value='3'".$selected[2].">"._AM_VIEWFORM."</option></select> <input type='submit' name='go'></form>";
$module_id = $xoopsModule->getVar('mid');
-switch($permtoset)
-{
+switch ($permtoset) {
case 1:
$title_of_form = _AM_APPROVEFORM;
$perm_name = 'news_approve';
@@ -64,8 +63,6 @@
$xt = new MyXoopsTopic($xoopsDB -> prefix('mod_news_topics'));
$alltopics =& $xt->getTopicsList();
-
-
if ($alltopics) {
foreach ($alltopics as $topic_id => $topic) {
$permform->addItem($topic_id, $topic['title'], $topic['pid']);
@@ -78,8 +75,4 @@
redirect_header("index.php?op=topicsmanager", 5,_NW_NEWS_NO_TOPICS, false);
}
-
-
-
-
-include 'admin_footer.php';
\ No newline at end of file
+include 'admin_footer.php';
Modified: XoopsModules/news/trunk/news/admin/index.php
===================================================================
--- XoopsModules/news/trunk/news/admin/index.php 2013-09-26 12:53:19 UTC (rev 12096)
+++ XoopsModules/news/trunk/news/admin/index.php 2013-09-26 15:56:34 UTC (rev 12097)
@@ -1,1637 +1,1632 @@
-<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// XOOPS - PHP Content Management System //
-// Copyright (c) 2000 XOOPS.org //
-// <http://www.xoops.org/> //
-// ------------------------------------------------------------------------ //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program; if not, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-include_once '../../../include/cp_header.php';
-include_once 'admin_header.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/xoopstopic.php';
-include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/config.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newstopic.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/class.sfiles.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/blacklist.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/registryfile.php';
-include_once XOOPS_ROOT_PATH.'/class/uploader.php';
-include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/admin/functions.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';
-include_once XOOPS_ROOT_PATH.'/modules/news/class/tree.php';
-$dateformat=news_getmoduleoption('dateformat');
-$myts =& MyTextSanitizer::getInstance();
-$topicscount=0;
-
-$storiesTableName = $xoopsDB->prefix('mod_news_stories');
-if(!news_FieldExists('picture', $storiesTableName)) {
- news_AddField('`picture` VARCHAR( 50 ) NOT NULL', $storiesTableName);
-}
-
-/**
- * Show new submissions
- *
- * This list can be view in the module's admin when you click on the tab named "Post/Edit News"
- * Submissions are news that was submit by users but who are not approved, so you need to edit
- * them to approve them.
- * Actually you can see the the story's title, the topic, the posted date, the author and a
- * link to delete the story. If you click on the story's title, you will be able to edit the news.
- * The table contains the last x new submissions.
- * The system's block called "Waiting Contents" is listing the number of those news.
- */
-function newSubmissions()
-{
- global $dateformat, $pathIcon16;
- $start = isset($_GET['startnew']) ? intval($_GET['startnew']) : 0;
- $newsubcount = NewsStory :: getAllStoriesCount(3,false);
- $storyarray = NewsStory :: getAllSubmitted(news_getmoduleoption('storycountadmin'),true,news_getmoduleoption('restrictindex'),$start);
- if ( count($storyarray)> 0) {
- $pagenav = new XoopsPageNav( $newsubcount, news_getmoduleoption('storycountadmin'), $start, 'startnew', 'op=newarticle');
- news_collapsableBar('newsub', 'topnewsubicon');
- echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='topnewsubicon' name='topnewsubicon' src='" . $pathIcon16."/close12.gif' alt='' /></a> "._AM_NEWSUB."</h4>";
- echo "<div id='newsub'>";
- echo '<br />';
- echo "<div style='text-align: center;'><table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><th align='center'>" . _AM_TITLE . "</th><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_POSTED . "</th><th align='center'>" . _AM_POSTER . "</th><th align='center'>" . _AM_ACTION . "</th></tr>\n";
- $class='';
- foreach( $storyarray as $newstory ) {
- $class = ($class == 'even') ? 'odd' : 'even';
- echo "<tr class='".$class."'><td align='left'>\n";
- $title = $newstory->title();
- if (!isset($title) || ($title == '' )) {
- echo "<a href='".XOOPS_URL."/modules/news/admin/index.php?op=edit&returnside=1&storyid=" . $newstory -> storyid() . "'>" . _AD_NOSUBJECT . "</a>\n";
- } else {
- echo " <a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $newstory -> storyid() . "'>" . $title . "</a>\n";
- }
- echo "</td><td>" . $newstory->topic_title() . "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created(),$dateformat) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a></td><td align='center'><a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $newstory->storyid() . "'><img src='" . $pathIcon16."/edit.png' title='"._AM_EDIT."'></a><a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'><img src='" . $pathIcon16."/delete.png' title='"._AM_DELETE."'></a></td></tr>\n";
- }
-
- echo '</table></div>';
- echo "<div align='right'>".$pagenav->renderNav().'</div><br />';
- echo '<br /></div><br />';
- }
-}
-
-/**
- * Shows all automated stories
- *
- * Automated stories are stories that have a publication's date greater than "now"
- * This list can be view in the module's admin when you click on the tab named "Post/Edit News"
- * Actually you can see the story's ID, its title, the topic, the author, the
- * programmed date and time, the expiration's date and two links. The first link is
- * used to edit the story while the second is used to remove the story.
- * The list only contains the last (x) automated news
- */
-function autoStories()
-{
- global $dateformat, $pathIcon16;
-
- $start = isset($_GET['startauto']) ? intval($_GET['startauto']) : 0;
- $storiescount = NewsStory :: getAllStoriesCount(2,false);
- $storyarray = NewsStory :: getAllAutoStory(news_getmoduleoption('storycountadmin'),true,$start);
- $class='';
- if(count($storyarray) > 0) {
- $pagenav = new XoopsPageNav($storiescount, news_getmoduleoption('storycountadmin'), $start, 'startauto', 'op=newarticle');
- news_collapsableBar('autostories', 'topautostories');
- echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='topautostories' name='topautostories' src='" . $pathIcon16."/close12.gif' alt='' /></a> "._AM_AUTOARTICLES."</h4>";
- echo "<div id='autostories'>";
- echo '<br />';
- echo "<div style='text-align: center;'>\n";
- echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><th align='center'>" . _AM_STORYID . "</th><th align='center'>" . _AM_TITLE . "</th><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_POSTER . "</th><th align='center' class='nw'>" . _AM_PROGRAMMED . "</th><th align='center' class='nw'>" . _AM_EXPIRED . "</th><th align='center'>" . _AM_ACTION . "</th></tr>";
- foreach($storyarray as $autostory) {
- $topic = $autostory -> topic();
- $expire = ( $autostory->expired() > 0 ) ? formatTimestamp($autostory->expired(),$dateformat) : '';
- $class = ($class == 'even') ? 'odd' : 'even';
- echo "<tr class='".$class."'>";
- echo "<td align='center'><b>" . $autostory -> storyid() . "</b>
- </td><td align='left'><a href='" . XOOPS_URL . "/modules/news/article.php?storyid=" . $autostory->storyid() . "'>" . $autostory->title() . "</a>
- </td><td align='center'>" . $topic->topic_title() . "
- </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $autostory->uid() . "'>" . $autostory->uname() . "</a></td><td align='center' class='nw'>" . formatTimestamp($autostory->published(),$dateformat) . "</td><td align='center'>" . $expire . "</td><td align='center'><a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $autostory->storyid() . "'><img src='" . $pathIcon16."/edit.png' title="._AM_EDIT."> </a> <a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $autostory->storyid() . "'><img src='" . $pathIcon16."/delete.png' title='"._AM_DELETE."'></a>";
-
- echo "</td></tr>\n";
- }
- echo '</table></div>';
- echo "<div align='right'>".$pagenav->renderNav().'</div><br />';
- echo '</div><br />';
- }
-}
-
-/**
- * Shows last x published stories
- *
- * This list can be view in the module's admin when you click on the tab named "Post/Edit News"
- * Actually you can see the the story's ID, its title, the topic, the author, the number of hits
- * and two links. The first link is used to edit the story while the second is used to remove the story.
- * The table only contains the last X published stories.
- * You can modify the number of visible stories with the module's option named
- * "Number of new articles to display in admin area".
- * As the number of displayed stories is limited, below this list you can find a text box
- * that you can use to enter a story's Id, then with the scrolling list you can select
- * if you want to edit or delete the story.
- */
-function lastStories()
-{
- global $dateformat, $pathIcon16;
- news_collapsableBar('laststories', 'toplaststories');
- echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='toplaststories' name='toplaststories' src='" . $pathIcon16."/close12.gif' alt='' /></a> ".sprintf(_AM_LAST10ARTS,news_getmoduleoption('storycountadmin'))."</h4>";
- echo "<div id='laststories'>";
- echo '<br />';
- echo "<div style='text-align: center;'>";
- $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
- $storyarray = NewsStory :: getAllPublished(news_getmoduleoption('storycountadmin'), $start, false, 0, 1 );
- $storiescount = NewsStory :: getAllStoriesCount(4,false);
- $pagenav = new XoopsPageNav( $storiescount, news_getmoduleoption('storycountadmin'), $start, 'start', 'op=newarticle');
- $class='';
- echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><th align='center'>" . _AM_STORYID . "</th><th align='center'>" . _AM_TITLE . "</th><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_POSTER . "</th><th align='center' class='nw'>" . _AM_PUBLISHED . "</th><th align='center' class='nw'>" . _AM_HITS . "</th><th align='center'>" . _AM_ACTION . "</th></tr>";
- foreach( $storyarray as $eachstory ) {
- $published = formatTimestamp($eachstory->published(),$dateformat );
- // $expired = ( $eachstory -> expired() > 0 ) ? formatTimestamp($eachstory->expired(),$dateformat) : '---';
- $topic = $eachstory -> topic();
- $class = ($class == 'even') ? 'odd' : 'even';
- echo "<tr class='".$class."'>";
- echo "<td align='center'><b>" . $eachstory -> storyid() . "</b>
- </td><td align='left'><a href='" . XOOPS_URL . "/modules/news/article.php?storyid=" . $eachstory -> storyid() . "'>" . $eachstory -> title() . "</a>
- </td><td align='center'>" . $topic -> topic_title() . "
- </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory -> uid() . "'>" . $eachstory -> uname() . "</a></td><td align='center' class='nw'>" . $published . "</td><td align='center'>" . $eachstory -> counter() . "</td><td align='center'>
- <a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $eachstory -> storyid() . "'> <img src='" . $pathIcon16."/edit.png' title="._AM_EDIT."> </a>
- <a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $eachstory -> storyid() . "'><img src='" . $pathIcon16."/delete.png' title='"._AM_DELETE."'></a>";
-
- echo "</td></tr>\n";
- }
- echo '</table><br />';
- echo "<div align='right'>".$pagenav->renderNav().'</div><br />';
-
- echo "<form action='index.php' method='get'>" . _AM_STORYID . " <input type='text' name='storyid' size='10' />
- <select name='op'>
- <option value='edit' selected='selected'>" . _AM_EDIT . "</option>
- <option value='delete'>" . _AM_DELETE . "</option>
- </select>
- <input type='hidden' name='returnside' value='1'>
- <input type='submit' value='" . _AM_GO . "' />
- </form>
- </div>";
- echo '</div><br />';
-}
-
-
-/**
- * Display a list of the expired stories
- *
- * This list can be view in the module's admin when you click on the tab named "Post/Edit News"
- * Actually you can see the story's ID, the title, the topic, the author,
- * the creation and expiration's date and you have two links, one to delete
- * the story and the other to edit the story.
- * The table only contains the last X expired stories.
- * You can modify the number of visible stories with the module's option named
- * "Number of new articles to display in admin area".
- * As the number of displayed stories is limited, below this list you can find a text box
- * that you can use to enter a story's Id, then with the scrolling list you can select
- * if you want to edit or delete the story.
- */
-function expStories()
-{
- global $dateformat, $pathIcon16;
- $start = isset($_GET['startexp']) ? intval($_GET['startexp']) : 0;
- $expiredcount = NewsStory :: getAllStoriesCount(1,false);
- $storyarray = NewsStory :: getAllExpired(news_getmoduleoption('storycountadmin'), $start, 0, 1 );
- $pagenav = new XoopsPageNav( $expiredcount, news_getmoduleoption('storycountadmin'), $start, 'startexp', 'op=newarticle');
-
- if(count($storyarray) > 0) {
- $class='';
- news_collapsableBar('expstories', 'topexpstories');
- echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='topexpstories' name='topexpstories' src='" . $pathIcon16."/close12.gif' alt='' /></a> "._AM_EXPARTS."</h4>";
- echo "<div id='expstories'>";
- echo '<br />';
- echo "<div style='text-align: center;'>";
- echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><th align='center'>" . _AM_STORYID . "</th><th align='center'>" . _AM_TITLE . "</th><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_POSTER . "</th><th align='center' class='nw'>" . _AM_CREATED . "</th><th align='center' class='nw'>" . _AM_EXPIRED . "</th><th align='center'>" . _AM_ACTION . "</th></tr>";
- foreach( $storyarray as $eachstory ) {
- $created = formatTimestamp($eachstory->created(),$dateformat);
- $expired = formatTimestamp($eachstory->expired(),$dateformat);
- $topic = $eachstory -> topic();
- // added exired value field to table
- $class = ($class == 'even') ? 'odd' : 'even';
- echo "<tr class='".$class."'>";
- echo "<td align='center'><b>" . $eachstory -> storyid() . "</b>
- </td><td align='left'><a href='" . XOOPS_URL . "/modules/news/article.php?returnside=1&storyid=" . $eachstory -> storyid() . "'>" . $eachstory -> title() . "</a>
- </td><td align='center'>" . $topic -> topic_title() . "
- </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory -> uid() . "'>" . $eachstory -> uname() . "</a></td><td align='center' class='nw'>" . $created . "</td><td align='center' class='nw'>" . $expired . "</td><td align='center'>
- <a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&op=edit&storyid=" . $eachstory -> storyid() . "'> <img src='" . $pathIcon16."/edit.png' title="._AM_EDIT."></a>
- <a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $eachstory -> storyid() . "'><img src='" . $pathIcon16."/delete.png' title='"._AM_DELETE."'></a>";
-
-
-
- echo "</td></tr>\n";
- }
- echo '</table><br />';
- echo "<div align='right'>".$pagenav->renderNav().'</div><br />';
- echo "<form action='index.php' method='get'>
- " . _AM_STORYID . " <input type='text' name='storyid' size='10' />
- <select name='op'>
- <option value='edit' selected='selected'>" . _AM_EDIT . "</option>
- <option value='delete'>" . _AM_DELETE . "</option>
- </select>
- <input type='hidden' name='returnside' value='1'>
- <input type='submit' value='" . _AM_GO . "' />
- </form>
- </div>";
- echo '</div><br />';
- }
-}
-
-/**
- * Delete (purge/prune) old stories
- *
- * You can use this function in the module's admin when you click on the tab named "Prune News"
- * It's useful to remove old stories. It is, of course, recommended
- * to backup (or export) your news before to purge news.
- * You must first specify a date. This date will be used as a reference, everything
- * that was published before this date will be deleted.
- * The option "Only remove stories who have expired" will enable you to only remove
- * expired stories published before the given date.
- * Finally, you can select the topics inside wich you will remove news.
- * Once you have set all the parameters, the script will first show you a confirmation's
- * message with the number of news that will be removed.
- * Note, the topics are not deleted (even if there are no more news inside them).
- */
-function PruneManager()
-{
- include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
- xoops_cp_header();
- $pruneAdmin = new ModuleAdmin();
- echo $pruneAdmin->addNavigation('index.php?op=prune');
- echo '<br /><br /><br />';
- $sform = new XoopsThemeForm(_AM_NEWS_PRUNENEWS, 'pruneform', XOOPS_URL.'/modules/news/admin/index.php', 'post');
- $sform->addElement(new XoopsFormTextDateSelect(_AM_NEWS_PRUNE_BEFORE, 'prune_date',15,time()), true);
- $onlyexpired=new xoopsFormCheckBox('', 'onlyexpired');
- $onlyexpired->addOption(1, _AM_NEWS_PRUNE_EXPIREDONLY);
- $sform->addElement($onlyexpired, false);
- $sform->addElement(new XoopsFormHidden('op', 'confirmbeforetoprune'), false);
- $topiclist=new XoopsFormSelect(_AM_NEWS_PRUNE_TOPICS, 'pruned_topics','',5,true);
- $topics_arr=array();
- $xt = new NewsTopic();
- $allTopics = $xt->getAllTopics(false); // The webmaster can see everything
- $topic_tree = new MyXoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
- $topics_arr = $topic_tree->getAllChild(0);
- if(count($topics_arr)) {
- foreach ($topics_arr as $onetopic) {
- $topiclist->addOption($onetopic->topic_id(),$onetopic->topic_title());
- }
- }
- $topiclist->setDescription(_AM_NEWS_EXPORT_PRUNE_DSC);
- $sform->addElement($topiclist,false);
- $button_tray = new XoopsFormElementTray('' ,'');
- $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');
- $button_tray->addElement($submit_btn);
- $sform->addElement($button_tray);
- $sform->display();
-}
-
-// A confirmation is asked before to prune stories
-function ConfirmBeforeToPrune()
-{
- global $dateformat;
- $story = new NewsStory();
- xoops_cp_header();
- $topiclist='';
- if(isset($_POST['pruned_topics'])) {
- $topiclist=implode(',',$_POST['pruned_topics']);
- }
- echo '<h4>' . _AM_NEWS_PRUNENEWS . '</h4>';
- $expired=0;
- if(isset($_POST['onlyexpired'])) {
- $expired = intval($_POST['onlyexpired']);
- }
- $date=$_POST['prune_date'];
- $timestamp=mktime(0,0,0,intval(substr($date,5,2)), intval(substr($date,8,2)), intval(substr($date,0,4)));
- $count=$story->GetCountStoriesPublishedBefore($timestamp, $expired, $topiclist);
- if($count) {
- $displaydate=formatTimestamp($timestamp,$dateformat);
- $msg=sprintf(_AM_NEWS_PRUNE_CONFIRM,$displaydate, $count);
- xoops_confirm(array( 'op' => 'prunenews', 'expired' => $expired, 'pruned_topics' => $topiclist, 'prune_date' => $timestamp, 'ok' => 1), 'index.php', $msg);
- } else {
- printf(_AM_NEWS_NOTHING_PRUNE);
- }
- unset($story);
-}
-
-// Effectively delete stories (published before a date), no more confirmation
-function PruneNews()
-{
- $story = new NewsStory();
- $timestamp=intval($_POST['prune_date']);
- $expired= intval($_POST['expired']);
- $topiclist='';
- if(isset($_POST['pruned_topics'])) {
- $topiclist=$_POST['pruned_topics'];
- }
-
- if(intval($_POST['ok'])==1) {
- $story = new NewsStory();
- xoops_cp_header();
- $count=$story->GetCountStoriesPublishedBefore($timestamp,$expired,$topiclist);
- $msg=sprintf(_AM_NEWS_PRUNE_DELETED,$count);
- $story->DeleteBeforeDate($timestamp,$expired,$topiclist);
- unset($story);
- news_updateCache();
- redirect_header( 'index.php', 3, $msg);
- }
-}
-
-/**
-* Newsletter's configuration
-*
-* You can create a newsletter's content from the admin part of the News module when you click on the tab named "Newsletter"
-* First, let be clear, this module'functionality will not send the newsletter but it will prepare its content for you.
-* To send the newsletter, you can use many specialized modules like evennews.
-* You first select a range of dates and if you want, a selection of topics to use for the search.
-* Once it's done, the script will use the file named /xoops/modules/language/yourlanguage/newsletter.php to create
-* the newsletter's content. When it's finished, the script generates a file in the upload folder.
-*/
-function Newsletter()
-{
- include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
- xoops_cp_header();
- $newsletterAdmin = new ModuleAdmin();
- echo $newsletterAdmin->addNavigation('index.php?op=configurenewsletter');
- echo '<br /><br /><br />';
- $sform = new XoopsThemeForm(_AM_NEWS_NEWSLETTER, 'newsletterform', XOOPS_URL.'/modules/news/admin/index.php', 'post');
- $dates_tray = new XoopsFormElementTray(_AM_NEWS_NEWSLETTER_BETWEEN);
- $date1 = new XoopsFormTextDateSelect('', 'date1',15,time());
- $date2 = new XoopsFormTextDateSelect(_AM_NEWS_EXPORT_AND, 'date2',15,time());
- $dates_tray->addElement($date1);
- $dates_tray->addElement($date2);
- $sform->addElement($dates_tray);
-
- $topiclist=new XoopsFormSelect(_AM_NEWS_PRUNE_TOPICS, 'export_topics','',5,true);
- $topics_arr=array();
- $xt = new NewsTopic();
- $allTopics = $xt->getAllTopics(false); // The webmaster can see everything
- $topic_tree = new MyXoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
- $topics_arr = $topic_tree->getAllChild(0);
- if(count($topics_arr)) {
- foreach ($topics_arr as $onetopic) {
- $topiclist->addOption($onetopic->topic_id(),$onetopic->topic_title());
- }
- }
- $topiclist->setDescription(_AM_NEWS_EXPORT_PRUNE_DSC);
- $sform->addElement($topiclist,false);
- $sform->addElement(new XoopsFormHidden('op', 'launchnewsletter'), false);
- $sform->addElement(new XoopsFormRadioYN(_AM_NEWS_REMOVE_BR, 'removebr',1),false);
- $sform->addElement(new XoopsFormRadioYN(_AM_NEWS_NEWSLETTER_HTML_TAGS, 'removehtml',0),false);
- $sform->addElement(new XoopsFormTextArea(_AM_NEWS_NEWSLETTER_HEADER, 'header', '', 4, 70), false);
- $sform->addElement(new XoopsFormTextArea(_AM_NEWS_NEWSLETTER_FOOTER, 'footer', '', 4, 70), false);
- $button_tray = new XoopsFormElementTray('' ,'');
- $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');
- $button_tray->addElement($submit_btn);
- $sform->addElement($button_tray);
- $sform->display();
-}
-
-
-/**
- * Launch the creation of the newsletter's content
- */
-function LaunchNewsletter()
-{
- global $xoopsConfig, $dateformat;
- xoops_cp_header();
- $newsletterAdmin = new ModuleAdmin();
- echo $newsletterAdmin->addNavigation('index.php?op=configurenewsletter');
- $newslettertemplate = '';
- if (file_exists(XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/newsletter.php')) {
- include_once XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/newsletter.php';
- } else {
- include_once XOOPS_ROOT_PATH.'/modules/news/language/english/newsletter.php';
- }
- echo '<br ...
[truncated message content] |