Esempio n. 1
0
        $tpl->assign('channel_lastbuild', wani_utf8_encode(date("r")));
        $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
        $tpl->assign('channel_editor', $xoopsConfig['adminmail']);
        $tpl->assign('channel_category', 'New Contents of Mylinks');
        $tpl->assign('channel_generator', XOOPS_VERSION);
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . "/{$logo}");
        $tpl->assign('channel_pubdate', wani_utf8_encode(date("r")));
        $tpl->assign('channel_copyright', 'wanisys');
        $dimention = getimagesize(XOOPS_ROOT_PATH . "/{$logo}");
        $width = empty($dimention[0]) ? 88 : $dimention[0] > 144 ? 144 : $dimention[0];
        $height = empty($dimention[1]) ? 31 : $dimention[1] > 400 ? 400 : $dimention[1];
        $tpl->assign('image_width', $width);
        $tpl->assign('image_height', $height);
        foreach ($new_array as $new) {
            $title = wani_utf8_encode(wani_make_html_title($new['title']));
            $link = $new['link'];
            $pubdate = '';
            if (isset($new['time'])) {
                $pubdate = wani_utf8_encode(date("r", $new['time']));
            }
            $description = '';
            if (isset($new['description'])) {
                $description = $new['description'];
                $description = wani_make_html_summary($description, $RSS_DESC_MAX);
                $description = wani_utf8_encode($description);
            }
            $tpl->append('items', array('title' => $title, 'link' => $link, 'guid' => $link, 'pubdate' => $pubdate, 'description' => $description));
        }
    }
}
Esempio n. 2
0
if ($cache) {
    $tpl->xoops_setCaching(2);
    $tpl->xoops_setCacheTime(3600);
}
if (!$tpl->is_cached("file:{$template}") || !$cache) {
    if (count($new_array) > 0) {
        $tpl->assign('xoops_charset', _CHARSET);
        $tpl->assign('site_url', XOOPS_URL . '/');
        $tpl->assign('site_name', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
        $tpl->assign('site_desc', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
        $tpl->assign('image_url', XOOPS_URL . "/{$logo}");
        $i = 0;
        $block = array();
        foreach ($new_array as $new) {
            $line['link'] = $new['link'];
            $line['title'] = wani_make_html_title($new['title']);
            $description = '';
            if (isset($new['description'])) {
                $description = $new['description'];
                $description = wani_make_html_summary($description, $PDA_DESC_MAX);
            }
            $line['desc'] = $description;
            $line['date_s'] = formatTimestamp($new['time'], 's');
            $block[] = $line;
            $i++;
        }
        $tpl->assign('whatsnew', $block);
    }
}
$tpl->display("file:{$template}");
exit;