<?php require dirname(dirname(__FILE__)) . '/include/common_prepend.inc.php'; $xoopsOption['template_main'] = $mydirname . '_main_eachpipe.html'; // xoops header include XOOPS_ROOT_PATH . '/header.php'; // fetch pipe_row $pipe_id = intval(@$_GET['pipe_id']); $pipe4assign = d3pipes_common_get_pipe4assign($mydirname, $pipe_id); // specialcheck for eachpipe if (empty($pipe4assign['main_disp'])) { redirect_header(XOOPS_URL . '/modules/' . $mydirname . '/', 3, _MD_D3PIPES_ERR_INVALIDPIPEID); exit; } // parse the pipe once $entries = d3pipes_common_fetch_entries($mydirname, $pipe4assign, $xoopsModuleConfig['entries_per_eachpipe'], $errors, $xoopsModuleConfig); // pagetitle & xoops_breadcrumbs $pagetitle4assign = empty($pipe4assign['name']) ? _MD_D3PIPES_H2_EACHPIPE : $pipe4assign['name']; $xoops_breadcrumbs[] = array('name' => $pagetitle4assign); // assign $xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'xoops_config' => $xoopsConfig, 'mod_config' => $xoopsModuleConfig, 'xoops_breadcrumbs' => $xoops_breadcrumbs, 'xoops_pagetitle' => $pagetitle4assign, 'errors' => $errors, 'clipping_count' => d3pipes_main_get_clipping_count_moduledb($mydirname, $pipe_id), 'pipe' => $pipe4assign, 'entries' => $entries, 'timezone_offset' => xoops_getUserTimestamp(0), 'xoops_module_header' => d3pipes_main_get_link2rss($mydirname, $pipe_id, $pipe4assign) . d3pipes_main_get_link2maincss($mydirname) . $xoopsTpl->get_template_vars("xoops_module_header"))); include XOOPS_ROOT_PATH . '/footer.php';
// fetch link2clipping $link2clipping = empty($_GET['link2clipping']) ? false : true; // fetch keep_pipeinfo $keep_pipeinfo = empty($_GET['keep_pipeinfo']) ? false : true; // fetch pipe_row $pipe_ids = empty($_GET['pipe_ids']) ? array(0) : explode(',', preg_replace('/[^0-9,:]/', '', $_GET['pipe_ids'])); if (sizeof($pipe_ids) == 1) { // single pipe $pipe4assign = d3pipes_common_get_pipe4assign($mydirname, intval($pipe_ids[0])); if (empty($pipe4assign)) { $entries = array(); $errors = array('Invalid pipe_id'); } else { $entries = d3pipes_common_fetch_entries($mydirname, $pipe4assign, $max_entries, $errors, $xoopsModuleConfig); } $pipes_entries = array(); } else { // Union object $union_obj =& d3pipes_common_get_joint_object($mydirname, 'union', $union_class, implode(',', $pipe_ids) . '||' . ($keep_pipeinfo ? 1 : 0)); $union_obj->setModConfigs($xoopsModuleConfig); $entries = $union_obj->execute(array(), $max_entries); $pipes_entries = method_exists($union_obj, 'getPipesEntries') ? $union_obj->getPipesEntries() : array(); $errors = $union_obj->getErrors(); } // assign require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; $xoopsTpl = new D3Tpl(); $xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'xoops_config' => $xoopsConfig, 'mod_config' => @$xoopsModuleConfig, 'xoops_breadcrumbs' => @$xoops_breadcrumbs, 'xoops_pagetitle' => @$pagetitle4assign, 'errors' => $errors, 'entries' => $entries, 'pipes_entries' => $pipes_entries, 'link2clipping' => $link2clipping, 'keep_pipeinfo' => $keep_pipeinfo, 'timezone_offset' => xoops_getUserTimestamp(0), 'xoops_module_header' => d3pipes_main_get_link2maincss($mydirname) . "\n" . $xoopsTpl->get_template_vars("xoops_module_header"))); $html = addslashes(strtr($xoopsTpl->fetch('db:' . $mydirname . '_main_jsbackend.html'), "\n\r", " ")); echo "d3pipes_insert_html('{$mydirname}_async_block_{$unique_id}','{$html}');"; exit;
redirect_header(XOOPS_URL . '/modules/' . $mydirname . '/', 3, _MD_D3PIPES_ERR_INVALIDPIPEID); exit; } // fetch entries $entries = d3pipes_common_fetch_entries($mydirname, $pipe4assign, $max_entries, $errors, $xoopsModuleConfig); // check lastfetch_time if (empty($pipe4assign['lastfetch_time'])) { $lastfetch_time = 0; foreach ($entries as $entry) { $lastfetch_time = max(@$entry['pipe']['lastfetch_time'], $lastfetch_time); } $pipe4assign['lastfetch_time'] = empty($lastfetch_time) ? time() : $lastfetch_time; } } // get lastmodified of all over of entries $entries_lastmodified = 0; foreach ($entries as $entry) { $entries_lastmodified = max($entries_lastmodified, $entry['pubtime']); } // Utf8from object $utf8from_obj =& d3pipes_common_get_joint_object_default($mydirname, 'utf8from', $xoopsModuleConfig['internal_encoding']); // assign require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; $xoopsTpl = new D3Tpl(); $xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'xoops_config' => $xoopsConfig, 'xoops_config_utf8' => array_map('d3pipes_common_filter_ietoutf8', $xoopsConfig), 'mod_config' => @$xoopsModuleConfig, 'xoops_breadcrumbs' => @$xoops_breadcrumbs, 'xoops_pagetitle' => @$pagetitle4assign, 'errors' => $errors, 'pipe' => $utf8from_obj->execute($pipe4assign), 'entries' => $utf8from_obj->execute($entries), 'entries_lastmodified' => $entries_lastmodified, 'timezone_offset' => xoops_getUserTimestamp(0), 'style' => $style, 'link_prefer' => $link_prefer, 'xoops_module_header' => d3pipes_main_get_link2maincss($mydirname) . "\n" . $xoopsTpl->get_template_vars("xoops_module_header"))); if (function_exists('mb_http_output')) { mb_http_output('pass'); } header('Content-Type:text/xml; charset=utf-8'); $xoopsTpl->display('db:' . $mydirname . '_independent_' . $style . '.html'); exit;