From: <be...@us...> - 2012-07-02 06:03:04
|
Revision: 9767 http://xoops.svn.sourceforge.net/xoops/?rev=9767&view=rev Author: beckmi Date: 2012-07-02 06:02:52 +0000 (Mon, 02 Jul 2012) Log Message: ----------- Updating Trunk to 1.67 Modified Paths: -------------- 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/article.php XoopsModules/news/trunk/news/backendt.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/class/blacklist.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/index.html XoopsModules/news/trunk/news/class/registryfile.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/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/config.php XoopsModules/news/trunk/news/extra/modules/tag/plugin/news.php XoopsModules/news/trunk/news/include/functions.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/index.php XoopsModules/news/trunk/news/language/english/admin.php XoopsModules/news/trunk/news/language/english/main.php XoopsModules/news/trunk/news/language/english/modinfo.php XoopsModules/news/trunk/news/language/english/newsletter.php XoopsModules/news/trunk/news/language/englishUTF8/admin.php XoopsModules/news/trunk/news/language/englishUTF8/modinfo.php XoopsModules/news/trunk/news/language/french/modinfo.php XoopsModules/news/trunk/news/language/frenchUTF8/modinfo.php XoopsModules/news/trunk/news/language/german/admin.php XoopsModules/news/trunk/news/language/german/blocks.php XoopsModules/news/trunk/news/language/german/main.php XoopsModules/news/trunk/news/language/german/modinfo.php XoopsModules/news/trunk/news/language/german/newsletter.php XoopsModules/news/trunk/news/list.tag.php XoopsModules/news/trunk/news/micro_summary.php XoopsModules/news/trunk/news/newsbythisauthor.php XoopsModules/news/trunk/news/print.php XoopsModules/news/trunk/news/sql/mysql.sql XoopsModules/news/trunk/news/submit.php XoopsModules/news/trunk/news/templates/blocks/news_block_archives.html XoopsModules/news/trunk/news/templates/blocks/news_block_bigstory.html XoopsModules/news/trunk/news/templates/blocks/news_block_randomnews.html XoopsModules/news/trunk/news/templates/blocks/news_block_top.html XoopsModules/news/trunk/news/templates/blocks/news_block_topicnav.html XoopsModules/news/trunk/news/templates/blocks/news_block_topics.html XoopsModules/news/trunk/news/templates/news_archive.html XoopsModules/news/trunk/news/templates/news_article.html XoopsModules/news/trunk/news/templates/news_by_this_author.html XoopsModules/news/trunk/news/templates/news_by_topic.html XoopsModules/news/trunk/news/templates/news_index.html XoopsModules/news/trunk/news/templates/news_item.html XoopsModules/news/trunk/news/templates/news_ratenews.html XoopsModules/news/trunk/news/templates/news_topics_directory.html XoopsModules/news/trunk/news/templates/news_whos_who.html XoopsModules/news/trunk/news/topics_directory.php XoopsModules/news/trunk/news/view.tag.php XoopsModules/news/trunk/news/whoswho.php XoopsModules/news/trunk/news/xoops_version.php Added 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/index.html XoopsModules/news/trunk/news/class/news_stories.php XoopsModules/news/trunk/news/class/news_topics.php XoopsModules/news/trunk/news/css/ XoopsModules/news/trunk/news/css/index.html XoopsModules/news/trunk/news/css/print.css XoopsModules/news/trunk/news/css/style.css XoopsModules/news/trunk/news/docs/ XoopsModules/news/trunk/news/docs/changelog.txt XoopsModules/news/trunk/news/docs/credits.txt XoopsModules/news/trunk/news/docs/index.html XoopsModules/news/trunk/news/docs/install.txt XoopsModules/news/trunk/news/docs/lang.diff XoopsModules/news/trunk/news/docs/licence.txt XoopsModules/news/trunk/news/docs/readme.txt XoopsModules/news/trunk/news/docs/upgrade.txt XoopsModules/news/trunk/news/images/dojo/ XoopsModules/news/trunk/news/images/dojo/articles.png XoopsModules/news/trunk/news/images/dojo/export.png XoopsModules/news/trunk/news/images/dojo/help.png XoopsModules/news/trunk/news/images/dojo/home.png XoopsModules/news/trunk/news/images/dojo/index.html XoopsModules/news/trunk/news/images/dojo/maintain.png XoopsModules/news/trunk/news/images/dojo/metagen.png XoopsModules/news/trunk/news/images/dojo/newsletter.png XoopsModules/news/trunk/news/images/dojo/options.png XoopsModules/news/trunk/news/images/dojo/permissions.png XoopsModules/news/trunk/news/images/dojo/purge.png XoopsModules/news/trunk/news/images/dojo/statistics.png XoopsModules/news/trunk/news/images/dojo/topics.png XoopsModules/news/trunk/news/images/dojo/update.png XoopsModules/news/trunk/news/images/news.png XoopsModules/news/trunk/news/include/install_function.php XoopsModules/news/trunk/news/include/update_function.php XoopsModules/news/trunk/news/language/english/help/ XoopsModules/news/trunk/news/language/english/help/help.html XoopsModules/news/trunk/news/language/english/help/index.html XoopsModules/news/trunk/news/language/englishUTF8/help/ XoopsModules/news/trunk/news/language/englishUTF8/help/help.html XoopsModules/news/trunk/news/language/englishUTF8/help/index.html XoopsModules/news/trunk/news/language/french/help/ XoopsModules/news/trunk/news/language/french/help/help.html XoopsModules/news/trunk/news/language/french/help/index.html XoopsModules/news/trunk/news/language/frenchUTF8/help/ XoopsModules/news/trunk/news/language/frenchUTF8/help/help.html XoopsModules/news/trunk/news/language/frenchUTF8/help/index.html XoopsModules/news/trunk/news/language/german/help/ XoopsModules/news/trunk/news/language/german/help/help.html XoopsModules/news/trunk/news/language/german/help/index.html XoopsModules/news/trunk/news/language/italian/ XoopsModules/news/trunk/news/language/italian/admin.php XoopsModules/news/trunk/news/language/italian/aggiornamento.txt XoopsModules/news/trunk/news/language/italian/blocks.php XoopsModules/news/trunk/news/language/italian/help/ XoopsModules/news/trunk/news/language/italian/help/help.html XoopsModules/news/trunk/news/language/italian/help/index.html XoopsModules/news/trunk/news/language/italian/index.html XoopsModules/news/trunk/news/language/italian/mail_template/ XoopsModules/news/trunk/news/language/italian/mail_template/global_newcategory_notify.tpl XoopsModules/news/trunk/news/language/italian/mail_template/global_newstory_notify.tpl XoopsModules/news/trunk/news/language/italian/mail_template/global_storysubmit_notify.tpl XoopsModules/news/trunk/news/language/italian/mail_template/index.html XoopsModules/news/trunk/news/language/italian/mail_template/story_approve_notify.tpl XoopsModules/news/trunk/news/language/italian/mail_template/topic_newstory_notify.tpl XoopsModules/news/trunk/news/language/italian/main.php XoopsModules/news/trunk/news/language/italian/modinfo.php XoopsModules/news/trunk/news/language/italian/newsletter.php Removed Paths: ------------- XoopsModules/news/trunk/news/changelog.txt XoopsModules/news/trunk/news/images/acrobat.gif XoopsModules/news/trunk/news/images/articles.png XoopsModules/news/trunk/news/images/attach.gif XoopsModules/news/trunk/news/images/blinklist.gif XoopsModules/news/trunk/news/images/close12.gif XoopsModules/news/trunk/news/images/delicious.gif XoopsModules/news/trunk/news/images/diggman.gif XoopsModules/news/trunk/news/images/export.png XoopsModules/news/trunk/news/images/fark.gif XoopsModules/news/trunk/news/images/forum.gif XoopsModules/news/trunk/news/images/friend.gif XoopsModules/news/trunk/news/images/furl.gif XoopsModules/news/trunk/news/images/help.png XoopsModules/news/trunk/news/images/home.png XoopsModules/news/trunk/news/images/maintain.png XoopsModules/news/trunk/news/images/metagen.png XoopsModules/news/trunk/news/images/newsletter.png XoopsModules/news/trunk/news/images/newsvine.gif XoopsModules/news/trunk/news/images/open12.gif XoopsModules/news/trunk/news/images/options.png XoopsModules/news/trunk/news/images/permissions.png XoopsModules/news/trunk/news/images/pixel.gif XoopsModules/news/trunk/news/images/print.gif XoopsModules/news/trunk/news/images/purge.png XoopsModules/news/trunk/news/images/reddit.gif XoopsModules/news/trunk/news/images/rss.gif XoopsModules/news/trunk/news/images/sel.gif XoopsModules/news/trunk/news/images/simpy.png XoopsModules/news/trunk/news/images/size.gif XoopsModules/news/trunk/news/images/spurl.gif XoopsModules/news/trunk/news/images/statistics.png XoopsModules/news/trunk/news/images/topics.png XoopsModules/news/trunk/news/images/update.png XoopsModules/news/trunk/news/images/yahoomyweb.gif XoopsModules/news/trunk/news/lang.diff XoopsModules/news/trunk/news/licence.txt XoopsModules/news/trunk/news/readme.txt XoopsModules/news/trunk/news/upgrade.txt Added: XoopsModules/news/trunk/news/admin/about.php =================================================================== --- XoopsModules/news/trunk/news/admin/about.php (rev 0) +++ XoopsModules/news/trunk/news/admin/about.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -0,0 +1,28 @@ +<?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://www.xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package News + * @since 2.5.0 + * @author XOOPS Development Team + * @version $Id $ + **/ +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 Added: XoopsModules/news/trunk/news/admin/admin_footer.php =================================================================== --- XoopsModules/news/trunk/news/admin/admin_footer.php (rev 0) +++ XoopsModules/news/trunk/news/admin/admin_footer.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -0,0 +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 Added: XoopsModules/news/trunk/news/admin/admin_header.php =================================================================== --- XoopsModules/news/trunk/news/admin/admin_header.php (rev 0) +++ XoopsModules/news/trunk/news/admin/admin_header.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -0,0 +1,70 @@ +<?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 XOOPS Development Team + * @version $Id $ +**/ +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +require_once $path . '/include/cp_header.php'; + +global $xoopsModule; + +$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); +$thisModulePath = dirname(dirname(__FILE__)); + +//if functions.php file exist +require_once dirname(dirname(__FILE__)) . '/include/functions.php'; +//require_once $thisModulePath . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); + +$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); +$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) { + include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'); +} else { + redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, FALSE); +} + + +$topicsHandler=& xoops_getModuleHandler('news_topics','news'); +$storiesHandler=& xoops_getModuleHandler('news_stories','news'); + +$myts =& MyTextSanitizer::getInstance(); + +if ($xoopsUser) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar( 'mid' ), $xoopsUser->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } +} else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); +} + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} + +$xoopsTpl->assign('pathIcon16', $pathIcon16); \ No newline at end of file Modified: XoopsModules/news/trunk/news/admin/amsimport.php =================================================================== --- XoopsModules/news/trunk/news/admin/amsimport.php 2012-07-02 05:56:04 UTC (rev 9766) +++ XoopsModules/news/trunk/news/admin/amsimport.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -30,8 +30,8 @@ * This script will import topics, articles, files, links, ratings, comments and notifications from AMS 2.41 * * @package News - * @author Instant Zero (http://www.instant-zero.com) - * @copyright 2005, 2006 - Instant Zero + * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com) + * @copyright 2005, 2006 - Herv\xE9 Thouzard * @version 1.0 */ @@ -65,7 +65,7 @@ } else { include_once XOOPS_ROOT_PATH.'/modules/AMS/language/english/admin.php'; } - $db =& Database::getInstance(); + $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; @@ -161,8 +161,8 @@ $news->setNosmiley($article['nosmiley']); $news->setHometext($text_lastversion['hometext']); $news->setBodytext($text_lastversion['bodytext'].$links.$forum); - $news->Setkeywords(''); - $news->Setdescription(''); + $news->setKeywords(''); + $news->setDescription(''); $news->counter=$article['counter']; $news->setTopicId($news_topicid); $news->setIhome($article['ihome']); Modified: XoopsModules/news/trunk/news/admin/functions.php =================================================================== --- XoopsModules/news/trunk/news/admin/functions.php 2012-07-02 05:56:04 UTC (rev 9766) +++ XoopsModules/news/trunk/news/admin/functions.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -33,156 +33,10 @@ * NOTE : Please give credits if you copy this code ! * * @package News - * @author Instant Zero (http://www.instant-zero.com) & Dojo Javscript Toolkit - * @copyright (c) Instant Zero - http://www.instant-zero.com + * @author Herv\xE9 Thouzard (http://www.herve-thouzard.com) & Dojo Javscript Toolkit + * @copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com) */ -function news_adminmenu($currentoption = 0, $breadcrumb = '') -{ - global $xoopsModule, $xoopsConfig; - - include XOOPS_ROOT_PATH . '/modules/news/config.php'; - if (file_exists(XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/modinfo.php')) { - include_once XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/modinfo.php'; - } else { - include_once XOOPS_ROOT_PATH . '/modules/news/language/english/modinfo.php'; - } - - if (!$cfg['use_fun_menu']) { - $tblColors = array('', '', '', '', '', '', '', '', ''); - if ($currentoption >= 0) { - $tblColors[$currentoption] = 'current'; - } - - /* Nice buttons styles */ - echo " - <style type='text/css'> - #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; } - #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/news/images/bg.png') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; } - #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; } - #buttonbar li { display:inline; margin:0; padding:0; } - #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/news/images/left_both.png') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; } - #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/news/images/right_both.png') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; } - /* Commented Backslash Hack hides rule from IE5-Mac \*/ - #buttonbar a span {float:none;} - /* End IE5-Mac hack */ - #buttonbar a:hover span { color:#333; } - #buttonbar #current a { background-position:0 -150px; border-width:0; } - #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; } - #buttonbar a:hover { background-position:0% -150px; } - #buttonbar a:hover span { background-position:100% -150px; } - </style> - "; - - echo "<div id='buttontop'>"; - echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>"; - echo "<td style=\"width: 60%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"".XOOPS_URL."/modules/system/admin.php?fct=preferences&op=showmod&mod=".$xoopsModule->getVar('mid')."\">" . _AM_NEWS_GENERALSET . "</a> | <a href=\"../index.php\">" . _AM_NEWS_GOTOMOD . "</a> | <a href=\"#\">" . _AM_NEWS_HELP . "</a> | <a href='index.php?op=verifydb'>". _AM_NEWS_VERIFY_TABLES ."</a></td>"; - echo "<td style=\"width: 40%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $xoopsModule->name() . " " . _AM_NEWS_MODULEADMIN . "</b> " . $breadcrumb . "</td>"; - echo '</tr></table>'; - echo '</div>'; - - echo "<div id='buttonbar'>"; - echo '<ul>'; - echo "<li id='" . $tblColors[0] . "'><a href=\"index.php?op=topicsmanager\"\"><span>"._MI_NEWS_ADMENU2 ."</span></a></li>\n"; - echo "<li id='" . $tblColors[1] . "'><a href=\"index.php?op=newarticle\"><span>" . _MI_NEWS_ADMENU3 . "</span></a></li>\n"; - echo "<li id='" . $tblColors[2] . "'><a href=\"groupperms.php\"><span>" . _MI_NEWS_GROUPPERMS . "</span></a></li>\n"; - echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=prune\"><span>" . _MI_NEWS_PRUNENEWS . "</span></a></li>\n"; - echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=export\"><span>" . _MI_NEWS_EXPORT . "</span></a></li>\n"; - echo "<li id='" . $tblColors[5] . "'><a href=\"index.php?op=configurenewsletter\"><span>" . _MI_NEWS_NEWSLETTER . "</span></a></li>\n"; - echo "<li id='" . $tblColors[6] . "'><a href=\"index.php?op=stats\"><span>" . _MI_NEWS_STATS . "</span></a></li>\n"; - if ($xoopsModule->getVar('version') != 166) { - echo "<li id='" . $tblColors[7] . "'><a href=\"upgrade.php\"><span>" . _AM_NEWS_UPGRADE . "</span></a></li>\n"; - } - echo "<li id='" . $tblColors[8] . "'><a href=\"index.php?op=metagen\"><span>" . _MI_NEWS_METAGEN . "</span></a></li>\n"; - echo '</ul></div>'; - echo '<br /><br /><pre> </pre><pre> </pre>'; - } else { - ?> - <script type="text/javascript" src="../js/dojo.js"></script> - <script language="JavaScript" type="text/javascript"> - dojo.require("dojo.widget.FisheyeList"); - dojo.hostenv.writeIncludes(); - </script> - <script> - function load_app(id){ - urltogo = new Array("../../system/admin.php?fct=preferences&op=showmod&mod=<?php echo $xoopsModule->getVar('mid'); ?>","../index.php","#","index.php?op=verifydb","index.php?op=topicsmanager","index.php?op=newarticle","groupperms.php","index.php?op=prune","index.php?op=export","index.php?op=configurenewsletter","index.php?op=stats","index.php?op=metagen","upgrade.php"); - window.location.href = urltogo[id]; - } - </script> - - <style> - .dojoHtmlFisheyeListBar { - margin: 0 auto; - text-align: center; - } - - .outerbar { - background-color: #ffffff; - text-align: center; - position: relative; - left: 0px; - top: 0px; - width: 100%; - } - </style> - - <div class="outerbar"> - <div class="dojo-FisheyeList" - dojo:itemWidth="50" dojo:itemHeight="50" - dojo:itemMaxWidth="200" dojo:itemMaxHeight="200" - dojo:orientation="horizontal" - dojo:effectUnits="2" - dojo:itemPadding="10" - dojo:attachEdge="top" - dojo:labelEdge="bottom" - dojo:enableCrappySvgSupport="false"> - - <div class="dojo-FisheyeListItem" onClick="load_app(0)" - dojo:iconsrc="../images/options.png" caption="<?php echo _AM_NEWS_GENERALSET; ?>"> - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(1);" - dojo:iconsrc="../images/home.png" caption="<?php echo _AM_NEWS_GOTOMOD; ?>"> - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(2);" - dojo:iconsrc="../images/help.png" caption="<?php echo _AM_NEWS_HELP; ?>"> - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(3);" - dojo:iconsrc="../images/maintain.png" caption="<?php echo _AM_NEWS_VERIFY_TABLES; ?>"> - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(4);" - dojo:iconsrc="../images/topics.png" caption="<?php echo _MI_NEWS_ADMENU2; ?>"> - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(5);" - dojo:iconsrc="../images/articles.png" dojo:caption="<?php echo _MI_NEWS_ADMENU3; ?>" > - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(6);" - dojo:iconsrc="../images/permissions.png" dojo:caption="<?php echo _MI_NEWS_GROUPPERMS; ?>" > - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(7);" - dojo:iconsrc="../images/purge.png" dojo:caption="<?php echo _MI_NEWS_PRUNENEWS; ?>" > - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(8);" - dojo:iconsrc="../images/export.png" dojo:caption="<?php echo _MI_NEWS_EXPORT; ?>" > - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(9);" - dojo:iconsrc="../images/newsletter.png" dojo:caption="<?php echo _MI_NEWS_NEWSLETTER; ?>" > - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(10);" - dojo:iconsrc="../images/statistics.png" dojo:caption="<?php echo _MI_NEWS_STATS; ?>" > - </div> - <div class="dojo-FisheyeListItem" onClick="load_app(11);" - dojo:iconsrc="../images/metagen.png" dojo:caption="<?php echo _MI_NEWS_METAGEN; ?>" > - </div> - <?php if ($xoopsModule->getVar('version') != 153) { ?> - <div class="dojo-FisheyeListItem" onClick="load_app(12);" - dojo:iconsrc="../images/update.png" dojo:caption="<?php echo _AM_NEWS_UPGRADE; ?>" > - </div> - <?php } ?> - </div> - </div> -<?php - } -} - + function news_collapsableBar($tablename = '', $iconname = '') { @@ -209,9 +63,9 @@ } var iconClose = new Image(); - iconClose.src = '../images/close12.gif'; + iconClose.src = '../images/icons/close12.gif'; var iconOpen = new Image(); - iconOpen.src = '../images/open12.gif'; + iconOpen.src = '../images/icons/open12.gif'; function toggleIcon ( iconName ) { Modified: XoopsModules/news/trunk/news/admin/groupperms.php =================================================================== --- XoopsModules/news/trunk/news/admin/groupperms.php 2012-07-02 05:56:04 UTC (rev 9766) +++ XoopsModules/news/trunk/news/admin/groupperms.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -29,10 +29,11 @@ include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; include_once XOOPS_ROOT_PATH . '/modules/news/admin/functions.php'; - +include_once 'admin_header.php'; xoops_cp_header(); +$permAdmin = new ModuleAdmin(); +echo $permAdmin->addNavigation('groupperms.php'); -news_adminmenu(2); echo '<br /><br /><br />'; $permtoset = isset($_POST['permtoset']) ? intval($_POST['permtoset']) : 1; $selected = array('', '', ''); @@ -68,6 +69,4 @@ echo $permform->render(); echo "<br /><br /><br /><br />\n"; unset($permform); - -xoops_cp_footer(); -?> \ No newline at end of file +include 'admin_footer.php'; \ No newline at end of file Added: XoopsModules/news/trunk/news/admin/index.html =================================================================== --- XoopsModules/news/trunk/news/admin/index.html (rev 0) +++ XoopsModules/news/trunk/news/admin/index.html 2012-07-02 06:02:52 UTC (rev 9767) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Modified: XoopsModules/news/trunk/news/admin/index.php =================================================================== --- XoopsModules/news/trunk/news/admin/index.php 2012-07-02 05:56:04 UTC (rev 9766) +++ XoopsModules/news/trunk/news/admin/index.php 2012-07-02 06:02:52 UTC (rev 9767) @@ -1,1560 +1,1643 @@ -<?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 XOOPS_ROOT_PATH.'/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.'/class/tree.php'; -$dateformat=news_getmoduleoption('dateformat'); -$myts =& MyTextSanitizer::getInstance(); -$topicscount=0; - -$storiesTableName = $xoopsDB->prefix('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; - $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='" . XOOPS_URL . "/modules/news/images/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'><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTED . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center'>" . _AM_ACTION . "</td></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='right'><a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'>" . _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; - $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='" . XOOPS_URL . "/modules/news/images/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'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PROGRAMMED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></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() . "'>" . _AM_EDIT . "</a>-<a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $autostory->storyid() . "'>" . _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; - news_collapsableBar('laststories', 'toplaststories'); - echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='toplaststories' name='toplaststories' src='" . XOOPS_URL . "/modules/news/images/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'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PUBLISHED . "</td><td align='center' class='nw'>" . _AM_HITS . "</td><td align='center'>" . _AM_ACTION . "</td></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() . "'>" . _AM_EDIT . "</a>-<a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $eachstory -> storyid() . "'>" . _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; - $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='" . XOOPS_URL . "/modules/news/images/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'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_CREATED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></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() . "'>" . _AM_EDIT . "</a>-<a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&storyid=" . $eachstory -> storyid() . "'>" . _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(); - news_adminmenu(3); - 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 XoopsObjectTree($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(); - news_adminmenu(5); - 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 XoopsObjectTree($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(); - news_adminmenu(5); - $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 />'; - $story = new NewsStory(); - $exportedstories = array(); - $topiclist = ''; - $removebr = $removehtml = false; - $removebr = isset($_POST['removebr']) ? intval($_POST['removebr']) : 0; - $removehtml = isset($_POST['removehtml']) ? intval($_POST['removehtml']) : 0; - $header = isset($_POST['header']) ? $_POST['header'] : ''; - $footer = isset($_POST['footer']) ? $_POST['footer'] : ''; - $date1 = $_POST['date1']; - $date2 = $_POST['date2']; - $timestamp1 = mktime(0,0,0,intval(substr($date1,5,2)), intval(substr($date1,8,2)), intval(substr($date1,0,4))); - $timestamp2 = mktime(23,59,59,intval(substr($date2,5,2)), intval(substr($date2,8,2)), intval(substr($date2,0,4))); - if(isset($_POST['export_topics'])) { - $topiclist = implode(',',$_POST['export_topics']); - } - $tbltopics = array(); - $exportedstories = $story->NewsExport($timestamp1, $timestamp2, $topiclist, 0, $tbltopics); - $newsfile = XOOPS_ROOT_PATH.'/uploads/newsletter.txt'; - if(count($exportedstories)) { - $fp = fopen($newsfile,'w'); - if(!$fp) { - redirect_header('index.php',4,sprintf(_AM_NEWS_EXPORT_ERROR,$newsfile)); - } - if(xoops_trim($header) != '') { - fwrite($fp, $header); - } - foreach($exportedstories as $onestory) { - $content = $newslettertemplate; - $search_pattern = array('%title%','%uname%','%created%','%published%','%expired%','%hometext%','%bodytext%','%description%','%keywords%','%reads%','%topicid%','%topic_title%','%comments%','%rating%','%votes%','%publisher%','%publisher_id%','%link%'); - $replace_pattern = array($onestory->title(),$onestory->uname(),formatTimestamp($onestory->created(),$dateformat),formatTimestamp($onestory->published(),$dateformat),formatTimestamp($onestory->expired(),$dateformat),$onestory->hometext(),$onestory->bodytext(),$onestory->description(),$onestory->keywords(),$onestory->counter(),$onestory->topicid(),$onestory->topic_title(),$onestory->comments(),$onestory->rating(),$onestory->votes(),$onestory->uname(),$onestory->uid(),XOOPS_URL.'/modules/news/article.php?storyid='.$onestory->storyid()); - $content = str_replace($search_pattern, $replace_pattern, $content); - if($removebr) { - $content = str_replace('<br />',"\r\n",$content); - } - if($removehtml) { - $content = strip_tags($content); - } - fwrite($fp,$content); - } - if(xoops_trim($footer) != '') { - fwrite($fp, $footer); - } - fclose($fp); - $newsfile=XOOPS_URL.'/uploads/newsletter.txt'; - printf(_AM_NEWS_NEWSLETTER_READY,$newsfile,XOOPS_URL.'/modules/news/admin/index.php?op=deletefile&type=newsletter'); - } else { - printf(_AM_NEWS_NOTHING); - } -} - - - -/** -* News export -* -* You can use this function in the module's admin when you click on the tab named "News Export" -* First select a range of date, possibly a range of topics and if you want, check the option "Include Topics Definitions" -* to also export the topics. -* News, and topics, will be exported to the XML format. -*/ -function NewsExport() -{ - include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; - xoops_cp_header(); - news_adminmenu(4); - echo '<br /><br /><br />'; - $sform = new XoopsThemeForm(_AM_NEWS_EXPORT_NEWS, 'exportform', XOOPS_URL.'/modules/news/admin/index.php', 'post'); - $dates_tray = new XoopsFormElementTray(_AM_NEWS_EXPORT_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 XoopsObjectTree($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 XoopsFormRadioYN(_AM_NEWS_EXPORT_INCTOPICS, 'includetopics',0),false); - $sform->addElement(new XoopsFormHidden('op', 'launchexport'), false); - $button_tray = new XoopsFormElementTray('' ,''); - $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit'); - $button_tray->addElement($submit_btn); - $sform->addElement($button_tray); - $sform->display(); -} - - -function news_utf8_encode($text) -{ - return xoops_utf8_encode($text); -} - -// Launch stories export (to the xml's format) -function LaunchExport() -{ - xoops_cp_header(); - news_adminmenu(4); - echo '<br />'; - $story = new NewsStory(); - $topic= new NewsTopic(); - $exportedstories=array(); - $date1=$_POST['date1']; - $date2=$_POST['date2']; - $timestamp1=mktime(0,0,0,intval(substr($date1,5,2)), intval(substr($date1,8,2)), intval(substr($date1,0,4))); - $timestamp2=mktime(23,59,59,intval(substr($date2,5,2)), intval(substr($date2,8,2)), intval(substr($date2,0,4))); - $topiclist=''; - if(isset($_POST['export_topics'])) { - $topiclist=implode(',',$_POST['export_topics']); - } - $topicsexport=intval($_POST['includetopics']); - $tbltopics=array(); - $exportedstories=$story->NewsExport($timestamp1, $timestamp2, $topiclist, $topicsexport, $tbltopics); - if(count($exportedstories)) { - $xmlfile=XOOPS_ROOT_PATH.'/uploads/stories.xml'; - $fp=fopen($xmlfile,'w'); - if(!$fp) { - redirect_header('index.php',4,sprintf(_AM_NEWS_EXPORT_ERROR,$xmlfile)); - } - - fwrite($fp,news_utf8_encode("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")); - fwrite($fp,news_utf8_encode("<news_stories>\n")); - if($topicsexport) { - foreach($tbltopics as $onetopic) { - $topic->NewsTopic($onetopic); - $content = "<news_topic>\n"; - $content .= sprintf("\t<topic_id>%u</topic_id>\n",$topic->topic_id()); - $content .= sprintf("\t<topic_pid>%u</topic_pid>\n",$topic->topic_pid()); - $content .= sprintf("\t<topic_imgurl>%s</topic_imgurl>\n",$topic->topic_imgurl()); - $content .= sprintf("\t<topic_title>%s</topic_title>\n",$topic->topic_title('F')); - $content .= sprintf("\t<menu>%d</menu>\n",$topic->menu()); - $content .= sprintf("\t<topic_frontpage>%d</topic_frontpage>\n",$topic->topic_frontpage()); - $content .= sprintf("\t<topic_rssurl>%s</topic_rssurl>\n",$top... [truncated message content] |