XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
backend.php
Go to the documentation of this file.
1 <?php
18 include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php';
19 
20 $GLOBALS['xoopsLogger']->activated = false;
21 if (function_exists('mb_http_output')) {
22  mb_http_output('pass');
23 }
24 header('Content-Type:text/xml; charset=utf-8');
25 
26 include_once $GLOBALS['xoops']->path('class/template.php');
27 $tpl = new XoopsTpl();
28 $tpl->caching = 2;
29 $tpl->cache_lifetime = 3600;
30 if (!$tpl->is_cached('db:system_rss.html')) {
31  xoops_load('XoopsLocal');
32  $tpl->assign('channel_title', XoopsLocal::convert_encoding(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
33  $tpl->assign('channel_link', XOOPS_URL . '/');
34  $tpl->assign('channel_desc', XoopsLocal::convert_encoding(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
35  $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
36  $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true));
37  $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true));
38  $tpl->assign('channel_category', 'News');
39  $tpl->assign('channel_generator', 'XOOPS');
40  $tpl->assign('channel_language', _LANGCODE);
41  $tpl->assign('image_url', XOOPS_URL . '/images/logo.png');
42  $dimension = getimagesize(XOOPS_ROOT_PATH . '/images/logo.png');
43  if (empty($dimension[0])) {
44  $width = 88;
45  } else {
46  $width = ($dimension[0] > 144) ? 144 : $dimension[0];
47  }
48  if (empty($dimension[1])) {
49  $height = 31;
50  } else {
51  $height = ($dimension[1] > 400) ? 400 : $dimension[1];
52  }
53  $tpl->assign('image_width', $width);
54  $tpl->assign('image_height', $height);
55  if (file_exists($fileinc = $GLOBALS['xoops']->path('modules/news/class/class.newsstory.php'))) {
56  include $fileinc;
57  $sarray = NewsStory::getAllPublished(10, 0, true);
58  }
59  if (!empty($sarray) && is_array($sarray)) {
60  foreach ($sarray as $story) {
61  $tpl->append('items', array(
62  'title' => XoopsLocal::convert_encoding(htmlspecialchars($story->title(), ENT_QUOTES)) ,
63  'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid() ,
64  'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid() ,
65  'pubdate' => formatTimestamp($story->published(), 'rss') ,
66  'description' => XoopsLocal::convert_encoding(htmlspecialchars($story->hometext(), ENT_QUOTES))));
67  }
68  }
69 }
70 $tpl->display('db:system_rss.html');
71 ?>