本文整理汇总了PHP中URL::admin方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::admin方法的具体用法?PHP URL::admin怎么用?PHP URL::admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::admin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smile_edit
function smile_edit($smile_data, $s_hidden_fields, $filename_list, $smiley_image)
{
global $smilies_path, $modheader;
$modheader .= '<script type="text/javascript">
function update_smiley(newimage)
{
document.getElementById("smiley_image").src = "' . $smilies_path . '" + newimage;
}
</script>';
showheader();
echo '
<form method="post" action="' . URL::admin('smilies') . '" enctype="multipart/form-data" accept-charset="utf-8">
<table class="forumline" cellspacing="1" cellpadding="4" border="0">
<tr>
<th class="thHead" colspan="2">Smiley Configuration</th>
</tr>
<tr>
<td class="row2">Smiley Code</td>
<td class="row2"><input type="text" name="smile_code" value="' . (isset($smile_data['code']) ? $smile_data['code'] : '') . '" /></td>
</tr>
<tr>
<td class="row1">Smiley Image File</td>
<td class="row1"><select name="smile_url" onchange="update_smiley(this.options[selectedIndex].value);">' . $filename_list . '</select> <img id="smiley_image" name="smiley_image" src="' . $smilies_path . $smiley_image . '" border="0" alt="" /> </td>
</tr>
<tr>
<td class="row2">Smiley Emotion</td>
<td class="row2"><input type="text" name="smile_emotion" value="' . (isset($smile_data['emoticon']) ? $smile_data['emoticon'] : '') . '" /></td>
</tr>
<tr>
<td class="catBottom" colspan="2" align="center">' . $s_hidden_fields . '<input class="mainoption" type="submit" value="' . _SAVECHANGES . '" /></td>
</tr>
</table></form>';
}
示例2: message_box
function message_box()
{
global $prefix, $MAIN_CFG, $currentlang, $db, $userinfo;
require_once CORE_PATH . 'nbbcode.php';
$query = $MAIN_CFG['global']['multilingual'] ? "AND (mlanguage='{$currentlang}' OR mlanguage='')" : '';
if (!is_admin()) {
if (is_user()) {
$query .= ' AND view!=2 AND view!=3';
} else {
$query .= ' AND (view=0 OR view=3)';
}
}
$result = $db->sql_query('SELECT mid, title, content, date, expire, view FROM ' . $prefix . "_message WHERE active='1' {$query} ORDER BY date DESC");
while (list($mid, $title, $content, $date, $expire, $view) = $db->sql_fetchrow($result)) {
$content = decode_bb_all($content, 1, true);
if (!empty($title) && !empty($content)) {
$output = '';
if ($view == 0) {
$output = _MVIEWALL;
} elseif ($view == 1) {
$output = _MVIEWUSERS;
} elseif ($view == 2) {
$output = _MVIEWADMIN;
} elseif ($view == 3) {
$output = _MVIEWANON;
} elseif ($view > 3 && (in_group($view - 3) || is_admin())) {
// <= phpBB User Groups Integration
$view = $view - 3;
if (!in_group($view)) {
list($output) = $db->sql_ufetchrow("SELECT group_name FROM " . $prefix . "_bbgroups WHERE group_id='{$view}'", SQL_NUM);
} else {
$output = in_group($view);
}
}
if ($output != '') {
$remain = '';
if (can_admin()) {
if ($expire == 0) {
$remain = _UNLIMITED;
} else {
$etime = ($date + $expire - time()) / 3600;
$etime = intval($etime);
$remain = $etime < 1 ? _EXPIRELESSHOUR : _EXPIREIN . " {$etime} " . _HOURS;
}
}
global $cpgtpl;
$cpgtpl->assign_block_vars('messageblock', array('S_TITLE' => $title, 'S_CONTENT' => $content, 'S_OUTPUT' => $output, 'S_DATE' => _POSTEDON . ' ' . formatDateTime($date, _DATESTRING2), 'S_REMAIN' => $remain, 'S_EDIT' => _EDIT, 'U_EDITMSG' => URL::admin('messages&edit=' . $mid)));
}
if ($expire != 0) {
if ($date + $expire < time()) {
$db->sql_query("UPDATE " . $prefix . "_message SET active='0' WHERE mid='{$mid}'");
}
}
}
}
$db->sql_freeresult($result);
}
示例3: index
private function index()
{
$GLOBALS['cpgtpl']->set_handle('body_cache', 'admin/cache.html');
$GLOBALS['cpgtpl']->assign_vars(array('S_ACTION' => URL::admin('cache'), 'S_IS_INDEX' => empty($this->compiler), 'S_COMPILER' => $this->compiler, 'S_CALL' => $this->call, 'S_CURRENT_FILE' => $this->current_file));
foreach ($this->installed as $data) {
$GLOBALS['cpgtpl']->assign_block_vars('installed', array_change_key_case($data, CASE_UPPER));
//$cpgtpl->assign_block_vars('installed', array_combine(preg_replace('#([a-z\-_]+)#ei', 'strtoupper(\'S_$1\')', array_keys($data)), $data));
}
foreach ($this->supported as $data) {
$GLOBALS['cpgtpl']->assign_block_vars('supported', array_change_key_case($data, CASE_UPPER));
//$cpgtpl->assign_block_vars('supported', array_combine(preg_replace('#([a-z\-_]+)#ei', 'strtoupper(\'S_$1\')', array_keys($data)), $data));
}
}
示例4: cpg_mm_admin_header
function cpg_mm_admin_header($title, $content = '')
{
global $pagetitle, $cpgtpl, $modheader;
$pagetitle .= ' ' . _BC_DELIM . ' ' . _CPG_MMADMIN;
$modheader .= '
<link rel="stylesheet" href="themes/default/style/tabletree.css" type="text/css" media="screen"/>
<script type="text/javascript" src="includes/javascript/framework.js"></script>
<script type="text/javascript" src="includes/javascript/dragndrop.js"></script>
<script type="text/javascript" src="includes/javascript/tabletree.js"></script>
<script type="text/javascript" src="includes/javascript/tree.js"></script>
';
require 'header.php';
GraphicAdmin('_AMENU1');
$cpgtpl->assign_vars(array('L_CPGMM' => URL::admin('cpgmm'), 'ICON_SELECT' => 'images/blocks/CPG_Main_Menu/icon_select.gif', 'ICON_FORBID' => 'images/blocks/CPG_Main_Menu/icon_cantselect.gif', 'ICON_HIDDEN' => 'images/blocks/CPG_Main_Menu/icon_hideselect.gif', 'HEAD_TITLE' => $title, 'HEAD_CONTENT' => $content));
$cpgtpl->set_handle('head', 'admin/cpgmm_header.html');
$cpgtpl->display('head');
}
示例5: df_delete_cache
function df_delete_cache()
{
if (preg_match('#^(a_|bb_|config_)[a-z]+$#i', $GLOBALS['AdminCache']->file) && unlink(BASEDIR . 'cache/' . $GLOBALS['AdminCache']->file . '.php')) {
cpg_error($GLOBALS['AdminCache']->file . '.php gone.', _DELETE, URL::admin('cache'));
} else {
if ($tpl = glob(BASEDIR . 'cache/tpl_' . $GLOBALS['AdminCache']->file . '*.html.inc')) {
while ($file = array_shift($tpl)) {
if (!unlink($file)) {
trigger_error(str_replace(BASEDIR . 'cache/', '', $file) . ' couldn\'t be deleted.', E_USER_WARNING);
}
}
} else {
if ($tpl = glob(BASEDIR . 'cache/' . $GLOBALS['AdminCache']->file . '*.php')) {
while ($file = array_shift($tpl)) {
if (!unlink($file)) {
trigger_error(str_replace(BASEDIR . 'cache/', '', $file) . ' couldn\'t be deleted.', E_USER_WARNING);
}
}
}
}
}
global $pagetitle;
cpg_error(_TASK_COMPLETED, $pagetitle, URL::admin('cache'));
}
示例6: trigger_error
| Dragonfly is released under the terms and conditions of the GNU |
| GPL version 2 or any later version |
+-------------------------------------------------------------------+
*/
if (!defined('CPG_NUKE')) {
exit;
}
global $db, $prefix;
# how many referers should the block display?
$ref = 10;
$a = 1;
$content = '';
$result = $db->sql_query("SELECT url FROM " . $prefix . "_referer ORDER BY lasttime DESC LIMIT {$ref}");
$total = $db->sql_numrows($result);
if ($total < 1) {
$content = 'ERROR';
return trigger_error(sprintf(_ERROR_NONE_TO_DISPLAY, strtolower(_HTTPREFERERS)), E_USER_WARNING);
}
while (list($url) = $db->sql_fetchrow($result)) {
$url2 = str_replace('_', ' ', $url);
if (strlen($url2) > 18) {
$url2 = substr($url, 0, 20);
$url2 .= '..';
}
$content .= "{$a}: \n" . "<a href=\"{$url}\" target=\"_blank\">{$url2}</a>\n" . "<br />\n";
$a++;
}
if (can_admin()) {
$content .= "<br />\n" . "<div style=\"text-align:center;\">\n" . "{$total} " . _HTTPREFERERS . "\n" . "<br /><br />\n" . "[ <a href=\"" . URL::admin('referers&del=all') . "\">" . _DELETE . "</a> ]\n" . "</div>\n";
}
$db->sql_freeresult($result);
示例7: die
if (!defined('ADMIN_PAGES')) {
exit;
}
if (!can_admin('referers')) {
die('Access Denied');
}
$pagetitle .= ' ' . _BC_DELIM . ' ' . _HTTPREFERERS;
global $bgcolor3, $db, $prefix;
if (isset($_GET['del']) && $_GET['del'] == 'all') {
$db->sql_query('DELETE FROM ' . $prefix . '_referer');
URL::redirect(URL::admin());
} else {
require_once 'header.php';
GraphicAdmin('_AMENU6');
$result = $db->sql_query('SELECT url FROM ' . $prefix . '_referer');
$bgcolor = '';
if ($db->sql_numrows($result) > 0) {
$cpgtpl->assign_vars(array('U_DELREFERERS' => URL::admin('&del=all')));
while (list($url) = $db->sql_fetchrow($result)) {
$bgcolor = $bgcolor == '' ? ' style="background: ' . $bgcolor3 . '"' : '';
$cpgtpl->assign_block_vars('referer', array('URL' => $url, 'CLR' => $bgcolor));
}
$cpgtpl->set_filenames(array('body' => 'admin/referers.html'));
$cpgtpl->display('body');
$cpgtpl->__destruct();
} else {
OpenTable();
echo sprintf(_ERROR_NONE_TO_DISPLAY, strtolower(_HTTPREFERERS));
CloseTable();
}
}
示例8: generate_secimg
$content .= '<div style="text-align:center;"><img src="images/blocks/no_avatar.gif" alt="" /><br />' . _BWEL . ' <b>' . _ANONYMOUS . '</b></div>
<hr /><form action="' . $redirect . '" method="post" enctype="multipart/form-data" accept-charset="utf-8" style="margin:0;"><div>
<span style="float:left; height:25px;">' . _NICKNAME . '</span><span style="float:right; height:25px;"><input type="text" name="ulogin" size="10" maxlength="25" /></span><br />
<span style="float:left; height:25px;">' . _PASSWORD . '</span><span style="float:right; height:25px;"><input type="password" name="user_password" size="10" maxlength="20" /></span><br />
';
if ($MAIN_CFG['debug']['sec_code'] & 2) {
$content .= '<span style="float:left; height:25px;">' . _SECURITYCODE . '</span><span style="float:right; height:25px;">' . generate_secimg() . '</span><br style="clear:left;" />
<span style="float:left; height:25px;">' . _TYPESECCODE . '</span><span style="float:right; height:25px;"><input type="text" name="gfx_check" size="8" maxlength="8" /></span><br />';
}
// don't show register link unless allowuserreg is yes
$content .= '<span style="float:left; height:25px;">' . ($MAIN_CFG['member']['allowuserreg'] ? '<input type="button" value="' . _BREG . '" onclick="window.location=\'' . URL::index('Your_Account&file=register', 1, 1) . '\'" />' : '') . '</span>
<span style="float:right; height:25px;"><input type="submit" value="' . _LOGIN . '" />
</span></div></form>';
}
if (is_admin()) {
$content .= '<br style="clear:left;"/><a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '"><img src="images/blocks/login.gif" alt="" /></a> <a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '">' . _ADMIN . ' ' . _LOGOUT . "</a><br />\n";
}
$day = L10NTime::tolocal(mktime(0, 0, 0, date('n'), date('j'), date('Y')) - date('Z'), $userinfo['user_dst'], $userinfo['user_timezone']);
list($last[0]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate>='" . $day . "'", SQL_NUM);
list($last[1]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate<'" . $day . "' AND user_regdate>='" . ($day - 86400) . "'", SQL_NUM);
list($lastuser) = $db->sql_ufetchrow("SELECT username FROM " . $user_prefix . "_users \n\tWHERE user_active = 1 AND user_level > 0 \n\tORDER BY user_id DESC", SQL_NUM);
list($numusers) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \nWHERE user_id > 1 AND user_level > 0", SQL_NUM);
$content .= '<hr /><span style="font-weight:bold; text-decoration:underline;">' . _BMEMP . ":</span><br />\n";
$content .= '<img src="images/blocks/ur-moderator.gif" alt="" /> ' . _BLATEST . ': <a href="' . URL::index("Your_Account&profile={$lastuser}") . '"><b>' . $lastuser . '</b></a><br />
<img src="images/blocks/ur-author.gif" alt="" /> ' . _BTD . ': <b>' . $last[0] . '</b><br />
<img src="images/blocks/ur-admin.gif" alt="" /> ' . _BYD . ': <b>' . $last[1] . '</b><br />
<img src="images/blocks/ur-guest.gif" alt="" /> ' . _BOVER . ': <b>' . $numusers . '</b><br />
<hr />
<img src="images/blocks/group-1.gif" alt="" /> <span style="font-weight:bold; text-decoration:underline;">' . _BVISIT . ':</span><br />
<img src="images/blocks/ur-member.gif" alt="" /> ' . _BMEM . ': <b>' . $online_num[0] . '</b><br />
<img src="images/blocks/ur-anony.gif" alt="" /> ' . _BVIS . ': <b>' . $online_num[1] . '</b><br />
示例9: round
$max_add_filesize = round($max_add_filesize / 1024 * 100) / 100;
}
}
$template->assign_vars(array('L_MANAGE_QUOTAS_TITLE' => $lang['Manage_quotas'], 'L_MANAGE_QUOTAS_EXPLAIN' => $lang['Manage_quotas_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_EDIT' => $lang['Edit'], 'L_VIEW' => $lang['View'], 'L_DESCRIPTION' => $lang['Description'], 'L_SIZE' => $lang['Max_filesize_attach'], 'L_ADD_NEW' => $lang['Add_new'], 'L_DELETE' => $lang['Delete'], 'MAX_FILESIZE' => $max_add_filesize, 'QUOTA_LIMIT_SETTINGS' => '', 'S_FILESIZE' => size_select('add_size_select', $size), 'L_REMOVE_SELECTED' => $lang['Remove_selected'], 'S_HIDDEN_FIELDS' => '', 'S_ATTACH_ACTION' => URL::admin("&do=attachments&mode=quota")));
$result = $db->sql_query("SELECT * FROM " . QUOTA_LIMITS_TABLE . " ORDER BY quota_limit DESC");
$rows = $db->sql_fetchrowset($result);
for ($i = 0; $i < count($rows); $i++) {
$size_format = $rows[$i]['quota_limit'] >= 1048576 ? 'mb' : ($rows[$i]['quota_limit'] >= 1024 ? 'kb' : 'b');
if ($rows[$i]['quota_limit'] >= 1048576) {
$rows[$i]['quota_limit'] = round($rows[$i]['quota_limit'] / 1048576 * 100) / 100;
} else {
if ($rows[$i]['quota_limit'] >= 1024) {
$rows[$i]['quota_limit'] = round($rows[$i]['quota_limit'] / 1024 * 100) / 100;
}
}
$template->assign_block_vars('limit_row', array('QUOTA_NAME' => $rows[$i]['quota_desc'], 'QUOTA_ID' => $rows[$i]['quota_limit_id'], 'S_FILESIZE' => size_select('size_select_list[]', $size_format), 'U_VIEW' => URL::admin("&do=attachments&mode={$mode}&e_mode=view_quota&quota_id=" . $rows[$i]['quota_limit_id']), 'MAX_FILESIZE' => $rows[$i]['quota_limit']));
}
} else {
if ($mode == 'quota' && $e_mode == 'view_quota') {
if (isset($_POST['quota_id']) || isset($_GET['quota_id'])) {
$quota_id = isset($_POST['quota_id']) ? intval($_POST['quota_id']) : intval($_GET['quota_id']);
} else {
message_die(GENERAL_MESSAGE, 'Invalid Call');
return;
}
$template->assign_block_vars('switch_quota_limit_desc', array());
$result = $db->sql_query("SELECT * FROM " . QUOTA_LIMITS_TABLE . " WHERE quota_limit_id = " . $quota_id . " LIMIT 1");
$row = $db->sql_fetchrow($result);
$template->assign_vars(array('L_QUOTA_LIMIT_DESC' => $row['quota_desc'], 'L_ASSIGNED_USERS' => $lang['Assigned_users'], 'L_ASSIGNED_GROUPS' => $lang['Assigned_groups'], 'L_UPLOAD_QUOTA' => $lang['Upload_quota'], 'L_PM_QUOTA' => $lang['Pm_quota']));
$sql = "SELECT q.user_id, u.username, q.quota_type\n\tFROM " . QUOTA_TABLE . " q, " . USERS_TABLE . " u\n\tWHERE q.quota_limit_id = " . $quota_id . " AND q.user_id <> 0 AND q.user_id = u.user_id";
$result = $db->sql_query($sql);
示例10: GraphicAdmin
GraphicAdmin('_AMENU3');
OpenTable();
echo '<div style="text-align:center;" class="title">' . _REMOVECOMMENTS . '</div>';
CloseTable();
OpenTable();
echo '<center>' . _SURETODELCOMMENTS . '<br /><br />[ <a href="javascript:history.go(-1)">' . _NO . '</a> | <a href="' . URL::admin("&del={$tid}&ok=1") . '">' . _YES . '</a> ]</center>';
CloseTable();
}
} else {
if (isset($_GET['polldel']) && can_admin('surveys')) {
$tid = intval($_GET['polldel']);
if (isset($_GET['ok'])) {
$result = $db->sql_query("SELECT poll_id FROM " . $prefix . "_pollcomments WHERE tid={$tid}");
list($poll_id) = $db->sql_fetchrow($result);
removeSubComments($poll_id, 'pollcomments');
$db->sql_query("DELETE FROM " . $prefix . "_pollcomments WHERE tid='{$tid}'");
URL::redirect(URL::index("Surveys&op=results&pollid={$poll_id}"));
} else {
require 'header.php';
GraphicAdmin('_AMENU3');
OpenTable();
echo '<div style="text-align:center;" class="title">' . _REMOVECOMMENTS . '</div>';
CloseTable();
OpenTable();
echo '<center>' . _SURETODELCOMMENTS . '<br /><br />[ <a href="javascript:history.go(-1)">' . _NO . '</a> | <a href="' . URL::admin("&polldel={$tid}&ok=1") . '">' . _YES . '</a> ]</center>';
CloseTable();
}
} else {
die('Access Denied');
}
}
示例11: array
$forum_perm[0]['forum_name'] = $lang['Perm_all_forums'];
} else {
$forum_p = array();
$act_id = 0;
$forum_p = auth_unpack($allowed_forums);
$result = $db->sql_query("SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " WHERE forum_id IN (" . implode(', ', $forum_p) . ")");
while ($row = $db->sql_fetchrow($result)) {
$forum_perm[$act_id]['forum_id'] = $row['forum_id'];
$forum_perm[$act_id]['forum_name'] = $row['forum_name'];
$act_id++;
}
}
for ($i = 0; $i < count($forum_perm); $i++) {
$template->assign_block_vars('allow_option_values', array('VALUE' => $forum_perm[$i]['forum_id'], 'OPTION' => $forum_perm[$i]['forum_name']));
}
$template->assign_vars(array('L_GROUP_PERMISSIONS_TITLE' => sprintf($lang['Group_permissions_title'], trim($group_name)), 'L_GROUP_PERMISSIONS_EXPLAIN' => $lang['Group_permissions_explain'], 'L_REMOVE_SELECTED' => $lang['Remove_selected'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'L_ADD_FORUMS' => $lang['Add_forums'], 'L_ADD_SELECTED' => $lang['Add_selected'], 'L_RESET' => $lang['Reset'], 'S_HIDDEN_FIELDS' => '', 'A_PERM_ACTION' => URL::admin("&do=extensions&mode=groups&e_mode=perm&e_group={$group}")));
$forum_option_values = array(GPERM_ALL => $lang['Perm_all_forums']);
$result = $db->sql_query("SELECT forum_id, forum_name FROM " . FORUMS_TABLE);
while ($row = $db->sql_fetchrow($result)) {
$forum_option_values[intval($row['forum_id'])] = $row['forum_name'];
}
reset($forum_option_values);
while (list($value, $option) = each($forum_option_values)) {
$template->assign_block_vars('forum_option_values', array('VALUE' => $value, 'OPTION' => $option));
}
$template->assign_var_from_handle('GROUP_PERMISSIONS_BOX', 'perm_box');
$empty_perm_forums = array();
$f_result = $db->sql_query("SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " WHERE auth_attachments < " . AUTH_ADMIN);
while ($row = $db->sql_fetchrow($f_result)) {
$forum_id = $row['forum_id'];
$sql = "SELECT forum_permissions FROM " . EXTENSION_GROUPS_TABLE . "\n\t\tWHERE allow_group = 1 ORDER BY group_name ASC";
示例12: get_rating
$rating_info = get_rating($row['score'], $row['votes']);
if (!is_admin() && $row['submitter'] != is_user()) {
update_views($global_id);
}
//$modheader .= '<link rel="stylesheet" type="text/css" href="modules/'.$module_name.'/include/style.css" />';
$pagetitle .= $module_title . ' ' . _BC_DELIM . ' ' . $row['title'];
if ($row['img_url']) {
if (ereg('://', $row['img_url'])) {
$row['img_url'] .= '" width="' . $dl_config['dimension_thumb'];
} else {
$row['img_url'] = dl_thumbimage($row['img_url']);
}
}
$can_dl = can_download($row['active'], $row['access']);
//$submitter_count = $db->sql_count($dl_prefix.'_downloads', "submitter='".Fix_Quotes($row['submitter'])."'")-1;
$cpgtpl->assign_vars(array('L_SUBMITTEDBY' => _DLP_SUBMITTEDBY, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_PUBLISHED' => _DLP_PUBLISHED, 'L_UPDATED' => _DLP_UPDATED, 'L_DESCRIPTION' => _DESCRIPTION, 'L_CATEGORY' => _CATEGORY, 'L_RATING' => _RATING, 'L_VOTES' => _VOTES, 'L_DOWNLOADS' => _DOWNLOADS, 'L_ACTIVE' => _ACTIVE, 'L_EDIT' => _EDIT, 'L_DELETE' => _DELETE, 'L_ISDLOWNER' => sprintf(_DLP_ISDLOWNER, URL::index('&file=manage&edit=' . $global_id)), 'L_MIRSUB' => sprintf(_DLP_MIRSUB, URL::index('&file=manage&mirrors=' . $global_id)), 'L_EDNOTE' => _DLP_EDNOTE, 'L_MEMREVIEWS' => _DLP_MEMREVIEWS, 'L_PENDREVIEWS' => _DLP_PENDREVIEWS, 'L_BY' => _BY, 'L_ON' => _ON, 'L_PAGE' => _DLP_PAGE, 'L_VIEWALLSCREENS' => _DLP_VIEWALLSCREENS, 'L_POPULARITY' => _POPULARITY, 'L_PAGEVIEWS' => _DLP_PAGEVIEWS, 'L_ADMINTOOLS' => _ADMINISTRATION, 'L_EDPICK' => _DLP_EDPICK, 'DL_MENU' => dl_detail_menu($global_id, $row['title'], $row['pick'], $row['active'], 1), 'DL_CATEGORY' => DL_Cat::breadcrumb($row['cid']), 'DL_SUBMITTER' => is_numeric($row['submitter']) ? '<a href="' . URL::index('&file=search&sa=' . $row['submitter']) . '">' . $row['username'] . '</a>' : $row['submitter'], 'DL_AUTHORNAME' => $row['name'], 'DL_AUTHOREMAIL' => $row['email'] ? spam_protect($row['email']) : false, 'DL_PUBLISHED' => generate_date($row['date']), 'DL_PUBLISHTYPE' => mark_date($row['date'], 3, 1, 'right'), 'DL_UPDATED' => $row['updated'] > $row['date'] ? generate_date($row['updated']) : false, 'DL_UPDATE_TYPE' => $row['updated'] > $row['date'] ? mark_date($row['updated'], 3, 2, 'right') : false, 'DL_DESCRIPTION' => nl2br($row['desc_short']) . (!empty($row['desc_long']) ? decode_bbcode("\n\n" . $row['desc_long'], true) : ''), 'DL_NOTES' => decode_bbcode($row['notes']), 'DL_REVIEWS_ACTIVE' => $dl_config['r_active'], 'IMG_DL_RATING' => $rating_info['image'], 'DL_VOTES' => intval($row['votes']), 'DL_POPULARITY' => popularity($global_id), 'DL_HITS' => intval($row['hits']), 'DL_VIEWS' => intval($row['views']), 'DL_SUB_MIRRORS' => $dl_config['pub_mirror'], 'U_DL_SCREENSHOT' => URL::index('&screen=' . $row['screen']), 'IMG_DL_SCREENSHOT' => $row['img_url'], 'B_DL_ADMIN' => can_admin($module_name), 'DL_IS_OWNER' => $row['submitter'] == $userinfo['user_id'], 'U_DL_DELETE' => URL::admin('&del_dl=' . $global_id), 'U_DL_EDIT' => URL::index('&file=manage&edit=' . $global_id), 'U_DL_MIRSUB' => URL::index('&file=manage&mirrors=' . $global_id), 'U_DL_MIRROR' => URL::index('&mirror=' . $global_id), 'U_DL_MIRRORS' => URL::index('&get=' . $global_id), 'U_DL_ACTIVE' => URL::admin('&active=' . $global_id), 'U_DL_PICK' => URL::admin('&pick=' . $global_id), 'IMG_DL_MIRRORS' => dl_image($can_dl ? 'download.png' : 'register.png'), 'IMG_DL_ACTIVE' => dl_image($row['active'] == 1 ? 'checked.png' : 'unchecked.png'), 'IMG_DL_PICK' => dl_image($row['pick'] ? 'checked.png' : 'unchecked.png'), 'S_DL_ACTIVE' => $row['active'] == 1 ? _YES : _NO, 'S_DL_PICK' => $row['pick'] ? _YES : _NO, 'S_DL_MIRRORS' => $can_dl ? _DLP_DLNOW : _DLP_NADL));
$result = $db->sql_query("SELECT field, title, type FROM " . $dl_prefix . "_fields \n\tWHERE type!=3 AND visible > 0");
if ($db->sql_numrows($result)) {
while ($row2 = $db->sql_fetchrow($result)) {
if ($row2['type'] == 1) {
$row[$row2['field']] = $row[$row2['field']] ? _YES : _NO;
}
if ($row[$row2['field']]) {
$row2['title'] = defined($row2['title']) ? constant($row2['title']) : $row2['title'];
if ($row2['field'] == 'homepage' && $row[$row2['field']]) {
$row[$row2['field']] = '<a href="' . $row[$row2['field']] . '" target="_blank">' . shrink_url($row[$row2['field']]) . '</a>';
}
$cpgtpl->assign_block_vars('dl_field', array('TITLE' => $row2['title'], 'VALUE' => $row[$row2['field']]));
}
}
}
示例13: pagination_link
function pagination_link($url)
{
if (defined('ADMIN_PAGES')) {
return URL::admin($url);
}
return URL::index($url);
}
示例14: intval
if (empty($_POST[POST_FORUM_URL])) {
//
// Output a selection table if no forum id has been specified.
//
$template->set_filenames(array('body' => 'forums/admin/forum_prune_select_body.html'));
$select_list = '<select name="' . POST_FORUM_URL . '">';
$select_list .= '<option value="-1">' . $lang['All_Forums'] . '</option>';
for ($i = 0; $i < count($forum_rows); $i++) {
$select_list .= '<option value="' . $forum_rows[$i]['forum_id'] . '">' . $forum_rows[$i]['forum_name'] . '</option>';
}
$select_list .= '</select>';
//
// Assign the template variables.
//
$template->assign_vars(array('L_FORUM_PRUNE' => $lang['Forum_Prune'], 'L_SELECT_FORUM' => $lang['Select_a_Forum'], 'L_LOOK_UP' => $lang['Look_up_Forum'], 'S_FORUMPRUNE_ACTION' => URL::admin("&do=forum_prune"), 'S_FORUMS_SELECT' => $select_list));
} else {
$forum_id = intval($_POST[POST_FORUM_URL]);
//
// Output the form to retrieve Prune information.
//
$template->set_filenames(array('body' => 'forums/admin/forum_prune_body.html'));
$forum_name = $forum_id == -1 ? $lang['All_Forums'] : $forum_rows[0]['forum_name'];
$prune_data = $lang['Prune_topics_not_posted'] . " ";
$prune_data .= '<input class="post" type="text" name="prunedays" size="4"> ' . $lang['Days'];
$hidden_input = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';
//
// Assign the template variables.
//
$template->assign_vars(array('FORUM_NAME' => $forum_name, 'L_FORUM' => $lang['Forum'], 'L_FORUM_PRUNE' => $lang['Forum_Prune'], 'L_FORUM_PRUNE_EXPLAIN' => $lang['Forum_Prune_explain'], 'L_DO_PRUNE' => $lang['Do_Prune'], 'S_FORUMPRUNE_ACTION' => URL::admin("&do=forum_prune"), 'S_PRUNE_DATA' => $prune_data, 'S_HIDDEN_VARS' => $hidden_input));
}
}
示例15: saveuser
function saveuser(&$userinfo)
{
global $db, $user_prefix, $MAIN_CFG, $allowusertheme, $CPG_SESS, $SESS;
$mode = isset($_POST['save']) ? $_POST['save'] : 'profile';
if ($mode == 'admin' && !defined('ADMIN_PAGES')) {
$mode = 'profile';
}
if ($mode == 'profile') {
$section = 'section=1 OR section=2';
} elseif ($mode == 'private') {
$section = 'section=3';
} elseif ($mode == 'prefs') {
$section = 'section=5';
}
$sql = $pass_change = false;
if ($mode == 'reg_details') {
global $allowmailchange;
$current_password = isset($_POST['current_password']) ? md5($_POST['current_password']) : '';
if (isset($_POST['new_password'])) {
$new_password = $_POST['new_password'];
$verify_password = isset($_POST['verify_password']) ? $_POST['verify_password'] : '';
if ($new_password != $verify_password) {
cpg_error(_PASSDIFFERENT, 'ERROR: Password mismatch');
} elseif ($new_password != '') {
if (strlen($new_password) < $MAIN_CFG['member']['minpass']) {
cpg_error(_YOUPASSMUSTBE . ' <b>' . $MAIN_CFG['member']['minpass'] . '</b> ' . _CHARLONG, 'ERROR: Password too short');
}
$new_password = md5($new_password);
if ($new_password != $userinfo['user_password']) {
if (!defined('ADMIN_PAGES') && $current_password != $userinfo['user_password']) {
cpg_error('Password incorrect');
}
$sql = " user_password='{$new_password}'";
$pass_change = true;
}
}
}
$user_email = isset($_POST['user_email']) ? $_POST['user_email'] : $userinfo['user_email'];
if (($allowmailchange || defined('ADMIN_PAGES')) && $user_email != $userinfo['user_email']) {
if ($current_password != $userinfo['user_password'] && !defined('ADMIN_PAGES')) {
cpg_error('Password incorrect');
}
if (is_email($user_email) < 1) {
cpg_error(_ERRORINVEMAIL);
}
if ($sql) {
$sql .= ', ';
}
$sql .= "user_email='{$user_email}'";
}
if (defined('ADMIN_PAGES') && isset($_POST['username']) && $_POST['username'] != $userinfo['username']) {
if (preg_match('#(\\ |\\*|#|\\\\|%|"|\'|`|&|\\^|@)', $_POST['username'])) {
cpg_error(_ERRORINVNICK);
}
if ($db->sql_count($user_prefix . '_users u, ' . $user_prefix . '_users_temp t', "u.username='{$_POST['username']}' OR t.username='{$_POST['username']}' LIMIT 1") > 0) {
cpg_error(_NICKTAKEN);
}
if ($sql) {
$sql .= ', ';
}
$sql .= "username='{$_POST['username']}'";
}
} elseif ($mode == 'avatar') {
require_once 'modules/' . basename(dirname(__FILE__)) . '/avatars.php';
// Local avatar?
$avatar_local = isset($_POST['user_avatar']) ? $_POST['user_avatar'] : '';
// Remote avatar?
$avatar_remoteurl = !empty($_POST['avatarremoteurl']) ? htmlprepare($_POST['avatarremoteurl']) : '';
// Upload avatar thru remote or upload?
$avatar_upload = !empty($_POST['avatarurl']) ? trim($_POST['avatarurl']) : (!empty($_FILES['avatar']) && $_FILES['avatar']['tmp_name'] != "none" ? $_FILES['avatar']['tmp_name'] : '');
$avatar_name = !empty($_FILES['avatar']['name']) ? $_FILES['avatar']['name'] : '';
// 0 = USER_AVATAR_NONE
if (isset($_POST['avatardel']) || $avatar_local == '') {
$sql = avatar_delete($userinfo);
}
// 1 = USER_AVATAR_UPLOAD
if ((!empty($avatar_upload) || !empty($avatar_name)) && $MAIN_CFG['avatar']['allow_upload']) {
if (!empty($avatar_upload)) {
$sql = avatar_upload(empty($avatar_name), $userinfo, $avatar_upload, $_FILES['avatar']);
} elseif (!empty($avatar_name)) {
cpg_error(sprintf(_AVATAR_FILESIZE, round($MAIN_CFG['avatar']['filesize'] / 1024)), 'ERROR: Filesize');
}
} elseif ($avatar_remoteurl != $userinfo['user_avatar'] && $avatar_remoteurl != '' && $MAIN_CFG['avatar']['allow_remote']) {
if (!preg_match('#^(http)|(ftp):\\/\\/#i', $avatar_remoteurl)) {
$avatar_remoteurl = 'http://' . $avatar_remoteurl;
}
if (preg_match('#^((http)|(ftp):\\/\\/[\\w\\-]+?\\.([\\w\\-]+\\.)+[\\w]+(:[0-9]+)*\\/.*?\\.(gif|jpg|jpeg|png)$)#is', $avatar_remoteurl)) {
if (in_array('getimagesize', explode(',', ini_get('disable_functions'))) || ini_get('disable_functions') == 'getimagesize') {
cpg_error('getimagesize is disabled', _AVATAR_ERR_URL);
} elseif (!getimagesize($avatar_remoteurl)) {
cpg_error('Image has wrong filetype', _AVATAR_ERR_URL);
} elseif (!($file_data = get_fileinfo($avatar_remoteurl, !$MAIN_CFG['avatar']['animated']))) {
cpg_error(_AVATAR_ERR_URL);
} elseif ($file_data['size'] > $MAIN_CFG['avatar']['filesize']) {
cpg_error(sprintf(_AVATAR_FILESIZE, round($MAIN_CFG['avatar']['filesize'] / 1024)));
} elseif (!$MAIN_CFG['avatar']['animated'] && $file_data['animation']) {
cpg_error('Animated avatar not allowed');
}
if (avatar_size($avatar_remoteurl)) {
avatar_delete($userinfo);
//.........这里部分代码省略.........