• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP gen_sort_selects函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: gen_topic_sort_options

 /**
  * Generate <select> markup
  */
 protected function gen_topic_sort_options($forum_data)
 {
     // Dummy variables
     $sort_days = 0;
     $limit_days = array();
     $sort_by_text = array('x' => $this->user->lang('SORTTOPICS_USER_DEFAULT'), 'a' => $this->user->lang('AUTHOR'), 't' => $this->user->lang('POST_TIME'), 'c' => $this->user->lang('SORTTOPICS_CREATED_TIME'), 'r' => $this->user->lang('REPLIES'), 's' => $this->user->lang('SUBJECT'), 'v' => $this->user->lang('VIEWS'));
     $sort_key = isset($forum_data['sort_topics_by']) ? $forum_data['sort_topics_by'] : $this->default_sort_by;
     $sort_dir = isset($forum_data['sort_topics_order']) ? $forum_data['sort_topics_order'] : $this->default_sort_order;
     $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, false, $this->default_sort_by, $this->default_sort_order);
     return array('by' => $s_sort_key, 'order' => $s_sort_dir);
 }
开发者ID:phpbb-es,项目名称:phpbb-ext-sorttopics,代码行数:15,代码来源:acp_listener.php


示例2: main


//.........这里部分代码省略.........
								AND is_orphan = 0';
                        $result = $db->sql_query($sql);
                        while ($row = $db->sql_fetchrow($result)) {
                            $deleted_filenames[] = $row['real_filename'];
                        }
                        $db->sql_freeresult($result);
                        if ($num_deleted = $this->attachment_manager->delete('attach', $delete_files)) {
                            if (sizeof($delete_files) != $num_deleted) {
                                $error[] = $user->lang['FILES_GONE'];
                            }
                            $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACHMENTS_DELETED', false, array(implode(', ', $deleted_filenames)));
                            $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames));
                        } else {
                            $error[] = $user->lang['NO_FILES_TO_DELETE'];
                        }
                    }
                }
                if ($action == 'stats') {
                    $this->handle_stats_resync();
                }
                $stats_error = $this->check_stats_accuracy();
                if ($stats_error) {
                    $error[] = $stats_error;
                }
                $template->assign_vars(array('S_MANAGE' => true));
                $start = $request->variable('start', 0);
                // Sort keys
                $sort_days = $request->variable('st', 0);
                $sort_key = $request->variable('sk', 't');
                $sort_dir = $request->variable('sd', 'd');
                // 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('f' => $user->lang['FILENAME'], 't' => $user->lang['FILEDATE'], 's' => $user->lang['FILESIZE'], 'x' => $user->lang['EXTENSION'], 'd' => $user->lang['DOWNLOADS'], 'p' => $user->lang['ATTACH_POST_TYPE'], 'u' => $user->lang['AUTHOR']);
                $sort_by_sql = array('f' => 'a.real_filename', 't' => 'a.filetime', 's' => 'a.filesize', 'x' => 'a.extension', 'd' => 'a.download_count', 'p' => 'a.in_message', 'u' => 'u.username');
                $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);
                $min_filetime = $sort_days ? time() - $sort_days * 86400 : '';
                $limit_filetime = $min_filetime ? " AND a.filetime >= {$min_filetime} " : '';
                $start = $sort_days && isset($_POST['sort']) ? 0 : $start;
                $attachments_per_page = (int) $config['topics_per_page'];
                $stats = $this->get_attachment_stats($limit_filetime);
                $num_files = $stats['num_files'];
                $total_size = $stats['upload_dir_size'];
                // Make sure $start is set to the last page if it exceeds the amount
                /* @var $pagination \phpbb\pagination */
                $pagination = $phpbb_container->get('pagination');
                $start = $pagination->validate_start($start, $attachments_per_page, $num_files);
                // If the user is trying to reach the second half of the attachments list, fetch it starting from the end
                $store_reverse = false;
                $sql_limit = $attachments_per_page;
                if ($start > $num_files / 2) {
                    $store_reverse = true;
                    // Select the sort order. Add time sort anchor for non-time sorting cases
                    $sql_sort_anchor = $sort_key != 't' ? ', a.filetime ' . ($sort_dir == 'd' ? 'ASC' : 'DESC') : '';
                    $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . ($sort_dir == 'd' ? 'ASC' : 'DESC') . $sql_sort_anchor;
                    $sql_limit = $pagination->reverse_limit($start, $sql_limit, $num_files);
                    $sql_start = $pagination->reverse_start($start, $sql_limit, $num_files);
                } else {
                    // Select the sort order. Add time sort anchor for non-time sorting cases
                    $sql_sort_anchor = $sort_key != 't' ? ', a.filetime ' . ($sort_dir == 'd' ? 'DESC' : 'ASC') : '';
                    $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . ($sort_dir == 'd' ? 'DESC' : 'ASC') . $sql_sort_anchor;
                    $sql_start = $start;
                }
                $attachments_list = array();
                // Just get the files
                $sql = 'SELECT a.*, u.username, u.user_colour, t.topic_title
					FROM ' . ATTACHMENTS_TABLE . ' a
					LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = a.poster_id)
					LEFT JOIN ' . TOPICS_TABLE . " t ON (a.topic_id = t.topic_id)\n\t\t\t\t\tWHERE a.is_orphan = 0\n\t\t\t\t\t\t{$limit_filetime}\n\t\t\t\t\tORDER BY {$sql_sort_order}";
                $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
                $i = $store_reverse ? $sql_limit - 1 : 0;
                // Store increment value in a variable to save some conditional calls
                $i_increment = $store_reverse ? -1 : 1;
                while ($attachment_row = $db->sql_fetchrow($result)) {
                    $attachments_list[$i] = $attachment_row;
                    $i = $i + $i_increment;
                }
                $db->sql_freeresult($result);
                $base_url = $this->u_action . "&amp;{$u_sort_param}";
                $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_files, $attachments_per_page, $start);
                $template->assign_vars(array('TOTAL_FILES' => $num_files, 'TOTAL_SIZE' => get_formatted_filesize($total_size), 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir));
                // Grab extensions
                $extensions = $cache->obtain_attach_extensions(true);
                for ($i = 0, $end = sizeof($attachments_list); $i < $end; ++$i) {
                    $row = $attachments_list[$i];
                    $row['extension'] = strtolower(trim((string) $row['extension']));
                    $comment = $row['attach_comment'] && !$row['in_message'] ? str_replace(array("\n", "\r"), array('<br />', "\n"), $row['attach_comment']) : '';
                    $display_cat = $extensions[$row['extension']]['display_cat'];
                    $l_downloaded_viewed = $display_cat == ATTACHMENT_CATEGORY_NONE ? 'DOWNLOAD_COUNTS' : 'VIEWED_COUNTS';
                    $template->assign_block_vars('attachments', array('ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']), 'FILESIZE' => get_formatted_filesize((int) $row['filesize']), 'FILETIME' => $user->format_date((int) $row['filetime']), 'REAL_FILENAME' => !$row['in_message'] ? utf8_basename((string) $row['real_filename']) : '', 'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']), 'EXT_GROUP_NAME' => !empty($extensions[$row['extension']]['group_name']) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '', 'COMMENT' => $comment, 'TOPIC_TITLE' => !$row['in_message'] ? (string) $row['topic_title'] : '', 'ATTACH_ID' => (int) $row['attach_id'], 'POST_ID' => (int) $row['post_msg_id'], 'TOPIC_ID' => (int) $row['topic_id'], 'POST_IDS' => !empty($post_ids[$row['attach_id']]) ? (int) $post_ids[$row['attach_id']] : '', 'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $row['download_count']), 'S_IN_MESSAGE' => (bool) $row['in_message'], 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}", 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&amp;id=' . $row['attach_id'])));
                }
                break;
        }
        if (sizeof($error)) {
            $template->assign_vars(array('S_WARNING' => true, 'WARNING_MSG' => implode('<br />', $error)));
        }
        if (sizeof($notify)) {
            $template->assign_vars(array('S_NOTIFY' => true, 'NOTIFY_MSG' => implode('<br />', $notify)));
        }
    }
开发者ID:bantu,项目名称:phpbb,代码行数:101,代码来源:acp_attachments.php


示例3: mcp_notes_user_view

/**
* Display user notes
*/
function mcp_notes_user_view($action)
{
    global $_CLASS, $_CORE_CONFIG, $config;
    $user_id = request_var('u', 0);
    $username = request_var('username', '');
    $start = request_var('start', 0);
    $st = request_var('st', 0);
    $sk = request_var('sk', 'b');
    $sd = request_var('sd', 'd');
    $url = 'forums&amp;file=mcp&amp;i=notes&mode=user_notes';
    $sql_where = $user_id ? "user_id = {$user_id}" : "username = '" . $db->sql_escape($username) . "'";
    $sql = 'SELECT *
		FROM ' . CORE_USERS_TABLE . "\n\t\tWHERE {$sql_where}";
    $result = $_CLASS['core_db']->query($sql);
    $userrow = $_CLASS['core_db']->fetch_row_assoc($result);
    $_CLASS['core_db']->free_result($result);
    if (!$userrow) {
        trigger_error('NO_USER');
    }
    $user_id = $userrow['user_id'];
    $deletemark = $action === 'del_marked';
    $deleteall = $action === 'del_all';
    $marked = get_variable('marknote', 'REQUEST', false, 'array:int');
    $usernote = request_var('usernote', '', true);
    // Handle any actions
    if (($deletemark || $deleteall) && $_CLASS['forums_auth']->acl_get('a_clearlogs')) {
        $where_sql = '';
        if ($deletemark && !empty($marked)) {
            $where_sql = ' AND log_id IN (' . implode(', ', $marked) . ')';
        }
        if ($where_sql || $deleteall) {
            $sql = 'DELETE FROM ' . FORUMS_LOG_TABLE . '
				WHERE log_type = ' . LOG_USERS . " \n\t\t\t\t\tAND reportee_id = {$user_id}\n\t\t\t\t\t{$where_sql}";
            $_CLASS['core_db']->query($sql);
            add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);
            $msg = $deletemark ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
            $redirect = generate_link($url . '&amp;u=' . $user_id);
            $_CLASS['core_display']->meta_refresh(3, $redirect);
            trigger_error($_CLASS['core_user']->lang[$msg] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
        }
    }
    if ($usernote && $action === 'add_feedback') {
        add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']);
        add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
        $redirect = generate_link($url . '&amp;u=' . $user_id);
        $_CLASS['core_display']->meta_refresh(3, $redirect);
        trigger_error($_CLASS['core_user']->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
    }
    // Generate the appropriate user information for the user we are looking at
    $rank_title = $rank_img = '';
    //get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
    $avatar_img = '';
    if (!empty($userrow['user_avatar'])) {
        switch ($userrow['user_avatar_type']) {
            case AVATAR_UPLOAD:
                $avatar_img = $_CORE_CONFIG['global']['path_avatar_upload'] . '/';
                break;
            case AVATAR_GALLERY:
                $avatar_img = $_CORE_CONFIG['global']['path_avatar_gallery'] . '/';
                break;
        }
        $avatar_img .= $userrow['user_avatar'];
        $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
    }
    $limit_days = array(0 => $_CLASS['core_user']->lang['ALL_ENTRIES'], 1 => $_CLASS['core_user']->lang['1_DAY'], 7 => $_CLASS['core_user']->lang['7_DAYS'], 14 => $_CLASS['core_user']->lang['2_WEEKS'], 30 => $_CLASS['core_user']->lang['1_MONTH'], 90 => $_CLASS['core_user']->lang['3_MONTHS'], 180 => $_CLASS['core_user']->lang['6_MONTHS'], 365 => $_CLASS['core_user']->lang['1_YEAR']);
    $sort_by_text = array('a' => $_CLASS['core_user']->lang['SORT_USERNAME'], 'b' => $_CLASS['core_user']->lang['SORT_DATE'], 'c' => $_CLASS['core_user']->lang['SORT_IP'], 'd' => $_CLASS['core_user']->lang['SORT_ACTION']);
    $sort_by_sql = array('a' => 'l.username', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
    $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
    gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
    // Define where and sort sql for use in displaying logs
    $sql_where = $st ? $_CLASS['core_user']->time - $st * 86400 : 0;
    $sql_sort = $sort_by_sql[$sk] . ' ' . ($sd == 'd' ? 'DESC' : 'ASC');
    $log_data = array();
    $log_count = 0;
    view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
    $_CLASS['core_template']->assign('S_USER_NOTES', false);
    if ($log_count) {
        $_CLASS['core_template']->assign('S_USER_NOTES', true);
        foreach ($log_data as $row) {
            $_CLASS['core_template']->assign_vars_array('usernotes', array('REPORT_BY' => $row['username'], 'REPORT_AT' => $_CLASS['core_user']->format_date($row['time']), 'ACTION' => $row['action'], 'IP' => $row['ip'], 'ID' => $row['id']));
        }
    }
    $pagination = generate_pagination($url . "&amp;u={$user_id}&amp;st={$st}&amp;sk={$sk}&amp;sd={$sd}", $log_count, $config['posts_per_page'], $start);
    $_CLASS['core_template']->assign_array(array('U_POST_ACTION' => generate_link($url . '&amp;u=' . $user_id), 'S_CLEAR_ALLOWED' => $_CLASS['forums_auth']->acl_get('a_clearlogs'), 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'L_TITLE' => $_CLASS['core_user']->get_lang('MCP_NOTES_USER'), 'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start), 'PAGINATION' => $pagination['formated'], 'PAGINATION_ARRAY' => $pagination['array'], 'TOTAL_REPORTS' => $log_count == 1 ? $_CLASS['core_user']->get_lang('LIST_REPORT') : sprintf($_CLASS['core_user']->get_lang('LIST_REPORTS'), $log_count), 'USERNAME' => $userrow['username'], 'USER_COLOR' => !empty($userrow['user_colour']) ? $userrow['user_colour'] : '', 'RANK_TITLE' => $rank_title, 'JOINED' => $_CLASS['core_user']->format_date($userrow['user_reg_date']), 'POSTS' => $userrow['user_posts'] ? $userrow['user_posts'] : 0, 'WARNINGS' => @$userrow['user_warnings'] ? $userrow['user_warnings'] : 0, 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img));
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:88,代码来源:mcp_notes.php


示例4: array

    }
}
// Forum rules and subscription info
$s_watching_forum = array('link' => '', 'link_toggle' => '', 'title' => '', 'title_toggle' => '', 'is_watching' => false);
if ($config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS)) {
    $notify_status = isset($forum_data['notify_status']) ? $forum_data['notify_status'] : NULL;
    watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0, $notify_status, $start, $forum_data['forum_name']);
}
$s_forum_rules = '';
gen_forum_auth_level('forum', $forum_id, $forum_data['forum_status']);
// Topic ordering options
$limit_days = array(0 => $user->lang['ALL_TOPICS'], 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('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
$sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => $auth->acl_get('m_approve', $forum_id) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved', 's' => 'LOWER(t.topic_title)', 'v' => 't.topic_views');
$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, $default_sort_days, $default_sort_key, $default_sort_dir);
// Limit topics to certain time frame, obtain correct topic count
if ($sort_days) {
    $min_post_time = time() - $sort_days * 86400;
    $sql = 'SELECT COUNT(topic_id) AS num_topics
		FROM ' . TOPICS_TABLE . "\n\t\tWHERE forum_id = {$forum_id}\n\t\t\tAND (topic_last_post_time >= {$min_post_time}\n\t\t\t\tOR topic_type = " . POST_ANNOUNCE . '
				OR topic_type = ' . POST_GLOBAL . ')
			AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id);
    $result = $db->sql_query($sql);
    $topics_count = (int) $db->sql_fetchfield('num_topics');
    $db->sql_freeresult($result);
    if (isset($_POST['sort'])) {
        $start = 0;
    }
    $sql_limit_time = "AND t.topic_last_post_time >= {$min_post_time}";
    // Make sure we have information about day selection ready
开发者ID:ZerGabriel,项目名称:phpbb,代码行数:31,代码来源:viewforum.php


示例5: main


//.........这里部分代码省略.........
                $message = request_var('message', '', true);
                // Sort keys
                $sort_days = request_var('st', 0);
                $sort_key = request_var('sk', 't');
                $sort_dir = request_var('sd', 'd');
                // Delete entries if requested and able
                if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) {
                    $where_sql = '';
                    if ($deletemark && $marked) {
                        $sql_in = array();
                        foreach ($marked as $mark) {
                            $sql_in[] = $mark;
                        }
                        $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
                        unset($sql_in);
                    }
                    if ($where_sql || $deleteall) {
                        $sql = 'DELETE FROM ' . LOG_TABLE . '
							WHERE log_type = ' . LOG_USERS . "\n\t\t\t\t\t\t\t{$where_sql}";
                        $db->sql_query($sql);
                        add_log('admin', 'LOG_CLEAR_USER', $user_row['username']);
                    }
                }
                if ($submit && $message) {
                    add_log('admin', 'LOG_USER_FEEDBACK', $user_row['username']);
                    add_log('user', $user_id, 'LOG_USER_GENERAL', $message);
                    trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
                }
                // 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('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
                $sort_by_sql = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
                $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');
                // Grab log data
                $log_data = array();
                $log_count = 0;
                view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
                $template->assign_vars(array('S_FEEDBACK' => true, 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start), 'PAGINATION' => generate_pagination($this->u_action . "&amp;u={$user_id}&amp;{$u_sort_param}", $log_count, $config['topics_per_page'], $start, true), 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs')));
                foreach ($log_data as $row) {
                    $template->assign_block_vars('log', array('USERNAME' => $row['username'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => nl2br($row['action']), 'ID' => $row['id']));
                }
                break;
            case 'profile':
                $cp = new custom_profile();
                $cp_data = $cp_error = array();
                $data = array();
                $sql = 'SELECT lang_id
					FROM ' . LANG_TABLE . "\n\t\t\t\t\tWHERE lang_iso = '" . $db->sql_escape($user_row['user_lang']) . "'";
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
                $user_row['iso_lang_id'] = $row['lang_id'];
                if ($submit) {
                    $var_ary = array('icq' => (string) '', 'aim' => (string) '', 'msn' => (string) '', 'yim' => (string) '', 'jabber' => (string) '', 'website' => (string) '', 'location' => (string) '', 'occupation' => (string) '', 'interests' => (string) '', 'bday_day' => 0, 'bday_month' => 0, 'bday_year' => 0);
                    foreach ($var_ary as $var => $default) {
                        $data[$var] = in_array($var, array('location', 'occupation', 'interests')) ? request_var($var, $default, true) : ($data[$var] = request_var($var, $default));
                    }
                    $var_ary = array('icq' => array(array('string', true, 3, 15), array('match', true, '#^[0-9]+$#i')), 'aim' => array('string', true, 3, 17), 'msn' => array('string', true, 5, 255), 'jabber' => array(array('string', true, 5, 255), array('match', true, '#^[a-z0-9\\.\\-_\\+]+?@(.*?\\.)*?[a-z0-9\\-_]+?\\.[a-z]{2,4}(/.*)?$#i')), 'yim' => array('string', true, 5, 255), 'website' => array(array('string', true, 12, 255), array('match', true, '#^http[s]?://(.*?\\.)*?[a-z0-9\\-]+\\.[a-z]{2,4}#i')), 'location' => array('string', true, 2, 255), 'occupation' => array('string', true, 2, 500), 'interests' => array('string', true, 2, 500), 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())));
                    $error = validate_data($data, $var_ary);
                    // validate custom profile fields
                    $cp->submit_cp_field('profile', $user_row['iso_lang_id'], $cp_data, $cp_error);
                    if (sizeof($cp_error)) {
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:acp_users.php


示例6: mcp_warn_list_view

	/**
	* Lists all users with warnings
	*/
	function mcp_warn_list_view($action)
	{
		global $phpEx, $phpbb_root_path, $config;
		global $template, $db, $user, $auth;

		$user->add_lang('memberlist');

		$start	= request_var('start', 0);
		$st		= request_var('st', 0);
		$sk		= request_var('sk', 'b');
		$sd		= request_var('sd', 'd');

		$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('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']);
		$sort_by_sql = array('a' => 'username_clean', 'b' => 'user_last_warning', 'c' => 'user_warnings');

		$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
		gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);

		// Define where and sort sql for use in displaying logs
		$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
		$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');

		$users = array();
		$user_count = 0;

		view_warned_users($users, $user_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);

		foreach ($users as $row)
		{
			$template->assign_block_vars('user', array(
				'U_NOTES'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),

				'USERNAME_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
				'USERNAME'			=> $row['username'],
				'USERNAME_COLOUR'	=> ($row['user_colour']) ? '#' . $row['user_colour'] : '',
				'U_USER'			=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
			
				'WARNING_TIME'	=> $user->format_date($row['user_last_warning']),
				'WARNINGS'		=> $row['user_warnings'],
			));
		}

		$template->assign_vars(array(
			'U_POST_ACTION'			=> $this->u_action,
			'S_CLEAR_ALLOWED'		=> ($auth->acl_get('a_clearlogs')) ? true : false,
			'S_SELECT_SORT_DIR'		=> $s_sort_dir,
			'S_SELECT_SORT_KEY'		=> $s_sort_key,
			'S_SELECT_SORT_DAYS'	=> $s_limit_days,

			'PAGE_NUMBER'		=> on_page($user_count, $config['topics_per_page'], $start),
			'PAGINATION'		=> generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
			'TOTAL_USERS'		=> ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
		));
	}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:58,代码来源:mcp_warn.php


示例7: main

    function main($id, $mode)
    {
        global $auth, $db, $user, $template;
        global $config, $phpbb_root_path, $phpEx;
        $user->add_lang('acp/common');
        //-- mod start : Garage ----------------------------------------------------------------------------------------------------
        //-- add
        $user->add_lang('acp/garage');
        //-- mod finish : Garage ---------------------------------------------------------------------------------------------------
        $action = request_var('action', array('' => ''));
        if (is_array($action)) {
            list($action, ) = each($action);
        } else {
            $action = request_var('action', '');
        }
        // Set up general vars
        $start = request_var('start', 0);
        $deletemark = $action == 'del_marked' ? true : false;
        $deleteall = $action == 'del_all' ? true : false;
        $marked = request_var('mark', array(0));
        // Sort keys
        $sort_days = request_var('st', 0);
        $sort_key = request_var('sk', 't');
        $sort_dir = request_var('sd', 'd');
        $this->tpl_name = 'mcp_logs';
        $this->page_title = 'MCP_LOGS';
        $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_')));
        $forum_list[] = 0;
        $forum_id = $topic_id = 0;
        switch ($mode) {
            case 'front':
                break;
            case 'forum_logs':
                $forum_id = request_var('f', 0);
                if (!in_array($forum_id, $forum_list)) {
                    trigger_error('NOT_AUTHORISED');
                }
                $forum_list = array($forum_id);
                break;
            case 'topic_logs':
                $topic_id = request_var('t', 0);
                $sql = 'SELECT forum_id
					FROM ' . TOPICS_TABLE . '
					WHERE topic_id = ' . $topic_id;
                $result = $db->sql_query($sql);
                $forum_id = (int) $db->sql_fetchfield('forum_id');
                $db->sql_freeresult($result);
                if (!in_array($forum_id, $forum_list)) {
                    trigger_error('NOT_AUTHORISED');
                }
                $forum_list = array($forum_id);
                break;
        }
        // Delete entries if requested and able
        if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) {
            if (confirm_box(true)) {
                if ($deletemark && sizeof($marked)) {
                    $sql = 'DELETE FROM ' . LOG_TABLE . '
						WHERE log_type = ' . LOG_MOD . '
							AND ' . $db->sql_in_set('forum_id', $forum_list) . '
							AND ' . $db->sql_in_set('log_id', $marked);
                    $db->sql_query($sql);
                    add_log('admin', 'LOG_CLEAR_MOD');
                } else {
                    if ($deleteall) {
                        $sql = 'DELETE FROM ' . LOG_TABLE . '
						WHERE log_type = ' . LOG_MOD . '
							AND ' . $db->sql_in_set('forum_id', $forum_list);
                        if ($mode == 'topic_logs') {
                            $sql .= ' AND topic_id = ' . $topic_id;
                        }
                        $db->sql_query($sql);
                        add_log('admin', 'LOG_CLEAR_MOD');
                    }
                }
            } else {
                confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array('f' => $forum_id, 't' => $topic_id, 'start' => $start, 'delmarked' => $deletemark, 'delall' => $deleteall, 'mark' => $marked, 'st' => $sort_days, 'sk' => $sort_key, 'sd' => $sort_dir, 'i' => $id, 'mode' => $mode, 'action' => request_var('action', array('' => '')))));
            }
        }
        // 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('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
        $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
        $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');
        // Grab log data
        $log_data = array();
        $log_count = 0;
        view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort);
        $template->assign_vars(array('PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start), 'TOTAL' => $log_count == 1 ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count), 'PAGINATION' => generate_pagination($this->u_action . "&amp;{$u_sort_param}", $log_count, $config['topics_per_page'], $start), 'L_TITLE' => $user->lang['MCP_LOGS'], 'U_POST_ACTION' => $this->u_action, 'S_CLEAR_ALLOWED' => $auth->acl_get('a_clearlogs') ? true : false, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_LOGS' => $log_count > 0));
        foreach ($log_data as $row) {
            $data = array();
            $checks = array('viewtopic', 'viewforum');
            foreach ($checks as $check) {
                if (isset($row[$check]) && $row[$check]) {
                    $data[] = '<a href="' . $row[$check] . '">' . $user->lang['LOGVIEW_' . strtoupper($check)] . '</a>';
                }
//.........这里部分代码省略.........
开发者ID:Phatboy82,项目名称:phpbbgarage,代码行数:101,代码来源:mcp_logs.php


示例8: base

    /**
     * Index Controller
     *	Route: gallery/search
     *
     * @return Symfony\Component\HttpFoundation\Response A Symfony Response object
     */
    public function base()
    {
        $search_id = $this->request->variable('search_id', '');
        $image_id = $this->request->variable('image_id', 0);
        $submit = $this->request->variable('submit', false);
        $keywords = utf8_normalize_nfc($this->request->variable('keywords', '', true));
        $add_keywords = utf8_normalize_nfc($this->request->variable('add_keywords', '', true));
        $username = $this->request->variable('username', '', true);
        $user_id = $this->request->variable('user_id', array(0));
        $search_terms = $this->request->variable('terms', 'all');
        $search_album = $this->request->variable('aid', array(0));
        $search_child = $this->request->variable('sc', true);
        $search_fields = $this->request->variable('sf', 'all');
        $sort_days = $this->request->variable('st', 0);
        $sort_key = $this->request->variable('sk', 't');
        $sort_dir = $this->request->variable('sd', 'd');
        $start = $this->request->variable('start', 0);
        $this->user->add_lang_ext('phpbbgallery/core', array('gallery'));
        $this->user->add_lang('search');
        /**
         * Build the sort options
         */
        $limit_days = array(0 => $this->user->lang['ALL_IMAGES'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']);
        $sort_by_text = array('t' => $this->user->lang['TIME'], 'n' => $this->user->lang['IMAGE_NAME'], 'u' => $this->user->lang['SORT_USERNAME'], 'vc' => $this->user->lang['GALLERY_VIEWS']);
        $sort_by_sql = array('t' => 'image_time', 'n' => 'image_name_clean', 'u' => 'image_username_clean', 'vc' => 'image_view_count');
        if ($this->gallery_config->get('allow_rates')) {
            $sort_by_text['ra'] = $this->user->lang['RATING'];
            $sort_by_sql['ra'] = 'image_rate_points';
            //@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg';
            $sort_by_text['r'] = $this->user->lang['RATES_COUNT'];
            $sort_by_sql['r'] = 'image_rates';
        }
        if ($this->gallery_config->get('allow_comments')) {
            $sort_by_text['c'] = $this->user->lang['COMMENTS'];
            $sort_by_sql['c'] = 'image_comments';
            $sort_by_text['lc'] = $this->user->lang['NEW_COMMENT'];
            $sort_by_sql['lc'] = 'image_last_comment';
        }
        $this->gallery_auth->load_user_premissions($this->user->data['user_id']);
        $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);
        $sql_order = $sort_by_sql[$sort_key] . ' ' . ($sort_dir == 'd' ? 'DESC' : 'ASC');
        // We will build SQL array and then build query (easely change count with rq)
        $sql_array = $sql_where = array();
        $sql_array['FROM'] = array($this->images_table => 'i');
        $sql_array['ORDER_BY'] = $sql_order;
        $sql_array['GROUP_BY'] = $sort_by_sql[$sort_key];
        if ($keywords || $username || $user_id || $search_id || $submit) {
            // Let's resolve username to user id ... or array of them.
            if ($username) {
                if (strpos($username, '*') !== false && utf8_strlen(str_replace(array('*', '%'), '', $username)) < $this->config['min_search_author_chars']) {
                    trigger_error(sprintf($this->user->lang['TOO_FEW_AUTHOR_CHARS'], $this->config['min_search_author_chars']));
                }
                $username_parsed = strpos($username, '*') !== false ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) . '\'';
                $sql = 'SELECT user_id
					FROM ' . USERS_TABLE . '
					WHERE ' . $username_parsed . '
					AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
                $result = $this->db->sql_query_limit($sql, 100);
                while ($row = $this->db->sql_fetchrow($result)) {
                    $user_id_ary[] = (int) $row['user_id'];
                }
                $this->db->sql_freeresult($result);
                $user_id_ary[] = (int) ANONYMOUS;
                $user_id = $user_id_ary;
            }
            if (!empty($user_id)) {
                $sql_where[] = $this->db->sql_in_set('i.image_user_id', $user_id);
            }
            // if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode
            // so we can keep the old keywords in their old mode, but add the new ones as required words
            if ($add_keywords) {
                if ($search_terms == 'all') {
                    $keywords .= ' ' . $add_keywords;
                } else {
                    $search_terms = 'all';
                    $keywords = preg_replace('#\\s+#u', ' |', $keywords) . ' ' . $add_keywords;
                }
            }
            $keywords_ary = $keywords ? explode(' ', $keywords) : array();
            // pre-made searches
            $sql = $field = $l_search_title = $search_results = '';
            $total_match_count = 0;
            $sql_limit = 0;
            $search_query = '';
            $matches = array('i.image_name', 'i.image_desc');
            if (!sizeof($keywords_ary) && !sizeof($user_id_ary)) {
                trigger_error('NO_SEARCH_RESULTS');
            }
            $matches = array('i.image_name', 'i.image_desc');
            foreach ($keywords_ary as $word) {
                $match_search_query = '';
                foreach ($matches as $match) {
                    $match_search_query .= ($match_search_query ? ' OR ' : '') . 'LOWER(' . $match . ') ';
//.........这里部分代码省略.........
开发者ID:K07H,项目名称:phpbbgallery,代码行数:101,代码来源:search.php


示例9: mcp_warn_list_view

 /**
  * Lists all users with warnings
  */
 function mcp_warn_list_view($action)
 {
     global $phpEx, $phpbb_root_path, $config, $phpbb_container;
     global $template, $db, $user, $auth, $request;
     $user->add_lang('memberlist');
     $pagination = $phpbb_container->get('pagination');
     $start = $request->variable('start', 0);
     $st = $request->variable('st', 0);
     $sk = $request->variable('sk', 'b');
     $sd = $request->variable('sd', 'd');
     $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('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']);
     $sort_by_sql = array('a' => 'username_clean', 'b' => 'warning_time', 'c' => 'user_warnings');
     $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
     gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
     // Define where and sort sql for use in displaying logs
     $sql_where = $st ? time() - $st * 86400 : 0;
     $sql_sort = $sort_by_sql[$sk] . ' ' . ($sd == 'd' ? 'DESC' : 'ASC');
     $users = array();
     $user_count = 0;
     $this->view_warnings_list($users, $user_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
     foreach ($users as $row) {
         $template->assign_block_vars('user', array('U_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => $row['username'], 'USERNAME_COLOUR' => $row['user_colour'] ? '#' . $row['user_colour'] : '', 'U_USER' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $row['user_id']), 'WARNING_TIME' => $row['warning_end'] ? $user->format_date($row['warning_end']) : $user->lang['PERMANENT'], 'WARNINGS' => $user->format_date($row['warning_time']), 'WARNING_STATUS' => $row['warning_status'] ? true : false, 'WARNING_TYPE' => $row['warning_type'] == BAN ? $user->lang['BAN'] : $user->lang['WARNING'], 'U_WARNING_POST_URL' => $row['post_id'] ? append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'p=' . $row['post_id'] . '#p' . $row['post_id']) : '', 'U_EDIT' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=\\rxu\\AdvancedWarnings\\mcp\\warnings_module&amp;mode=' . ($row['post_id'] ? 'warn_post&amp;p=' . $row['post_id'] : 'warn_user') . '&amp;u=' . $row['user_id'] . '&amp;warn_id=' . $row['warning_id']) : ''));
     }
     $base_url = append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i=\rxu\\AdvancedWarnings\\mcp\\warnings_module&amp;mode=list&amp;st={$st}&amp;sk={$sk}&amp;sd={$sd}");
     if ($user_count) {
         $pagination->generate_template_pagination($base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start);
     }
     $template->assign_vars(array('U_POST_ACTION' => $this->u_action, 'S_CLEAR_ALLOWED' => $auth->acl_get('a_clearlogs') ? true : false, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'PAGE_NUMBER' => $user_count ? $pagination->on_page($user_count, $config['topics_per_page'], $start) : '', 'TOTAL_WARNINGS' => $user->lang('LIST_WARNINGS', (int) $user_count)));
 }
开发者ID:Galixte,项目名称:advanced_warnings,代码行数:33,代码来源:warnings_module.php


示例10: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache;
     global $config, $phpbb_root_path, $phpEx;
     $user->add_lang(array('acp/board', 'mods/asacp', 'mods/acp_asacp', 'install', 'acp/common'));
     include $phpbb_root_path . 'antispam/acp_functions.' . $phpEx;
     $error = $notify = array();
     $submit = isset($_POST['submit']) ? true : false;
     $action = request_var('action', '');
     add_form_key('as_acp');
     if ($submit && !check_form_key('as_acp')) {
         trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
     }
     $error = $options = array();
     switch ($mode) {
         case 'ip_search':
             $this->tpl_name = 'antispam/mcp_asacp';
             $this->page_title = 'ASACP_IP_SEARCH';
             $ip = request_var('ip', '');
             $type = request_var('type', '');
             if ($ip) {
                 asacp_display_ip_search($type, $ip, $this->u_action . '&amp;ip=' . $ip, request_var('start', 0));
             }
             $template->assign_vars(array('L_TITLE' => $user->lang['ASACP_IP_SEARCH'], 'L_TITLE_EXPLAIN' => $user->lang['ASACP_IP_SEARCH_EXPLAIN'], 'S_DATA_OUTPUT' => true, 'S_DISPLAY_IP_INPUT' => $ip ? false : true, 'U_BACK' => $type ? $this->u_action . '&amp;ip=' . $ip : false, 'U_BACK_NONE' => $this->u_action));
             break;
             // case 'ip_search' :
         // case 'ip_search' :
         case 'log':
         case 'flag':
             $this->tpl_name = 'mcp_logs';
             if ($mode == 'log') {
                 $this->page_title = $user->lang['ASACP_SPAM_LOG'];
             } else {
                 $this->page_title = $user->lang['ASACP_FLAG_LOG'];
                 // Reset the user flag new notification
                 if ($user->data['user_flag_new']) {
                     $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_flag_new = 0 WHERE user_id = ' . $user->data['user_id']);
                 }
             }
             $user->add_lang('mcp');
             // Set up general vars
             $start = request_var('start', 0);
             $action = request_var('action', array('' => ''));
             if (is_array($action)) {
                 list($action, ) = each($action);
             } else {
                 $action = request_var('action', '');
             }
             $deletemark = !empty($_POST['delmarked']) || $action == 'del_marked' ? true : false;
             $deleteall = !empty($_POST['delall']) || $action == 'del_all' ? true : false;
             $marked = request_var('mark', array(0));
             // Sort keys
             $sort_days = request_var('st', 0);
             $sort_key = request_var('sk', 't');
             $sort_dir = request_var('sd', 'd');
             $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
             $keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
             // Delete entries if requested and able
             if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) {
                 if (confirm_box(true)) {
                     clear_spam_log($mode, $deletemark ? false : $deleteall, $marked, $keywords);
                 } else {
                     confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array('start' => $start, 'delmarked' => $deletemark, 'delall' => $deleteall, 'mark' => $marked, 'st' => $sort_days, 'sk' => $sort_key, 'sd' => $sort_dir, 'keywords' => $keywords, 'i' => $id, 'mode' => $mode, 'action' => $this->u_action)));
                 }
             }
             // 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('t' => $user->lang['SORT_DATE'], 'u' => $user->lang['SORT_USERNAME'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
             $sort_by_sql = array('t' => 'l.log_time', 'u' => 'u.username_clean', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
             $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_days = $sort_d 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP gen_spiffycal_db_date_short函数代码示例发布时间:2022-05-15
下一篇:
PHP gen_reseller_menu函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap