Example #1
0
/**
 * Function to respond to a trackback
 */
function newbb_trackback_response($error = 0, $error_message = '')
{
    require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.config.php";
    $moduleConfig = newbb_loadConfig();
    if (!empty($moduleConfig["rss_utf8"])) {
        $charset = "utf-8";
        $error_message = xoops_utf8_encode($error_message);
    } else {
        $charset = _CHARSET;
    }
    header('Content-Type: text/xml; charset="' . $charset . '"');
    if ($error) {
        echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
        echo "<response>\n";
        echo "<error>1</error>\n";
        echo "<message>{$error_message}</message>\n";
        echo "</response>";
        die;
    } else {
        echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
        echo "<response>\n";
        echo "<error>0</error>\n";
        echo "</response>";
    }
}
Example #2
0
        $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
        $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
        $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_category', 'News');
        $tpl->assign('channel_generator', 'XOOPS');
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif');
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
        if (empty($dimention[0])) {
            $width = 88;
        } else {
            $width = $dimention[0] > 144 ? 144 : $dimention[0];
        }
        if (empty($dimention[1])) {
            $height = 31;
        } else {
            $height = $dimention[1] > 400 ? 400 : $dimention[1];
        }
        $tpl->assign('image_width', $width);
        $tpl->assign('image_height', $height);
        $count = $sarray;
        foreach ($sarray as $story) {
            //$tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode($myts->undoHtmlSpecialChars($story->hometext(), ENT_QUOTES))));
            $tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
        }
    }
}
$tpl->display('db:system_rss.html');
Example #3
0
    if (is_array($sarray)) {
        $tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
        $tpl->assign('channel_link', XOOPS_URL . '/');
        $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
        $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
        $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
        $tpl->assign('channel_editor', $xoopsConfig['adminmail']);
        $tpl->assign('channel_category', 'News');
        $tpl->assign('channel_generator', 'SmartSection');
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif');
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
        if (empty($dimention[0])) {
            $width = 88;
        } else {
            $width = $dimention[0] > 144 ? 144 : $dimention[0];
        }
        if (empty($dimention[1])) {
            $height = 31;
        } else {
            $height = $dimention[1] > 400 ? 400 : $dimention[1];
        }
        $tpl->assign('image_width', $width);
        $tpl->assign('image_height', $height);
        $count = $sarray;
        foreach ($sarray as $item) {
            $tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($item->title(), ENT_QUOTES)), 'link' => $item->getItemUrl(), 'guid' => $item->getItemUrl(), 'pubdate' => formatTimestamp($item->getVar('datesub'), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($item->summary(), ENT_QUOTES))));
        }
    }
}
$tpl->display('db:system_rss.html');
Example #4
0
/**
 * Converts text to UTF-8 encoded text
 * @see xoops_utf8_encode
 * @todo Move to a static class method - String
 */
function xoops_convert_encoding(&$text)
{
    return xoops_utf8_encode($text);
}
Example #5
0
 /**
  * Function to respond to a trackback
  */
 function art_trackback_response($error = 0, $error_message = '')
 {
     $moduleConfig = art_load_config();
     if (!empty($moduleConfig["do_trackbackutf8"])) {
         $charset = "utf-8";
         $error_message = xoops_utf8_encode($error_message);
     } else {
         $charset = _CHARSET;
     }
     header('Content-Type: text/xml; charset="' . $charset . '"');
     if ($error) {
         echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
         echo "<response>\n";
         echo "<error>1</error>\n";
         echo "<message>{$error_message}</message>\n";
         echo "</response>";
         die;
     } else {
         echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
         echo "<response>\n";
         echo "<error>0</error>\n";
         echo "</response>";
     }
 }
Example #6
0
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="Refresh" content="<?echo $refresh; ?>" />
<link rel="stylesheet" type="text/css" charset="EUC-JP" media="all" href="<?php 
    echo XOOPS_URL;
    ?>
/modules/cubeUtils/images/igoogle.css" />
<base target="__blank" />
</head>
<body><div class="xoops-content">
    <?php 
    echo $content;
    ?>
