You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.1 KiB
84 lines
2.1 KiB
<?php |
|
|
|
/** |
|
* AVE.cms - Модуль RSS |
|
* |
|
* @package AVE.cms |
|
* @subpackage module_RSS |
|
* @filesource |
|
*/ |
|
|
|
if(!defined('BASE_DIR')) exit; |
|
|
|
if (defined('ACP')) |
|
{ |
|
$modul['ModuleName'] = 'RSS потоки'; |
|
$modul['ModuleSysName'] = 'rss'; |
|
$modul['ModuleVersion'] = '1.2'; |
|
$modul['ModuleDescription'] = 'Данный модуль предзназначен для организации RSS потоков на вашем сайте.'; |
|
$modul['ModuleAutor'] = 'AVE.CMS Team'; |
|
$modul['ModuleCopyright'] = '© 2007-2013 AVE.CMS'; |
|
$modul['ModuleIsFunction'] = 1; |
|
$modul['ModuleAdminEdit'] = 1; |
|
$modul['ModuleFunction'] = 'mod_rss'; |
|
$modul['ModuleTag'] = '[mod_rss:XXX]'; |
|
$modul['ModuleTagLink'] = null; |
|
$modul['ModuleAveTag'] = '#\\\[mod_rss:(\\\d+)]#'; |
|
$modul['ModulePHPTag'] = "<?php mod_rss(''$1''); ?>"; |
|
} |
|
|
|
/** |
|
* Обработка тега модуля RSS |
|
* |
|
* @param int $rss_id идентификатор RSS-ленты |
|
*/ |
|
function mod_rss($rss_id) |
|
{ |
|
$rss_id = preg_replace('/\D/', '', $rss_id); |
|
|
|
if (is_numeric($rss_id)) |
|
{ |
|
echo '<a href="', ABS_PATH, 'rss/rss-', $rss_id, '.xml" target="blank"><img src="', |
|
ABS_PATH, 'modules/rss/templates/feed.gif" border="0" title="RSS лента новостей" /></a>'; |
|
} |
|
} |
|
|
|
if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'rss' |
|
&& isset($_REQUEST['do']) && $_REQUEST['do'] == 'show') |
|
{ |
|
header('Location:rss/index.php?id=' . $_GET['id']); |
|
} |
|
|
|
if (defined('ACP') && !empty($_REQUEST['moduleaction'])) |
|
{ |
|
require(BASE_DIR . '/modules/rss/class.rss.php'); |
|
|
|
switch ($_REQUEST['moduleaction']) |
|
{ |
|
case '1': |
|
$tpl_dir = BASE_DIR . '/modules/rss/templates/'; |
|
$lang_file = BASE_DIR . '/modules/rss/lang/' . $_SESSION['user_language'] . '.txt'; |
|
Rss::rssList($tpl_dir, $lang_file); |
|
break; |
|
|
|
case 'add': |
|
Rss::rssNew(); |
|
break; |
|
|
|
case 'del': |
|
Rss::rssDelete(); |
|
break; |
|
|
|
case 'edit': |
|
$tpl_dir = BASE_DIR . '/modules/rss/templates/'; |
|
$lang_file = BASE_DIR . '/modules/rss/lang/' . $_SESSION['user_language'] . '.txt'; |
|
Rss::rssEdit($tpl_dir, $lang_file); |
|
break; |
|
|
|
case 'saveedit': |
|
Rss::rssSave(); |
|
break; |
|
} |
|
} |
|
|
|
?>
|