Ejemplo n.º 1
0
<?php

require '../../mainfile.php';
require_once XOOPS_ROOT_PATH . '/class/template.php';
require_once dirname(__FILE__) . '/include/functions.php';
require_once dirname(__FILE__) . '/include/wap_ua.inc.php';
$mydirname = basename(dirname(__FILE__));
if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) {
    echo "invalid dirname: " . htmlspecialchars($mydirname);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
// WAP
$wap_type = wap_ua();
// template object
$tpl = new XoopsTpl();
$tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH . '/themes');
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(0);
$hlman =& xoops_getmodulehandler('headline');
$hlid = isset($_GET['id']) ? intval($_GET['id']) : 0;
//$xoopsOption['template_main'] = "xhld{$mydirnumber}_index.html";
//include XOOPS_ROOT_PATH.'/header.php';
$headlines =& $hlman->getObjects(new Criteria('headline_display', 1));
$count = count($headlines);
/*for ($i = 0; $i < $count; $i++) {
	$tpl->append('feed_sites', array('id' => $headlines[$i]->getVar('headline_id'), 'name' => $headlines[$i]->getVar('headline_name'), 'syndication' => $headlines[$i]->getVar('headline_syndication')));
}*/
$tpl->assign('mod_url', XOOPS_URL . '/modules/' . $mydirname);
$dtfmt_short = empty($xoopsModuleConfig["dtfmt_short"]) ? '' : $xoopsModuleConfig["dtfmt_short"];
if ($hlid == 0) {
    if (!empty($xoopsModuleConfig["index_viewmode"])) {
Ejemplo n.º 2
0
//  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 '../../mainfile.php';
include dirname(__FILE__) . '/include/functions.php';
include dirname(__FILE__) . '/include/wap_ua.inc.php';
$mydirname = basename(dirname(__FILE__));
if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) {
    echo "invalid dirname: " . htmlspecialchars($mydirname);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
// WAP
if (wap_ua() != 'HTML') {
    header("Location: " . XOOPS_URL . "/modules/{$mydirname}/wap.php");
}
$hlman =& xoops_getmodulehandler('headline');
$hlid = isset($_GET['id']) ? intval($_GET['id']) : 0;
$xoopsOption['template_main'] = "xhld{$mydirnumber}_index.html";
include XOOPS_ROOT_PATH . '/header.php';
$headlines =& $hlman->getObjects(new Criteria('headline_display', 1));
$count = count($headlines);
for ($i = 0; $i < $count; $i++) {
    $xoopsTpl->append('feed_sites', array('id' => $headlines[$i]->getVar('headline_id'), 'name' => $headlines[$i]->getVar('headline_name'), 'syndication' => $headlines[$i]->getVar('headline_syndication')));
}
$xoopsTpl->assign('lang_headlines', _HL_HEADLINES);
$xoopsTpl->assign('mod_url', XOOPS_URL . '/modules/' . $mydirname);
if ($hlid == 0) {
    // Hack by Tom