</div></body></html>
<?php 
} else {
    $site = xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
    header('Content-type: text/xml; charset=UTF-8', true);
    echo '<?xml version="1.0" encoding="UTF-8" ?>';
    ?>
<Module>
  <ModulePrefs
    title="__UP_title__"
    title_url="<?php 
    echo XOOPS_URL;
    ?>
"
    height="200" > 
    <Require feature="dynamic-height" />
  </ModulePrefs>
  <UserPref name="title" default_value="<?echo $site ?> Block" />
  <UserPref name="height" display_name="Height" default_value="200" />
Example #7
0
        $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
        $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true));
        // Fed up with spam
        $tpl->assign('channel_category', htmlspecialchars($xt->topic_title(), ENT_QUOTES));
        $tpl->assign('channel_generator', 'XOOPS');
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif');
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
        if (empty($dimention[0])) {
            $width = 88;
        } else {
            $width = $dimention[0] > 144 ? 144 : $dimention[0];
        }
        if (empty($dimention[1])) {
            $height = 31;
        } else {
            $height = $dimention[1] > 400 ? 400 : $dimention[1];
        }
        $tpl->assign('image_width', $width);
        $tpl->assign('image_height', $height);
        $count = $sarray;
        foreach ($sarray as $story) {
            $storytitle = htmlspecialchars($story->title(), ENT_QUOTES);
            $description = htmlspecialchars($story->hometext(), ENT_QUOTES);
            $tpl->append('items', array('title' => xoops_utf8_encode($storytitle), 'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode($description)));
        }
    }
}
$tpl->display('db:news_rss.html', $topicid);
Example #8
0
function news_utf8_encode($text)
{
    return xoops_utf8_encode($text);
}
Example #9
0
    $tpl->assign('channel_link', XOOPS_URL . '/');
    $tpl->assign('channel_desc', xoops_utf8_encode($slogan));
    $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
    $tpl->assign('channel_webmaster', xoops_utf8_encode($email));
    $tpl->assign('channel_editor', xoops_utf8_encode($email));
    $tpl->assign('channel_category', xoops_utf8_encode($categoryTitle));
    $tpl->assign('channel_generator', xoops_utf8_encode(oledrion_utils::getModuleName()));
    $tpl->assign('channel_language', _LANGCODE);
    $tpl->assign('image_url', XOOPS_URL . '/images/logo.png');
    $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.png');
    if (empty($dimention[0])) {
        $width = 88;
    } else {
        $width = $dimention[0] > 144 ? 144 : $dimention[0];
    }
    if (empty($dimention[1])) {
        $height = 31;
    } else {
        $height = $dimention[1] > 400 ? 400 : $dimention[1];
    }
    $tpl->assign('image_width', $width);
    $tpl->assign('image_height', $height);
    $products = $h_oledrion_products->getRecentProducts(new oledrion_parameters(array('start' => 0, 'limit' => $limit, 'category' => $cat_cid)));
    foreach ($products as $item) {
        $title = htmlspecialchars($item->getVar('product_title'), ENT_QUOTES);
        $description = htmlspecialchars(strip_tags($item->getVar('product_summary')), ENT_QUOTES);
        $link = $item->getLink();
        $tpl->append('items', array('title' => xoops_utf8_encode($title), 'link' => $link, 'guid' => $link, 'pubdate' => formatTimestamp($item->getVar('product_submitted'), 'rss'), 'description' => xoops_utf8_encode($description)));
    }
}
$tpl->display('db:oledrion_rss.tpl', $cat_cid);
Example #10
0
 function executeViewIndex(&$controller, &$xoopsUser, &$render)
 {
     $xoopsConfig = $controller->mRoot->mContext->mXoopsConfig;
     //
     // Set up the render buffer.
     //
     $renderSystem =& $controller->mRoot->getRenderSystem('Legacy_RenderSystem');
     $renderTarget =& $renderSystem->createRenderTarget('main');
     $renderTarget->setTemplateName("legacy_rss.html");
     $renderTarget->setAttribute('channel_title', $xoopsConfig['sitename']);
     $renderTarget->setAttribute('channel_link', XOOPS_URL . '/');
     $renderTarget->setAttribute('channel_desc', $xoopsConfig['slogan']);
     $renderTarget->setAttribute('channel_lastbuild', formatTimestamp(time(), 'rss'));
     $renderTarget->setAttribute('channel_webmaster', $xoopsConfig['adminmail']);
     $renderTarget->setAttribute('channel_editor', $xoopsConfig['adminmail']);
     $renderTarget->setAttribute('channel_category', 'News');
     $renderTarget->setAttribute('channel_generator', 'XOOPS Cube');
     $renderTarget->setAttribute('image_url', XOOPS_URL . '/images/logo.gif');
     $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
     $width = 0;
     if (empty($dimention[0])) {
         $width = 88;
     } else {
         $width = $dimention[0] > 144 ? 144 : $dimention[0];
     }
     $height = 0;
     if (empty($dimention[1])) {
         $height = 31;
     } else {
         $height = $dimention[1] > 400 ? 400 : $dimention[1];
     }
     $renderTarget->setAttribute('image_width', $width);
     $renderTarget->setAttribute('image_height', $height);
     $renderTarget->setAttribute('items', $this->mItems);
     //
     // Rendering
     //
     $renderSystem->render($renderTarget);
     if (function_exists('mb_http_output')) {
         mb_http_output('pass');
     }
     header('Content-Type:text/xml; charset=utf-8');
     print xoops_utf8_encode($renderTarget->getResult());
     exit(0);
 }
