本文整理汇总了PHP中COM_showMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP COM_showMessage函数的具体用法?PHP COM_showMessage怎么用?PHP COM_showMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了COM_showMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: security_check_reminder
/**
* Display a reminder to execute the security check script
*
* @return string HTML for security reminder (or empty string)
*/
function security_check_reminder()
{
global $_CONF, $_TABLES, $_IMAGE_TYPE, $MESSAGE;
$retval = '';
if (!SEC_inGroup('Root')) {
return $retval;
}
$done = DB_getItem($_TABLES['vars'], 'value', "name = 'security_check'");
if ($done != 1) {
$retval .= COM_showMessage(92);
}
return $retval;
}
示例2: savegroup
/**
* Save a group to the database
*
* @param string $grp_id ID of group to save
* @param string $grp_name Group Name
* @param string $grp_descr Description of group
* @param boolean $grp_admin Flag that indicates this is an admin use group
* @param boolean $grp_gl_core Flag that indicates if this is a core Geeklog group
* @param boolean $grp_default Flag that indicates if this is a default group
* @param boolean $grp_applydefault Flag that indicates whether to apply a change in $grp_default to all existing user accounts
* @param array $features Features the group has access to
* @param array $groups Groups this group will belong to
* @return string HTML refresh or error message
*
*/
function savegroup($grp_id, $grp_name, $grp_descr, $grp_admin, $grp_gl_core, $grp_default, $grp_applydefault, $features, $groups)
{
global $_CONF, $_TABLES, $_USER, $LANG_ACCESS, $_GROUP_VERBOSE;
$retval = '';
if (!empty($grp_name) && !empty($grp_descr)) {
$GroupAdminGroups = SEC_getUserGroups();
if (!empty($grp_id) && $grp_id > 0 && !in_array($grp_id, $GroupAdminGroups) && !SEC_groupIsRemoteUserAndHaveAccess($grp_id, $GroupAdminGroups)) {
COM_accessLog("User {$_USER['username']} tried to edit group '{$grp_name}' ({$grp_id}) with insufficient privileges.");
return COM_refresh($_CONF['site_admin_url'] . '/group.php');
}
if ($grp_gl_core == 1 and !is_array($features)) {
COM_errorLog("Sorry, no valid features were passed to this core group ({$grp_id}) and saving could cause problem...bailing.");
return COM_refresh($_CONF['site_admin_url'] . '/group.php');
}
// group names have to be unique, so check if this one exists already
$g_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = '{$grp_name}'");
if ($g_id > 0) {
if (empty($grp_id) || $grp_id != $g_id) {
// there already is a group with that name - complain
$retval .= COM_showMessageText($LANG_ACCESS['groupexistsmsg'], $LANG_ACCESS['groupexists']) . editgroup($grp_id);
$retval = COM_createHTMLDocument($retval, array('pagetitle' => $LANG_ACCESS['groupeditor']));
return $retval;
}
}
$grp_descr = COM_stripslashes($grp_descr);
$grp_descr = DB_escapeString($grp_descr);
$grp_applydefault_add = true;
if (empty($grp_id)) {
DB_save($_TABLES['groups'], 'grp_name,grp_descr,grp_gl_core,grp_default', "'{$grp_name}','{$grp_descr}',{$grp_gl_core},{$grp_default}");
$grp_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = '{$grp_name}'");
$new_group = true;
} else {
if ($grp_applydefault == 1) {
// check if $grp_default changed
$old_default = DB_getItem($_TABLES['groups'], 'grp_default', "grp_id = {$grp_id}");
if ($old_default == $grp_default) {
// no change required
$grp_applydefault = 0;
} elseif ($old_default == 1) {
$grp_applydefault_add = false;
}
}
DB_save($_TABLES['groups'], 'grp_id,grp_name,grp_descr,grp_gl_core,grp_default', "{$grp_id},'{$grp_name}','{$grp_descr}',{$grp_gl_core},{$grp_default}");
$new_group = false;
}
if (empty($grp_id) || $grp_id < 1) {
// "this shouldn't happen"
COM_errorLog("Internal error: invalid group id");
$retval .= COM_showMessage(95);
$retval = COM_createHTMLDocument($retval, array('pagetitle' => $LANG_ACCESS['groupeditor']));
return $retval;
}
// Use the field grp_gl_core to indicate if this non-core GL Group
// is an Admin related group
if ($grp_gl_core != 1 and $grp_id > 1) {
if ($grp_admin == 1) {
DB_query("UPDATE {$_TABLES['groups']} SET grp_gl_core=2 WHERE grp_id={$grp_id}");
} else {
DB_query("UPDATE {$_TABLES['groups']} SET grp_gl_core=0 WHERE grp_id={$grp_id}");
}
}
// now save the features
DB_delete($_TABLES['access'], 'acc_grp_id', $grp_id);
$num_features = count($features);
if (SEC_inGroup('Root')) {
foreach ($features as $f) {
DB_query("INSERT INTO {$_TABLES['access']} (acc_ft_id,acc_grp_id) VALUES ({$f},{$grp_id})");
}
} else {
$GroupAdminFeatures = SEC_getUserPermissions();
$availableFeatures = explode(',', $GroupAdminFeatures);
foreach ($features as $f) {
if (in_array($f, $availableFeatures)) {
DB_query("INSERT INTO {$_TABLES['access']} (acc_ft_id,acc_grp_id) VALUES ({$f},{$grp_id})");
}
}
}
if ($_GROUP_VERBOSE) {
COM_errorLog('groups = ' . $groups);
COM_errorLog("deleting all group_assignments for group {$grp_id}/{$grp_name}", 1);
}
DB_delete($_TABLES['group_assignments'], 'ug_grp_id', $grp_id);
if (!empty($groups)) {
foreach ($groups as $g) {
if (in_array($g, $GroupAdminGroups)) {
//.........这里部分代码省略.........
示例3: LIB_Edit
function LIB_Edit($pi_name, $id, $edt_flg, $msg = '', $errmsg = "", $mode = "edit")
{
global $_CONF;
global $_TABLES;
global $LANG_ADMIN;
global $MESSAGE;
global $LANG_ACCESS;
global $_USER;
$lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN";
global ${$lang_box_admin};
$lang_box_admin = ${$lang_box_admin};
$lang_box = "LANG_" . strtoupper($pi_name);
global ${$lang_box};
$lang_box = ${$lang_box};
$lang_box_noyes = "LANG_" . strtoupper($pi_name) . "_NOYES";
global ${$lang_box_noyes};
$lang_box_noyes = ${$lang_box_noyes};
$lang_box_inputtype = "LANG_" . strtoupper($pi_name) . "_INPUTTYPE";
global ${$lang_box_inputtype};
$lang_box_inputtype = ${$lang_box_inputtype};
$table = $_TABLES[strtoupper($pi_name) . '_def_group'];
$table1 = $_TABLES[strtoupper($pi_name) . '_def_category'];
$table2 = $_TABLES[strtoupper($pi_name) . '_def_field'];
// $cur_year = date( 'Y' );
// $year_startoffset=1990 - $cur_year +1;
// $year_endoffset=0;
$retval = '';
$delflg = false;
//メッセージ表示
if (!empty($msg)) {
$retval .= COM_showMessage($msg, $pi_name);
$retval .= $errmsg;
// clean 'em up
$code = COM_applyFilter($_POST['code']);
$name = COM_applyFilter($_POST['name']);
$description = $_POST['description'];
//COM_applyFilter($_POST['description']);
$orderno = COM_applyFilter($_POST['orderno']);
$parent_flg = COM_applyFilter($_POST['parent_flg'], true);
$input_type = COM_applyFilter($_POST['input_type'], true);
$uuid = $_USER['uid'];
} else {
if (empty($id)) {
$id = 0;
$code = "";
$name = "";
$description = "";
$orderno = "";
$parent_flg = 0;
$uuid = 0;
$udatetime = "";
//"";
} else {
$sql = "SELECT ";
$sql .= " *";
$sql .= " ,UNIX_TIMESTAMP(udatetime) AS udatetime_un" . LB;
$sql .= " FROM ";
$sql .= $table;
$sql .= " WHERE ";
$sql .= " group_id = {$id}";
$result = DB_query($sql);
$A = DB_fetchArray($result);
$code = COM_stripslashes($A['code']);
$name = COM_stripslashes($A['name']);
$description = COM_stripslashes($A['description']);
$orderno = COM_stripslashes($A['orderno']);
$parent_flg = COM_stripslashes($A['parent_flg']);
$input_type = COM_stripslashes($A['input_type']);
$uuid = COM_stripslashes($A['uuid']);
$wary = COM_getUserDateTimeFormat(COM_stripslashes($A['udatetime_un']));
$udatetime = $wary[0];
if ($edt_flg == FALSE) {
$delflg = true;
}
}
}
if ($mode === "copy") {
$id = 0;
//作成日付
$created = 0;
$created_month = 0;
$created_day = 0;
$created_year = 0;
$created_hour = 0;
$created_minute = 0;
//
$delflg = false;
}
$retval .= COM_startBlock($lang_box_admin['edit'], '', COM_getBlockTemplate('_admin_block', 'header'));
$tmplfld = DATABOX_templatePath('admin', 'default', $pi_name);
$templates = new Template($tmplfld);
$templates->set_file('editor', "group_editor.thtml");
//--
$templates->set_var('about_thispage', $lang_box_admin['about_admin_group']);
$templates->set_var('lang_must', $lang_box_admin['must']);
$templates->set_var('site_url', $_CONF['site_url']);
$templates->set_var('site_admin_url', $_CONF['site_admin_url']);
$token = SEC_createToken();
$retval .= SEC_getTokenExpiryNotice($token);
$templates->set_var('gltoken_name', CSRF_TOKEN);
//.........这里部分代码省略.........
示例4: do_update
/**
* Updates a plugin (call its upgrade function).
*
* @param string $pi_name name of the plugin to uninstall
* @return string HTML for error or success message
*
*/
function do_update($pi_name)
{
global $_CONF, $LANG32;
$retval = '';
if (!empty($pi_name)) {
$result = PLG_upgrade($pi_name);
if ($result > 0) {
if ($result === TRUE) {
// Catch returns that are just true/false
PLG_pluginStateChange($pi_name, 'upgraded');
$retval = COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=60');
} else {
// Plugin returned a message number
$retval = COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=' . $result . '&plugin=' . $pi_name);
}
return $retval;
} else {
// Plugin function returned a false
$retval = COM_showMessage(95);
}
} else {
// no plugin name given
$retval = COM_showMessageText($LANG32[12], $LANG32[13]);
}
$retval = COM_siteHeader('menu', $LANG32[13]) . $retval . COM_siteFooter();
return $retval;
}
示例5: banner_list
/**
* Create the banner list depending on the category given
*
* @param array $message message(s) to display
* @return string the banner page
*
*/
function banner_list($message)
{
global $_CONF, $_TABLES, $_BAN_CONF, $LANG_BANNER_ADMIN, $LANG_BANNER, $LANG_BANNER_STATS;
$cid = $_BAN_CONF['root'];
$display = '';
if (isset($_GET['category'])) {
$cid = strip_tags(COM_stripslashes($_GET['category']));
} elseif (isset($_POST['category'])) {
$cid = strip_tags(COM_stripslashes($_POST['category']));
}
$cat = addslashes($cid);
$page = 0;
if (isset($_GET['page'])) {
$page = COM_applyFilter($_GET['page'], true);
}
if ($page == 0) {
$page = 1;
}
if (empty($cid)) {
if ($page > 1) {
$page_title = sprintf($LANG_BANNER[114] . ' (%d)', $page);
} else {
$page_title = $LANG_BANNER[114];
}
} else {
if ($cid == $_BAN_CONF['root']) {
$category = $LANG_BANNER['root'];
} else {
$category = DB_getItem($_TABLES['bannercategories'], 'category', "cid = '{$cat}'");
}
if ($page > 1) {
$page_title = sprintf($LANG_BANNER[114] . ': %s (%d)', $category, $page);
} else {
$page_title = sprintf($LANG_BANNER[114] . ': %s', $category);
}
}
// Check has access to this category
if ($cid != $_BAN_CONF['root']) {
$result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['bannercategories']} WHERE cid='{$cat}'");
$A = DB_fetchArray($result);
if (SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) < 2) {
$display .= COM_siteHeader('menu', $page_title);
$display .= COM_showMessage(5, 'banner');
$display .= COM_siteFooter();
echo $display;
exit;
}
}
$display .= COM_siteHeader('menu', $page_title);
if (is_array($message) && !empty($message[0])) {
$display .= COM_startBlock($message[0], '', COM_getBlockTemplate('_msg_block', 'header'));
$display .= $message[1];
$display .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
} else {
if (isset($_REQUEST['msg'])) {
$msg = COM_applyFilter($_REQUEST['msg'], true);
if ($msg > 0) {
$display .= COM_showMessage($msg, 'banner');
}
}
}
$bannerlist = new Template($_CONF['path'] . 'plugins/banner/templates/');
$bannerlist->set_file(array('bannerlist' => 'banner.thtml', 'catbanner' => 'categorybanner.thtml', 'banner' => 'bannerdetails.thtml', 'catnav' => 'categorynavigation.thtml', 'catrow' => 'categoryrow.thtml', 'catcol' => 'categorycol.thtml', 'actcol' => 'categoryactivecol.thtml', 'pagenav' => 'pagenavigation.thtml', 'catdrop' => 'categorydropdown.thtml'));
$bannerlist->set_var('xhtml', XHTML);
$bannerlist->set_var('blockheader', COM_startBlock($LANG_BANNER[114]));
$bannerlist->set_var('layout_url', $_CONF['layout_url']);
if ($_BAN_CONF['bannercols'] > 0) {
// Create breadcrumb trail
$bannerlist->set_var('breadcrumbs', banner_breadcrumbs($_BAN_CONF['root'], $cid));
// Set dropdown for category jump
$bannerlist->set_var('lang_go', $LANG_BANNER[124]);
$bannerlist->set_var('banner_dropdown', banner_select_box(2, $cid));
// Show categories
$sql = "SELECT cid,pid,category,description FROM {$_TABLES['bannercategories']} WHERE pid='{$cat}'";
$sql .= COM_getLangSQL('cid', 'AND');
$sql .= COM_getPermSQL('AND') . " ORDER BY category";
$result = DB_query($sql);
$nrows = DB_numRows($result);
if ($nrows > 0) {
$bannerlist->set_var('lang_categories', $LANG_BANNER_ADMIN[14]);
for ($i = 1; $i <= $nrows; $i++) {
$C = DB_fetchArray($result);
// Get number of child banner user can see in this category
$ccid = addslashes($C['cid']);
$result1 = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['banner']} WHERE cid='{$ccid}'" . COM_getPermSQL('AND'));
$D = DB_fetchArray($result1);
// Get number of child categories user can see in this category
$result2 = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['bannercategories']} WHERE pid='{$ccid}'" . COM_getPermSQL('AND'));
$E = DB_fetchArray($result2);
// Format numbers for display
$display_count = '';
// don't show zeroes
if ($E['count'] > 0) {
//.........这里部分代码省略.........
示例6: links_edit_category
function links_edit_category($cid, $pid)
{
global $_CONF, $_TABLES, $_USER, $MESSAGE, $LANG_LINKS_ADMIN, $LANG_ADMIN, $LANG_ACCESS, $_LI_CONF;
$retval = '';
$cid = addslashes($cid);
if (!empty($pid)) {
// have parent id, so making a new subcategory
// get parent access rights
$result = DB_query("SELECT group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['linkcategories']} WHERE cid='" . addslashes($pid) . "'");
$A = DB_fetchArray($result);
$A['owner_id'] = $_USER['uid'];
$A['pid'] = $pid;
} elseif (!empty($cid)) {
// have category id, so editing a category
$sql = "SELECT * FROM {$_TABLES['linkcategories']} WHERE cid='{$cid}'" . COM_getPermSQL('AND');
$result = DB_query($sql);
$A = DB_fetchArray($result);
} else {
// nothing, so making a new top-level category
// get default access rights
$A['group_id'] = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name='Links Admin'");
SEC_setDefaultPermissions($A, $_LI_CONF['category_permissions']);
$A['owner_id'] = $_USER['uid'];
$A['pid'] = $_LI_CONF['root'];
}
$access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
if ($access < 3) {
return COM_showMessage(6, 'links');
}
$token = SEC_createToken();
$retval .= COM_startBlock($LANG_LINKS_ADMIN[56], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= SEC_getTokenExpiryNotice($token);
$T = new Template($_CONF['path'] . 'plugins/links/templates/admin');
$T->set_file(array('page' => 'categoryeditor.thtml'));
$T->set_var('xhtml', XHTML);
$T->set_var('site_url', $_CONF['site_url']);
$T->set_var('site_admin_url', $_CONF['site_admin_url']);
$T->set_var('layout_url', $_CONF['layout_url']);
$T->set_var('lang_pagetitle', $LANG_LINKS_ADMIN[28]);
$T->set_var('lang_link_list', $LANG_LINKS_ADMIN[53]);
$T->set_var('lang_new_link', $LANG_LINKS_ADMIN[51]);
$T->set_var('lang_validate_links', $LANG_LINKS_ADMIN[26]);
$T->set_var('lang_list_categories', $LANG_LINKS_ADMIN[50]);
$T->set_var('lang_new_category', $LANG_LINKS_ADMIN[52]);
$T->set_var('lang_admin_home', $LANG_ADMIN['admin_home']);
$T->set_var('instructions', $LANG_LINKS_ADMIN[29]);
$T->set_var('lang_category', $LANG_LINKS_ADMIN[30]);
$T->set_var('lang_cid', $LANG_LINKS_ADMIN[32]);
$T->set_var('lang_description', $LANG_LINKS_ADMIN[31]);
$T->set_var('lang_topic', $LANG_LINKS_ADMIN[33]);
$T->set_var('lang_parent', $LANG_LINKS_ADMIN[34]);
$T->set_var('lang_save', $LANG_ADMIN['save']);
if (!empty($cid)) {
$delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
$jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
$T->set_var('delete_option', sprintf($delbutton, $jsconfirm));
$T->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
} else {
$T->set_var('delete_option', '');
}
$T->set_var('lang_cancel', $LANG_ADMIN['cancel']);
if (!empty($cid)) {
$T->set_var('cid_value', $A['cid']);
$T->set_var('old_cid_value', $A['cid']);
$T->set_var('category_options', links_select_box(3, $A['pid']));
$T->set_var('category_value', $A['category']);
$T->set_var('description_value', $A['description']);
} else {
$A['cid'] = COM_makeSid();
$T->set_var('cid_value', $A['cid']);
$T->set_var('old_cid_value', '');
$T->set_var('category_options', links_select_box(3, $A['pid']));
$T->set_var('category_value', '');
$T->set_var('description_value', '');
}
if (!isset($A['tid'])) {
$A['tid'] = 'all';
}
$topics = COM_topicList('tid,topic', $A['tid'], 1, true);
$T->set_var('topic_list', $topics);
$alltopics = '<option value="all"';
if ($A['tid'] == 'all') {
$alltopics .= ' selected="selected"';
}
$alltopics .= '>' . $LANG_LINKS_ADMIN[35] . '</option>' . LB;
$T->set_var('topic_selection', '<select name="tid">' . $alltopics . $topics . '</select>');
if (empty($cid)) {
$num_links = $LANG_ADMIN['na'];
} else {
$nresult = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['links']} WHERE cid='{$cid}'" . COM_getPermSQL('AND'));
$N = DB_fetchArray($nresult);
$num_links = COM_numberFormat($N['count']);
}
$T->set_var('lang_num_links', $LANG_LINKS_ADMIN[61]);
$T->set_var('num_links', $num_links);
// user access info
$T->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
$T->set_var('lang_owner', $LANG_ACCESS['owner']);
$T->set_var('owner_name', COM_getDisplayName($A['owner_id']));
$T->set_var('cat_ownerid', $A['owner_id']);
//.........这里部分代码省略.........
示例7: _userVerify
function _userVerify()
{
global $_CONF, $_SYSTEM, $_TABLES, $_USER, $LANG04;
$retval = '';
$uid = (int) COM_applyFilter($_GET['u'], true);
$vid = COM_applyFilter($_GET['vid']);
if (!empty($uid) && is_numeric($uid) && $uid > 1 && !empty($vid) && strlen($vid) == 32) {
$uid = (int) $uid;
$safevid = DB_escapeString($vid);
$result = DB_query("SELECT UNIX_TIMESTAMP(act_time) AS act_time FROM {$_TABLES['users']} WHERE uid=" . $uid . " AND act_token='" . $safevid . "' AND status=" . USER_ACCOUNT_AWAITING_VERIFICATION);
if (DB_numRows($result) != 1) {
$valid = 0;
} else {
$U = DB_fetchArray($result);
if ($U['act_time'] != '' && $U['act_time'] > time() - $_SYSTEM['verification_token_ttl']) {
$valid = 1;
} else {
$valid = 0;
}
}
if ($valid == 1) {
DB_query("UPDATE {$_TABLES['users']} SET status=" . USER_ACCOUNT_AWAITING_ACTIVATION . ",act_time='1000-01-01 00:00:00' WHERE uid=" . $uid);
$retval .= COM_showMessage(515, '', '', 0, 'success');
$retval .= SEC_loginForm();
} else {
// request invalid or expired
$result = DB_query("SELECT * FROM {$_TABLES['users']} WHERE uid=" . $uid);
if (DB_numRows($result) == 1) {
$U = DB_fetchArray($result);
switch ($U['status']) {
case USER_ACCOUNT_AWAITING_ACTIVATION:
case USER_ACCOUNT_ACTIVE:
$retval .= COM_showMessage(517, '', '', 0, 'info');
$retval .= SEC_loginForm();
break;
case USER_ACCOUNT_AWAITING_VERIFICATION:
$retval .= COM_showMessage(516, '', '', 1, 'error');
$retval .= newtokenform($uid);
break;
default:
echo COM_refresh($_CONF['site_url']);
}
} else {
echo COM_refresh($_CONF['site_url']);
}
}
} else {
// this request doesn't make sense - ignore it
echo COM_refresh($_CONF['site_url']);
}
return $retval;
}
示例8: DB_getItem
$page_title = DB_getItem($_TABLES['maps_maps'], 'name', "mid={$_REQUEST['mid']}");
}
if ($_REQUEST['mode'] == 'markers' && $_REQUEST['mid'] != 0 && is_numeric($_REQUEST['mid'])) {
$page_title .= ' | ' . DB_getItem($_TABLES['maps_maps'], 'name', "mid={$_REQUEST['mid']}");
}
if ($_REQUEST['mode'] == 'marker' && isset($_REQUEST['mkid']) && $_REQUEST['mkid'] != '' && is_numeric($_REQUEST['mkid'])) {
$page_title = DB_getItem($_TABLES['maps_markers'], 'name', "mkid={$_REQUEST['mkid']}");
}
$display .= COM_siteHeader('menu', stripslashes($page_title));
$display .= MAPS_user_menu();
$msg = 0;
if (isset($_REQUEST['msg'])) {
$msg = COM_applyFilter($_REQUEST['msg'], true);
}
if ($msg > 0) {
$display .= COM_showMessage($msg, 'maps');
}
switch ($_REQUEST['mode']) {
case 'map':
// query database for map
if ($_REQUEST['mid'] > 0 && is_numeric($_REQUEST['mid'])) {
$display .= MAPS_getMap($_REQUEST['mid']);
if ($_REQUEST['mid'] >= 0 && is_numeric($_REQUEST['mid'])) {
$display .= MAPS_ListMarkers($_REQUEST['mid']);
}
} elseif ($_REQUEST['mid'] == 0) {
//Display the Global Map
$display .= MAPS_getGlobalMap();
} else {
echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
}
示例9: isset
}
if (isset($_POST['sp_status_no'])) {
$sp_status = 0;
}
} else {
$sp_status = isset($_POST['sp_status']) ? 1 : 0;
}
$display .= PAGE_submit($sp_id, $sp_status, $sp_uid, isset($_POST['sp_title']) ? $_POST['sp_title'] : '', isset($_POST['sp_content']) ? $_POST['sp_content'] : '', isset($_POST['sp_hits']) ? COM_applyFilter($_POST['sp_hits'], true) : 0, isset($_POST['sp_format']) ? COM_applyFilter($_POST['sp_format']) : '', isset($_POST['sp_onmenu']) ? $_POST['sp_onmenu'] : '', isset($_POST['sp_label']) ? $_POST['sp_label'] : '', isset($_POST['commentcode']) ? COM_applyFilter($_POST['commentcode'], true) : 0, isset($_POST['owner_id']) ? COM_applyFilter($_POST['owner_id'], true) : 2, isset($_POST['group_id']) ? COM_applyFilter($_POST['group_id'], true) : 0, isset($_POST['perm_owner']) ? $_POST['perm_owner'] : '', isset($_POST['perm_group']) ? $_POST['perm_group'] : '', isset($_POST['perm_members']) ? $_POST['perm_members'] : '', isset($_POST['perm_anon']) ? $_POST['perm_anon'] : '', isset($_POST['sp_php']) ? $_POST['sp_php'] : '', isset($_POST['sp_nf']) ? $_POST['sp_nf'] : '', isset($_POST['sp_old_id']) ? COM_applyFilter($_POST['sp_old_id']) : '', isset($_POST['sp_nf']) ? $_POST['sp_centerblock'] : '', $sp_help, isset($_POST['sp_tid']) ? COM_applyFilter($_POST['sp_tid']) : '', isset($_POST['sp_where']) ? COM_applyFilter($_POST['sp_where'], true) : 0, isset($_POST['sp_inblock']) ? $_POST['sp_inblock'] : '', isset($_POST['postmode']) ? COM_applyFilter($_POST['postmode']) : '', isset($_POST['sp_search']) ? 1 : 0);
} else {
$display = COM_refresh($_CONF['site_admin_url'] . '/index.php');
}
} else {
//token expired?
SEC_setCookie($_CONF['cookie_name'] . 'adveditor', SEC_createTokenGeneral('advancededitor'), time() + 1200, $_CONF['cookie_path'], $_CONF['cookiedomain'], $_CONF['cookiesecure'], false);
$display .= COM_siteHeader('menu', $LANG_STATIC['staticpageeditor']);
$display .= COM_showMessage(501);
$editor = '';
if (isset($_GET['editor'])) {
$editor = COM_applyFilter($_GET['editor']);
}
// $mode = 'edit';
$owner_id = $_POST['owner_id'];
$group_id = $_POST['group_id'];
$perm_owner = $_POST['perm_owner'];
$perm_group = $_POST['perm_group'];
$perm_members = $_POST['perm_members'];
$perm_anon = $_POST['perm_anon'];
list($perm_owner, $perm_group, $perm_members, $perm_anon) = SEC_getPermissionValues($perm_owner, $perm_group, $perm_members, $perm_anon);
$_POST['perm_owner'] = $perm_owner;
$_POST['perm_group'] = $perm_group;
$_POST['perm_members'] = $perm_members;
示例10: COM_displayMessageAndAbort
/**
* Display a message and abort
*
* NOTE: Displays the message and aborts the script.
*
* @param int $msg message number
* @param string $plugin plugin name, if applicable
* @param int $http_status HTTP status code to send with the message
* @param string $http_text Textual version of the HTTP status code
*
*/
function COM_displayMessageAndAbort($msg, $plugin = '', $http_status = 200, $http_text = 'OK')
{
$display = COM_siteHeader('menu') . COM_showMessage($msg, $plugin) . COM_siteFooter(true);
if ($http_status != 200) {
header("HTTP/1.1 {$http_status} {$http_text}");
header("Status: {$http_status} {$http_text}");
}
echo $display;
exit;
}
示例11: COM_createHTMLDocument
if ($mode == 'personal' and $_CAJP_CONF['personalcalendars'] == 0) {
// User is trying to use the personal calendar feature even though it isn't
// turned on.
$display .= $LANG_CALJP_2[37];
$display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle));
COM_output($display);
exit;
}
// after this point, we can safely assume that if $mode == 'personal',
// the current user is actually allowed to use this personal calendar
$msg = 0;
if (isset($_REQUEST['msg'])) {
$msg = COM_applyFilter($_REQUEST['msg'], true);
}
if ($msg > 0) {
$display .= COM_showMessage($msg, 'calendarjp');
}
$view = '';
if (isset($_REQUEST['view'])) {
$view = COM_applyFilter($_REQUEST['view']);
}
if (!in_array($view, array('month', 'week', 'day', 'addentry', 'savepersonal'))) {
$view = '';
}
$year = 0;
if (isset($_REQUEST['year'])) {
$year = COM_applyFilter($_REQUEST['year'], true);
}
$month = 0;
if (isset($_REQUEST['month'])) {
$month = COM_applyFilter($_REQUEST['month'], true);
示例12: listServices
$display .= listServices();
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_TRB['services_headline']));
} else {
if ($mode == 'freepb') {
$display .= COM_showMessageFromParameter();
$display .= pingbackForm();
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_TRB['pingback']));
} else {
if ($mode == 'sendpingback') {
$target = COM_applyFilter($_POST['target']);
if (empty($target)) {
$display .= showTrackbackMessage($LANG_TRB['pbtarget_missing'], $LANG_TRB['pbtarget_required']);
} elseif (SEC_checkToken()) {
$result = PNB_sendPingback($_CONF['site_url'], $target);
if (empty($result)) {
$display .= COM_showMessage(74);
$target = '';
} else {
$message = '<p>' . $LANG_TRB['pb_error_details'] . '<br' . XHTML . '>' . '<span class="warningsmall">' . htmlspecialchars($result) . '</span></p>';
$display .= showTrackbackMessage($LANG_TRB['send_error'], $message);
}
}
$display .= pingbackForm($target);
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_TRB['pingback']));
} else {
$display = COM_refresh($_CONF['site_admin_url'] . '/index.php');
}
}
}
}
}
示例13: CLASSIFIEDS_catList
$content .= CLASSIFIEDS_catList();
}
$T->set_var('header', $LANG_ADVT['blocktitle']);
$menu_opt = $LANG_ADVT['mnu_home'];
break;
}
// switch ($page)
if ($menu_opt != '') {
$menu->set_selected($menu_opt);
}
$T->set_var('menu', $menu->generate());
$T->set_var('content', $content);
$T->parse('output', 'page');
echo CLASSIFIEDS_siteHeader($pageTitle);
if ($msg != '') {
echo COM_showMessage($msg, $_CONF_ADVT['pi_name']);
}
echo $T->finish($T->get_var('output'));
echo CLASSIFIEDS_siteFooter();
function showHelp()
{
global $LANG_ADVT, $_CONF;
$retval = '';
foreach ($LANG_ADVT['help'] as $section => $content) {
$retval .= "<h2>{$content[0]}</h2>\n<ol>\n";
foreach ($content[1] as $key => $value) {
$value = str_replace('{site_url}', $_CONF['site_url'], $value);
$retval .= "<li>{$value}</li>\n";
}
$retval .= "</ol>\n";
}
示例14: submitstaticpage
}
if (!isset($_POST['sp_inblock'])) {
$_POST['sp_inblock'] = '';
}
if (!isset($_POST['postmode'])) {
$_POST['postmode'] = '';
}
if (!isset($_POST['draft_flag'])) {
$_POST['draft_flag'] = '';
}
if (!isset($_POST['cache_time'])) {
$_POST['cache_time'] = $_SP_CONF['default_cache_time'];
}
if (!isset($_POST['template_flag'])) {
$_POST['template_flag'] = '';
}
$display .= submitstaticpage($sp_id, $_POST['sp_title'], $_POST['sp_page_title'], $_POST['sp_content'], COM_applyFilter($_POST['sp_hits'], true), COM_applyFilter($_POST['sp_format']), $_POST['sp_onmenu'], $_POST['sp_label'], COM_applyFilter($_POST['commentcode'], true), COM_applyFilter($_POST['owner_id'], true), COM_applyFilter($_POST['group_id'], true), $_POST['perm_owner'], $_POST['perm_group'], $_POST['perm_members'], $_POST['perm_anon'], $_POST['sp_php'], $_POST['sp_nf'], COM_applyFilter($_POST['sp_old_id']), $_POST['sp_centerblock'], $sp_help, COM_applyFilter($_POST['sp_where'], true), $_POST['sp_inblock'], COM_applyFilter($_POST['postmode']), $_POST['meta_description'], $_POST['meta_keywords'], $_POST['draft_flag'], $_POST['template_flag'], $_POST['template_id'], COM_applyFilter($_POST['cache_time'], true));
} else {
$display = COM_refresh($_CONF['site_admin_url'] . '/index.php');
}
} else {
if (isset($_REQUEST['msg'])) {
$msg = COM_applyFilter($_REQUEST['msg'], true);
if ($msg > 0) {
$display .= COM_showMessage($msg, 'staticpages');
}
}
$display .= liststaticpages();
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_STATIC['staticpagelist']));
}
COM_output($display);
示例15: stripslashes
$meta_description = stripslashes($A['meta_description']);
$meta_keywords = stripslashes($A['meta_keywords']);
//$meta_description = stripslashes( DB_getItem( $_TABLES['topics'], 'meta_description', "tid = '$topic'" ));
//$meta_keywords = stripslashes( DB_getItem( $_TABLES['topics'], 'meta_keywords', "tid = '$topic'" ));
$header .= COM_createMetaTags($meta_description, $meta_keywords);
}
} else {
$header = '<link rel="microsummary" href="' . $_CONF['site_url'] . '/index.php?display=microsummary" title="Microsummary"' . XHTML . '>';
}
$display .= COM_siteHeader('menu', '', $header);
if (isset($_GET['msg'])) {
$plugin = '';
if (isset($_GET['plugin'])) {
$plugin = COM_applyFilter($_GET['plugin']);
}
$display .= COM_showMessage(COM_applyFilter($_GET['msg'], true), $plugin);
}
if (SEC_inGroup('Root') && $page == 1) {
$done = DB_getItem($_TABLES['vars'], 'value', "name = 'security_check'");
if ($done != 1) {
/**
* we don't have the path to the admin directory, so try to figure it
* out from $_CONF['site_admin_url']
* @todo FIXME: this duplicates some code from admin/sectest.php
*/
$adminurl = $_CONF['site_admin_url'];
if (strrpos($adminurl, '/') == strlen($adminurl)) {
$adminurl = substr($adminurl, 0, -1);
}
$pos = strrpos($adminurl, '/');
if ($pos === false) {