当前位置: 首页>>代码示例>>PHP>>正文


PHP mosParameters::set方法代码示例

本文整理汇总了PHP中mosParameters::set方法的典型用法代码示例。如果您正苦于以下问题:PHP mosParameters::set方法的具体用法?PHP mosParameters::set怎么用?PHP mosParameters::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mosParameters的用法示例。


在下文中一共展示了mosParameters::set方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plgContentJCommentsLinksJ10

function plgContentJCommentsLinksJ10($published, &$row, &$params, $page = 0)
{
    global $task, $option, $my;
    // disable comments link in 3rd party components (except Events and AlphaContent)
    if ($option != 'com_content' && $option != 'com_frontpage' && $option != 'com_alphacontent' && $option != 'com_events') {
        return;
    }
    require_once JCOMMENTS_HELPERS . '/content.php';
    require_once JCOMMENTS_LIBRARIES . '/joomlatune/language.tools.php';
    if (!isset($params) || $params == null) {
        $params = new mosParameters('');
    }
    $pvars = array_keys(get_object_vars($params->_params));
    if (!$published || $params->get('popup') || in_array('moduleclass_sfx', $pvars)) {
        JCommentsContentPluginHelper::processForeignTags($row, true);
        JCommentsContentPluginHelper::clear($row, true);
        return;
    }
    /*
    if ($option == 'com_frontpage') {
    	$pluginParams = JCommentsPluginHelper::getParams('jcomments', 'content');
    	if ((int) $pluginParams->get('show_frontpage', 1) == 0) {
    		return;
    	}
    }
    */
    require_once JCOMMENTS_BASE . '/jcomments.config.php';
    require_once JCOMMENTS_BASE . '/jcomments.class.php';
    if ($task != 'view') {
        // replace other comment systems tags to JComments equivalents like {jcomments on}
        JCommentsContentPluginHelper::processForeignTags($row, false);
        // show link to comments only
        if ($row->access <= $my->gid) {
            $readmore_link = JCommentsObjectHelper::getLink($row->id, 'com_content');
            $readmore_register = 0;
        } else {
            $readmore_link = sefRelToAbs('index.php?option=com_registration&amp;task=register');
            $readmore_register = 1;
        }
        $tmpl = JCommentsFactory::getTemplate($row->id, 'com_content', false);
        $tmpl->load('tpl_links');
        $tmpl->addVar('tpl_links', 'comments_link_style', $readmore_register ? -1 : 1);
        $tmpl->addVar('tpl_links', 'link-readmore', $readmore_link);
        $tmpl->addVar('tpl_links', 'content-item', $row);
        if ($params->get('readmore') == 0 || @$row->readmore == 0) {
            $tmpl->addVar('tpl_links', 'readmore_link_hidden', 1);
        } else {
            if (@$row->readmore > 0) {
                $tmpl->addVar('tpl_links', 'readmore_link_hidden', 0);
            }
        }
        $config = JCommentsFactory::getConfig();
        $commentsDisabled = false;
        if (!JCommentsContentPluginHelper::checkCategory($row->catid)) {
            $commentsDisabled = true;
        }
        if ($config->getInt('comments_off', 0) == 1) {
            $commentsDisabled = true;
        } else {
            if ($config->getInt('comments_on', 0) == 1) {
                $commentsDisabled = false;
            }
        }
        $tmpl->addVar('tpl_links', 'comments_link_hidden', intval($commentsDisabled));
        $count = 0;
        // do not query comments count if comments disabled and link hidden
        if (!$commentsDisabled) {
            require_once JCOMMENTS_MODELS . '/jcomments.php';
            require_once JCOMMENTS_LIBRARIES . '/joomlatune/language.tools.php';
            $acl = JCommentsFactory::getACL();
            $options = array();
            $options['object_id'] = (int) $row->id;
            $options['object_group'] = 'com_content';
            $options['published'] = $acl->canPublish() || $acl->canPublishForObject($row->id, 'com_content') ? null : 1;
            $count = JCommentsModel::getCommentsCount($options);
            $anchor = $count == 0 ? '#addcomments' : '#comments';
            $link_text = $count == 0 ? JText::_('LINK_ADD_COMMENT') : JText::plural('LINK_READ_COMMENTS', $count);
            $tmpl->addVar('tpl_links', 'link-comment', $readmore_link . $anchor);
            $tmpl->addVar('tpl_links', 'link-comment-text', $link_text);
            $tmpl->addVar('tpl_links', 'link-comments-class', 'comments-link');
            $tmpl->addVar('tpl_links', 'comments-count', $count);
        }
        if ($readmore_register == 1 && $count == 0) {
            $tmpl->addVar('tpl_links', 'comments_link_hidden', 1);
        }
        if ($readmore_register == 1) {
            $readmore_text = JText::_('LINK_REGISTER_TO_READ_MORE');
        } else {
            $readmore_text = JText::_('LINK_READ_MORE');
        }
        $tmpl->addVar('tpl_links', 'link-readmore-text', $readmore_text);
        $tmpl->addVar('tpl_links', 'link-readmore-title', $row->title);
        $tmpl->addVar('tpl_links', 'link-readmore-class', 'readmore-link');
        JCommentsContentPluginHelper::clear($row, true);
        $row->text .= $tmpl->renderTemplate('tpl_links');
        $GLOBALS['jcomments_params_readmore'] = $params->get('readmore');
        $GLOBALS['jcomments_row_readmore'] = $row->readmore;
        $params->set('readmore', 0);
        $row->readmore = 0;
    } else {
//.........这里部分代码省略.........
开发者ID:sergy444,项目名称:joomla,代码行数:101,代码来源:jcomments.j10.php

示例2: listWeblinks

function listWeblinks($catid)
{
    global $mainframe, $database, $my;
    global $mosConfig_live_site;
    global $Itemid;
    $rows = array();
    $currentcat = null;
    if ($catid) {
        // url links info for category
        $query = "SELECT id, url, title, description, date, hits, params" . "\n FROM #__weblinks" . "\n WHERE catid = " . (int) $catid . "\n AND published = 1" . "\n AND archived = 0" . "\n ORDER BY ordering";
        $database->setQuery($query);
        $rows = $database->loadObjectList();
        // current cate info
        $query = "SELECT *" . "\n FROM #__categories" . "\n WHERE id = " . (int) $catid . "\n AND published = 1" . "\n AND access <= " . (int) $my->gid;
        $database->setQuery($query);
        $database->loadObject($currentcat);
        /*
        Check if the category is published or if access level allows access
        */
        if (!$currentcat->name) {
            mosNotAuth();
            return;
        }
    }
    /* Query to retrieve all categories that belong under the web links section and that are published. */
    $query = "SELECT cc.*, a.catid, a.title, a.url, COUNT(a.id) AS numlinks" . "\n FROM #__categories AS cc" . "\n LEFT JOIN #__weblinks AS a ON a.catid = cc.id" . "\n WHERE a.published = 1" . "\n AND section = 'com_weblinks'" . "\n AND cc.published = 1" . "\n AND cc.access <= " . (int) $my->gid . "\n GROUP BY cc.id" . "\n ORDER BY cc.ordering";
    $database->setQuery($query);
    $categories = $database->loadObjectList();
    // Parameters
    $menu = $mainframe->get('menu');
    $params = new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('header', $menu->name);
    $params->def('pageclass_sfx', '');
    $params->def('headings', 1);
    $params->def('hits', $mainframe->getCfg('hits'));
    $params->def('item_description', 1);
    $params->def('other_cat_section', 1);
    $params->def('other_cat', 1);
    $params->def('description', 1);
    $params->def('description_text', _WEBLINKS_DESC);
    $params->def('image', '-1');
    $params->def('weblink_icons', '');
    $params->def('image_align', 'right');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    if ($catid) {
        $params->set('type', 'category');
    } else {
        $params->set('type', 'section');
    }
    // page description
    $currentcat->descrip = '';
    if (@$currentcat->description != '') {
        $currentcat->descrip = $currentcat->description;
    } else {
        if (!$catid) {
            // show description
            if ($params->get('description')) {
                $currentcat->descrip = $params->get('description_text');
            }
        }
    }
    // page image
    $currentcat->img = '';
    $path = $mosConfig_live_site . '/images/stories/';
    if (@$currentcat->image != '') {
        $currentcat->img = $path . $currentcat->image;
        $currentcat->align = $currentcat->image_position;
    } else {
        if (!$catid) {
            if ($params->get('image') != -1) {
                $currentcat->img = $path . $params->get('image');
                $currentcat->align = $params->get('image_align');
            }
        }
    }
    // page header
    $currentcat->header = '';
    if (@$currentcat->name != '') {
        $currentcat->header = $currentcat->name;
    } else {
        $currentcat->header = $params->get('header');
    }
    // used to show table rows in alternating colours
    $tabclass = array('sectiontableentry1', 'sectiontableentry2');
    HTML_weblinks::displaylist($categories, $rows, $catid, $currentcat, $params, $tabclass);
}
开发者ID:allenahner,项目名称:mizzou,代码行数:87,代码来源:weblinks.php

示例3: showFeed

function showFeed($feedid)
{
    global $database, $mainframe, $mosConfig_absolute_path, $mosConfig_cachepath, $Itemid, $my;
    // check if cache directory is writeable
    $cacheDir = $mosConfig_cachepath . '/';
    if (!is_writable($cacheDir)) {
        echo 'Cache Directory Unwriteable';
        return;
    }
    require_once $mainframe->getPath('class');
    $newsfeed = new mosNewsFeed($database);
    $newsfeed->load((int) $feedid);
    /*
     * Check if newsfeed is published
     */
    if (!$newsfeed->published) {
        mosNotAuth();
        return;
    }
    $category = new mosCategory($database);
    $category->load((int) $newsfeed->catid);
    /*
     * Check if newsfeed category is published
     */
    if (!$category->published) {
        mosNotAuth();
        return;
    }
    /*
     * check whether category access level allows access
     */
    if ($category->access > $my->gid) {
        mosNotAuth();
        return;
    }
    // full RSS parser used to access image information
    require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_rss.php';
    $LitePath = $mosConfig_absolute_path . '/includes/Cache/Lite.php';
    // Adds parameter handling
    $menu = $mainframe->get('menu');
    $params = new mosParameters($menu->params);
    $params->def('page_title', 1);
    $params->def('header', $menu->name);
    $params->def('pageclass_sfx', '');
    $params->def('back_button', $mainframe->getCfg('back_button'));
    // Feed Display control
    $params->def('feed_image', 1);
    $params->def('feed_descr', 1);
    $params->def('item_descr', 1);
    $params->def('word_count', 0);
    // Encoding
    $params->def('utf8', 1);
    if (!$params->get('page_title')) {
        $params->set('header', '');
    }
    $and = '';
    if ($feedid) {
        $and = "\n AND id = {$feedid}";
    }
    $mainframe->SetPageTitle($menu->name);
    HTML_newsfeed::showNewsfeeds($newsfeed, $LitePath, $cacheDir, $params);
}
开发者ID:allenahner,项目名称:mizzou,代码行数:62,代码来源:newsfeeds.php

示例4: showItem

function showItem($uid, $gid, &$access, $pop, $option = 'com_content', $now)
{
    global $database, $mainframe, $Itemid;
    global $mosConfig_MetaTitle, $mosConfig_MetaAuthor;
    $now = _CURRENT_SERVER_TIME;
    $nullDate = $database->getNullDate();
    if ($access->canEdit) {
        $xwhere = '';
    } else {
        $xwhere = " AND ( a.state = 1 OR a.state = -1 )" . "\n AND ( a.publish_up = " . $database->Quote($nullDate) . " OR a.publish_up <= " . $database->Quote($now) . " )" . "\n AND ( a.publish_down = " . $database->Quote($nullDate) . " OR a.publish_down >= " . $database->Quote($now) . " )";
    }
    // main query
    $query = "SELECT a.*, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups," . "\n s.published AS sec_pub, cc.published AS cat_pub, s.access AS sec_access, cc.access AS cat_access," . "\n s.id AS sec_id, cc.id as cat_id" . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope = 'content'" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE a.id = " . (int) $uid . $xwhere . "\n AND a.access <= " . (int) $gid;
    $database->setQuery($query);
    $row = NULL;
    if ($database->loadObject($row)) {
        /*
         * check whether category is published
         */
        if (!$row->cat_pub && $row->catid) {
            mosNotAuth();
            return;
        }
        /*
         * check whether section is published
         */
        if (!$row->sec_pub && $row->sectionid) {
            mosNotAuth();
            return;
        }
        /*
         * check whether category access level allows access
         */
        if ($row->cat_access > $gid && $row->catid) {
            mosNotAuth();
            return;
        }
        /*
         * check whether section access level allows access
         */
        if ($row->sec_access > $gid && $row->sectionid) {
            mosNotAuth();
            return;
        }
        $params = new mosParameters($row->attribs);
        $params->set('intro_only', 0);
        $params->def('back_button', $mainframe->getCfg('back_button'));
        if ($row->sectionid == 0) {
            $params->set('item_navigation', 0);
        } else {
            $params->set('item_navigation', $mainframe->getCfg('item_navigation'));
        }
        // loads the links for Next & Previous Button
        if ($params->get('item_navigation')) {
            // Paramters for menu item as determined by controlling Itemid
            $menu = $mainframe->get('menu');
            $mparams = new mosParameters($menu->params);
            // the following is needed as different menu items types utilise a different param to control ordering
            // for Blogs the `orderby_sec` param is the order controlling param
            // for Table and List views it is the `orderby` param
            $mparams_list = $mparams->toArray();
            if (array_key_exists('orderby_sec', $mparams_list)) {
                $order_method = $mparams->get('orderby_sec', '');
            } else {
                $order_method = $mparams->get('orderby', '');
            }
            // additional check for invalid sort ordering
            if ($order_method == 'front') {
                $order_method = '';
            }
            $orderby = _orderby_sec($order_method);
            // array of content items in same category correctly ordered
            $query = "SELECT a.id" . "\n FROM #__content AS a" . "\n WHERE a.catid = " . (int) $row->catid . "\n AND a.state = " . (int) $row->state . ($access->canEdit ? '' : "\n AND a.access <= " . (int) $gid) . $xwhere . "\n ORDER BY {$orderby}";
            $database->setQuery($query);
            $list = $database->loadResultArray();
            // this check needed if incorrect Itemid is given resulting in an incorrect result
            if (!is_array($list)) {
                $list = array();
            }
            // location of current content item in array list
            $location = array_search($uid, $list);
            $row->prev = '';
            $row->next = '';
            if ($location - 1 >= 0) {
                // the previous content item cannot be in the array position -1
                $row->prev = $list[$location - 1];
            }
            if ($location + 1 < count($list)) {
                // the next content item cannot be in an array position greater than the number of array postions
                $row->next = $list[$location + 1];
            }
        }
        // page title
        $mainframe->setPageTitle($row->title);
        if ($mosConfig_MetaTitle == '1') {
            $mainframe->addMetaTag('title', $row->title);
        }
        if ($mosConfig_MetaAuthor == '1') {
            $mainframe->addMetaTag('author', $row->author);
        }
//.........这里部分代码省略.........
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:101,代码来源:content.php

示例5: die

<?php

/* ja_cssmenu.php @copyright (C) 2005 Joomlart.com (formerly MamboTheme.com)*/
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
$japarams = new mosParameters('');
global $ja_template_name;
$japarams->set('template', $ja_template_name);
//	Change this value to correct template
$japarams->set('absPath', $mosConfig_absolute_path . '/templates/' . $japarams->get('template') . '/ja_cssmenu');
$japarams->set('LSPath', $mosConfig_live_site . '/templates/' . $japarams->get('template') . '/ja_cssmenu');
$japarams->set('menutype', 'mainmenu');
//	Source of menu
include_once $japarams->get('absPath') . '/ja-menulib.php';
global $my;
$jamenu = new JAMenu($database, $japarams);
$jamenu->genMenu();
开发者ID:allenahner,项目名称:mizzou,代码行数:16,代码来源:ja_cssmenu.php

示例6: contactpage

function contactpage($contact_id)
{
    global $mainframe, $database, $my, $Itemid;
    $query = "SELECT a.id AS value, CONCAT_WS( ' - ', a.name, a.con_position ) AS text, a.catid, cc.access AS cat_access" . "\n FROM #__contact_details AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n WHERE a.published = 1" . "\n AND cc.published = 1" . "\n AND a.access <= " . (int) $my->gid . "\n ORDER BY a.default_con DESC, a.ordering ASC";
    $database->setQuery($query);
    $checks = $database->loadObjectList();
    $count = count($checks);
    if ($count) {
        if ($contact_id < 1) {
            $contact_id = $checks[0]->value;
        }
        $query = "SELECT a.*, cc.access AS cat_access" . "\n FROM #__contact_details AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n WHERE a.published = 1" . "\n AND a.id = " . (int) $contact_id . "\n AND a.access <= " . (int) $my->gid;
        $database->SetQuery($query);
        $contacts = $database->LoadObjectList();
        if (!$contacts) {
            echo _NOT_AUTH;
            return;
        }
        $contact = $contacts[0];
        /*
         * check whether category access level allows access
         */
        if ($contact->cat_access > $my->gid) {
            mosNotAuth();
            return;
        }
        $list = array();
        foreach ($checks as $check) {
            if ($check->catid == $contact->catid) {
                $list[] = $check;
            }
        }
        // creates dropdown select list
        $contact->select = mosHTML::selectList($list, 'contact_id', 'class="inputbox" onchange="ViewCrossReference(this);"', 'value', 'text', $contact_id);
        // Adds parameter handling
        $params = new mosParameters($contact->params);
        $params->set('page_title', 0);
        $params->def('pageclass_sfx', '');
        $params->def('back_button', $mainframe->getCfg('back_button'));
        $params->def('print', !$mainframe->getCfg('hidePrint'));
        $params->def('name', 1);
        $params->def('email', 0);
        $params->def('street_address', 1);
        $params->def('suburb', 1);
        $params->def('state', 1);
        $params->def('country', 1);
        $params->def('postcode', 1);
        $params->def('telephone', 1);
        $params->def('fax', 1);
        $params->def('misc', 1);
        $params->def('image', 1);
        $params->def('email_description', 1);
        $params->def('email_description_text', _EMAIL_DESCRIPTION);
        $params->def('email_form', 1);
        $params->def('email_copy', 0);
        // global pront|pdf|email
        $params->def('icons', $mainframe->getCfg('icons'));
        // contact only icons
        $params->def('contact_icons', 0);
        $params->def('icon_address', '');
        $params->def('icon_email', '');
        $params->def('icon_telephone', '');
        $params->def('icon_fax', '');
        $params->def('icon_misc', '');
        $params->def('drop_down', 0);
        $params->def('vcard', 0);
        if ($contact->email_to && $params->get('email')) {
            // email cloacking
            $contact->email = mosHTML::emailCloaking($contact->email_to);
        }
        // loads current template for the pop-up window
        $pop = intval(mosGetParam($_REQUEST, 'pop', 0));
        if ($pop) {
            $params->set('popup', 1);
            $params->set('back_button', 0);
        }
        if ($params->get('email_description')) {
            $params->set('email_description', $params->get('email_description_text'));
        } else {
            $params->set('email_description', '');
        }
        // needed to control the display of the Address marker
        $temp = $params->get('street_address') . $params->get('suburb') . $params->get('state') . $params->get('country') . $params->get('postcode');
        $params->set('address_check', $temp);
        // determines whether to use Text, Images or nothing to highlight the different info groups
        switch ($params->get('contact_icons')) {
            case 1:
                // text
                $params->set('marker_address', _CONTACT_ADDRESS);
                $params->set('marker_email', _CONTACT_EMAIL);
                $params->set('marker_telephone', _CONTACT_TELEPHONE);
                $params->set('marker_fax', _CONTACT_FAX);
                $params->set('marker_misc', _CONTACT_MISC);
                $params->set('column_width', '100');
                break;
            case 2:
                // none
                $params->set('marker_address', '');
                $params->set('marker_email', '');
                $params->set('marker_telephone', '');
//.........这里部分代码省略.........
开发者ID:allenahner,项目名称:mizzou,代码行数:101,代码来源:contact.php

示例7: botTinymceEditorInit

/**
* TinyMCE WYSIWYG Editor - javascript initialisation
*/
function botTinymceEditorInit()
{
    global $mosConfig_live_site, $database, $mosConfig_absolute_path, $mainframe;
    // load tinymce info
    $query = "SELECT params" . "\n FROM #__mambots" . "\n WHERE element = 'tinymce'" . "\n AND folder = 'editors'";
    $database->setQuery($query);
    $database->loadObject($mambot);
    $params = new mosParameters($mambot->params);
    $theme = $params->get('theme', 'advanced');
    // handling for former default option
    if ($theme == 'default') {
        $theme = 'advanced';
    }
    $toolbar = $params->def('toolbar', 'top');
    $html_height = $params->def('html_height', '550');
    $html_width = $params->def('html_width', '750');
    $text_direction = $params->def('text_direction', 'ltr');
    $content_css = $params->def('content_css', 1);
    $content_css_custom = $params->def('content_css_custom', '');
    $invalid_elements = $params->def('invalid_elements', 'script,applet,iframe');
    $newlines = $params->def('newlines', 0);
    $cleanup = $params->def('cleanup', 1);
    $cleanup_startup = $params->set('cleanup_startup', 0);
    // Currently disabled due to bugs in TinyMCE
    $compressed = $params->def('compressed', 0);
    $relative_urls = $params->def('relative_urls', 0);
    // Plugins
    // preview
    $preview = $params->def('preview', 1);
    $preview_height = $params->def('preview_height', '550');
    $preview_width = $params->def('preview_width', '750');
    // insert date
    $insertdate = $params->def('insertdate', 1);
    $format_date = $params->def('format_date', '%Y-%m-%d');
    // insert time
    $inserttime = $params->def('inserttime', 1);
    $format_time = $params->def('format_time', '%H:%M:%S');
    // search & replace
    $searchreplace = $params->def('searchreplace', 1);
    // emotions
    $smilies = $params->def('smilies', 1);
    // flash
    $flash = $params->def('flash', 1);
    // table
    $table = $params->def('table', 1);
    // horizontal line
    $hr = $params->def('hr', 1);
    // fullscreen
    $fullscreen = $params->def('fullscreen', 1);
    // autosave
    $autosave = $params->def('autosave', 0);
    // layer
    $layer = $params->def('layer', 1);
    // style
    $style = $params->def('style', 1);
    // visualchars
    $visualchars = $params->def('visualchars', 1);
    // media
    $media = $params->def('media', 1);
    // nonbreaking
    $nonbreaking = $params->def('nonbreaking', 1);
    if ($relative_urls) {
        $relative_urls = 'true';
    } else {
        $relative_urls = 'false';
    }
    if ($content_css_custom) {
        $content_css = 'content_css : "' . $content_css_custom . '", ';
    } else {
        $query = "SELECT template" . "\n FROM #__templates_menu" . "\n WHERE client_id = 0" . "\n AND menuid = 0";
        $database->setQuery($query);
        $template = $database->loadResult();
        $file_path = $mosConfig_absolute_path . '/templates/' . $template . '/css/';
        if ($content_css) {
            $file = 'template.css';
        } else {
            $file = 'editor_content.css';
        }
        $content_css = 'content_css : "' . $mosConfig_live_site . '/templates/' . $template . '/css/';
        if (file_exists($file_path . '/' . $file)) {
            $content_css = $content_css . $file . '", ';
        } else {
            $content_css = $content_css . 'template_css.css", ';
        }
    }
    $plugins[] = '';
    $buttons2[] = '';
    $buttons3[] = '';
    $elements[] = '';
    if ($cleanup) {
        $cleanup = 'true';
    } else {
        $cleanup = 'false';
    }
    if ($cleanup_startup) {
        $cleanup_startup = 'true';
    } else {
//.........这里部分代码省略.........
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:101,代码来源:tinymce.php

示例8: mosParameters

     $params = new mosParameters($my->params, $file, 'component');
     $now = time();
     // expired page functionality handling
     $expired = $params->def('expired', '');
     $expired_time = $params->def('expired_time', '');
     // if now expired link set or expired time is more than half the admin session life set, simply load normal admin homepage
     $checktime = ($mosConfig_session_life_admin ? $mosConfig_session_life_admin : 1800) / 2;
     if (!$expired || $now - $expired_time > $checktime) {
         $expired = 'index2.php';
     }
     // link must also be a Joomla link to stop malicious redirection
     if (strpos($expired, 'index2.php?option=com_') !== 0) {
         $expired = 'index2.php';
     }
     // clear any existing expired page data
     $params->set('expired', '');
     $params->set('expired_time', '');
     // param handling
     if (is_array($params->toArray())) {
         $txt = array();
         foreach ($params->toArray() as $k => $v) {
             $txt[] = "{$k}={$v}";
         }
         $saveparams = implode("\n", $txt);
     }
     // save cleared expired page info to user data
     $query = "UPDATE #__users" . "\n SET params = " . $database->Quote($saveparams) . "\n WHERE id = " . (int) $my->id . "\n AND username = " . $database->Quote($my->username) . "\n AND usertype = " . $database->Quote($my->usertype);
     $database->setQuery($query);
     $database->query();
 }
 // check if auto_purge value set
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:31,代码来源:index.php

示例9: die

<?php

/* ja_transmenu.php @copyright (C) 2005 Joomlart.com (formerly MamboTheme.com)*/
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
global $ja_template_name;
$japarams = new mosParameters('');
$japarams->set('template', $ja_template_name);
//	Change this value to correct template
$japarams->set('absPath', $mosConfig_absolute_path . '/templates/' . $japarams->get('template') . '/ja_transmenu');
$japarams->set('LSPath', $mosConfig_live_site . '/templates/' . $japarams->get('template') . '/ja_transmenu');
$japarams->set('menutype', 'mainmenu');
//	Source of menu
//Set style for menu
$japarams->set('menu_style', 'horizontal');
//	Value: horizontal, vertical
$japarams->set('menu_direction', 'down');
//	Value: down, right
$japarams->set('menu_position', 'bottomLeft');
//	Value: bottomLeft, bottomRight, topLeft, topRight
$japarams->set('p_t', '0');
$japarams->set('p_l', '0');
$japarams->set('class_sfx', '-trans');
$japarams->set('subpad_x', '0');
$japarams->set('subpad_y', '0');
$japarams->set('menu_images', '0');
$japarams->set('menu_images_align', '0');
include_once $japarams->get('absPath') . '/ja-menulib.php';
global $my;
$jamenu = new JAMenu($database, $japarams);
$jamenu->genMenu();
?>
开发者ID:allenahner,项目名称:mizzou,代码行数:31,代码来源:ja_transmenu.php

示例10: initSessionAdmin

 function initSessionAdmin($option, $task)
 {
     global $_VERSION, $mosConfig_admin_expired;
     // logout check
     if ($option == 'logout') {
         require $GLOBALS['mosConfig_absolute_path'] . '/administrator/logout.php';
         exit;
     }
     $site = $GLOBALS['mosConfig_live_site'];
     // check if session name corresponds to correct format
     if (session_name() != md5($site)) {
         echo "<script>document.location.href='index.php'</script>\n";
         exit;
     }
     // restore some session variables
     $my = new mosUser($this->_db);
     $my->id = intval(mosGetParam($_SESSION, 'session_user_id', ''));
     $my->username = strval(mosGetParam($_SESSION, 'session_username', ''));
     $my->usertype = strval(mosGetParam($_SESSION, 'session_usertype', ''));
     $my->gid = intval(mosGetParam($_SESSION, 'session_gid', ''));
     $my->params = mosGetParam($_SESSION, 'session_user_params', '');
     $session_id = mosGetParam($_SESSION, 'session_id', '');
     $logintime = mosGetParam($_SESSION, 'session_logintime', '');
     if ($session_id != session_id()) {
         // session id does not correspond to required session format
         echo "<script>document.location.href='index.php?mosmsg=Invalid Session'</script>\n";
         exit;
     }
     // check to see if session id corresponds with correct format
     if ($session_id == md5($my->id . $my->username . $my->usertype . $logintime)) {
         // if task action is to `save` or `apply` complete action before doing session checks.
         if ($task != 'save' && $task != 'apply') {
             // test for session_life_admin
             if (@$GLOBALS['mosConfig_session_life_admin']) {
                 $session_life_admin = $GLOBALS['mosConfig_session_life_admin'];
             } else {
                 $session_life_admin = 1800;
             }
             // purge expired admin sessions only
             $past = time() - $session_life_admin;
             $query = "DELETE FROM #__session" . "\n WHERE time < '" . (int) $past . "'" . "\n AND guest = 1" . "\n AND gid = 0" . "\n AND userid <> 0";
             $this->_db->setQuery($query);
             $this->_db->query();
             $current_time = time();
             // update session timestamp
             $query = "UPDATE #__session" . "\n SET time = " . $this->_db->Quote($current_time) . "\n WHERE session_id = " . $this->_db->Quote($session_id);
             $this->_db->setQuery($query);
             $this->_db->query();
             // set garbage cleaning timeout
             $this->setSessionGarbageClean();
             // check against db record of session
             $query = "SELECT COUNT( session_id )" . "\n FROM #__session" . "\n WHERE session_id = " . $this->_db->Quote($session_id) . "\n AND username = " . $this->_db->Quote($my->username) . "\n AND userid = " . intval($my->id);
             $this->_db->setQuery($query);
             $count = $this->_db->loadResult();
             // if no entry in session table that corresponds boot from admin area
             if ($count == 0) {
                 $link = NULL;
                 if ($_SERVER['QUERY_STRING']) {
                     $link = 'index2.php?' . $_SERVER['QUERY_STRING'];
                 }
                 // check if site designated as a production site
                 // for a demo site disallow expired page functionality
                 // link must also be a Joomla link to stop malicious redirection
                 if ($link && strpos($link, 'index2.php?option=com_') === 0 && $_VERSION->SITE == 1 && @$mosConfig_admin_expired === '1') {
                     $now = time();
                     $file = $this->getPath('com_xml', 'com_users');
                     if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
                         $params = new mosParameters($my->params, $file, 'component');
                     } else {
                         $errorlevel = error_reporting();
                         error_reporting(0);
                         $params = new mosParameters($my->params, $file, 'component');
                         error_reporting($errorlevel);
                     }
                     // return to expired page functionality
                     $params->set('expired', $link);
                     $params->set('expired_time', $now);
                     // param handling
                     if (is_array($params->toArray())) {
                         $txt = array();
                         foreach ($params->toArray() as $k => $v) {
                             $txt[] = "{$k}={$v}";
                         }
                         $saveparams = implode("\n", $txt);
                     }
                     // save expired page info to user data
                     $query = "UPDATE #__users" . "\n SET params = " . $this->_db->Quote($saveparams) . "\n WHERE id = " . (int) $my->id . "\n AND username = " . $this->_db->Quote($my->username) . "\n AND usertype = " . $this->_db->Quote($my->usertype);
                     $this->_db->setQuery($query);
                     $this->_db->query();
                 }
                 echo "<script>document.location.href='index.php?mosmsg=Admin Session Expired'</script>\n";
                 exit;
             } else {
                 // load variables into session, used to help secure /popups/ functionality
                 $_SESSION['option'] = $option;
                 $_SESSION['task'] = $task;
             }
         }
     } else {
         if ($session_id == '') {
//.........这里部分代码省略.........
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:101,代码来源:joomla.php


注:本文中的mosParameters::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。