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


PHP COM_getArgument函数代码示例

本文整理汇总了PHP中COM_getArgument函数的典型用法代码示例。如果您正苦于以下问题:PHP COM_getArgument函数的具体用法?PHP COM_getArgument怎么用?PHP COM_getArgument使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: COM_applyFilter

if (isset($_REQUEST['msg'])) {
    $msg = COM_applyFilter($_REQUEST['msg']);
} else {
    $msg = '';
}
if (isset($_REQUEST['mode'])) {
    $mode = COM_applyFilter($_REQUEST['mode']);
} else {
    $mode = COM_getArgument('mode');
}
if (isset($_REQUEST['id'])) {
    $id = COM_sanitizeID($_REQUEST['id']);
} else {
    $id = COM_applyFilter(COM_getArgument('id'));
}
$page = COM_getArgument('page');
// Assume that the 'mode' is also (or only) the desired page to display
//if (empty($mode)) $id='';
if (empty($page)) {
    $page = $mode;
}
// Set up the basic menu for all users
$menu_opt = '';
USES_class_navbar();
$menu = new navbar();
$menu->add_menuitem($LANG_ADVT['mnu_home'], CLASSIFIEDS_makeURL('home'));
$menu->add_menuitem($LANG_ADVT['mnu_recent'], CLASSIFIEDS_makeURL('recent'));
// Show additional menu options to logged-in users
if (!$isAnon) {
    $menu->add_menuitem($LANG_ADVT['mnu_account'], CLASSIFIEDS_makeURL('account'));
    $menu->add_menuitem($LANG_ADVT['mnu_myads'], CLASSIFIEDS_makeURL('manage'));
开发者ID:JohnToro,项目名称:classifieds,代码行数:31,代码来源:index.php

示例2: MG_siteHeader

    exit;
}
if (COM_isAnonUser() && $_MG_CONF['loginrequired'] == 1) {
    $display = MG_siteHeader();
    $display .= SEC_loginRequiredForm();
    $display .= COM_siteFooter();
    echo $display;
    exit;
}
require_once $_CONF['path'] . 'plugins/mediagallery/include/init.php';
MG_initAlbums();
/*
* Main Function
*/
COM_setArgNames(array('aid', 'f', 'sort'));
$album_id = COM_applyFilter(COM_getArgument('aid'), true);
$T = new Template(MG_getTemplatePath($album_id));
$T->set_file(array('page' => 'playall_xspf.thtml'));
if ($MG_albums[$album_id]->access == 0) {
    $display .= COM_showMessageText($LANG_MG00['access_denied_msg'], $LANG_ACCESS['accessdenied'], true);
    $display .= MG_siteFooter();
    echo $display;
    exit;
}
$album_title = $MG_albums[$album_id]->title;
$album_desc = $MG_albums[$album_id]->description;
MG_usage('playalbum', $album_title, '', '');
$birdseed = '<a href="' . $_CONF['site_url'] . '/index.php">' . $LANG_MG03['home'] . '</a> ' . ($_MG_CONF['gallery_only'] == 1 ? '' : $_MG_CONF['seperator'] . ' <a href="' . $_MG_CONF['site_url'] . '/index.php">' . $_MG_CONF['menulabel'] . '</a> ') . $MG_albums[$album_id]->getPath(1, 0, 1);
$T->set_var(array('site_url' => $_MG_CONF['site_url'], 'birdseed' => $birdseed, 'pagination' => '<a href="' . $_MG_CONF['site_url'] . '/album.php?aid=' . $album_id . '&amp;page=1&amp;sort=' . '0' . '">' . $LANG_MG03['return_to_album'] . '</a>', 'album_title' => $album_title, 'album_desc' => $album_desc, 'aid' => $album_id, 'home' => $LANG_MG03['home'], 'return_to_album' => $LANG_MG03['return_to_album']));
/*
 * Need to handle empty albums a little better
开发者ID:spacequad,项目名称:glfusion,代码行数:31,代码来源:playall.php

示例3: Template

if (SEC_hasRights('filemgmt.user') or $mydownloads_publicpriv == 1) {
    $p = new Template($_CONF['path'] . 'plugins/filemgmt/templates');
    $p->set_file(array('page' => 'filelisting.thtml', 'records' => 'filelisting_record.thtml', 'category' => 'filelisting_category.thtml'));
    $p->set_var('layout_url', $_CONF['layout_url']);
    $p->set_var('site_url', $_CONF['site_url']);
    $p->set_var('site_admin_url', $_CONF['site_admin_url']);
    $p->set_var('xhtml', XHTML);
    $p->set_var('target', $CONF_FM['ignore_target'] ? '' : 'target="_blank"');
    $myts = new MyTextSanitizer();
    $mytree = new XoopsTree($_DB_name, $_FM_TABLES['filemgmt_cat'], "cid", "pid");
    $mytree->setGroupAccessFilter($_GROUPS);
    $display = '';
    //@@@@@20090602update urlrewrite ---->
    //$lid = COM_applyFilter($_GET['id'],true);
    COM_setArgNames(array('id'));
    $lid = COM_applyFilter(COM_getArgument('id'), true);
    //@@@@@20090602update urlrewrite<-----
    if ($lid == 0) {
        // Check if the script is being called from the commentbar
        $lid = str_replace('fileid_', '', $_POST['id']);
    }
    $groupsql = filemgmt_buildAccessSql();
    $sql = "SELECT COUNT(*) FROM {$_FM_TABLES['filemgmt_filedetail']} a ";
    $sql .= "LEFT JOIN {$_FM_TABLES['filemgmt_cat']} b ON a.cid=b.cid ";
    $sql .= "WHERE a.lid='{$lid}' {$groupsql} AND a.status > 0";
    list($fileAccessCnt) = DB_fetchArray(DB_query($sql));
    if ($fileAccessCnt > 0 and DB_count($_FM_TABLES['filemgmt_filedetail'], "lid", $lid) == 1) {
        $p->set_var('block_header', COM_startBlock("<b>" . $LANG_FILEMGMT['plugin_name'] . "</b>"));
        $p->set_var('block_footer', COM_endBlock());
        require_once $_CONF['path_system'] . 'lib-comment.php';
        $sql = "SELECT d.lid, d.cid, d.title, d.url, d.homepage, d.version, d.size, d.logourl, d.submitter, d.status, d.date, ";
开发者ID:milk54,项目名称:geeklog-japan,代码行数:31,代码来源:index.php

示例4: isset

/*if (empty($view)) {
    $view = isset($_EV_CONF['default_view']) ? $_EV_CONF['default_view'] : '';
}*/
if (isset($_GET['range'])) {
    $range = COM_applyFilter($_GET['range'], true);
} elseif (isset($_POST['range'])) {
    $range = COM_applyFilter($_POST['range'], true);
} else {
    $range = COM_applyFilter(COM_getArgument('range'), true);
}
if (isset($_GET['cat'])) {
    $category = COM_applyFilter($_GET['cat'], true);
} elseif (isset($_POST['cat'])) {
    $category = COM_applyFilter($_POST['cat'], true);
} else {
    $category = COM_applyFilter(COM_getArgument('cat'), true);
}
if (isset($_GET['cal'])) {
    $calendar = COM_applyFilter($_GET['cal'], true);
} elseif (isset($_POST['cal'])) {
    $calendar = COM_applyFilter($_POST['cal'], true);
} else {
    $calendar = '';
}
//$_REQUEST['event_type'] = $category;   // Hack
if (!empty($category)) {
    $catname = DB_getItem($_TABLES['evlist_categories'], 'name', "id = '{$category}'");
}
if (!empty($_REQUEST['msg'])) {
    $msg = COM_applyFilter($_REQUEST['msg'], true);
} else {
开发者ID:matrox66,项目名称:evlist,代码行数:31,代码来源:index.php

示例5: USES_evlist_class_ticket

     if ($_EV_CONF['enable_rsvp'] && !COM_isAnonUser()) {
         USES_evlist_class_ticket();
         $eid = COM_sanitizeID($_GET['eid'], false);
         $doc = evTicket::PrintTickets($eid, 0, $_USER['uid']);
         echo $doc;
         exit;
     } else {
         $content .= 'Function not available';
     }
     break;
 case 'view':
 default:
     if (empty($eid)) {
         // Default action, view the calendar or event
         COM_setArgNames(array('eid', 'ts', 'range', 'cat'));
         $eid = COM_sanitizeID(COM_getArgument('eid'), false);
     }
     if (!empty($eid)) {
         USES_evlist_class_repeat();
         $Rep = new evRepeat($eid);
         $pagetitle = COM_stripslashes($Rep->Event->title);
         if ($view == 'print') {
             $template = 'event_print';
             $query = '';
         }
         $query = isset($_GET['query']) ? $_GET['query'] : '';
         $content .= $Rep->Detail('', $query, $template);
     } else {
         // Shouldn't be in this file without an event ID to display or edit
         echo COM_refresh(EVLIST_URL . '/index.php');
         exit;
开发者ID:matrox66,项目名称:evlist,代码行数:31,代码来源:event.php

示例6: COM_handle404

*
* @package StaticPages
* @subpackage public_html
*/
/**
* Geeklog common function library
*/
require_once '../lib-common.php';
if (!in_array('staticpages', $_PLUGINS)) {
    COM_handle404();
    exit;
}
// MAIN
COM_setArgNames(array('page', 'disp_mode'));
$page = COM_applyFilter(COM_getArgument('page'));
$display_mode = COM_applyFilter(COM_getArgument('disp_mode'));
$query = '';
if (isset($_REQUEST['query'])) {
    $query = COM_applyfilter($_GET['query']);
}
TOPIC_getTopic('staticpages', $page);
// from comments display refresh:
if (isset($_REQUEST['order'])) {
    $comment_order = COM_applyFilter($_REQUEST['order']);
    $comment_mode = COM_applyFilter($_REQUEST['mode']);
    if (isset($_REQUEST['cpage'])) {
        $comment_page = COM_applyFilter($_REQUEST['cpage']);
    }
    if (strcasecmp($comment_order, 'ASC') != 0 && strcasecmp($comment_order, 'DESC') != 0) {
        $comment_order = '';
    }
开发者ID:milk54,项目名称:geeklog-japan,代码行数:31,代码来源:index.php

示例7: COM_refresh

// | 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.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
require_once '../lib-common.php';
if (!in_array('banner', $_PLUGINS)) {
    echo COM_refresh($_CONF['site_url'] . '/index.php');
    exit;
}
// MAIN
$url = '';
COM_setArgNames(array('what', 'item'));
$what = COM_getArgument('what');
if ($what == 'banner') {
    $item = COM_applyFilter(COM_getArgument('item'));
    if (!empty($item)) {
        // Hack: due to PLG_afterSaveSwitch settings, we may get
        // an attached &msg - strip it off
        $i = explode('&', $item);
        $item = $i[0];
    }
    if (!empty($item)) {
        $url = DB_getItem($_TABLES['banner'], 'url', "bid = '{$item}' AND (publishstart IS NULL OR publishstart < NOW()) and (publishend IS NULL OR publishend > NOW())");
        if (!empty($url)) {
            DB_change($_TABLES['banner'], 'hits', 'hits + 1', 'bid', $item, '', true);
        }
    }
}
if (empty($url)) {
    $url = $_CONF['site_url'];
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:31,代码来源:portal.php

示例8: paypal_access_check

    exit;
}
/* Ensure sufficient privs to read this page */
paypal_access_check();
// Import plugin-specific functions
USES_paypal_functions();
// Create a global shopping cart for our use.  This allows the cart to be
// manipulated in an action and then displayed in a view, without necessarily
// having to revisit the database or create a new cart.
USES_paypal_class_cart();
$ppGCart = new ppCart();
COM_setArgNames(array('id'));
if (isset($_GET['id'])) {
    $id = COM_sanitizeID($_GET['id']);
} else {
    $id = COM_applyFilter(COM_getArgument('id'));
}
$display = PAYPAL_siteHeader();
$T = new Template(PAYPAL_PI_PATH . '/templates');
$T->set_file('title', 'paypal_title.thtml');
$T->set_var('title', $LANG_PP['main_title']);
$display .= $T->parse('', 'title');
if (!empty($msg)) {
    //msg block
    $display .= COM_startBlock('', '', 'blockheader-message.thtml');
    $display .= $msg;
    $display .= COM_endBlock('blockfooter-message.thtml');
}
$display .= PAYPAL_userMenu($LANG_PP['product_list']);
$content = '';
if (!empty($id)) {
开发者ID:NewRoute,项目名称:paypal,代码行数:31,代码来源:detail.php

示例9: COM_applyFilter

    if (isset($_POST['order'])) {
        $order = COM_applyFilter($_POST['order']);
    }
    if (isset($_POST['query'])) {
        $query = $_POST['query'];
    }
    if (isset($_POST['reply'])) {
        $reply = COM_applyFilter($_POST['reply']);
    }
    if (isset($_POST['cpage'])) {
        $page = COM_applyFilter($_POST['cpage'], true);
    }
} else {
    COM_setArgNames(array('story', 'mode'));
    $sid = COM_applyFilter(COM_getArgument('story'));
    $mode = COM_applyFilter(COM_getArgument('mode'));
    if (isset($_GET['order'])) {
        $order = COM_applyFilter($_GET['order']);
    }
    if (isset($_GET['query'])) {
        $query = $_GET['query'];
    }
    if (isset($_GET['reply'])) {
        $reply = COM_applyFilter($_GET['reply']);
    }
    if (isset($_GET['cpage'])) {
        $page = COM_applyFilter($_GET['cpage'], true);
    }
}
if (empty($sid)) {
    echo COM_refresh($_CONF['site_url'] . '/index.php');
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:31,代码来源:article.php

示例10: CMT_handleComment

/**
 * Handles comment processing
 *
 * @param    string   $mode    Mode of comment processing
 * @param    string   $type    Type of item (article, polls, etc.)
 * @param    string   $title   Title of item
 * @param    string   $sid     ID for item to show comments for
 * @param    string   $format  'threaded', 'nested', or 'flat'
 * @return   string            HTML formated
 */
function CMT_handleComment($mode = '', $type = '', $title = '', $sid = '', $format = '')
{
    global $_CONF, $_TABLES, $_USER, $LANG03, $LANG_ADMIN, $topic, $_PLUGINS;
    $commentmode = '';
    if (!empty($_REQUEST[CMT_MODE])) {
        $commentmode = COM_applyFilter($_REQUEST[CMT_MODE]);
    }
    if (empty($mode)) {
        $mode = COM_applyFilter(COM_getArgument(CMT_MODE));
    }
    if (empty($commentmode) && !empty($mode)) {
        $commentmode = $mode;
    }
    if (empty($sid) && !empty($_REQUEST[CMT_SID])) {
        $sid = COM_applyFilter($_REQUEST[CMT_SID]);
    }
    $pid = 0;
    if (!empty($_REQUEST[CMT_PID])) {
        $pid = COM_applyFilter($_REQUEST[CMT_PID], true);
    }
    if (empty($type) && !empty($_REQUEST[CMT_TYPE])) {
        $type = COM_applyFilter($_REQUEST[CMT_TYPE]);
    }
    if (!empty($_REQUEST['title'])) {
        $title = $_REQUEST['title'];
        // apply filters later in CMT_commentForm or CMT_saveComment
    }
    if (!empty($_REQUEST[CMT_UID])) {
        $uid = COM_applyFilter($_REQUEST[CMT_UID]);
    } else {
        $uid = 1;
        if (!empty($_USER['uid'])) {
            $uid = $_USER['uid'];
        }
    }
    $postmode = $_CONF['postmode'];
    if (isset($_REQUEST['postmode'])) {
        $postmode = COM_applyFilter($_REQUEST['postmode']);
    }
    $formtype = '';
    if (!empty($_REQUEST['formtype'])) {
        $formtype = COM_applyFilter($_REQUEST['formtype']);
    }
    // Get comment id, may not be there...will handle in function
    $cid = 0;
    if (isset($_REQUEST[CMT_CID])) {
        $cid = COM_applyFilter($_REQUEST[CMT_CID], true);
    }
    TOPIC_getTopic('comment', $cid);
    if (empty($format) && isset($_REQUEST['format'])) {
        $format = COM_applyFilter($_REQUEST['format']);
    }
    if (!in_array($format, array('threaded', 'nested', 'flat', 'nocomment'))) {
        if (COM_isAnonUser()) {
            $format = $_CONF['comment_mode'];
        } else {
            $format = DB_getItem($_TABLES['usercomment'], 'commentmode', "uid = {$_USER['uid']}");
        }
    }
    $order = '';
    if (isset($_REQUEST['order'])) {
        $order = COM_applyFilter($_REQUEST['order']);
    }
    $cpage = 1;
    if (!empty($_REQUEST['cpage'])) {
        $cpage = COM_applyFilter($_REQUEST['cpage'], true);
        if (empty($cpage)) {
            $cpage = 1;
        }
    }
    $is_comment_page = CMT_isCommentPage();
    $retval = '';
    if ($_CONF['show_comments_at_replying'] && $is_comment_page && !empty($sid) && !empty($type) && in_array($commentmode, array('', $LANG03[28], $LANG03[34], $LANG03[14], 'edit'))) {
        if ($commentmode == 'edit') {
            $cid = 0;
            if (isset($_REQUEST[CMT_CID])) {
                $cid = COM_applyFilter($_REQUEST[CMT_CID], true);
            }
            if ($cid <= 0) {
                COM_errorLog("CMT_handleComment(): {$_USER['uid']} from {$_SERVER['REMOTE_ADDR']} tried " . 'to edit a comment with one or more missing/bad values.');
                return COM_refresh($_CONF['site_url'] . '/index.php');
            }
            $pid = $cid;
        }
        if ($pid > 0 && empty($title)) {
            $atype = DB_escapeString($type);
            $title = DB_getItem($_TABLES['comments'], 'title', "(cid = {$pid}) AND (type = '{$atype}')");
        }
        if (empty($title)) {
            $title = PLG_getItemInfo($type, $sid, 'title');
//.........这里部分代码省略.........
开发者ID:ivywe,项目名称:geeklog,代码行数:101,代码来源:lib-comment.php

示例11: downloader

* For really strict webhosts, this file an be used to show images in pages that
* serve the images from outside of the webtree to a place that the webserver
* user can actually write too
*
* @author   Tony Bibbs, tony AT tonybibbs DOT com
*
*/
require_once 'lib-common.php';
require_once $_CONF['path_system'] . 'classes/downloader.class.php';
$downloader = new downloader();
$downloader->setLogFile($_CONF['path_log'] . 'error.log');
$downloader->setLogging(true);
$downloader->setAllowedExtensions(array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'png' => 'image/png', 'png' => 'image/x-png'));
COM_setArgNames(array('mode', 'image'));
$mode = COM_applyFilter(COM_getArgument('mode'));
$image = COM_applyFilter(COM_getArgument('image'));
if (strstr($image, '..')) {
    // Can you believe this, some jackass tried to relative pathing to access
    // files they shouldn't have access to?
    COM_accessLog('Someone tried to illegally access files using getimage.php');
    exit;
}
// Set the path properly
switch ($mode) {
    case 'show':
    case 'articles':
        $downloader->setPath($_CONF['path_images'] . 'articles/');
        break;
    case 'topics':
        $downloader->setPath($_CONF['path_images'] . 'topics/');
        break;
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:31,代码来源:getimage.php

示例12: elseif

        $url_rewrite = true;
    } elseif (substr($url, $q - 4, 4) != '.php') {
        $url_rewrite = true;
    }
}
//
if ($url_rewrite) {
    COM_setArgNames(array('idcode', 'm', 'template', $dummy1));
    $m = COM_applyFilter(COM_getArgument('m'));
    $template = COM_applyFilter(COM_getArgument('template'));
    //code 使用の時
    if ($m === "code") {
        $id = 0;
        $code = COM_applyFilter(COM_getArgument('idcode'));
    } elseif ($m === "id") {
        $id = COM_applyFilter(COM_getArgument('idcode'), true);
        $code = "";
    } else {
        $id = 0;
        $code = "";
    }
} else {
    $m = COM_applyFilter($_GET['m']);
    $id = COM_applyFilter($_GET['id'], true);
    $code = COM_applyFilter($_GET['code']);
    $template = COM_applyFilter($_GET['template']);
}
//ログイン要否チェック
if (COM_isAnonUser()) {
    if ($_CONF['loginrequired'] or $_DATABOX_CONF['loginrequired'] == 3 or $_DATABOX_CONF['loginrequired'] == 2 or $_DATABOX_CONF['loginrequired'] == 1 and $id > 0 or $_DATABOX_CONF['loginrequired'] == 1 and $code != "") {
        $display .= DATABOX_siteHeader($pi_name, '', $page_title);
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:31,代码来源:data.php

示例13: COM_setArgNames

        }
        $retval = $urlpart . $extra_vars;
    }
    return $retval;
}
// MAIN
$ret_url = '';
if (isset($_SERVER['HTTP_REFERER'])) {
    if (strpos($_SERVER['HTTP_REFERER'], $_CONF['site_url']) !== false) {
        $ret_url = $_SERVER['HTTP_REFERER'];
    }
}
// if not allowed, just ignore and return
if ($_CONF['allow_user_language'] == 1) {
    COM_setArgNames(array('lang'));
    $lang = strtolower(COM_applyFilter(COM_getArgument('lang')));
    $lang = preg_replace('/[^a-z0-9\\-_]/', '', $lang);
    $oldlang = COM_getLanguageId();
    // do we really have a new language to switch to?
    if (!empty($lang) && array_key_exists($lang, $_CONF['language_files'])) {
        // does such a language file exist?
        $langfile = $_CONF['language_files'][$lang];
        if (is_file($_CONF['path_language'] . $langfile . '.php')) {
            // Set the language cookie.
            // Mainly used for anonymous users so the rest of their session
            // will remain in the selected language
            setcookie($_CONF['cookie_language'], $langfile, time() + 31536000, $_CONF['cookie_path'], $_CONF['cookiedomain'], $_CONF['cookiesecure']);
            // if user is not anonymous, store the preference in the database
            if (!COM_isAnonUser()) {
                DB_query("UPDATE {$_TABLES['users']} SET language = '{$langfile}' WHERE uid = {$_USER['uid']}");
            }
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:31,代码来源:switchlang.php

示例14: COM_siteFooter

/**
* Returns the site footer
*
* This loads the proper templates, does variable substitution and returns the
* HTML for the site footer.
*
* @param   boolean     $rightblock     Whether or not to show blocks on right hand side default is no
* @param   array       $custom         An array defining custom function to be used to format Rightblocks
* @see function COM_siteHeader
* @return   string  Formated HTML containing site footer and optionally right blocks
*
*/
function COM_siteFooter($rightblock = -1, $custom = '')
{
    global $_CONF, $_TABLES, $_USER, $LANG01, $LANG12, $LANG_BUTTONS, $LANG_DIRECTION, $_IMAGE_TYPE, $topic, $_COM_VERBOSE, $_PAGE_TIMER, $theme_what, $theme_pagetitle, $theme_headercode, $theme_layout, $_LOGO, $uiStyles;
    COM_hit();
    if (isset($blockInterface['right'])) {
        $currentURL = COM_getCurrentURL();
        if (strpos($currentURL, $_CONF['site_admin_url']) === 0) {
            if ($blockInterface['right']['location'] == 'right' || $blockInterface['right']['location'] == 'left') {
                $rightblocks = -1;
            }
        }
    }
    $function = $_USER['theme'] . '_siteFooter';
    if (function_exists($function)) {
        return $function($rightblock, $custom);
    }
    $dt = new Date('now', $_USER['tzid']);
    $what = $theme_what;
    $pagetitle = $theme_pagetitle;
    $themecode = $theme_headercode;
    // Grab any content that was cached by the system
    $content = ob_get_contents();
    ob_end_clean();
    $theme = new Template($_CONF['path_layout']);
    $theme->set_file(array('header' => 'header.thtml', 'footer' => 'footer.thtml', 'leftblocks' => 'leftblocks.thtml', 'rightblocks' => 'rightblocks.thtml'));
    $theme->set_var('num_search_results', $_CONF['num_search_results']);
    // get topic if not on home page
    if (!isset($_GET['topic'])) {
        if (isset($_GET['story'])) {
            $sid = COM_applyFilter($_GET['story']);
        } elseif (isset($_GET['sid'])) {
            $sid = COM_applyFilter($_GET['sid']);
        } elseif (isset($_POST['story'])) {
            $sid = COM_applyFilter($_POST['story']);
        }
        if (empty($sid) && $_CONF['url_rewrite'] && strpos($_SERVER['PHP_SELF'], 'article.php') !== false) {
            COM_setArgNames(array('story', 'mode'));
            $sid = COM_applyFilter(COM_getArgument('story'));
        }
        if (!empty($sid)) {
            $topic = DB_getItem($_TABLES['stories'], 'tid', "sid='" . DB_escapeString($sid) . "'");
        }
    } else {
        $topic = COM_applyFilter($_GET['topic']);
    }
    $loggedInUser = !COM_isAnonUser();
    $theme->set_var('site_name', $_CONF['site_name']);
    $theme->set_var('background_image', $_CONF['layout_url'] . '/images/bg.' . $_IMAGE_TYPE);
    $theme->set_var('site_mail', "mailto:{$_CONF['site_mail']}");
    if ($_LOGO['display_site_slogan']) {
        $theme->set_var('site_slogan', $_CONF['site_slogan']);
    }
    $msg = $LANG01[67] . ' ' . $_CONF['site_name'];
    if (!empty($_USER['username']) && !COM_isAnonUser()) {
        $msg .= ', ' . COM_getDisplayName($_USER['uid'], $_USER['username'], $_USER['fullname']);
    }
    $curtime = $dt->format($dt->getUserFormat(), true);
    $theme->set_var('welcome_msg', $msg);
    $theme->set_var('datetime', $curtime);
    if ($_LOGO['use_graphic_logo'] == 1 && file_exists($_CONF['path_html'] . '/images/' . $_LOGO['logo_name'])) {
        $L = new Template($_CONF['path_layout']);
        $L->set_file(array('logo' => 'logo-graphic.thtml'));
        $imgInfo = @getimagesize($_CONF['path_html'] . '/images/' . $_LOGO['logo_name']);
        $dimension = $imgInfo[3];
        $L->set_var('site_name', $_CONF['site_name']);
        $site_logo = $_CONF['site_url'] . '/images/' . $_LOGO['logo_name'];
        $L->set_var('site_logo', $site_logo);
        $L->set_var('dimension', $dimension);
        if ($imgInfo[1] != 100) {
            $delta = 100 - $imgInfo[1];
            $newMargin = $delta;
            $L->set_var('delta', 'style="padding-top:' . $newMargin . 'px;"');
        } else {
            $L->set_var('delta', '');
        }
        if ($_LOGO['display_site_slogan']) {
            $L->set_var('site_slogan', $_CONF['site_slogan']);
        }
        $L->parse('output', 'logo');
        $theme->set_var('logo_block', $L->finish($L->get_var('output')));
    } else {
        if ($_LOGO['use_graphic_logo'] == 0) {
            $L = new Template($_CONF['path_layout']);
            $L->set_file(array('logo' => 'logo-text.thtml'));
            $L->set_var('site_name', $_CONF['site_name']);
            if ($_LOGO['display_site_slogan']) {
                $L->set_var('site_slogan', $_CONF['site_slogan']);
            }
//.........这里部分代码省略.........
开发者ID:NewRoute,项目名称:glfusion,代码行数:101,代码来源:lib-common.php

示例15: COM_siteHeader


//.........这里部分代码省略.........
        case 'xhtml10strict':
            $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
            break;
        default:
            // fallback: HTML 4.01 Transitional w/o system identifier
            $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
            break;
    }
    // send out the charset header
    header('Content-Type: text/html; charset=' . COM_getCharset());
    if (!empty($_CONF['frame_options'])) {
        header('X-FRAME-OPTIONS: ' . $_CONF['frame_options']);
    }
    $header = COM_newTemplate($_CONF['path_layout']);
    $header->set_file(array('header' => 'header.thtml', 'menuitem' => 'menuitem.thtml', 'menuitem_last' => 'menuitem_last.thtml', 'menuitem_none' => 'menuitem_none.thtml', 'leftblocks' => 'leftblocks.thtml', 'rightblocks' => 'rightblocks.thtml'));
    $header->postprocess_fn = 'PLG_replaceTags';
    $header->set_var('doctype', $doctype);
    if (XHTML == '') {
        $header->set_var('xmlns', '');
    } else {
        $header->set_var('xmlns', ' xmlns="http://www.w3.org/1999/xhtml"');
    }
    // get topic if not on home page
    if (!isset($_GET['topic'])) {
        if (isset($_GET['story'])) {
            $sid = COM_applyFilter($_GET['story']);
        } elseif (isset($_GET['sid'])) {
            $sid = COM_applyFilter($_GET['sid']);
        } elseif (isset($_POST['story'])) {
            $sid = COM_applyFilter($_POST['story']);
        }
        if (empty($sid) && $_CONF['url_rewrite'] && strpos($_SERVER['PHP_SELF'], 'article.php') !== false) {
            COM_setArgNames(array('story', 'mode'));
            $sid = COM_applyFilter(COM_getArgument('story'));
        }
        if (!empty($sid)) {
            $topic = DB_getItem($_TABLES['stories'], 'tid', "sid='{$sid}'");
        }
    } else {
        $topic = COM_applyFilter($_GET['topic']);
    }
    $feed_url = array();
    if ($_CONF['backend'] == 1) {
        $baseurl = SYND_getFeedUrl();
        $sql = 'SELECT format, filename, title, language FROM ' . $_TABLES['syndication'] . " WHERE (header_tid = 'all')";
        if (!empty($topic)) {
            $sql .= " OR (header_tid = '" . addslashes($topic) . "')";
        }
        $result = DB_query($sql);
        $numRows = DB_numRows($result);
        for ($i = 0; $i < $numRows; $i++) {
            $A = DB_fetchArray($result);
            if (!empty($A['filename'])) {
                $format_type = SYND_getMimeType($A['format']);
                $format_name = SYND_getFeedType($A['format']);
                $feed_title = $format_name . ' Feed: ' . $A['title'];
                $feed_url[] = '<link rel="alternate" type="' . $format_type . '" hreflang="' . $A['language'] . '" href="' . $baseurl . $A['filename'] . '" title="' . htmlspecialchars($feed_title) . '"' . XHTML . '>';
            }
        }
    }
    $header->set_var('feed_url', implode(LB, $feed_url));
    // for backward compatibility only - use {feed_url} instead
    $feed = SYND_getDefaultFeedUrl();
    $header->set_var('rdf_file', $feed);
    $header->set_var('rss_url', $feed);
    $relLinks = array();
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:67,代码来源:lib-common.php


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