本文整理汇总了PHP中build_select函数的典型用法代码示例。如果您正苦于以下问题:PHP build_select函数的具体用法?PHP build_select怎么用?PHP build_select使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build_select函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_link_select
function get_link_select($conn, $data)
{
$type = $data['type'];
$extra_info = $data['extra'];
ossim_valid($type, OSS_INPUT, 'illegal:' . _('Type'));
ossim_valid($extra_info, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _('Parameter'));
if (ossim_error()) {
$info_error = _('Error') . ': ' . ossim_get_error();
ossim_clean_error();
$return['error'] = TRUE;
$return['msg'] = $info_error;
return $return;
}
switch ($type) {
case 'host':
case 'host_group':
case 'net':
case 'net_group':
case 'incident':
list($list, $num_rows) = Repository::get_hostnet($conn, $type);
$result = build_select($list);
break;
case 'plugin_sid':
$result = plugin_select($conn);
break;
case 'sid':
$result = pluginsids_select($conn, $extra_info);
break;
case "directive":
$result = directives_select();
break;
case 'taxonomy':
$result = taxonomy_select($conn);
break;
case 'subcategory':
$result = subcategory_select($conn, $extra_info);
break;
default:
$return['error'] = TRUE;
$return['msg'] = _('Invalid Type');
return $return;
}
$return['error'] = FALSE;
$return['data'] = $result;
return $return;
}
示例2: build_select
function build_select($con, $portal, $pai, $nivel = 0, $pai_atual, $id_atual)
{
// if ($nivel > 1) { return; }
$sql = "select * from links l inner join links_do_subportal ls\n\t\t\ton l.id = ls.links_id\n\t\t\twhere subportais_id=" . $portal . " and pai=" . $pai . " and ativo=1\n\t\t\torder by link";
$result = mysql_query($sql);
$r = "";
$nivel++;
while ($links = mysql_fetch_assoc($result)) {
$fi = build_select($con, $portal, $links["id"], $nivel, $pai_atual, $id_atual);
if ($pai_atual == $links["id"]) {
$selected = "selected";
} else {
$selected = "";
}
if ($id_atual == $links["id"]) {
$selected .= " disabled";
}
if ($fi == "") {
if ($nivel == 1) {
$r .= "<optgroup value=" . $links["id"] . " label=\"" . $links["link"] . "\">\n";
$r .= "\t<option value=" . $links["id"] . " {$selected}>»»" . $links["link"] . "««</option>\n";
$r .= "</optgroup>\n";
} else {
$r .= "\t<option value=" . $links["id"] . " {$selected}>" . $links["link"] . "</option>\n";
}
} else {
if ($nivel == 1) {
$r .= "<optgroup value=" . $links["id"] . " label=\"" . $links["link"] . "\">\n";
$r .= "\t<option value=" . $links["id"] . " {$selected}>»»" . $links["link"] . "««</option>\n";
if ($id_atual != $links["id"]) {
$r .= $fi . "\n";
}
$r .= "</optgroup>\n";
} else {
$r .= "\t<option value=" . $links["id"] . " {$selected}>" . $links["link"] . "</option>\n";
if ($id_atual != $links["id"]) {
$r .= $fi . "\n";
}
}
}
}
return $r;
}
示例3: disp_ping_ui
/**
* generates the ping UI in HTML and returns it
*/
function disp_ping_ui()
{
$ret = '';
if ($_REQUEST['ping_if'] !== 'tun0' || $_REQUEST['ping_if'] !== 'eth0' || $_REQUEST['ping_if'] !== 'eth1') {
$_REQUEST['ping_if'] = 'eth0';
}
//interface dropdown
$sel = array('id' => 'ping_if', 'selected' => $_REQUEST['ping_if'], array('eth0', 'eth0'), array('eth1', 'eth1'), array('tun0', 'tun0'));
$ret .= '<h2>Ping Utility</h2>';
$ret .= '<noscript><strong>The utility requires javascript. You may use the command line instead</strong></noscript>';
$ret .= '<p>The Ping Utility uses the same ping commands as the PIA-Tunnel scripts.<br>' . 'Try pining a hostname (google.com) to see if name resolution works or ' . 'your computers/router by IP if everything fails.....' . '</p>';
$ret .= '<p>The following firewall rule applies<br>' . '* outgoing eth0 not allowed when the VPN is connected. connections to the Internet are ' . ' only allowed through tun0' . '</p>';
$ret .= '<input type="hidden" name="cmd" value="ping_host">';
$ret .= 'Outgoing interface: ' . build_select($sel) . '<br>';
$ret .= 'Name or IP ';
$ret .= ' <input id="inp_host" type="text" name="IP" placeholder="google.com" value="" style="width: 20em;"> ';
$ret .= ' <input id="btn_ping" type="button" href="#" onclick="send_ping();" name="ping it" value="Ping Host" disabled>';
$ret .= '<textarea id="ping_out" style="width: 625px; height: 20em;">ping results are stored in /pia/cache/tools_ping.txt ....';
$ret .= "</textarea>\n";
$ret .= '<script type="text/javascript">' . 'document.getElementById("btn_ping").disabled = false;' . 'document.getElementById("inp_host").focus();' . 'var timr2;
function send_ping(){
document.getElementById("btn_ping").disabled = true;
var timr1=setTimeout(function(){
document.getElementById("ping_out").innerHTML = "running .....";
var _ping = new PingObj();
_ping.ping("inp_host");
},500);
timr2=setInterval(function(){
var _ping = new PingObj();
_ping.read();
},2500);
}</script>';
return $ret;
}
示例4: array
if (!($ranks = $datastore->get('ranks'))) {
$datastore->update('ranks');
$ranks = $datastore->get('ranks');
}
$poster_rank = $rank_image = $rank_style = $rank_select = '';
if ($user_rank = $profiledata['user_rank'] and isset($ranks[$user_rank])) {
$rank_image = $ranks[$user_rank]['rank_image'] ? '<img src="' . $ranks[$user_rank]['rank_image'] . '" alt="" title="" border="0" />' : '';
$poster_rank = $ranks[$user_rank]['rank_title'];
$rank_style = $ranks[$user_rank]['rank_style'];
}
if (IS_ADMIN) {
$rank_select = array($lang['NONE'] => 0);
foreach ($ranks as $row) {
$rank_select[$row['rank_title']] = $row['rank_id'];
}
$rank_select = build_select('rank-sel', $rank_select, $user_rank);
}
if (bf($profiledata['user_opt'], 'user_opt', 'user_viewemail') || $profiledata['user_id'] == $userdata['user_id'] || IS_AM) {
$email_uri = $bb_cfg['board_email_form'] ? 'profile.php?mode=email&' . POST_USERS_URL . '=' . $profiledata['user_id'] : 'mailto:' . $profiledata['user_email'];
$email = '<a class="editable" href="' . $email_uri . '">' . $profiledata['user_email'] . '</a>';
} else {
$email = '';
}
//
// Generate page
//
$profile_user_id = $profiledata['user_id'] == $userdata['user_id'];
$signature = $bb_cfg['allow_sig'] && $profiledata['user_sig'] ? $profiledata['user_sig'] : '';
if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) {
if ($profile_user_id) {
$signature = $lang['SIGNATURE_DISABLE'];
示例5: url_arg
$datetime_href_s = url_arg($url, $datetime_key, date($dt_format, $row['log_time']));
$datetime_href_s = url_arg($datetime_href_s, $daysback_key, 1);
$template->assign_block_vars('log', array('ACTION_DESC' => $lang['LOG_ACTION']['LOG_TYPE'][$log_type_flip[$row['log_type_id']]], 'ACTION_HREF_S' => url_arg($url, $type_key, $row['log_type_id']), 'USER_ID' => $row['log_user_id'], 'USERNAME' => $row['log_username'], 'USER_HREF_S' => url_arg($url, $user_key, $row['log_user_id']), 'USER_IP' => decode_ip($row['log_user_ip']), 'FORUM_ID' => $row['log_forum_id'], 'FORUM_HREF' => BB_ROOT . FORUM_URL . $row['log_forum_id'], 'FORUM_HREF_S' => url_arg($url, $forum_key, $row['log_forum_id']), 'FORUM_NAME' => htmlCHR($forum_name), 'FORUM_ID_NEW' => $row['log_forum_id_new'], 'FORUM_HREF_NEW' => BB_ROOT . FORUM_URL . $row['log_forum_id_new'], 'FORUM_HREF_NEW_S' => url_arg($url, $forum_key, $row['log_forum_id_new']), 'FORUM_NAME_NEW' => htmlCHR($forum_name_new), 'TOPIC_ID' => $row['log_topic_id'], 'TOPIC_HREF' => !$topic_deleted ? BB_ROOT . TOPIC_URL . $row['log_topic_id'] : '', 'TOPIC_HREF_S' => url_arg($url, $topic_key, $row['log_topic_id']), 'TOPIC_TITLE' => $topic_title, 'TOPIC_ID_NEW' => $row['log_topic_id_new'], 'TOPIC_HREF_NEW' => BB_ROOT . TOPIC_URL . $row['log_topic_id_new'], 'TOPIC_HREF_NEW_S' => url_arg($url, $topic_key, $row['log_topic_id_new']), 'TOPIC_TITLE_NEW' => $topic_title_new, 'DATE' => bb_date($row['log_time'], 'j-M'), 'TIME' => bb_date($row['log_time'], 'H:i'), 'DATETIME_HREF_S' => $datetime_href_s, 'MSG' => $msg, 'ROW_CLASS' => $row_class));
// Topics
if ($topic_csv && empty($filter['topics'][$row['log_topic_title']])) {
$template->assign_block_vars('topics', array('TOPIC_TITLE' => $row['log_topic_title']));
$filter['topics'][$row['log_topic_title']] = true;
}
// Forums
if ($forum_csv && empty($filter['forums'][$forum_name])) {
$template->assign_block_vars('forums', array('FORUM_NAME' => htmlCHR($forum_name)));
$filter['forums'][$forum_name] = true;
}
// Users
if ($user_csv && empty($filter['users'][$row['log_username']])) {
$template->assign_block_vars('users', array('USERNAME' => $row['log_username']));
$filter['users'][$row['log_username']] = true;
}
}
$template->assign_vars(array('FILTERS' => $topic_csv || $forum_csv || $user_csv, 'FILTER_TOPICS' => !empty($filter['topics']), 'FILTER_FORUMS' => !empty($filter['forums']), 'FILTER_USERS' => !empty($filter['users'])));
} else {
$template->assign_block_vars('log_not_found', array());
}
//
// Selects
//
$log_type_select = array($lang['ACTS_LOG_ALL_ACTIONS'] => $all_types) + $log_action->log_type_select;
// Order select
$order_options = '<option value=""> ' . $lang['ACTS_LOG_TIME'] . ' </option>';
$template->assign_vars(array('LOG_COLSPAN' => 4, 'DATETIME_NAME' => $datetime_key, 'DATETIME_VAL' => date('Y-m-d', $datetime_val), 'DAYSBACK_NAME' => $daysback_key, 'DAYSBACK_VAL' => $daysback_val, 'FIRST_LOG_TIME' => $first_log_time ? date('Y-m-d', $first_log_time) : $lang['ACC_NONE'], 'TITLE_MATCH_MAX' => $title_match_max_len, 'TITLE_MATCH_NAME' => $title_match_key, 'TITLE_MATCH_VAL' => $title_match_val, 'ORDER_NAME' => '', 'ORDER_OPTIONS' => $order_options, 'SORT_NAME' => $sort_key, 'SORT_ASC' => $sort_asc, 'SORT_DESC' => $sort_desc, 'SORT_ASC_CHECKED' => $sort_val == $sort_asc ? HTML_CHECKED : '', 'SORT_DESC_CHECKED' => $sort_val == $sort_desc ? HTML_CHECKED : '', 'SEL_FORUM' => get_forum_select('admin', "{$forum_key}[]", $forum_selected, $max_forum_name_len, $select_max_height, '', $all_forums), 'SEL_LOG_TYPE' => build_select("{$type_key}[]", $log_type_select, $type_selected, 60, $select_max_height), 'SEL_USERS' => build_select("{$user_key}[]", $users, $user_selected, 16, $select_max_height), 'S_LOG_ACTION' => "admin_log.php", 'TOPIC_CSV' => $topic_csv));
print_page('admin_log.tpl', 'admin');
示例6: main
//.........这里部分代码省略.........
}
$db->sql_freeresult($result);
$sql_ary = array();
foreach ($posted as $user_id => $topic_row) {
foreach ($topic_row as $topic_id) {
$sql_ary[] = array('user_id' => $user_id, 'topic_id' => $topic_id, 'topic_posted' => 1);
}
}
unset($posted);
if (sizeof($sql_ary)) {
switch (SQL_LAYER) {
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary) {
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
break;
}
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$total_files = $config['num_files'];
$start_date = $user->format_date($config['board_startdate']);
$boarddays = (time() - $config['board_startdate']) / 86400;
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
$upload_dir_size = $config['upload_dir_size'] >= 1048576 ? sprintf('%.2f ' . $user->lang['MB'], $config['upload_dir_size'] / 1048576) : ($config['upload_dir_size'] >= 1024 ? sprintf('%.2f ' . $user->lang['KB'], $config['upload_dir_size'] / 1024) : sprintf('%.2f ' . $user->lang['BYTES'], $config['upload_dir_size']));
$avatar_dir_size = 0;
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) {
while (($file = readdir($avatar_dir)) !== false) {
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false) {
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
}
@closedir($avatar_dir);
// This bit of code translates the avatar directory size into human readable format
// Borrowed the code from the PHP.net annoted manual, origanally written by:
// Jesse (jesse@jess.on.ca)
$avatar_dir_size = $avatar_dir_size >= 1048576 ? sprintf('%.2f ' . $user->lang['MB'], $avatar_dir_size / 1048576) : ($avatar_dir_size >= 1024 ? sprintf('%.2f ' . $user->lang['KB'], $avatar_dir_size / 1024) : sprintf('%.2f ' . $user->lang['BYTES'], $avatar_dir_size));
} else {
// Couldn't open Avatar dir.
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
}
if ($posts_per_day > $total_posts) {
$posts_per_day = $total_posts;
}
if ($topics_per_day > $total_topics) {
$topics_per_day = $total_topics;
}
if ($users_per_day > $total_users) {
$users_per_day = $total_users;
}
if ($files_per_day > $total_files) {
$files_per_day = $total_files;
}
$dbsize = get_database_size();
$s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING'));
$template->assign_vars(array('TOTAL_POSTS' => $total_posts, 'POSTS_PER_DAY' => $posts_per_day, 'TOTAL_TOPICS' => $total_topics, 'TOPICS_PER_DAY' => $topics_per_day, 'TOTAL_USERS' => $total_users, 'USERS_PER_DAY' => $users_per_day, 'TOTAL_FILES' => $total_files, 'FILES_PER_DAY' => $files_per_day, 'START_DATE' => $start_date, 'AVATAR_DIR_SIZE' => $avatar_dir_size, 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'GZIP_COMPRESSION' => $config['gzip_compress'] ? $user->lang['ON'] : $user->lang['OFF'], 'U_ACTION' => append_sid("{$phpbb_admin_path}index.{$phpEx}"), 'S_ACTION_OPTIONS' => $auth->acl_get('a_board') ? $s_action_options : ''));
$log_data = array();
$log_count = 0;
if ($auth->acl_get('a_viewlogs')) {
view_log('admin', $log_data, $log_count, 5);
foreach ($log_data as $row) {
$template->assign_block_vars('log', array('USERNAME' => $row['username'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action']));
}
}
if ($auth->acl_get('a_user')) {
$sql = 'SELECT user_id, username, user_regdate
FROM ' . USERS_TABLE . '
WHERE user_type = ' . USER_INACTIVE . '
ORDER BY user_regdate ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$template->assign_block_vars('inactive', array('DATE' => $user->format_date($row['user_regdate']), 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=users&mode=overview&u={$row['user_id']}")));
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable']) {
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array('S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary)));
}
// Display debug_extra notice
if (defined('DEBUG_EXTRA')) {
$template->assign_var('S_DEBUG_EXTRA', true);
}
$this->tpl_name = 'acp_main';
$this->page_title = 'ACP_MAIN';
}
示例7: main
//.........这里部分代码省略.........
WHERE ' . $db->sql_in_set('user_id', $mark) . '
AND user_type = ' . USER_INACTIVE;
$result = $db->sql_query($sql);
$inactive_users = array();
while ($row = $db->sql_fetchrow($result)) {
$inactive_users[] = $row;
}
$db->sql_freeresult($result);
}
user_active_flip('activate', $mark);
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users)) {
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger();
foreach ($inactive_users as $row) {
$messenger->template('admin_welcome_activated', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($row['username'])));
$messenger->send(NOTIFY_EMAIL);
}
$messenger->save_queue();
}
} else {
if ($action == 'delete') {
if (confirm_box(true)) {
if (!$auth->acl_get('a_userdel')) {
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
foreach ($mark as $user_id) {
user_delete('retain', $user_id, $user_affected[$user_id]);
}
add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
} else {
$s_hidden_fields = array('mode' => $mode, 'action' => $action, 'mark' => $mark, 'submit' => 1, 'start' => $start);
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
}
}
}
break;
case 'remind':
if (empty($config['email_enable'])) {
trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark) . '
AND user_inactive_reason';
$sql .= $config['require_activation'] == USER_ACTIVATION_ADMIN ? ' = ' . INACTIVE_REMIND : ' <> ' . INACTIVE_MANUAL;
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
// Send the messages
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$messenger = new messenger();
$usernames = array();
do {
$messenger->template('user_remind_inactive', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($row['username']), 'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true), 'U_ACTIVATE' => generate_board_url() . "/ucp.{$phpEx}?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']));
$messenger->send($row['user_notify_type']);
$usernames[] = $row['username'];
} while ($row = $db->sql_fetchrow($result));
$messenger->save_queue();
add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
unset($usernames);
}
$db->sql_freeresult($result);
break;
}
}
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']);
$sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
// Define where and sort sql for use in displaying logs
$sql_where = $sort_days ? time() - $sort_days * 86400 : 0;
$sql_sort = $sort_by_sql[$sort_key] . ' ' . ($sort_dir == 'd' ? 'DESC' : 'ASC');
$inactive = array();
$inactive_count = 0;
$start = view_inactive_users($inactive, $inactive_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
foreach ($inactive as $row) {
$template->assign_block_vars('inactive', array('INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), 'JOINED' => $user->format_date($row['user_regdate']), 'LAST_VISIT' => !$row['user_lastvisit'] ? ' - ' : $user->format_date($row['user_lastvisit']), 'REASON' => $row['inactive_reason'], 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=users&mode=overview&u={$row['user_id']}")));
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable']) {
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array('S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary), 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, 'S_ON_PAGE' => on_page($inactive_count, $config['topics_per_page'], $start), 'PAGINATION' => generate_pagination($this->u_action . "&{$u_sort_param}", $inactive_count, $config['topics_per_page'], $start, true), 'U_ACTION' => $this->u_action . '&start=' . $start));
$this->tpl_name = 'acp_inactive';
$this->page_title = 'ACP_INACTIVE_USERS';
}
示例8: get_list
if (isset($_REQUEST['c'])) {
$cat_id = (int) $_REQUEST['c'];
}
}
$catlist = get_list('category', $cat_id, TRUE);
$forumlocked = $forumunlocked = '';
$forumstatus == FORUM_LOCKED ? $forumlocked = 'selected="selected"' : ($forumunlocked = 'selected="selected"');
$statuslist = '<option value="' . FORUM_UNLOCKED . '" ' . $forumunlocked . '>' . $lang['STATUS_UNLOCKED'] . '</option>\\n';
$statuslist .= '<option value="' . FORUM_LOCKED . '" ' . $forumlocked . '>' . $lang['STATUS_LOCKED'] . '</option>\\n';
$forum_display_sort_list = get_forum_display_sort_option($forum_display_sort, 'list', 'sort');
$forum_display_order_list = get_forum_display_sort_option($forum_display_order, 'list', 'order');
$s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
$s_parent = '<option value="-1"> ' . $lang['SF_NO_PARENT'] . '</option>\\n';
$sel_forum = $forum_parent && !isset($_REQUEST['forum_parent']) ? $forum_id : $forum_parent;
$s_parent .= sf_get_list('forum', $forum_id, $sel_forum);
$template->assign_vars(array('TPL_EDIT_FORUM' => true, 'S_FORUM_DISPLAY_SORT_LIST' => $forum_display_sort_list, 'S_FORUM_DISPLAY_ORDER_LIST' => $forum_display_order_list, 'S_FORUM_ACTION' => 'admin_forums.php', 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SUBMIT_VALUE' => $buttonvalue, 'S_CAT_LIST' => $catlist, 'S_STATUS_LIST' => $statuslist, 'SHOW_ON_INDEX' => $show_on_index, 'S_PARENT_FORUM' => $s_parent, 'CAT_LIST_CLASS' => $forum_parent ? 'hidden' : '', 'SHOW_ON_INDEX_CLASS' => !$forum_parent ? 'hidden' : '', 'TPL_SELECT' => get_select('forum_tpl', $forum_tpl_id, 'html', $lang['TEMPLATE_DISABLE']), 'ALLOW_REG_TRACKER' => build_select('allow_reg_tracker', array($lang['DISALLOWED'] => 0, $lang['ALLOWED'] => 1), $allow_reg_tracker), 'ALLOW_PORNO_TOPIC' => build_select('allow_porno_topic', array($lang['NONE'] => 0, $lang['YES'] => 1), $allow_porno_topic), 'SELF_MODERATED' => build_select('self_moderated', array($lang['NONE'] => 0, $lang['YES'] => 1), $self_moderated), 'L_FORUM_TITLE' => $l_title, 'PRUNE_DAYS' => $prune_days, 'FORUM_NAME' => htmlCHR($forumname), 'DESCRIPTION' => htmlCHR($forumdesc)));
break;
case 'createforum':
//
// Create a forum in the DB
//
$cat_id = intval($_POST[POST_CAT_URL]);
$forum_name = (string) $_POST['forumname'];
$forum_desc = (string) $_POST['forumdesc'];
$forum_status = intval($_POST['forumstatus']);
$prune_days = intval($_POST['prune_days']);
$forum_parent = $_POST['forum_parent'] != -1 ? intval($_POST['forum_parent']) : 0;
$show_on_index = $forum_parent ? intval($_POST['show_on_index']) : 1;
$forum_display_sort = intval($_POST['forum_display_sort']);
$forum_display_order = intval($_POST['forum_display_order']);
$forum_tpl_id = (int) $_POST['forum_tpl_select'];
示例9: VPN_get_connections
/**
* method to get a list of valid VPN connection
* currently only supporting PIA so I simply index the .ovpn files
* - used build_select()
* @param string $name name and id of element as a string
* @param array $build_options *Optional* additional build_select() as array (besides name)
* @return string/bool string containing HTML formated as <select> or FALSE
*/
function VPN_get_connections($name, $build_options = array())
{
$fw_ret = array();
$ret = array();
$sel = array();
$sel['id'] = $name;
if (count($build_options) > 0) {
$sel = array_merge($sel, $build_options);
}
if (array_key_exists('ovpn', $_SESSION) !== true) {
echo "FATAL ERROR: Unable to get list of VPN connections!";
return false;
}
//loop over session to generate options
foreach ($_SESSION['ovpn'] as $ovpn) {
if (provider_ready2use($ovpn) === true) {
$html = htmlentities($ovpn);
//$ret .= "<option value=\"$html\">$html</option>\n";
if (supports_forwarding($html) === true) {
$fw_ret[] = array($html, '*' . $html);
} else {
$ret[] = array($html, $html);
}
}
}
if ($ret == '') {
return false;
}
sort($ret);
sort($fw_ret);
if (count($ret) === 0 && count($fw_ret) === 0) {
$ret[] = array('invalid login data', 'invalid login data');
}
$t = array_merge($sel, $fw_ret, $ret);
$assembled = build_select($t);
//return "<select name=\"vpn_connections\">\n$ret</select>\n";
return $assembled;
}
示例10: foreach
foreach ($forums_ary as $forum_id) {
$forum_name = $forum_name_html[$forum_id];
$forum_name = str_short($forum_name, $max_forum_name_len - 2);
$style = '';
if (!isset($cat_forum['subforums'][$forum_id])) {
$class = 'root_forum has_sf';
$class .= isset($cat_forum['forums_with_sf'][$forum_id]) ? ' has_sf' : '';
$style = " class=\"{$class}\"";
}
$selected = isset($search_in_forums_fary[$forum_id]) ? HTML_SELECTED : '';
$opt .= '<option id="fs-' . $forum_id . '" value="' . $forum_id . '"' . $style . $selected . '>' . (isset($cat_forum['subforums'][$forum_id]) ? HTML_SF_SPACER : '') . $forum_name . " </option>\n";
}
$opt .= "</optgroup>\n";
}
$search_all_opt = '<option value="' . $search_all . '" value="fs-' . $search_all . '"' . ($forum_val == $search_all ? HTML_SELECTED : '') . '> ' . htmlCHR($lang['ALL_AVAILABLE']) . "</option>\n";
$cat_forum_select = "\n" . '<select id="fs-main" style="width: 100%;" name="' . $forum_key . '[]" multiple="multiple" size="' . $forum_select_size . "\">\n" . $search_all_opt . $opt . "</select>\n";
// Sort dir
$template->assign_vars(array('SORT_NAME' => $sort_key, 'SORT_ASC' => $sort_asc, 'SORT_DESC' => $sort_desc, 'SORT_ASC_CHECKED' => $sort_val == $sort_asc ? HTML_CHECKED : '', 'SORT_DESC_CHECKED' => $sort_val == $sort_desc ? HTML_CHECKED : ''));
// Displaying options
$tor_type_lang = $lang['GOLD'] . ' / ' . $lang['SILVER'];
$template->assign_vars(array('SHOW_CAT_CHBOX' => build_checkbox($show_cat_key, $lang['BT_SHOW_CAT'], $show_cat_val), 'SHOW_FORUM_CHBOX' => build_checkbox($show_forum_key, $lang['BT_SHOW_FORUM'], $show_forum_val), 'SHOW_AUTHOR_CHBOX' => build_checkbox($show_author_key, $lang['BT_SHOW_AUTHOR'], $show_author_val), 'SHOW_SPEED_CHBOX' => build_checkbox($show_speed_key, $lang['BT_SHOW_SPEED'], $show_speed_val), 'ALL_WORDS_CHBOX' => build_checkbox($all_words_key, $lang['SEARCH_ALL_WORDS'], $all_words_val), 'TOR_TYPE_CHBOX' => build_checkbox($tor_type_key, $tor_type_lang, $tor_type_val), 'ONLY_MY_CHBOX' => build_checkbox($my_key, $lang['BT_ONLY_MY'], $only_my, IS_GUEST), 'ONLY_ACTIVE_CHBOX' => build_checkbox($active_key, $lang['BT_ONLY_ACTIVE'], $active_val), 'SEED_EXIST_CHBOX' => build_checkbox($seed_exist_key, $lang['BT_SEED_EXIST'], $seed_exist), 'ONLY_NEW_CHBOX' => build_checkbox($new_key, $lang['BT_ONLY_NEW'], $only_new, IS_GUEST), 'DL_CANCEL_CHBOX' => build_checkbox($dl_cancel_key, $lang['SEARCH_DL_CANCEL'], $dl_cancel_val, IS_GUEST, 'dlCancel'), 'DL_COMPL_CHBOX' => build_checkbox($dl_compl_key, $lang['SEARCH_DL_COMPLETE'], $dl_compl_val, IS_GUEST, 'dlComplete'), 'DL_DOWN_CHBOX' => build_checkbox($dl_down_key, $lang['SEARCH_DL_DOWN'], $dl_down_val, IS_GUEST, 'dlDown'), 'DL_WILL_CHBOX' => build_checkbox($dl_will_key, $lang['SEARCH_DL_WILL'], $dl_will_val, IS_GUEST, 'dlWill'), 'POSTER_NAME_NAME' => $poster_name_key, 'POSTER_NAME_VAL' => htmlCHR($poster_name_val), 'TITLE_MATCH_NAME' => $title_match_key, 'TITLE_MATCH_VAL' => htmlCHR($title_match_val), 'AJAX_TOPICS' => $user->opt_js['tr_t_ax'], 'SHOW_TIME_TOPICS' => $user->opt_js['tr_t_t'], 'SHOW_CURSOR' => $user->opt_js['hl_tr'], 'HIDE_CONTENTS' => $user->opt_js['h_tsp'], 'U_SEARCH_USER' => "search.php?mode=searchuser&input_name={$poster_name_key}"));
// Hidden fields
$save_through_pages = array('all_words', 'active', 'dl_cancel', 'dl_compl', 'dl_down', 'dl_will', 'my', 'new', 'seed_exist', 'show_author', 'show_cat', 'show_forum', 'show_speed', 'tor_type');
$hidden_fields = array();
foreach ($save_through_pages as $name) {
$hidden_fields['prev_' . ${"{$name}_key"}] = ${"{$name}_val"};
}
// Set colspan
$tor_colspan = $tor_colspan - $hide_cat - $hide_forum - $hide_author - $hide_speed;
$template->assign_vars(array('PAGE_TITLE' => $lang['TRACKER'], 'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields), 'CAT_FORUM_SELECT' => $cat_forum_select, 'ORDER_SELECT' => build_select($order_key, $order_select, $order_val), 'TIME_SELECT' => build_select($time_key, $time_select, $time_val), 'S_NOT_SEEN_SELECT' => build_select($s_not_seen_key, $s_not_seen_select, $s_not_seen_val), 'S_RG_SELECT' => build_select($s_rg_key, $s_release_group_select, $s_rg_val), 'TOR_SEARCH_ACTION' => $tracker_url, 'TOR_COLSPAN' => $tor_colspan, 'TITLE_MATCH_MAX' => $title_match_max_len, 'POSTER_NAME_MAX' => $poster_name_max_len, 'POSTER_ERROR' => $poster_error, 'SHOW_SEARCH_OPT' => (bool) $allowed_forums, 'SHOW_CAT' => $show_cat_val, 'SHOW_FORUM' => $show_forum_val, 'SHOW_AUTHOR' => $show_author_val, 'SHOW_SPEED' => $show_speed_val, 'MAX_FS' => $max_forums_selected, 'L_MAX_FS' => sprintf($lang['SEL_CHAPTERS_HELP'], $max_forums_selected), 'TRACKER_URL' => make_url('tracker.php?'), 'TR_CAT_URL' => "{$tracker_url}?{$cat_key}=", 'TR_FORUM_URL' => "{$tracker_url}?{$forum_key}=", 'TR_POSTER_URL' => "{$tracker_url}?{$poster_id_key}="));
print_page('tracker.tpl');
示例11: get_row_column_mappings_table
/**
*/
function get_row_column_mappings_table($s_item_type, $owner_id, $header_row, $field_column_r, $field_default_r, $field_initcap_r)
{
$buffer = "\n<table>";
$buffer .= "\n<tr class=\"navbar\"><th></th>" . "<th>" . get_opendb_lang_var('field') . "</th>" . "<th>" . get_opendb_lang_var('default') . "</th>" . "<th> " . get_opendb_lang_var('initcap') . "</th></tr>";
// If the prompt for this field, matches any of the $tokens, then select that token.
if (!is_numeric($field_column_r['s_item_type'])) {
for ($i = 0; $i < count($header_row); $i++) {
if ($header_row[$i] == 's_item_type' || $header_row[$i] == get_opendb_lang_var('s_item_type')) {
$field_column_r['s_item_type'] = $i;
break;
}
}
}
// If your data includes the item_type, then specify the column, so we
// can ignore records that are not of the chosen item_type.
$buffer .= "\n<tr>" . "<th class=\"prompt\" scope=\"row\">" . get_opendb_lang_var('s_item_type') . "</th>" . "<td class=\"data fieldColumn\">" . get_column_select_block("field_column[s_item_type]", $header_row, $field_column_r['s_item_type']) . "</td>" . "<td class=\"data defaultColumn\"> </td>" . "<td class=\"data initcapColumn\"> </td>" . "</tr>";
// --------- Now the main input fields start....
$results = fetch_item_attribute_type_rs($s_item_type);
if ($results) {
while ($item_attribute_type_r = db_fetch_assoc($results)) {
// purely readonly
if ($item_attribute_type_r['s_field_type'] !== 'ITEM_ID') {
$fieldname = get_field_name($item_attribute_type_r['s_attribute_type'], $item_attribute_type_r['order_no']);
if ($item_attribute_type_r['s_field_type'] == 'STATUSTYPE') {
$lookup_results = fetch_newitem_status_type_rs();
$default_field = build_select("field_default[{$fieldname}]", $lookup_results, $field_default_r[$fieldname], FALSE);
// do not include 'None' option
$initcap_field = NULL;
// No initcap for these types of fields.
} else {
if ($item_attribute_type_r['input_type'] !== "textarea" && $item_attribute_type_r['input_type'] !== "url") {
// Check if any lookup values for this field.
$lookup_results = fetch_attribute_type_lookup_rs($item_attribute_type_r['s_attribute_type'], 'order_no, value ASC');
if ($lookup_results) {
$default_field = build_select("field_default[{$fieldname}]", $lookup_results, $field_default_r[$fieldname]);
$initcap_field = NULL;
// No initcap for these types of fields.
} else {
//use normal input field.
if ($item_attribute_type_r['multi_attribute_ind'] == 'Y') {
$item_attribute_type_r['multi_attribute_ind'] = 'N';
}
$default_field = get_item_input_field("field_default[{$fieldname}]", $item_attribute_type_r, NULL, $field_default_r[$fieldname], FALSE);
if ($item_attribute_type_r['input_type'] === 'text') {
$initcap_field = get_input_field("field_initcap[{$fieldname}]", NULL, NULL, "checkbox(true,false,)", "N", ifempty($field_initcap_r[$fieldname], get_opendb_config_var('import', 'row_import_default_initcap_checked') ? "true" : "false"), FALSE);
} else {
//Only for text fields.
$initcap_field = NULL;
}
}
} else {
$field = NULL;
$default_field = NULL;
$initcap_field = NULL;
}
}
// If the prompt for this field, matches any of the $tokens, then select that token.
if (!is_numeric($field_column_r[$fieldname])) {
for ($i = 0; $i < count($header_row); $i++) {
// A direct export from CSV Export, so lets match the columns for you.
if ($header_row[$i] == $fieldname || $header_row[$i] == $item_attribute_type_r['prompt'] || $item_attribute_type_r['s_field_type'] == 'CATEGORY' && $header_row[$i] == 'Genre') {
$field_column_r[$fieldname] = $i;
break;
}
}
}
$buffer .= "\n<tr>" . "<th class=\"prompt\" scope=\"row\">" . $item_attribute_type_r['prompt'] . "</th>" . "<td class=\"data fieldColumn\">" . get_column_select_block("field_column[{$fieldname}]", $header_row, $field_column_r[$fieldname]) . "</td>" . "<td class=\"data defaultColumn\">" . $default_field . "</td>" . "<td class=\"data initcapColumn\">" . $initcap_field . "</td>" . "</tr>";
}
//if($item_attribute_type_r['s_field_type'] !== 'ITEM_ID')
}
//while
db_free_result($results);
}
//if($results)
$buffer .= "\n</table>";
return $buffer;
}
示例12: DB
}
$bt_userdata = DB()->fetch_row($sql);
$user_status = isset($bt_userdata['user_status']) ? $bt_userdata['user_status'] : null;
if (($min_ratio_dl || $min_ratio_warn) && $user_status != DL_STATUS_COMPLETE && $bt_user_id != $poster_id && $tor_type != TOR_TYPE_GOLD) {
if (($user_ratio = get_bt_ratio($bt_userdata)) !== null) {
$dl_allowed = $user_ratio > $min_ratio_dl;
}
if (isset($user_ratio) && isset($min_ratio_warn) && $user_ratio < $min_ratio_warn && TR_RATING_LIMITS || $bt_userdata['u_down_total'] < MIN_DL_FOR_RATIO) {
$template->assign_vars(array('SHOW_RATIO_WARN' => true, 'RATIO_WARN_MSG' => sprintf($lang['BT_RATIO_WARNING_MSG'], $min_ratio_dl, $bb_cfg['ratio_url_help'])));
}
}
if (!$dl_allowed) {
$template->assign_block_vars('postrow.attach.tor_reged', array());
$template->assign_vars(array('TOR_BLOCKED' => true, 'TOR_BLOCKED_MSG' => sprintf($lang['BT_LOW_RATIO_FOR_DL'], round($user_ratio, 2), "search.php?dlu={$bt_user_id}&dlc=1")));
} else {
$template->assign_block_vars('postrow.attach.tor_reged', array('DOWNLOAD_NAME' => $display_name, 'TRACKER_LINK' => $tracker_link, 'ATTACH_ID' => $attach_id, 'TOR_SILVER_GOLD' => $tor_type, 'TOR_FROZEN' => !IS_AM ? isset($bb_cfg['tor_frozen'][$tor_info['tor_status']]) && !(isset($bb_cfg['tor_frozen_author_download'][$tor_info['tor_status']]) && $userdata['user_id'] == $tor_info['poster_id']) ? true : '' : '', 'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor_info['tor_status']], 'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor_info['tor_status']], 'TOR_STATUS_BY' => $tor_info['checked_user_id'] && $is_auth['auth_mod'] ? '<span title="' . bb_date($tor_info['checked_time']) . '"> · ' . profile_url($tor_info) . ' · <i>' . delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] . '</i></span>' : '', 'TOR_STATUS_SELECT' => build_select('sel_status', array_flip($lang['TOR_STATUS_NAME']), TOR_APPROVED), 'TOR_STATUS_REPLY' => $bb_cfg['tor_comment'] && !IS_GUEST && in_array($tor_info['tor_status'], $bb_cfg['tor_reply']) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED, 'S_UPLOAD_IMAGE' => $upload_image, 'U_DOWNLOAD_LINK' => $download_link, 'DL_LINK_CLASS' => isset($bt_userdata['user_status']) ? $dl_link_css[$bt_userdata['user_status']] : 'genmed', 'DL_TITLE_CLASS' => isset($bt_userdata['user_status']) ? $dl_status_css[$bt_userdata['user_status']] : 'gen', 'FILESIZE' => $tor_file_size, 'MAGNET' => $tor_magnet, 'HASH' => strtoupper(bin2hex($tor_info['info_hash'])), 'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $download_count), 'REGED_TIME' => bb_date($tor_info['reg_time']), 'REGED_DELTA' => delta_time($tor_info['reg_time']), 'TORRENT_SIZE' => humn_size($tor_size), 'COMPLETED' => sprintf($lang['DOWNLOAD_NUMBER'], $tor_info['complete_count'])));
if ($comment) {
$template->assign_block_vars('postrow.attach.tor_reged.comment', array('COMMENT' => $comment));
}
}
if ($bb_cfg['show_tor_info_in_dl_list']) {
$template->assign_vars(array('SHOW_DL_LIST' => true, 'SHOW_DL_LIST_TOR_INFO' => true, 'TOR_SIZE' => humn_size($tor_size), 'TOR_LONGEVITY' => delta_time($tor_info['reg_time']), 'TOR_COMPLETED' => declension($tor_info['complete_count'], 'times')));
}
// Show peers
if ($show_peers) {
// Sorting order in full mode
if ($s_mode == 'full') {
$full_mode_order = 'tr.remain';
$full_mode_sort_dir = 'ASC';
if (isset($_REQUEST['psortasc'])) {
$full_mode_sort_dir = 'ASC';
示例13: build_select
$rss_array[$ID] = $data[$index]->title;
}
#
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add Homepage', 'TEXT_CENTER' => '', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'TD_WIDTH' => '30%', 'BUTTON_TEXT' => 'Save Home'));
$s1 = build_select($element1, 'element1');
$s2 = build_select($element2, 'element2');
$s3 = build_select($element3, 'element3');
$s4 = build_select($element4, 'element4');
$s5 = build_select($element5, 'element5');
$s6 = build_select($element6, 'element6');
$s7 = build_select($element7, 'element7');
$s8 = build_select($element8, 'element8');
$s9 = build_select($element9, 'element9');
$s10 = build_select($element10, 'element10');
$s11 = build_select($element11, 'element11');
$s12 = build_select($element12, 'element12');
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title', 'VALUE' => $title, 'SIZE' => 20, 'TEXT' => 'Title'));
$all_select = '<table cellpadding=3><tr><td><b>1. Row</b></td><td>' . $s1 . '</td><td>' . $s2 . '</td></tr>
<tr><td><strong>2. Row</strong></td><td>' . $s3 . '</td><td>' . $s4 . '</td></tr>
<tr><td><strong>3. Row</strong></td><td>' . $s5 . '</td><td>' . $s6 . '</td></tr>
<tr><td><strong>4. Row</strong></td><td>' . $s7 . '</td><td>' . $s8 . '</td></tr>
<tr><td><strong>5. Row</strong></td><td>' . $s9 . '</td><td>' . $s10 . '</td></tr>
<tr><td><strong>6. Row</strong></td><td>' . $s11 . '</td><td>' . $s12 . '</td></tr></table>';
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => $all_select));
$html_instance->process();
#
function build_select($current_value, $name)
{
global $base_instance, $rss_array;
$userid = $base_instance->get_userid();
$all = '';
示例14: build_select
$post_new_topic = $lang['POST_NEW_TOPIC'];
}
// Post URL generation for templating vars
$template->assign_vars(array('U_POST_NEW_TOPIC' => $post_new_topic_url, 'S_SELECT_TOPIC_DAYS' => build_select('topicdays', array_flip($sel_previous_days), $topic_days), 'S_POST_DAYS_ACTION' => "viewforum.php?f={$forum_id}&start={$start}", 'S_DISPLAY_ORDER' => $s_display_order));
// User authorisation levels output
$u_auth = array();
$u_auth[] = $is_auth['auth_post'] ? $lang['RULES_POST_CAN'] : $lang['RULES_POST_CANNOT'];
$u_auth[] = $is_auth['auth_reply'] ? $lang['RULES_REPLY_CAN'] : $lang['RULES_REPLY_CANNOT'];
$u_auth[] = $is_auth['auth_edit'] ? $lang['RULES_EDIT_CAN'] : $lang['RULES_EDIT_CANNOT'];
$u_auth[] = $is_auth['auth_delete'] ? $lang['RULES_DELETE_CAN'] : $lang['RULES_DELETE_CANNOT'];
$u_auth[] = $is_auth['auth_vote'] ? $lang['RULES_VOTE_CAN'] : $lang['RULES_VOTE_CANNOT'];
$u_auth[] = $is_auth['auth_attachments'] ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'];
$u_auth[] = $is_auth['auth_download'] ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'];
$u_auth[] = $is_auth['auth_mod'] ? $lang['RULES_MODERATE'] : '';
$u_auth = join("<br />\n", $u_auth);
$template->assign_vars(array('SHOW_JUMPBOX' => true, 'PAGE_TITLE' => htmlCHR($forum_data['forum_name']), 'FORUM_ID' => $forum_id, 'FORUM_NAME' => htmlCHR($forum_data['forum_name']), 'TORRENTS' => $forum_data['allow_reg_tracker'], 'POST_IMG' => $forum_data['forum_status'] == FORUM_LOCKED ? $images['post_locked'] : $post_img, 'FOLDER_IMG' => $images['folder'], 'FOLDER_NEW_IMG' => $images['folder_new'], 'FOLDER_LOCKED_IMG' => $images['folder_locked'], 'FOLDER_STICKY_IMG' => $images['folder_sticky'], 'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'], 'FOLDER_DOWNLOAD_IMG' => $images['folder_dl'], 'SHOW_ONLY_NEW_MENU' => true, 'ONLY_NEW_POSTS_ON' => $only_new == ONLY_NEW_POSTS, 'ONLY_NEW_TOPICS_ON' => $only_new == ONLY_NEW_TOPICS, 'TITLE_MATCH' => htmlCHR($title_match), 'SELECT_TPP' => $select_tpp ? build_select('tpp', $select_tpp, $topics_per_page, null, null, 'onchange="$(\'#tpp\').submit();"') : '', 'T_POST_NEW_TOPIC' => $forum_data['forum_status'] == FORUM_LOCKED ? $lang['FORUM_LOCKED'] : $post_new_topic, 'S_AUTH_LIST' => $u_auth, 'U_VIEW_FORUM' => FORUM_URL . $forum_id, 'U_MARK_READ' => FORUM_URL . $forum_id . "&mark=topics", 'U_SEARCH_SELF' => "search.php?uid={$userdata['user_id']}&f={$forum_id}"));
// Okay, lets dump out the page ...
$found_topics = 0;
foreach ($topic_rowset as $topic) {
$topic_id = $topic['topic_id'];
$moved = $topic['topic_status'] == TOPIC_MOVED;
$replies = $topic['topic_replies'];
$t_hot = $replies >= $bb_cfg['hot_threshold'];
$t_type = $topic['topic_type'];
$separator = '';
$is_unread = is_unread($topic['topic_last_post_time'], $topic_id, $forum_id);
if ($t_type == POST_ANNOUNCE && !defined('ANNOUNCE_SEP')) {
define('ANNOUNCE_SEP', true);
$separator = $lang['TOPICS_ANNOUNCEMENT'];
} elseif ($t_type == POST_STICKY && !defined('STICKY_SEP')) {
define('STICKY_SEP', true);
示例15: get_forum_select
function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '', $all_forums_option = null)
{
global $lang, $datastore;
if (is_array($mode)) {
$not_auth_forums_fary = array_flip($mode);
$mode = 'not_auth_forums';
}
if (is_null($max_length)) {
$max_length = HTML_SELECT_MAX_LENGTH;
}
$select = is_null($all_forums_option) ? array() : array($lang['ALL_AVAILABLE'] => $all_forums_option);
if (!($forums = $datastore->get('cat_forums'))) {
$datastore->update('cat_forums');
$forums = $datastore->get('cat_forums');
}
foreach ($forums['f'] as $fid => $f) {
switch ($mode) {
case 'guest':
if ($f['auth_view'] != AUTH_ALL) {
continue 2;
}
break;
case 'user':
if ($f['auth_view'] != AUTH_ALL && $f['auth_view'] != AUTH_REG) {
continue 2;
}
break;
case 'not_auth_forums':
if (isset($not_auth_forums_fary[$f['forum_id']])) {
continue 2;
}
break;
case 'admin':
break;
default:
trigger_error(__FUNCTION__ . ": invalid mode '{$mode}'", E_USER_ERROR);
}
$cat_title = $forums['c'][$f['cat_id']]['cat_title'];
$f_name = $f['forum_parent'] ? ' |- ' : '';
$f_name .= $f['forum_name'];
while (isset($select[$cat_title][$f_name])) {
$f_name .= ' ';
}
$select[$cat_title][$f_name] = $fid;
if (!$f['forum_parent']) {
$class = 'root_forum';
$class .= isset($f['subforums']) ? ' has_sf' : '';
$select['__attributes'][$cat_title][$f_name]['class'] = $class;
}
}
return build_select($name, $select, $selected, $max_length, $multiple_size, $js);
}