Example #11
0
/**
* @desc Genera la información para mostrar la Sindicación
* @param int Limite de resultados
* @return Array
*/
function &mywords_rssshow($limit)
{
    global $util, $mc;
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    include_once XOOPS_ROOT_PATH . '/modules/mywords/class/mwcategory.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/mywords/class/mwpost.class.php';
    foreach ($_GET as $k => $v) {
        ${$k} = $v;
    }
    $feed = array();
    // Información General
    $ret = array();
    $mc =& $util->moduleConfig('mywords');
    if ($show == 'all') {
        $feed['title'] = htmlspecialchars(_MI_MW_RSSNAME);
        $feed['link'] = XOOPS_URL . '/modules/mywords';
        $feed['description'] = htmlspecialchars($util->filterTags($mc['rssdesc']));
        $sql = "SELECT * FROM " . $db->prefix("mw_posts") . " WHERE aprovado='1' AND estado>'0' ORDER BY modificado DESC LIMIT 0,{$limit}";
    } else {
        if ($id == '') {
            return;
        }
        $cat = new MWCategory($id);
        if ($cat->isNew()) {
            return;
        }
        $feed['title'] = sprintf(_MI_MW_RSSNAMECAT, $cat->getName());
        $feed['link'] = $cat->getLink();
        $feed['description'] = $cat->getDescription();
        $sql = "SELECT b.* FROM " . $db->prefix("mw_catpost") . " a," . $db->prefix("mw_posts") . " b WHERE a.cat='" . $cat->getID() . "' AND b.id_post=a.post AND b.aprovado='1' AND b.estado>'0' ORDER BY b.modificado DESC LIMIT 0,{$limit}";
    }
    // Generamos los elementos
    $result = $db->query($sql);
    $posts = array();
    while ($row = $db->fetchArray($result)) {
        $post = new MWPost();
        $post->assignVars($row);
        $rtn = array();
        $rtn['title'] = $post->getTitle();
        $rtn['link'] = $post->getPermaLink();
        $rtn['description'] = xoops_utf8_encode(htmlspecialchars($post->getHomeText(), ENT_QUOTES));
        $rtn['pubDate'] = formatTimestamp($post->getDate());
        $posts[] = $rtn;
    }
    $ret = array('feed' => $feed, 'items' => $posts);
    return $ret;
}
Example #12
0
function &xoops_convert_encoding(&$text, $to = 'utf-8', $from = '')
{
    if (is_callable(array("XoopsLocal", "convert_encoding"))) {
        return XoopsLocal::convert_encoding($text, $to, $from);
    }
    if (strtolower($to) != "utf-8") {
        return $text;
    }
    return xoops_utf8_encode($text);
}
if (!empty($_POST['as_dw_extension_zip'])) {
    require_once XOOPS_ROOT_PATH . '/class/zipdownloader.php';
    $downloader = new XoopsZipDownloader();
    $do_download = true;
} else {
    if (!empty($_POST['as_dw_extension_tgz'])) {
        require_once XOOPS_ROOT_PATH . '/class/tardownloader.php';
        $downloader = new XoopsTarDownloader();
        $do_download = true;
    }
}
if (!empty($do_download)) {
    // make files for each tplsvars
    foreach ($tplsvarsinfo_total as $key => $val) {
        $name = substr($key, 1);
        $description = htmlspecialchars(xoops_utf8_encode(xoops_substr($val, 0, 256)), ENT_QUOTES);
        $snippet_body = sprintf($snippet_format, $name, $description);
        $file_name = strtr($key, '.', '_') . '.csn';
        $downloader->addFileData($snippet_body, $dw_snippets_dirname . '/' . $file_name);
    }
    // make a mxi file per module
    foreach ($tplsvarsinfo_mod_tpl as $mod_name => $tplsvarsinfo_tpl) {
        $file_entries = '';
        foreach ($tplsvarsinfo_tpl as $tpl_name => $tplsvarsinfo) {
            foreach ($tplsvarsinfo as $key => $val) {
                $name = substr($key, 1);
                $file_name = strtr($key, '.', '_') . '.csn';
                $file_entries .= "\t\t" . '<file name="' . $dw_snippets_dirname . '/' . $file_name . '" destination="$Dreamweaver/Configuration/Snippets/XOOPS-' . $site_name . '/' . $tpl_name . '" />' . "\n";
            }
        }
        $mxi_body = get_mxi_body($mod_name, $file_entries);
Example #14
0
File: kml.php Project: nouphet/rata
        $xml .= '
	    <Placemark>
	      <name>' . $title . '</name>
	      <description>
' . $desc . '
	      </description>
	      <lid>' . $lid . '</lid><icd>' . $icon . '</icd>
	      <coordinates>' . $lng . ',' . $lat . ',' . $zoom . '</coordinates>
	    </Placemark>';
    } else {
        $xml .= '
	    <Placemark>
	      <name>' . $title . '</name>
	      <description>
	        <![CDATA[
' . $desc . '
	        ]]>
	      </description>' . $iconstyle . '	      
	      <Point>
	        <coordinates>' . $lng . ',' . $lat . ',0</coordinates>
	      </Point>
	    </Placemark>';
    }
}
$xml .= '
</Document>';
if ($mtype == G_KML) {
    $xml .= '</kml>';
}
print xoops_utf8_encode($xml);
exit(0);
Example #15
0
} else {
    $cat = intval($_GET['cat']);
}
if (function_exists('mb_http_output')) {
    mb_http_output('pass');
}
header('Content-Type:text/xml; charset=utf-8');
$tpl = new XoopsTpl();
$tpl->xoops_setCaching(0);
$tpl->xoops_setCacheTime($xoopsModuleConfig['rss_cache_time'] * 60);
if (!$tpl->is_cached('db:extcal_rss.html', $cat)) {
    $events = $eventHandler->getUpcommingEvent($xoopsModuleConfig['rss_nb_event'], $cat);
    if (is_array($events)) {
        $tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
        $tpl->assign('channel_link', XOOPS_URL . '/');
        $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
        $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
        $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
        $tpl->assign('channel_editor', $xoopsConfig['adminmail']);
        $tpl->assign('channel_category', 'Event');
        $tpl->assign('channel_generator', 'XOOPS');
        $tpl->assign('channel_language', _LANGCODE);
        $tpl->assign('image_url', XOOPS_URL . '/modules/extcal/images/extcal_logo.png');
        $tpl->assign('image_width', 92);
        $tpl->assign('image_height', 52);
        foreach ($events as $event) {
            $tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($event->getVar('event_title'), ENT_QUOTES)), 'link' => XOOPS_URL . '/modules/extcal/event.php?event=' . $event->getVar('event_id'), 'guid' => XOOPS_URL . '/modules/extcal/event.php?event=' . $event->getVar('event_id'), 'pubdate' => formatTimestamp($event->getVar('event_submitdate'), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($event->getVar('event_desc'), ENT_QUOTES))));
        }
    }
}
$tpl->display('db:extcal_rss.html', $cat);