本文整理汇总了PHP中create_tabs函数的典型用法代码示例。如果您正苦于以下问题:PHP create_tabs函数的具体用法?PHP create_tabs怎么用?PHP create_tabs使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_tabs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_users
function list_users($search = '')
{
global $CONFIG, $cpg_udb, $CPG_PHP_SELF, $LINEBREAK;
//, $PHP_SELF;
global $lang_usermgr_php, $lang_byte_units, $lang_date, $lang_common, $icon_array;
global $lim_user, $number_of_columns, $template_tab_display;
global $USER_DATA;
$superCage = Inspekt::makeSuperCage();
list($timestamp, $form_token) = getFormToken();
$number_of_columns_minus_one = $number_of_columns - 1;
$number_of_columns_minus_three = $number_of_columns - 3;
$number_of_columns_minus_four = $number_of_columns - 4;
$sort_codes = array('name_a' => 'user_name ASC', 'name_d' => 'user_name DESC', 'group_a' => 'group_name ASC', 'group_d' => 'group_name DESC', 'reg_a' => 'user_regdate ASC', 'reg_d' => 'user_regdate DESC', 'pic_a' => 'pic_count ASC', 'pic_d' => 'pic_count DESC', 'disku_a' => 'disk_usage ASC', 'disku_d' => 'disk_usage DESC', 'lv_a' => 'user_lastvisit ASC', 'lv_d' => 'user_lastvisit DESC');
$sort = 'reg_d';
if ($superCage->get->keyExists('sort') && ($matches = $superCage->get->getMatched('sort', '/^[a-z_]+$/'))) {
if ($sort_codes[$matches[0]]) {
$sort = $matches[0];
}
}
$makereadonly = $CONFIG['bridge_enable'] ? 'style="display:none;" disabled="disabled" ' : '';
$user_count = $cpg_udb->get_user_count();
if (!$user_count) {
cpg_die(CRITICAL_ERROR, $lang_usermgr_php['err_no_users'], __FILE__, __LINE__);
}
$user_per_page = 25;
$page = $superCage->get->testInt('page') ? $superCage->get->getInt('page') : 1;
$lower_limit = ($page - 1) * $user_per_page;
$lower_limit = ($page - 1) * $user_per_page;
$username = '';
if ($search) {
$username = '&username=' . $search;
$users_search = $cpg_udb->get_users(array('users_per_page' => $user_count, 'lower_limit' => 0, 'search' => $search, 'sort' => $sort));
$user_count = count($users_search);
}
$tab_tmpl = $template_tab_display;
$tab_tmpl['page_link'] = strtr($tab_tmpl['page_link'], array('{LINK}' => 'usermgr.php?sort=' . $sort . '&page=%d' . $username));
$tab_tmpl['left_text'] = strtr($tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_usermgr_php['u_user_on_p_pages']));
$users = $cpg_udb->get_users(array('users_per_page' => $user_per_page, 'lower_limit' => $lower_limit, 'search' => $search, 'sort' => $sort));
$total_pages = ceil($user_count / $user_per_page);
$tabs = create_tabs($user_count, $page, $total_pages, $tab_tmpl);
$lb = '<span id="album_listbox_wrapper" style="display:none">';
$lb .= $lang_usermgr_php['sort_by'] . ': ';
$lb .= "<select name=\"album_listbox\" id=\"album_listbox\" class=\"listbox\" onchange=\"if(this.options[this.selectedIndex].value) window.location.href='{$CPG_PHP_SELF}?page={$page}&sort='+this.options[this.selectedIndex].value;\">" . $LINEBREAK;
foreach ($sort_codes as $key => $value) {
$selected = $key == $sort ? 'selected="selected"' : "";
$lb .= ' <option value="' . $key . '" ' . $selected . '>' . $lang_usermgr_php[$key] . '</option>' . $LINEBREAK;
}
$lb .= '</select>' . $LINEBREAK;
$lb .= '</span>' . $LINEBREAK;
echo <<<EOT
<script type="text/javascript" language="javascript">
<!--
function selectaction(d,box) {
// check if an action has been selected
var action = document.editForm.action.value;
if (action == '') {
return false;
}
// check if at least one user has been selected
var checked_counter = 0;
var checked_string = '';
var f = document.editForm;
for (i = 0; i < f.length; i++) {
if (f[i].type == "checkbox" && f[i].name.indexOf(box) >= 0) {
if (f[i].checked) {
checked_counter = checked_counter + 1;
if (checked_string == '') {
checked_string = f[i].name;
} else {
checked_string = checked_string + ',' + f[i].name;
}
}
}
}
if (checked_counter == 0) {
document.editForm.action.value = '';
alert('{$lang_usermgr_php['alert_no_selection']}');
return false;
}
document.editForm.id.value = checked_string;
document.editForm.new_password.style.display = "none";
document.editForm.group.style.display = "none";
document.editForm.go.style.display = "none";
document.editForm.delete_files.style.display = "none";
document.editForm.delete_comments.style.display = "none";
switch(document.editForm.action.value) {
case "delete":
document.editForm.delete_files.style.display = "inline";
document.editForm.delete_comments.style.display = "inline";
document.editForm.go.style.display = "inline";
break;
case "reset_password":
document.editForm.new_password.style.display = "inline";
document.editForm.go.style.display = "inline";
break;
case "change_group":
document.editForm.new_password.value = '';
document.editForm.group.style.display = "inline";
if (document.editForm.group.value != '') {
//.........这里部分代码省略.........
示例2: theme_display_thumbnails
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')
{
global $CONFIG;
global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $template_tab_display, $template_thumbnail_view;
static $header = '';
static $thumb_cell = '';
static $empty_cell = '';
static $row_separator = '';
static $footer = '';
static $tabs = '';
static $spacer = '';
if ($header == '') {
$thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
$tabs = template_extract_block($template_thumbnail_view, 'tabs');
$header = template_extract_block($template_thumbnail_view, 'header');
$empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
$row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
$footer = template_extract_block($template_thumbnail_view, 'footer');
$spacer = template_extract_block($template_thumbnail_view, 'spacer');
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['pic_on_page']));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
$tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
// The sort order options are not available for meta albums
if ($sort_options) {
$param = array('{ALBUM_NAME}' => $album_name, '{AID}' => $aid, '{PAGE}' => $page, '{NAME}' => $lang_thumb_view['name'], '{TITLE}' => $lang_thumb_view['title'], '{DATE}' => $lang_thumb_view['date'], '{SORT_TA}' => $lang_thumb_view['sort_ta'], '{SORT_TD}' => $lang_thumb_view['sort_td'], '{SORT_NA}' => $lang_thumb_view['sort_na'], '{SORT_ND}' => $lang_thumb_view['sort_nd'], '{SORT_DA}' => $lang_thumb_view['sort_da'], '{SORT_DD}' => $lang_thumb_view['sort_dd']);
$title = template_eval($template_thumb_view_title_row, $param);
} else {
if ($aid == 'favpics' && $CONFIG['enable_zipdownload'] == 1) {
//Lots of stuff can be added here later
$param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => $lang_thumb_view['download_zip']);
$title = template_eval($template_fav_thumb_view_title_row, $param);
} else {
$title = $album_name;
}
}
if ($mode == 'thumb') {
starttable('100%', $title, $thumbcols);
} else {
starttable('100%');
}
echo $header;
$i = 0;
foreach ($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "displayimage.php?album={$aid}{$cat_link}&pos={$thumb['pos']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
} else {
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => '');
}
echo template_eval($thumb_cell, $params);
if ($i % $thumbcols == 0 && $i < count($thumb_list)) {
echo $row_separator;
}
}
for (; $i % $thumbcols; $i++) {
echo $empty_cell;
}
echo $footer;
if ($display_tabs) {
$params = array('{THUMB_COLS}' => $thumbcols, '{TABS}' => $tabs_html);
echo template_eval($tabs, $params);
}
endtable();
echo $spacer;
}
示例3: array
$sort = !isset($_GET['sort']) || !isset($sort_codes[$_GET['sort']]) ? 'oid_d' : $_GET['sort'];
$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . $lang_photoshop_admin['u_orders_on_p_pages'] . '</b></td>' . "\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>', 'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="index.php?file=photo_shop/photo_shop_myorders&page=%d&box=' . $box . '&sort=' . $sort . '"><b>%d</b></a></td>' . "\n", 'active_next_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%s</b></td>', 'inactive_next_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="index.php?file=photo_shop/photo_shop_myorders&page=%s&box=' . $box . '&sort=' . $sort . '"><b>Next</b></a></td>', 'active_prev_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%s</b></td>', 'inactive_prev_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="index.php?file=photo_shop/photo_shop_myorders&page=%s&box=' . $box . '&sort=' . $sort . '"><b>Prev</b></a></td>');
$orders_per_page = 25;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$lower_limit = ($page - 1) * $orders_per_page;
$total_pages = ceil($tot_box[$box] / $orders_per_page);
//Fetch orders
//bridge
//$result = cpg_db_query("SELECT s.*, u.user_name, u.user_email FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$CONFIG['TABLE_USERS']} as u ON u.user_id = s.uid WHERE aktive=".$box." AND cd=1 ORDER BY ". $sort_codes[$sort] ." LIMIT $lower_limit, $orders_per_page;");
$result = $cpg_udb->photo_shop_fetch_orders($box, $sort_codes, $sort, $lower_limit, $orders_per_page);
//total_orders
$result2 = cpg_db_query("SELECT count(*) FROM {$CONFIG['TABLE_SHOP']} WHERE aktive=" . $box . " AND cd=1 AND uid=" . USER_ID);
list($total) = @mysql_fetch_array($result2);
mysql_free_result($result2);
if ($total > 0) {
$tabs = create_tabs($total, $page, $total_pages, $tab_tmpl);
}
$lb = "<select name=\"album_listbox\" class=\"listbox\" onchange=\"if(this.options[this.selectedIndex].value) window.location.href='index.php?file=photo_shop/photo_shop_myorders&page={$page}&box={$box}&sort='+this.options[this.selectedIndex].value;\">\n";
foreach ($sort_codes as $key => $value) {
$selected = $key == $sort ? 'selected="selected"' : "";
$lb .= " <option value=\"" . $key . "\" {$selected}>" . $lang_photoshop_admin[$key] . "</option>\n";
}
$lb .= "</select>\n";
pageheader($lang_photoshop_admin['o_board_title']);
?>
<?php
echo <<<EOT
\t<form action="index.php?file=photo_shop/photo_shop_myorders" method="post">
\t<table class="maintable" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
示例4: theme_display_thumbnails
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')
{
global $xoopsModuleConfig, $xoopsTpl;
global $template_tab_display;
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => _MD_THM_PICPAGE));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => _MD_THM_USERPAGE));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
$thumbcols = $xoopsModuleConfig['thumbcols'];
$cell_width = ceil(100 / $xoopsModuleConfig['thumbcols']) . '%';
$tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
$i = 0;
foreach ($thumb_list as $thumb) {
$i++;
$pic = array();
$pic['thumb'] = $thumb['image'];
if (is_array($thumb['caption'])) {
$pic['user'] = 1;
$pic['u_name'] = $thumb['caption']['u_name'];
$pic['u_id'] = $thumb['caption']['u_id'];
$pic['albums'] = $thumb['caption']['albums'];
$pic['pictures'] = "";
} else {
$pic['caption'] = $thumb['caption'];
$pic['user'] = 0;
}
if ($mode == 'thumb') {
$pic['link_tgt'] = "displayimage.php?pid={$thumb['pid']}&album={$aid}{$cat_link}&pos={$thumb['pos']}";
$pic['admin_menu'] = $thumb['admin_menu'];
} else {
$pic['link_tgt'] = "index.php?cat={$thumb['cat']}";
$pic['admin_menu'] = "";
}
if ($i % $thumbcols == 0 && $i < count($thumb_list)) {
$pic['row_sep'] = 1;
} else {
$pic['row_sep'] = 0;
}
$pics[] = $pic;
}
$empties = array();
for (; $i % $thumbcols; $i++) {
$empties[] = 1;
}
$xoopsTpl->append('thumbs', array('mode' => $mode, 'sort_options' => $sort_options, 'album_name' => $album_name, 'aid' => $aid, 'page' => $page, 'name' => _MD_THM_NAME, 'date' => _MD_THM_DATE, 'sort_na' => _MD_THM_SORT_NA, 'sort_nd' => _MD_THM_SORT_ND, 'sort_da' => _MD_THM_SORT_DA, 'sort_dd' => _MD_THM_SORT_DD, 'colspan' => $thumbcols, 'tabs' => $tabs_html, 'cell_width' => $cell_width, 'pics' => $pics, 'empties' => $empties));
}
示例5: foreach
// Display pagination
$record_selector = ' - <select name="amount" size="1" onchange="sendForm();" class="listbox">';
foreach ($amount_allowed as $key) {
$record_selector .= '<option value="' . $key . '" ';
if ($amount == $key) {
$record_selector .= ' selected="selected"';
}
$record_selector .= '>' . $key . '</option>' . $line_break;
}
$record_selector .= '</select> ' . $lang_stat_details_php['records_per_page'] . $line_break;
$stats_tmpl = $template_tab_display;
$stats_tmpl['left_text'] = strtr($stats_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_stat_details_php['records_on_page'] . $record_selector));
$stats_tmpl['inactive_tab'] = strtr($stats_tmpl['inactive_tab'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
$stats_tmpl['inactive_next_tab'] = strtr($stats_tmpl['inactive_next_tab'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
$stats_tmpl['inactive_prev_tab'] = strtr($stats_tmpl['inactive_prev_tab'], array('{LINK}' => cpgGetScriptNameParams('page') . 'page=%d#details'));
$tabs = create_tabs($count, $page, $numPages, $stats_tmpl);
$tableColumnsPlus = $tableColumns + 1;
print <<<EOT
<tr>
<td align="right" valign="top" colspan="{$tableColumnsPlus}">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
{$tabs}
</tr>
</table>
</td>
</tr>
EOT;
// display table footer with options
$hide_internal_selected = $hide_internal == '1' ? 'checked="checked"' : '';
$date_display_0_selected = $date_display == '0' ? 'selected="selected"' : '';
示例6: theme_display_thumbnails
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date = '')
{
global $CONFIG;
global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $lang_common, $template_tab_display, $template_thumbnail_view, $lang_album_list;
static $header = '';
static $thumb_cell = '';
static $empty_cell = '';
static $row_separator = '';
static $footer = '';
static $tabs = '';
static $spacer = '';
if ($header == '') {
$thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
$tabs = template_extract_block($template_thumbnail_view, 'tabs');
$header = template_extract_block($template_thumbnail_view, 'header');
$empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
$row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
$footer = template_extract_block($template_thumbnail_view, 'footer');
$spacer = template_extract_block($template_thumbnail_view, 'spacer');
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$date_link = $date == '' ? '' : '&date=' . $date;
$uid_link = isset($_GET['uid']) && is_numeric($_GET['uid']) ? '&uid=' . $_GET['uid'] : '';
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
$tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
// The sort order options are not available for meta albums
if ($sort_options) {
$param = array('{ALBUM_NAME}' => $album_name, '{AID}' => $aid, '{PAGE}' => $page, '{NAME}' => $lang_thumb_view['name'], '{TITLE}' => $lang_common['title'], '{DATE}' => $lang_thumb_view['date'], '{SORT_TA}' => $lang_thumb_view['sort_ta'], '{SORT_TD}' => $lang_thumb_view['sort_td'], '{SORT_NA}' => $lang_thumb_view['sort_na'], '{SORT_ND}' => $lang_thumb_view['sort_nd'], '{SORT_DA}' => $lang_thumb_view['sort_da'], '{SORT_DD}' => $lang_thumb_view['sort_dd'], '{POSITION}' => $lang_thumb_view['position'], '{SORT_PA}' => $lang_thumb_view['sort_pa'], '{SORT_PD}' => $lang_thumb_view['sort_pd']);
$title = template_eval($template_thumb_view_title_row, $param);
} else {
if ($aid == 'favpics' && $CONFIG['enable_zipdownload'] == 1) {
//Lots of stuff can be added here later
$param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => $lang_thumb_view['download_zip']);
$title = template_eval($template_fav_thumb_view_title_row, $param);
} else {
$title = $album_name;
}
}
if ($mode == 'thumb') {
starttable('100%', $title, $thumbcols);
} else {
starttable('100%');
}
echo $header;
$i = 0;
foreach ($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
if ($aid == 'lastalb') {
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
} elseif ($aid == 'random') {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) {
// code for full-size pop-up
$target = 'javascript:;" onClick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
} else {
$target = "displayimage.php?pid={$thumb['pid']}{$uid_link}";
}
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
} else {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) {
// code for full-size pop-up
$target = 'javascript:;" onClick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
} else {
$target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&pid={$thumb['pid']}{$uid_link}";
}
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
}
} else {
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => '');
}
echo template_eval($thumb_cell, $params);
if ($i % $thumbcols == 0 && $i < count($thumb_list)) {
echo $row_separator;
}
}
for (; $i % $thumbcols; $i++) {
echo $empty_cell;
}
echo $footer;
if ($display_tabs) {
$params = array('{THUMB_COLS}' => $thumbcols, '{TABS}' => $tabs_html);
echo template_eval($tabs, $params);
}
endtable();
echo $spacer;
//.........这里部分代码省略.........
示例7: list_users
function list_users()
{
global $CONFIG, $PHP_SELF, $HTTP_GET_VARS;
global $lang_usermgr_php, $lang_byte_units, $register_date_fmt;
global $lim_user;
$sort_codes = array('name_a' => 'user_name ASC', 'name_d' => 'user_name DESC', 'group_a' => 'group_name ASC', 'group_d' => 'group_name DESC', 'reg_a' => 'user_regdate ASC', 'reg_d' => 'user_regdate DESC', 'pic_a' => 'pic_count ASC', 'pic_d' => 'pic_count DESC', 'disku_a' => 'disk_usage ASC', 'disku_d' => 'disk_usage DESC', 'lv_a' => 'user_lastvisit ASC', 'lv_d' => 'user_lastvisit DESC');
$sort = !isset($HTTP_GET_VARS['sort']) || !isset($sort_codes[$HTTP_GET_VARS['sort']]) ? 'reg_d' : $HTTP_GET_VARS['sort'];
$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . $lang_usermgr_php['u_user_on_p_pages'] . '</b></td>' . "\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>', 'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d&sort=' . $sort . '"<b>%d</b></a></td>' . "\n");
$result = db_query("SELECT count(*) FROM {$CONFIG['TABLE_USERS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$user_count = $nbEnr[0];
mysql_free_result($result);
if (!$user_count) {
cpg_die(CRITICAL_ERROR, $lang_usermgr_php['err_no_users'], __FILE__, __LINE__);
}
$user_per_page = 25;
$page = isset($HTTP_GET_VARS['page']) ? (int) $HTTP_GET_VARS['page'] : 1;
$lower_limit = ($page - 1) * $user_per_page;
$total_pages = ceil($user_count / $user_per_page);
$sql = "SELECT user_id, user_name, UNIX_TIMESTAMP(user_regdate) as user_regdate, UNIX_TIMESTAMP(user_lastvisit) as user_lastvisit, user_active, " . "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_name, group_quota " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.owner_id = u.user_id " . "GROUP BY user_id " . "ORDER BY " . $sort_codes[$sort] . " " . "LIMIT {$lower_limit}, {$user_per_page};";
$result = db_query($sql);
$tabs = create_tabs($user_count, $page, $total_pages, $tab_tmpl);
starttable('100%');
if (!$lim_user) {
echo <<<EOT
<tr>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['name']}</span></b></td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['group']}</span></b></td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['registered_on']}</span></b></td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['last_visit']}</span></b></td>
<td class="tableh1" colspan="2" align="center"><b><span class="statlink">{$lang_usermgr_php['operations']}</span></b></td>
<td class="tableh1" align="center"><b><span class="statlink">{$lang_usermgr_php['pictures']}</span></b></td>
<td class="tableh1" colspan="2" align="center"><b><span class="statlink">{$lang_usermgr_php['disk_space']}</span></b></td>
</tr>
EOT;
} else {
echo <<<EOT
<tr>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['name']}</span></b></td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['group']}</span></b></td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['registered_on']}</span></b></td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['last_visit']}</span></b></td>
<td class="tableh1" align="center"><b><span class="statlink">{$lang_usermgr_php['pictures']}</span></b></td>
<td class="tableh1" colspan="2" align="center"><b><span class="statlink">{$lang_usermgr_php['disk_space']}</span></b></td>
</tr>
EOT;
}
while ($user = mysql_fetch_array($result)) {
if ($user['user_active'] == 'NO') {
$user['group_name'] = '<i>' . $lang_usermgr_php['inactive'] . '</i>';
}
$user['user_regdate'] = localised_date($user['user_regdate'], $register_date_fmt);
if ($user['user_lastvisit']) {
$user['user_lastvisit'] = localised_date($user['user_lastvisit'], $register_date_fmt);
} else {
$user['user_lastvisit'] = $lang_usermgr_php['never'];
}
$usr_link = '<a href="profile.php?uid=' . $user['user_id'] . '">' . $user['user_name'];
if ($user['pic_count']) {
$usr_link .= '</a> (<a href="thumbnails.php?album=lastupby&uid=' . $user['user_id'] . '">' . $lang_usermgr_php['latest_upload'] . '</a>)';
} else {
$usr_link .= '</a>';
}
if (!$lim_user) {
echo <<<EOT
<tr>
<td class="tableb">{$usr_link}</td>
<td class="tableb">{$user['group_name']}</td>
<td class="tableb">{$user['user_regdate']}</td>
<td class="tableb">{$user['user_lastvisit']}</td>
<td class="tableb" align="center"><div class="admin_menu"><a href="{$PHP_SELF}?op=edit&user_id={$user['user_id']}">{$lang_usermgr_php['edit']}</a></div></td>
<td class="tableb" align="center"><div class="admin_menu"><a href="delete.php?id={$user['user_id']}&what=user" onclick="return confirm('{$lang_usermgr_php['confirm_del']}');">{$lang_usermgr_php['delete']}</a></div></td>
<td class="tableb" align="center">{$user['pic_count']}</td>
<td class="tableb" align="right">{$user['disk_usage']} {$lang_byte_units[1]}</td>
<td class="tableb" align="right">{$user['group_quota']} {$lang_byte_units[1]}</td>
</tr>
EOT;
} else {
echo <<<EOT
<tr>
<td class="tableb">{$usr_link}</td>
<td class="tableb">{$user['group_name']}</td>
<td class="tableb">{$user['user_regdate']}</td>
<td class="tableb">{$user['user_lastvisit']}</td>
<td class="tableb" align="center">{$user['pic_count']}</td>
<td class="tableb" align="right">{$user['disk_usage']} {$lang_byte_units[1]}</td>
<td class="tableb" align="right">{$user['group_quota']} {$lang_byte_units[1]}</td>
</tr>
EOT;
}
}
// while
mysql_free_result($result);
$lb = "<select name=\"album_listbox\" class=\"listbox\" onChange=\"if(this.options[this.selectedIndex].value) window.location.href='{$PHP_SELF}?page={$page}&sort='+this.options[this.selectedIndex].value;\">\n";
foreach ($sort_codes as $key => $value) {
$selected = $key == $sort ? "SELECTED" : "";
//.........这里部分代码省略.........
示例8: theme_display_thumbnails
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date = '')
{
global $CONFIG, $CURRENT_ALBUM_DATA;
global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $lang_common, $template_tab_display, $template_thumbnail_view, $lang_album_list, $lang_errors;
$superCage = Inspekt::makeSuperCage();
static $header = '';
static $thumb_cell = '';
static $empty_cell = '';
static $row_separator = '';
static $footer = '';
static $tabs = '';
static $spacer = '';
if ($header == '') {
$thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
$tabs = template_extract_block($template_thumbnail_view, 'tabs');
$header = template_extract_block($template_thumbnail_view, 'header');
$empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
$row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
$footer = template_extract_block($template_thumbnail_view, 'footer');
$spacer = template_extract_block($template_thumbnail_view, 'spacer');
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$date_link = $date == '' ? '' : '&date=' . $date;
if ($superCage->get->getInt('uid')) {
$uid_link = '&uid=' . $superCage->get->getInt('uid');
} else {
$uid_link = '';
}
$album_types = array('albums' => array('lastalb'));
$album_types = CPGPluginAPI::filter('theme_thumbnails_album_types', $album_types);
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => in_array($aid, $album_types['albums']) ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
$tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
if (!GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row, 'admin_buttons') !== false) {
template_extract_block($template_thumb_view_title_row, 'admin_buttons');
}
// The sort order options are not available for meta albums
if ($sort_options) {
if (GALLERY_ADMIN_MODE) {
$param = array('{ALBUM_ID}' => $aid, '{CAT_ID}' => $cat > 0 ? $cat : $CURRENT_ALBUM_DATA['category'], '{MODIFY_LNK}' => $lang_common['album_properties'], '{MODIFY_ICO}' => cpg_fetch_icon('modifyalb', 1), '{PARENT_CAT_LNK}' => $lang_common['parent_category'], '{PARENT_CAT_ICO}' => cpg_fetch_icon('category', 1), '{EDIT_PICS_LNK}' => $lang_common['edit_files'], '{EDIT_PICS_ICO}' => cpg_fetch_icon('edit', 1), '{ALBUM_MGR_LNK}' => $lang_common['album_manager'], '{ALBUM_MGR_ICO}' => cpg_fetch_icon('alb_mgr', 1));
} else {
$param = array();
}
$param['{ALBUM_NAME}'] = $album_name;
// Plugin Filter: allow plugin to modify or add tags to process
$param = CPGPluginAPI::filter('theme_thumbnails_title', $param);
$title = template_eval($template_thumb_view_title_row, $param);
} elseif ($aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) {
//Lots of stuff can be added here later
$param = array('{ALBUM_ID}' => $aid, '{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => cpg_fetch_icon('zip', 2) . $lang_thumb_view['download_zip']);
// Plugin Filter: allow plugin to modify or add tags to process
$param = CPGPluginAPI::filter('theme_thumbnails_title', $param);
$title = template_eval($template_fav_thumb_view_title_row, $param);
} else {
$title = $album_name;
}
CPGPluginAPI::action('theme_thumbnails_wrapper_start', null);
if ($mode == 'thumb') {
starttable('100%', $title, $thumbcols);
} else {
starttable('100%');
}
$header = CPGPluginAPI::filter('theme_thumbnails_header', $header);
echo $header;
$i = 0;
global $thumb;
// make $thumb accessible to plugins
foreach ($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
if (in_array($aid, $album_types['albums'])) {
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
} else {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) {
// code for full-size pop-up
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
$target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
} elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
$target = 'javascript:;" onclick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
} else {
$target = 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
}
} elseif ($aid == 'random') {
$target = "displayimage.php?pid={$thumb['pid']}{$uid_link}#top_display_media";
} elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
$page = cpg_get_comment_page_number($thumb['msg_id']);
$page = is_numeric($page) ? "&page={$page}" : '';
$target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&pid={$thumb['pid']}{$uid_link}&msg_id={$thumb['msg_id']}{$page}#comment{$thumb['msg_id']}";
} else {
$target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&pid={$thumb['pid']}{$uid_link}#top_display_media";
}
//.........这里部分代码省略.........
示例9: theme_display_thumbnails
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date = '')
{
global $CONFIG;
global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $lang_common, $template_tab_display, $template_thumbnail_view, $lang_album_list, $lang_errors, $lang_main_menu;
global $REFERER, $lightbox;
// plugin addition
$superCage = Inspekt::makeSuperCage();
static $header = '';
static $thumb_cell = '';
static $empty_cell = '';
static $row_separator = '';
static $footer = '';
static $tabs = '';
static $spacer = '';
if ($header == '') {
$thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
$tabs = template_extract_block($template_thumbnail_view, 'tabs');
$header = template_extract_block($template_thumbnail_view, 'header');
$empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
$row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
$footer = template_extract_block($template_thumbnail_view, 'footer');
$spacer = template_extract_block($template_thumbnail_view, 'spacer');
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$date_link = $date == '' ? '' : '&date=' . $date;
if ($superCage->get->getInt('uid')) {
$uid_link = '&uid=' . $superCage->get->getInt('uid');
} else {
$uid_link = '';
}
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
$tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
if (!GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row, 'admin_buttons') !== false) {
template_extract_block($template_thumb_view_title_row, 'admin_buttons');
}
// The sort order options are not available for meta albums
if ($sort_options) {
if (GALLERY_ADMIN_MODE) {
$param = array('{ALBUM_ID}' => $aid, '{CAT_ID}' => $cat > 0 ? $cat : $cat, '{MODIFY}' => cpg_fetch_icon('modifyalb', 1) . $lang_common['album_properties'], '{PARENT_CAT}' => cpg_fetch_icon('category', 1) . $lang_common['parent_category'], '{EDIT_PICS}' => cpg_fetch_icon('edit', 1) . $lang_common['edit_files'], '{ALBUM_MGR}' => cpg_fetch_icon('alb_mgr', 1) . $lang_common['album_manager']);
} else {
$param = array();
}
$param['{ALBUM_NAME}'] = $album_name;
$title = template_eval($template_thumb_view_title_row, $param);
} elseif ($aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) {
//Lots of stuff can be added here later
$param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => cpg_fetch_icon('zip', 2) . $lang_thumb_view['download_zip']);
$title = template_eval($template_fav_thumb_view_title_row, $param);
} else {
$title = $album_name;
}
// plugin addition
$lightbox['data']['referrer'] = urldecode($REFERER);
if ($superCage->post->keyExists('search') && !$superCage->get->keyExists('album')) {
$lightbox['data']['referrer'] .= "?album=search";
}
if (isset($lightbox['data']['activate_favsel'])) {
echo '<form action="' . $lightbox['data']['referrer'] . '" method="post">';
}
if ($mode == 'thumb') {
starttable('100%', $title, $thumbcols);
} else {
starttable('100%');
}
echo $header;
$i = 0;
global $thumb;
// make $thumb accessible to plugins
foreach ($thumb_list as $thumb) {
$i++;
if ($mode == 'thumb') {
if ($aid == 'lastalb') {
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
} elseif ($aid == 'random') {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) {
// code for full-size pop-up
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
$target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
} elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
$target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
} else {
$target = 'javascript:;" onClick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
}
} else {
$target = "displayimage.php?pid={$thumb['pid']}{$uid_link}";
}
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
} else {
// determine if thumbnail link targets should open in a pop-up
if ($CONFIG['thumbnail_to_fullsize'] == 1) {
//.........这里部分代码省略.........
示例10: elseif
$xoopsDB->query("DELETE FROM " . $xoopsDB->prefix("xcgal_ecard") . "");
} elseif ($_POST['card_action'] == 3) {
$xoopsDB->query("DELETE FROM " . $xoopsDB->prefix("xcgal_ecard") . " WHERE picked=1");
} elseif ($_POST['card_action'] == 4) {
$xoopsDB->query("DELETE FROM " . $xoopsDB->prefix("xcgal_ecard") . " WHERE picked=0");
}
}
$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . _AM_CARDMGR_CONPAGE . '</b></td>' . "\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '<td><img src="../images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>', 'inactive_tab' => '<td><img src="../images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d"><b>%d</b></a></td>' . "\n");
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$lower_limit = ($page - 1) * $card_per_page;
$result = $xoopsDB->query("SELECT count(*) FROM " . $xoopsDB->prefix("xcgal_ecard") . " WHERE 1");
$nbEnr = $xoopsDB->fetchArray($result);
$card_count = $nbEnr['count(*)'];
$xoopsDB->freeRecordSet($result);
$total_pages = ceil($card_count / $card_per_page);
$tabs = create_tabs($card_count, $page, $total_pages, $tab_tmpl);
$result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("xcgal_ecard") . " ORDER BY s_time DESC LIMIT {$lower_limit}, {$card_per_page}");
xoops_cp_header();
echo "<table><tr><td width='100px'><b><a href='index.php'>INDEX</a></b></td>\r\n<td align='center'>\r\n<b><a href='catmgr.php'>" . _AM_CATMNGR . "</a></b> :: \r\n<b><a href='usermgr.php'>" . _AM_USERMNGR . "</a></b> :: \r\n<b><a href='groupmgr.php'>" . _AM_GROUPMNGR . "</a></b><br />\r\n<b><a href='searchnew.php'>" . _AM_BATCHADD . "</a></b> :: \r\n<b><a href='ecardmgr.php'>" . _AM_ECARDMNGR . "</a></b> :: \r\n<b><a href='../editpics.php?mode=upload_approval'>" . _AM_PICAPP . "</a></b>\r\n</td></tr> </table>\r\n<br /><hr />";
echo "<form method=\"post\" name=\"ecard\" action=\"{$PHP_SELF}\">";
echo "<table border='0' cellpadding='0' cellspacing='1' width='100%' class='outer'><tr><th colspan='8'>" . _AM_CARDMGR_TITLE . "</th></tr>";
echo "<tr><td class=\"head\"><input name='allbox' id='allbox' onclick='xoopsCheckAll(\"ecard\", \"allbox\");' type='checkbox' value='Check All' /></td><td class=\"head\">" . _AM_CARDMGR_TIME . "</td><td class=\"head\">" . _AM_CARDMGR_SUNAME . "</td><td class=\"head\">" . _AM_CARDMGR_SEMAIL . "</td><td class=\"head\">" . _AM_CARDMGR_SIP . "</td><td class=\"head\">" . _AM_CARDMGR_PID . "</td><td class=\"head\">" . _AM_CARDMGR_STATUS . "</td></tr>";
$tdstyle = "even";
$user_handler =& xoops_gethandler('member');
while ($row = $xoopsDB->fetchArray($result)) {
if ($tdstyle == "even") {
$tdstyle = "odd";
} else {
$tdstyle = "even";
}
echo "<tr><td class=\"{$tdstyle}\"><input type='checkbox' id='ecard[]' name='ecard[]' value='" . $row['e_id'] . "' /></td><td class=\"{$tdstyle}\">" . formatTimestamp($row['s_time'], 'm') . "</td>";
示例11: list_users
function list_users($search = '')
{
global $CONFIG, $cpg_udb;
//, $PHP_SELF;
global $lang_usermgr_php, $lang_byte_units, $register_date_fmt, $lang_common;
global $lim_user, $number_of_columns;
global $USER_DATA;
$number_of_columns_minus_one = $number_of_columns - 1;
$sort_codes = array('name_a' => 'user_name ASC', 'name_d' => 'user_name DESC', 'group_a' => 'group_name ASC', 'group_d' => 'group_name DESC', 'reg_a' => 'user_regdate ASC', 'reg_d' => 'user_regdate DESC', 'pic_a' => 'pic_count ASC', 'pic_d' => 'pic_count DESC', 'disku_a' => 'disk_usage ASC', 'disku_d' => 'disk_usage DESC', 'lv_a' => 'user_lastvisit ASC', 'lv_d' => 'user_lastvisit DESC');
$sort = !isset($_GET['sort']) || !isset($sort_codes[$_GET['sort']]) ? 'reg_d' : $_GET['sort'];
$tab_tmpl = array('left_text' => '<td width="100%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . $lang_usermgr_php['u_user_on_p_pages'] . '</b></td>' . "\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>', 'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $_SERVER['PHP_SELF'] . '?page=%d&sort=' . $sort . '"<b>%d</b></a></td>' . "\n");
$makereadonly = $CONFIG['bridge_enable'] ? 'style="display:none;" disabled="disabled" ' : '';
$user_count = $cpg_udb->get_user_count();
if (!$user_count) {
cpg_die(CRITICAL_ERROR, $lang_usermgr_php['err_no_users'], __FILE__, __LINE__);
}
$user_per_page = 25;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$lower_limit = ($page - 1) * $user_per_page;
$total_pages = ceil($user_count / $user_per_page);
/*
* Commented out to support bridge files -Omni
*
$sql = "SELECT user_id, user_name, user_email, UNIX_TIMESTAMP(user_regdate) as user_regdate, UNIX_TIMESTAMP(user_lastvisit) as user_lastvisit, user_active, ".
"COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_name, group_quota ".
"FROM {$CONFIG['TABLE_USERS']} AS u ".
"INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id ".
"LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.owner_id = u.user_id ".
$search.
"GROUP BY user_id " . "ORDER BY " . $sort_codes[$sort] . " ".
"LIMIT $lower_limit, $user_per_page";
*/
$users = $cpg_udb->get_users(array('users_per_page' => $user_per_page, 'lower_limit' => $lower_limit, 'search' => $search, 'sort' => $sort));
/*
* Commented out to support bridge files -Omni
*
*/
//$result = cpg_db_query($sql);
$tabs = create_tabs($user_count, $page, $total_pages, $tab_tmpl);
$lb = "<select name=\"album_listbox\" class=\"listbox\" onChange=\"if(this.options[this.selectedIndex].value) window.location.href='{$_SERVER['PHP_SELF']}?page={$page}&sort='+this.options[this.selectedIndex].value;\">\n";
foreach ($sort_codes as $key => $value) {
$selected = $key == $sort ? "SELECTED" : "";
$lb .= " <option value=\"" . $key . "\" {$selected}>" . $lang_usermgr_php[$key] . "</option>\n";
}
$lb .= "</select>\n";
echo <<<EOT
<script type="text/javascript" language="javascript">
<!--
function selectAll(d,box) {
var f = document.editForm;
for (i = 0; i < f.length; i++) {
//alert (f[i].name.indexOf(box));
if (f[i].type == "checkbox" && f[i].name.indexOf(box) >= 0) {
if (d.checked) {
f[i].checked = true;
} else {
f[i].checked = false;
}
}
}
if (d.name == "checkAll") {
document.getElementsByName('checkAll2')[0].checked = document.getElementsByName('checkAll')[0].checked;
} else {
document.getElementsByName('checkAll')[0].checked = document.getElementsByName('checkAll2')[0].checked;
}
}
function selectaction(d,box) {
// check if an action has been selected
var action = document.editForm.action.value;
if (action == '') {
return false;
}
// check if at least one user has been selected
var checked_counter = 0;
var checked_string = '';
var f = document.editForm;
for (i = 0; i < f.length; i++) {
if (f[i].type == "checkbox" && f[i].name.indexOf(box) >= 0) {
if (f[i].checked) {
checked_counter = checked_counter + 1;
if (checked_string == '') {
checked_string = f[i].name;
} else {
checked_string = checked_string + ',' + f[i].name;
}
}
}
}
if (checked_counter == 0) {
document.editForm.action.value = '';
alert('{$lang_usermgr_php['alert_no_selection']}');
return false;
}
document.editForm.id.value = checked_string;
document.editForm.new_password.style.display = "none";
document.editForm.group.style.display = "none";
document.editForm.go.style.display = "none";
document.editForm.delete_files.style.display = "none";
document.editForm.delete_comments.style.display = "none";
//.........这里部分代码省略.........
示例12: list_users
function list_users()
{
global $db, $CONFIG, $CPG_URL, $CPG_M_DIR, $THEME_DIR;
global $lang_usermgr_php, $lang_byte_units, $register_date_fmt;
global $module_name;
$sort_codes = array('name_a' => 'username ASC', 'name_d' => 'username DESC', 'group_a' => 'group_name ASC', 'group_d' => 'group_name DESC', 'reg_a' => 'user_id ASC', 'reg_d' => 'user_id DESC', 'pic_a' => 'pic_count ASC', 'pic_d' => 'pic_count DESC', 'disku_a' => 'disk_usage ASC', 'disku_d' => 'disk_usage DESC');
$sort = !isset($_GET['sort']) || !isset($sort_codes[$_GET['sort']]) ? 'reg_d' : $_GET['sort'];
$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . U_USER_ON_P_PAGES . '</b></td>' . "\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '<td><img src="images/spacer.gif" alt="" width="1" height="1" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>', 'inactive_tab' => '<td><img src="images/spacer.gif" alt="" width="1" height="1" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . URL::index('&file=usermgr&page=%d&sort=' . $sort) . '"><b>%d</b></a></td>' . "\n");
$result = $db->sql_query("SELECT count(*) FROM {$CONFIG['TABLE_USERS']}");
$nbEnr = $db->sql_fetchrow($result);
$user_count = $nbEnr[0];
$db->sql_freeresult($result);
if (!$user_count) {
cpg_die(_CRITICAL_ERROR, ERR_NO_USERS, __FILE__, __LINE__);
}
$user_per_page = 25;
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$lower_limit = ($page - 1) * $user_per_page;
$total_pages = ceil($user_count / $user_per_page);
$sql = "SELECT user_id, username, user_email, user_regdate as user_regdate_cp, group_name, user_active_cp, user_level," . "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group_cp = group_id " . "LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = " . FIRST_USER_CAT . " + user_id " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid " . "GROUP BY user_id, username, user_email, user_regdate, group_name, user_active_cp, user_level, group_quota " . "ORDER BY " . $sort_codes[$sort] . " " . "LIMIT {$lower_limit}, {$user_per_page}";
$result = $db->sql_query($sql);
$tabs = create_tabs($user_count, $page, $total_pages, $tab_tmpl);
starttable('100%');
echo '<tr>
<td class="tableh1" colspan="7"><form method="POST" action="' . URL::index("&file=usermgr", 0, 1) . '">
<input type="hidden" name="opp" value="edit" />
<b><span class="statlink">' . SEARCH_LNK . ' ' . U_NAME . ': </span></b>
<input type="text" name="user_name" maxlength="25" />
<input type="submit" name="submit" value="' . _GO . '"></form></td>
</tr><tr>
<td class="tableh1"><b><span class="statlink">' . U_NAME . '</span></b></td>
<td class="tableh1"><b><span class="statlink">' . GROUP . '</span></b></td>
<td class="tableh1" colspan="2" align="center"><b><span class="statlink">' . OPERATIONS . '</span></b></td>
<td class="tableh1" align="center"><b><span class="statlink">' . PICTURES . '</span></b></td>
<td class="tableh1" colspan="2" align="center"><b><span class="statlink">' . DISK_SPACE . '</span></b></td>
</tr>
';
while ($user = $db->sql_fetchrow($result)) {
if (!$user['user_active_cp'] || $user['user_level'] == 0) {
$user['group_name'] = '<i>' . INACTIVE . '</i>';
}
$user['user_regdate_cp'] = localised_date($user['user_regdate_cp'], $register_date_fmt);
if ($user['pic_count']) {
$usr_link_start = '<a href="' . URL::index('&cat=' . ($user['user_id'] + FIRST_USER_CAT)) . '" target="_blank">';
$usr_link_end = '</a>';
} else {
$usr_link_start = '';
$usr_link_end = '';
}
$user['disk_usage'] = $user['disk_usage'] != '' ? $user['disk_usage'] : '0';
echo '
<tr>
<td class="tableb">' . $usr_link_start . $user['username'] . $usr_link_end . '</td>
<td class="tableb">' . $user['group_name'] . '</td>
<td class="tableb" valign="middle" align="center"><br />
<form method="post" action="' . URL::index("&file=usermgr") . '">
<input type="hidden" name="opp" value="edit" />
<input type="hidden" name="user_id" value="' . $user['user_id'] . '" />
<input type="submit" name="submit" class="admin_menu" value="' . EDIT . '" />
</form>
</td>
<td class="tableb" valign="middle" align="center"><br />
<form method="post" action="' . URL::index("&file=delete") . '">
<input type="hidden" name="what" value="user" />
<input type="hidden" name="id" value="' . $user['user_id'] . '" />
<input type="submit" name="submit" class="admin_menu" value="' . DELETE . '" />
</form>
</td>
<td class="tableb" align="center">' . $user['pic_count'] . '</td>
<td class="tableb" align="right">' . $user['disk_usage'] . ' ' . $lang_byte_units[1] . '</td>
<td class="tableb" align="right">' . $user['group_quota'] . ' ' . $lang_byte_units[1] . '</td>
</tr>
';
}
// while
$db->sql_freeresult($result);
//$CPG_URL = URL::index("&file=usermgr&page=$page&sort=",0);
//echo <<<EOT
//<select onChange="if(this.options[this.selectedIndex].value) window.location.href='$CPG_URL'+this.options[this.selectedIndex].value;" name="album_listbox" class="listbox">";
//EOT;
//$lb = "<select name=\"album_listbox\" class=\"listbox\" onChange=\"if(this.options[this.selectedIndex].value) window.location.href='" . $CPG_URL . "&file=usermgr&page=$page&sort='+this.options[this.selectedIndex].value;\">\n";
$lb = '';
foreach ($sort_codes as $key => $value) {
$selected = $key == $sort ? "SELECTED" : "";
$lb .= " <option value=\"" . $key . "\" {$selected}>" . $lang_usermgr_php[$key] . "</option>\n";
}
$lb .= "</select>\n";
$CPG_URL = URL::index("&file=usermgr&page={$page}&sort=", 0, 1);
echo '<tr><form method="post" action="' . ADDUSER_URL . '" enctype="multipart/form-data" accept-charset="' . _CHARSET . '">
<td colspan="8" align="center" class="tablef">
<table cellpadding="0" cellspacing="0">
<tr>
<td><input type="submit" value="' . CREATE_NEW_USER . '" class="button" /></td>
<td><img src="' . $THEME_DIR . '/images/spacer.gif" width="50" height="1" alt="" /></td>
<td><b>' . SORT_BY . '</b></td>
<td><img src="' . $THEME_DIR . '/images/spacer.gif" width="10" height="1" alt="" /></td>
<td><select onchange="if(this.options[this.selectedIndex].value) window.location.href=\'' . $CPG_URL . '\'+this.options[this.selectedIndex].value;" name="album_listbox" class="listbox">' . $lb . '</td>
</tr>
</table>
</td>
//.........这里部分代码省略.........
示例13: strtr
}
$header_output[$sort_header] .= '</a>';
} else {
$header_output[$sort_header] = '<img src="images/spacer.gif" width="9" height="9" border="0" alt="" title="" />';
}
}
$comm_id = 0;
$banning_tab_array = $template_tab_display;
$banning_tab_array['left_text'] = strtr($banning_tab_array['left_text'], array('{LEFT_TEXT}' => $lang_banning_php['records_on_page'] . ', ' . $lang_banning_php['sorted_by'] . ' ' . $sort_string . $help_array['tab']));
$banning_tab_array['page_link'] = strtr($banning_tab_array['page_link'], array('{LINK}' => 'banning.php?sort=' . $sort . '&page=%d' . '#ban_users'));
$tabs = <<<EOT
<table border="0" cellspacing="0" cellpadding="0" class="maintable" width="100%">
<tr>
EOT;
$tabs .= create_tabs($totalBanCount, $page, $total_pages, $banning_tab_array);
$tabs .= <<<EOT
</tr>
</table>
EOT;
/**
* create_banlist()
*
* @return
**/
function create_banlist()
{
global $CONFIG, $lang_banning_php, $lang_usermgr_php, $lang_common, $lang_date, $CPG_PHP_SELF, $icon_array, $sort, $limit, $header_output, $help_array;
//$PHP_SELF,
$result = cpg_db_query("SELECT *, UNIX_TIMESTAMP(expiry) AS expiry FROM {$CONFIG['TABLE_BANNED']} WHERE brute_force = 0 ORDER BY {$sort} {$limit}");
$count = $result->numRows();
示例14: list_users
function list_users()
{
global $PHP_SELF, $_GET, $xoopsDB, $xoopsConfig;
$sort = !isset($_GET['sort']) || !isset($sort_codes[$_GET['sort']]) ? 'name_a' : $_GET['sort'];
$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . _AM_USERMGR_UONPAGE . '</b></td>' . "\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '<td><img src="../images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>', 'inactive_tab' => '<td><img src="../images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d&op=showuser"<b>%d</b></a></td>' . "\n");
$result = $xoopsDB->query("SELECT COUNT(DISTINCT owner_id) as owners FROM " . $xoopsDB->prefix("xcgal_pictures") . " ");
$nbEnr = $xoopsDB->fetchArray($result);
$user_count = $nbEnr['owners'];
$xoopsDB->freeRecordSet($result);
$byte = _AM_GRPMGR_KB;
if (!$user_count) {
redirect_header('index.php', 2, _AM_USERMGR_NOUSER);
}
$user_per_page = 25;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$lower_limit = ($page - 1) * $user_per_page;
$total_pages = ceil($user_count / $user_per_page);
$sql = "SELECT owner_id, COUNT(pid) as pic_count, " . "ROUND(SUM(total_filesize)/1024) as disk_usage " . "FROM " . "" . $xoopsDB->prefix("xcgal_pictures") . " " . "GROUP BY owner_id " . "LIMIT {$lower_limit}, {$user_per_page}";
$sql2 = "SELECT category, COUNT(aid) as alb FROM " . "" . $xoopsDB->prefix("xcgal_albums") . " WHERE category > " . FIRST_USER_CAT . " " . "GROUP BY category ";
$result = $xoopsDB->query($sql);
$result2 = $xoopsDB->query($sql2);
$albs = db_fetch_rowset($result2);
$tabs = create_tabs($user_count, $page, $total_pages, $tab_tmpl);
//starttable('100%');
echo "<table border='0' cellpadding='0' cellspacing='1' width='100%' class='outer'><tr><th colspan='4'>" . _AM_USERMGR_ULIST . "</th></tr>";
echo "<tr><td width=\"40%\" align=\"center\" class=\"head\">" . _AM_USERMGR_USER . "</td><td width=\"20%\" align=\"center\" class=\"head\">" . _AM_USERMGR_ALBUMS . "</td><td class=\"head\" align=\"center\" width=\"20%\">" . _AM_USERMGR_PICS . "</td><td class=\"head\" align=\"right\" width=\"20%\">" . _AM_USERMGR_QUOTA . "</td></tr>";
$tdstyle = "even";
$user_handler =& xoops_gethandler('member');
while ($user = $xoopsDB->fetchArray($result)) {
$pic_owner =& $user_handler->getUser($user['owner_id']);
if ($user['pic_count'] && is_object($pic_owner)) {
$usr_link_start = '<a href="../index.php?cat=' . ($user['owner_id'] + FIRST_USER_CAT) . '" target="_blank">';
$usr_link_end = '</a>';
$ulink = "<a href=\"" . XOOPS_URL . "/userinfo.php?uid={$user['owner_id']}\" target=\"_blank\">";
$ulink_end = "</a>";
$user['uname'] = $pic_owner->uname();
} else {
$usr_link_start = '';
$usr_link_end = '';
$ulink = "";
$ulink_end = "";
$user['uname'] = $xoopsConfig['anonymous'];
}
if ($tdstyle == "even") {
$tdstyle = "odd";
} else {
$tdstyle = "even";
}
echo <<<EOT
<tr>
<td class="{$tdstyle}" align="center">{$ulink}{$user['uname']}{$ulink_end}</td>
<td class="{$tdstyle}" align="center">
EOT;
foreach ($albs as $alb) {
if ($user['owner_id'] == $alb['category'] - FIRST_USER_CAT) {
echo $usr_link_start . $alb['alb'] . $usr_link_end;
}
}
echo <<<EOT
</td>
<td class="{$tdstyle}" align="center"><a href="../thumbnails.php?album=usearch&suid={$user['owner_id']}" target="_blank">{$user['pic_count']}</a></td>
<td class="{$tdstyle}" align="right">{$user['disk_usage']} {$byte}</td>
</tr>
EOT;
}
// while
$xoopsDB->freeRecordSet($result);
echo <<<EOT
<tr>
<td colspan="8" class="foot">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
{$tabs}
</tr>
</table>
</td>
</tr></table>
EOT;
//endtable();
}
示例15: theme_options_page
//.........这里部分代码省略.........
// -------------------------------------------------------------------------
/*
var calcHeight = function()
{
$( "#preview-frame" ).height($(window).height() - 100);
}
$(document).ready(function()
{
calcHeight();
});
$(window).resize(function()
{
calcHeight();
}).load(function()
{
calcHeight();
});
*/
// -------------------------------------------------------------------------
});
</script>
<?php
if (isset($_GET['tab'])) {
create_tabs($_GET['tab']);
} else {
create_tabs('general');
}
?>
<div id="poststuff">
<?php
// theme options page
if ($pagenow == 'themes.php' && $_GET['page'] == 'theme-options') {
// tab from url
if (isset($_GET['tab'])) {
$tab = $_GET['tab'];
} else {
$tab = 'general';
}
switch ($tab) {
case 'general':
if (esc_attr(@$_GET['saved']) == 'true') {
echo '<div class="alert-success" title="Click to close"><p><strong>Saved.</strong></p></div>';
}
?>
<div class="postbox">
<div class="inside">
<form method="post" class="ajax-form" action="<?php
admin_url('themes.php?page=theme-options');
?>
">
<?php
wp_nonce_field("settings-page");
?>
<table>