[ Index ] |
|
Code source de XOOPS 2.0.17.1 |
1 <?php 2 // $Id: admin.php 1074 2007-10-11 15:21:11Z phppp $ 3 // ------------------------------------------------------------------------ // 4 // XOOPS - PHP Content Management System // 5 // Copyright (c) 2000 XOOPS.org // 6 // <http://www.xoops.org/> // 7 // ------------------------------------------------------------------------ // 8 // This program is free software; you can redistribute it and/or modify // 9 // it under the terms of the GNU General Public License as published by // 10 // the Free Software Foundation; either version 2 of the License, or // 11 // (at your option) any later version. // 12 // // 13 // You may not change or alter any portion of this comment or credits // 14 // of supporting developers from this source code or any supporting // 15 // source code which is considered copyrighted (c) material of the // 16 // original comment or credit authors. // 17 // // 18 // This program is distributed in the hope that it will be useful, // 19 // but WITHOUT ANY WARRANTY; without even the implied warranty of // 20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 21 // GNU General Public License for more details. // 22 // // 23 // You should have received a copy of the GNU General Public License // 24 // along with this program; if not, write to the Free Software // 25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 26 // ------------------------------------------------------------------------ // 27 28 $xoopsOption['pagetype'] = "admin"; 29 include "mainfile.php"; 30 include XOOPS_ROOT_PATH."/include/cp_functions.php"; 31 /*********************************************************/ 32 /* Admin Authentication */ 33 /*********************************************************/ 34 35 if ( $xoopsUser ) { 36 if ( !$xoopsUser->isAdmin(-1) ) { 37 redirect_header("index.php",2,_AD_NORIGHT); 38 exit(); 39 } 40 } else { 41 redirect_header("index.php",2,_AD_NORIGHT); 42 exit(); 43 } 44 $op = "list"; 45 46 if ( !empty($_GET['op']) ) { 47 $op = $_GET['op']; 48 } 49 50 if ( !empty($_POST['op']) ) { 51 $op = $_POST['op']; 52 } 53 54 if (!file_exists(XOOPS_CACHE_PATH.'/adminmenu.php') && $op != 'generate') { 55 xoops_header(); 56 xoops_confirm(array('op' => 'generate'), 'admin.php', _AD_PRESSGEN); 57 xoops_footer(); 58 exit(); 59 } 60 61 switch ($op) { 62 case "list": 63 xoops_cp_header(); 64 // ###### Output warn messages for security ###### 65 if (is_dir(XOOPS_ROOT_PATH."/install/" )) { 66 xoops_error(sprintf(_WARNINSTALL2,XOOPS_ROOT_PATH.'/install/')); 67 echo '<br />'; 68 } 69 if ( is_writable(XOOPS_ROOT_PATH."/mainfile.php" ) ) { 70 xoops_error(sprintf(_WARNINWRITEABLE,XOOPS_ROOT_PATH.'/mainfile.php')); 71 echo '<br />'; 72 } 73 if (!empty($_GET['xoopsorgnews'])) { 74 $rssurl = 'http://sourceforge.net/export/rss2_projnews.php?group_id=41586&rss_fulltext=1'; 75 $rssfile = XOOPS_CACHE_PATH.'/adminnews.xml'; 76 $rssdata = ''; 77 if (!file_exists($rssfile) || filemtime($rssfile) < time() - 86400) { 78 require_once XOOPS_ROOT_PATH.'/class/snoopy.php'; 79 $snoopy = new Snoopy; 80 if ($snoopy->fetch($rssurl)) { 81 $rssdata = $snoopy->results; 82 if (false !== $fp = fopen($rssfile, 'w')) { 83 fwrite($fp, $rssdata); 84 } 85 fclose($fp); 86 } 87 } else { 88 if (false !== $fp = fopen($rssfile, 'r')) { 89 while (!feof ($fp)) { 90 $rssdata .= fgets($fp, 4096); 91 } 92 fclose($fp); 93 } 94 } 95 if ($rssdata != '') { 96 include_once XOOPS_ROOT_PATH.'/class/xml/rss/xmlrss2parser.php'; 97 $rss2parser = new XoopsXmlRss2Parser($rssdata); 98 if (false != $rss2parser->parse()) { 99 echo '<table class="outer" width="100%">'; 100 $items =& $rss2parser->getItems(); 101 $count = count($items); 102 $myts =& MyTextSanitizer::getInstance(); 103 for ($i = 0; $i < $count; $i++) { 104 echo '<tr class="head"><td><a href="'.htmlspecialchars($items[$i]['link']).'" target="_blank">'; 105 echo htmlspecialchars($items[$i]['title']).'</a> ('.htmlspecialchars($items[$i]['pubdate']).')</td></tr>'; 106 if ($items[$i]['description'] != "") { 107 echo '<tr><td class="odd">'.utf8_decode($items[$i]['description']); 108 if ($items[$i]['guid'] != "") { 109 echo ' <a href="'.htmlspecialchars($items[$i]['guid']).'" target="_blank">'._MORE.'</a>'; 110 } 111 echo '</td></tr>'; 112 } elseif ($items[$i]['guid'] != "") { 113 echo '<tr><td class="even" valign="top"></td><td colspan="2" class="odd"><a href="'.htmlspecialchars($items[$i]['guid']).'" target="_blank">'._MORE.'</a></td></tr>'; 114 } 115 } 116 echo '</table>'; 117 } else { 118 echo $rss2parser->getErrors(); 119 } 120 } 121 } 122 xoops_cp_footer(); 123 break; 124 case 'generate': 125 xoops_module_write_admin_menu(xoops_module_get_admin_menu()); 126 redirect_header('admin.php', 1, _AD_LOGINADMIN); 127 break; 128 default: 129 break; 130 } 131 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Nov 25 11:44:32 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |