示例#1
0
 /**
  * xos_kernel_Xoops2::themeSelect()
  *
  * @return void
  */
 function themeSelect()
 {
     if (!empty($_POST['xoops_theme_select']) && in_array($_POST['xoops_theme_select'], xoops_getConfigOption('theme_set_allowed'))) {
         xoops_setConfigOption('theme_set', $_POST['xoops_theme_select']);
         $_SESSION['xoopsUserTheme'] = $_POST['xoops_theme_select'];
     } else {
         if (!empty($_SESSION['xoopsUserTheme']) && in_array($_SESSION['xoopsUserTheme'], xoops_getConfigOption('theme_set_allowed'))) {
             xoops_setConfigOption('theme_set', $_SESSION['xoopsUserTheme']);
         }
     }
 }
示例#2
0
 /**
  * Constructer
  *
  */
 function __construct()
 {
     $cpanel = xoops_getConfigOption('cpanel');
     $this->loadGui($cpanel);
 }
示例#3
0
/**
 * xoops_header()
 *
 * @param mixed $closehead
 * @return
 */
function xoops_header($closehead = true)
{
    global $xoopsConfig, $xoopsTheme, $xoopsConfigMetaFooter;
    $myts =& MyTextSanitizer::getInstance();
    if (!headers_sent()) {
        header('Content-Type:text/html; charset=' . _CHARSET);
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0');
        header("Pragma: no-cache");
    }
    echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
    echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '">
          <head>
          <meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />
          <meta http-equiv="content-language" content="' . _LANGCODE . '" />
          <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']) . '" />
          <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']) . '" />
          <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_desc']) . '" />
          <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']) . '" />
          <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']) . '" />
          <meta name="copyright" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']) . '" />
          <meta name="generator" content="XOOPS" />
          <title>' . htmlspecialchars($xoopsConfig['sitename']) . '</title>
          <script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script>';
    $themecss = xoops_getcss($xoopsConfig['theme_set']);
    echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css" />';
    $language = xoops_getConfigOption('language');
    if (file_exists($GLOBALS['xoops']->path('language/' . $language . '/style.css'))) {
        echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/language/' . $language . '/style.css" />';
    }
    if ($themecss) {
        echo '<link rel="stylesheet" type="text/css" media="all" href="' . $themecss . '" />';
    }
    if ($closehead) {
        echo '</head><body>';
    }
}
示例#4
0
    }
    if (strpos(XOOPS_VAR_PATH . '/', XOOPS_ROOT_PATH . '/') !== false || strpos(XOOPS_VAR_PATH . '/', $_SERVER['DOCUMENT_ROOT'] . '/') !== false) {
        xoops_error(sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_VAR_PATH));
        echo '<br />';
    }
}
if (!empty($_GET['xoopsorgnews'])) {
    // Multiple feeds
    $myts =& MyTextSanitizer::getInstance();
    $rssurl = array();
    $rssurl[] = 'http://sourceforge.net/export/rss2_projnews.php?group_id=41586&rss_fulltext=1';
    $rssurl[] = 'http://www.xoops.org/backend.php';
    if ($URLs = (include $GLOBALS['xoops']->path('language/' . xoops_getConfigOption('language') . '/backend.php'))) {
        $rssurl = array_unique(array_merge($rssurl, $URLs));
    }
    $rssfile = 'adminnews-' . xoops_getConfigOption('language');
    xoops_load('XoopsCache');
    $items = array();
    if (!($items = XoopsCache::read($rssfile))) {
        require_once $GLOBALS['xoops']->path('class/snoopy.php');
        include_once $GLOBALS['xoops']->path('class/xml/rss/xmlrss2parser.php');
        xoops_load('XoopsLocal');
        $snoopy = new Snoopy();
        $cnt = 0;
        foreach ($rssurl as $url) {
            if ($snoopy->fetch($url)) {
                $rssdata = $snoopy->results;
                $rss2parser = new XoopsXmlRss2Parser($rssdata);
                if (false != $rss2parser->parse()) {
                    $_items = $rss2parser->getItems();
                    $count = count($_items);
示例#5
0
 /**
  * Load localization information
  *
  * Folder structure for localization:
  *                                                                             <ul>themes/themefolder/english
  *                                                                                 <li>main.php - language definitions</li>
  *                                                                                 <li>style.css - localization stylesheet</li>
  *                                                                                 <li>script.js - localization script</li>
  *                                                                             </ul>
  */
 function loadLocalization($type = "main")
 {
     $language = xoops_getConfigOption('language');
     // Load global localization stylesheet if available
     if (file_exists($GLOBALS['xoops']->path('language/' . $language . '/style.css'))) {
         $this->addStylesheet($GLOBALS['xoops']->url('language/' . $language . '/style.css'));
     }
     if (!file_exists($this->path . '/language/' . $language)) {
         return true;
     }
     $this->addLanguage($type);
     // Load theme localization stylesheet and scripts if available
     if (file_exists($this->path . '/language/' . $language . '/script.js')) {
         $this->addScript($this->url . '/language/' . $language . '/script.js');
     }
     if (file_exists($this->path . '/language/' . $language . '/style.css')) {
         $this->addStylesheet($this->url . '/language/' . $language . '/style.css');
     }
     return true;
 }