当前位置: 首页>>代码示例>>PHP>>正文


PHP view_log函数代码示例

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


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

示例1: route

function route()
{
    switch (TRUE) {
        case isset($_GET['log_file']):
            view_log($_GET['log_file']);
            break;
        default:
            menu();
    }
}
开发者ID:eaglstun,项目名称:dbug,代码行数:10,代码来源:admin.php

示例2: test_view_log_function

 /**
  * @dataProvider view_log_function_data
  */
 public function test_view_log_function($expected, $expected_returned, $mode, $log_count, $limit = 5, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_id ASC', $keywords = '')
 {
     global $cache, $db, $user, $auth, $phpbb_log, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
     $db = $this->new_dbal();
     $cache = new phpbb_mock_cache();
     $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
     // Create auth mock
     $auth = $this->getMock('\\phpbb\\auth\\auth');
     $acl_get_map = array(array('f_read', 23, true), array('m_', 23, true));
     $acl_gets_map = array(array('a_', 'm_', 23, true));
     $auth->expects($this->any())->method('acl_get')->with($this->stringContains('_'), $this->anything())->will($this->returnValueMap($acl_get_map));
     $auth->expects($this->any())->method('acl_gets')->with($this->stringContains('_'), $this->anything())->will($this->returnValueMap($acl_gets_map));
     $user = new phpbb_mock_user();
     $user->optionset('viewcensors', false);
     // Test sprintf() of the data into the action
     $user->lang = array('LOG_INSTALL_INSTALLED' => 'installed: %s', 'LOG_USER' => 'User<br /> %s', 'LOG_MOD2' => 'Mod2', 'LOG_MOD3' => 'Mod3: %1$s, %2$s', 'LOG_SINGULAR_PLURAL' => array(1 => 'singular', 2 => 'plural (%d)'));
     $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
     $log = array();
     $this->assertEquals($expected_returned, view_log($mode, $log, $log_count, $limit, $offset, $forum_id, $topic_id, $user_id, $limit_days, $sort_by, $keywords));
     $this->assertEquals($expected, $log);
 }
开发者ID:MrAdder,项目名称:phpbb,代码行数:24,代码来源:function_view_log_test.php

示例3: main


//.........这里部分代码省略.........
						add_log('admin', 'LOG_CLEAR_USER', $user_row['username']);
					}
				}

				if ($submit && $message)
				{
					if (!check_form_key($form_name))
					{
						trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
					}

					add_log('admin', 'LOG_USER_FEEDBACK', $user_row['username']);
					add_log('mod', 0, 0, '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' => '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('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_full'],
						'IP'			=> $row['ip'],
						'DATE'			=> $user->format_date($row['time']),
						'ACTION'		=> nl2br($row['action']),
						'ID'			=> $row['id'])
					);
				}

			break;

			case 'profile':

				include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
				include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);

				$cp = new custom_profile();
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:66,代码来源:acp_users.php

示例4: _

    echo '<input type="checkbox" name="warn" value="1" checked="checked" /> ' . _('Show alerts') . ' ';
} else {
    echo '<input type="checkbox" name="warn" value="1" /> ' . _('Show alerts') . ' ';
}
if ($info) {
    echo '<input type="checkbox" name="info" value="1" checked="checked" /> ' . _('Show information') . ' ';
} else {
    echo '<input type="checkbox" name="info" value="1" /> ' . _('Show informations') . ' ';
}
echo '<input type="submit" value="reload" /> ';
echo '</form></td><td>';
echo '<form name="mod_ha_logs" action="logs.php" method="post">';
echo '<input type="hidden" name="action" value="cleanup_logs" />';
echo '<input type="submit" value="' . _('Cleanup logs') . '" />';
echo '</form></td></tr></table>';
echo '<div><span class="mod_ha_log_gravity mod_ha_host"> ' . sprintf(_('%s logs'), count($res)) . '</span></div><br />';
if (count($res)) {
    foreach ($res as $line) {
        $tmp = explode(' ', $line);
        $log = array();
        for ($i = 0; $i < 6; $i++) {
            $log[$i] = $tmp[0];
            array_shift($tmp);
        }
        $log[6] = implode(" ", $tmp);
        unset($tmp);
        view_log($log);
    }
}
echo '</div>';
page_footer();
开发者ID:skdong,项目名称:nfs-ovd,代码行数:31,代码来源:logs.php

示例5: 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

示例6: main


//.........这里部分代码省略.........
                    $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)) {
                        $error = array_merge($error, $cp_error);
                    }
                    if (!sizeof($error)) {
                        $sql_ary = array('user_icq' => $data['icq'], 'user_aim' => $data['aim'], 'user_msnm' => $data['msn'], 'user_yim' => $data['yim'], 'user_jabber' => $data['jabber'], 'user_website' => $data['website'], 'user_from' => $data['location'], 'user_occ' => $data['occupation'], 'user_interests' => $data['interests'], 'user_birthday' => sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']));
                        $sql = 'UPDATE ' . USERS_TABLE . '
							SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "\n\t\t\t\t\t\t\tWHERE user_id = {$user_id}";
                        $db->sql_query($sql);
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:acp_users.php

示例7: 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&amp;mode=overview&amp;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';
    }
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:acp_main.php

示例8: mcp_post_details


//.........这里部分代码省略.........
        $bbcode = new bbcode($post_info['bbcode_bitfield']);
        $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
    }
    $message = bbcode_nl2br($message);
    $message = smiley_text($message);
    if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) {
        $extensions = $cache->obtain_attach_extensions($post_info['forum_id']);
        $sql = 'SELECT *
			FROM ' . ATTACHMENTS_TABLE . '
			WHERE post_msg_id = ' . $post_id . '
				AND in_message = 0
			ORDER BY filetime DESC, post_msg_id ASC';
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $attachments[] = $row;
        }
        $db->sql_freeresult($result);
        if (sizeof($attachments)) {
            $update_count = array();
            parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);
        }
        // Display not already displayed Attachments for this post, we already parsed them. ;)
        if (!empty($attachments)) {
            $template->assign_var('S_HAS_ATTACHMENTS', true);
            foreach ($attachments as $attachment) {
                $template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment));
            }
        }
    }
    $template->assign_vars(array('U_MCP_ACTION' => "{$url}&amp;i=main&amp;quickmod=1&amp;mode=post_details", 'U_POST_ACTION' => "{$url}&amp;i={$id}&amp;mode=post_details", 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i=queue&amp;p={$post_id}&amp;f={$post_info['forum_id']}"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']), 'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']), 'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'] ? true : false, 'S_POST_UNAPPROVED' => !$post_info['post_approved'] ? true : false, 'S_POST_LOCKED' => $post_info['post_edit_locked'] ? true : false, 'S_USER_NOTES' => true, 'S_CLEAR_ALLOWED' => $auth->acl_get('a_clearlogs') ? true : false, 'U_EDIT' => $auth->acl_get('m_edit', $post_info['forum_id']) ? append_sid("{$phpbb_root_path}posting.{$phpEx}", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '', 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username&amp;select_single=true'), 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']), 'U_MCP_WARN_USER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']), 'MINI_POST_IMG' => $post_unread ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$post_info['forum_id']}&amp;p={$post_id}") . "#p{$post_id}\">", '</a>'), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.{$phpEx}", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => $auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '') ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], 'U_LOOKUP_IP' => $auth->acl_get('m_info', $post_info['forum_id']) ? "{$url}&amp;i={$id}&amp;mode={$mode}&amp;lookup={$post_info['poster_ip']}#ip" : '', 'U_WHOIS' => $auth->acl_get('m_info', $post_info['forum_id']) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i={$id}&amp;mode={$mode}&amp;action=whois&amp;p={$post_id}&amp;ip={$post_info['poster_ip']}") : ''));
    // Get User Notes
    $log_data = array();
    $log_count = false;
    view_log('user', $log_data, $log_count, $config['posts_per_page'], 0, 0, 0, $post_info['user_id']);
    if (!empty($log_data)) {
        $template->assign_var('S_USER_NOTES', true);
        foreach ($log_data as $row) {
            $template->assign_block_vars('usernotes', array('REPORT_BY' => $row['username_full'], 'REPORT_AT' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'ID' => $row['id']));
        }
    }
    // Get Reports
    if ($auth->acl_get('m_report', $post_info['forum_id'])) {
        $sql = 'SELECT r.*, re.*, u.user_id, u.username
			FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REPORTS_REASONS_TABLE . " re\n\t\t\tWHERE r.post_id = {$post_id}\n\t\t\t\tAND r.reason_id = re.reason_id\n\t\t\t\tAND u.user_id = r.user_id\n\t\t\tORDER BY r.report_time DESC";
        $result = $db->sql_query($sql);
        if ($row = $db->sql_fetchrow($result)) {
            $template->assign_var('S_SHOW_REPORTS', true);
            do {
                // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
                if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) {
                    $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
                    $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
                }
                $template->assign_block_vars('reports', array('REPORT_ID' => $row['report_id'], 'REASON_TITLE' => $row['reason_title'], 'REASON_DESC' => $row['reason_description'], 'REPORTER' => $row['user_id'] != ANONYMOUS ? $row['username'] : $user->lang['GUEST'], 'U_REPORTER' => $row['user_id'] != ANONYMOUS ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $row['user_id']) : '', 'USER_NOTIFY' => $row['user_notify'] ? true : false, 'REPORT_TIME' => $user->format_date($row['report_time']), 'REPORT_TEXT' => bbcode_nl2br(trim($row['report_text']))));
            } while ($row = $db->sql_fetchrow($result));
        }
        $db->sql_freeresult($result);
    }
    // Get IP
    if ($auth->acl_get('m_info', $post_info['forum_id'])) {
        $rdns_ip_num = request_var('rdns', '');
        if ($rdns_ip_num != 'all') {
            $template->assign_vars(array('U_LOOKUP_ALL' => "{$url}&amp;i=main&amp;mode=post_details&amp;rdns=all"));
        }
        // Get other users who've posted under this IP
        $sql = 'SELECT poster_id, COUNT(poster_id) as postings
开发者ID:ahmatjan,项目名称:Crimson,代码行数:67,代码来源:mcp_post.php

示例9: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('mcp');
     // Set up general vars
     $action = request_var('action', '');
     $forum_id = request_var('f', 0);
     $start = request_var('start', 0);
     $deletemark = !empty($_POST['delmarked']) ? true : false;
     $deleteall = !empty($_POST['delall']) ? 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 = 'acp_logs';
     $this->log_type = constant('LOG_' . strtoupper($mode));
     // Delete entries if requested and able
     if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) {
         if (confirm_box(true)) {
             $where_sql = '';
             if ($deletemark && sizeof($marked)) {
                 $sql_in = array();
                 foreach ($marked as $mark) {
                     $sql_in[] = $mark;
                 }
                 $where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in);
                 unset($sql_in);
             }
             if ($where_sql || $deleteall) {
                 $sql = 'DELETE FROM ' . LOG_TABLE . "\n\t\t\t\t\t\tWHERE log_type = {$this->log_type}\n\t\t\t\t\t\t{$where_sql}";
                 $db->sql_query($sql);
                 add_log('admin', 'LOG_CLEAR_' . strtoupper($mode));
             }
         } else {
             confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array('f' => $forum_id, 'start' => $start, 'delmarked' => $deletemark, 'delall' => $deleteall, 'mark' => $marked, 'st' => $sort_days, 'sk' => $sort_key, 'sd' => $sort_dir, 'i' => $id, 'mode' => $mode, 'action' => $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('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');
     $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS'];
     $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN'];
     $this->page_title = $l_title;
     // Define forum list if we're looking @ mod logs
     if ($mode == 'mod') {
         $forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id);
         $template->assign_vars(array('S_SHOW_FORUMS' => true, 'S_FORUM_BOX' => $forum_box));
     }
     // Grab log data
     $log_data = array();
     $log_count = 0;
     view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort);
     $template->assign_vars(array('L_TITLE' => $l_title, 'L_EXPLAIN' => $l_title_explain, 'U_ACTION' => $this->u_action, 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start), 'PAGINATION' => generate_pagination($this->u_action . "&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) {
         $data = array();
         $checks = array('viewtopic', 'viewlogs', 'viewforum');
         foreach ($checks as $check) {
             if (isset($row[$check]) && $row[$check]) {
                 $data[] = '<a href="' . $row[$check] . '">' . $user->lang['LOGVIEW_' . strtoupper($check)] . '</a>';
             }
         }
         $template->assign_block_vars('log', array('USERNAME' => $row['username_full'], 'REPORTEE_USERNAME' => $row['reportee_username'] && $row['user_id'] != $row['reportee_id'] ? $row['reportee_username_full'] : '', 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'DATA' => sizeof($data) ? implode(' | ', $data) : '', 'ID' => $row['id']));
     }
 }
开发者ID:BackupTheBerlios,项目名称:phpbb-hu-svn,代码行数:72,代码来源:acp_logs.php

示例10: view_log

                                            </div>
                                            <div class="help-block" style="margin:0px;"></div></div></div>







                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="tab-pane fade" id="profile"><?php 
            view_log($tid);
            ?>
</div>
                </div>
            </div>
            </div>


            <div class="col-md-4">
                <div class="panel panel-info">
                    <?php 
            echo get_client_info_ticket($cid);
            ?>
                </div>
            </div>
开发者ID:Glavnyuk,项目名称:hd.rustem,代码行数:30,代码来源:ticket.php

示例11: mcp_post_details

/**
* Handling actions in post details screen
*/
function mcp_post_details($id, $mode, $action)
{
    global $phpEx, $phpbb_root_path, $config;
    global $template, $db, $user, $auth;
    $user->add_lang('posting');
    $post_id = request_var('p', 0);
    $start = request_var('start', 0);
    // Get post data
    $post_info = get_post_data(array($post_id));
    if (!sizeof($post_info)) {
        trigger_error($user->lang['POST_NOT_EXIST']);
    }
    $post_info = $post_info[$post_id];
    $url = append_sid("{$phpbb_root_path}mcp.{$phpEx}?" . extra_url());
    switch ($action) {
        case 'whois':
            $ip = request_var('ip', '');
            include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
            $whois = user_ipwhois($ip);
            $whois = preg_replace('#(\\s)([\\w\\-\\._\\+]+@[\\w\\-\\.]+)(\\s)#', '\\1<a href="mailto:\\2">\\2</a>\\3', $whois);
            $whois = preg_replace('#(\\s)(http:/{2}[^\\s]*)(\\s)#', '\\1<a href="\\2" target="_blank">\\2</a>\\3', $whois);
            $template->assign_vars(array('RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i={$id}&amp;mode={$mode}&amp;p={$post_id}") . '">', '</a>'), 'WHOIS' => trim($whois)));
            // We're done with the whois page so return
            return;
            break;
        case 'chgposter':
        case 'chgposter_ip':
            if ($action == 'chgposter') {
                $username = request_var('username', '', true);
                $sql_where = "username = '" . $db->sql_escape($username) . "'";
            } else {
                $new_user_id = request_var('u', 0);
                $sql_where = 'user_id = ' . $new_user_id;
            }
            $sql = 'SELECT *
				FROM ' . USERS_TABLE . '
				WHERE ' . $sql_where;
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if (!$row) {
                trigger_error($user->lang['NO_USER']);
            }
            if ($auth->acl_get('m_chgposter', $post_info['forum_id'])) {
                change_poster($post_info, $row);
            }
            break;
    }
    // Set some vars
    $users_ary = array();
    $post_id = $post_info['post_id'];
    $poster = $post_info['user_colour'] ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
    // Process message, leave it uncensored
    $message = $post_info['post_text'];
    if ($post_info['bbcode_bitfield']) {
        include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
        $bbcode = new bbcode($post_info['bbcode_bitfield']);
        $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
    }
    $message = smiley_text($message);
    $message = str_replace("\n", '<br />', $message);
    $template->assign_vars(array('U_MCP_ACTION' => "{$url}&amp;i=main&amp;quickmod=1", 'U_POST_ACTION' => "{$url}&amp;i={$id}&amp;mode=post_details", 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']), 'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']), 'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'] ? true : false, 'S_POST_UNAPPROVED' => !$post_info['post_approved'] ? true : false, 'S_POST_LOCKED' => $post_info['post_edit_locked'] ? true : false, 'S_USER_NOTES' => true, 'S_CLEAR_ALLOWED' => $auth->acl_get('a_clearlogs') ? true : false, 'U_EDIT' => $auth->acl_get('m_edit', $post_info['forum_id']) ? append_sid("{$phpbb_root_path}posting.{$phpEx}", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '', 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username'), 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']), 'U_MCP_WARN_USER' => $auth->acl_getf_global('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_VIEW_PROFILE' => $post_info['user_id'] != ANONYMOUS ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $post_info['user_id']) : '', 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$post_info['forum_id']}&amp;p={$post_id}") . "#p{$post_id}\">", '</a>'), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.{$phpEx}", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), 'POSTER_NAME' => $poster, 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => @gethostbyaddr($post_info['poster_ip']), 'POST_ID' => $post_info['post_id']));
    // Get User Notes
    $log_data = array();
    $log_count = 0;
    view_log('user', $log_data, $log_count, $config['posts_per_page'], 0, 0, 0, $post_info['user_id']);
    if ($log_count) {
        $template->assign_var('S_USER_NOTES', true);
        foreach ($log_data as $row) {
            $template->assign_block_vars('usernotes', array('REPORT_BY' => $row['username'], 'REPORT_AT' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'ID' => $row['id']));
        }
    }
    // Get Reports
    if ($auth->acl_get('m_', $post_info['forum_id'])) {
        $sql = 'SELECT r.*, re.*, u.user_id, u.username
			FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REPORTS_REASONS_TABLE . " re\n\t\t\tWHERE r.post_id = {$post_id}\n\t\t\t\tAND r.reason_id = re.reason_id\n\t\t\t\tAND u.user_id = r.user_id\n\t\t\tORDER BY r.report_time DESC";
        $result = $db->sql_query($sql);
        if ($row = $db->sql_fetchrow($result)) {
            $template->assign_var('S_SHOW_REPORTS', true);
            do {
                // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
                if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) {
                    $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
                    $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
                }
                $template->assign_block_vars('reports', array('REPORT_ID' => $row['report_id'], 'REASON_TITLE' => $row['reason_title'], 'REASON_DESC' => $row['reason_description'], 'REPORTER' => $row['user_id'] != ANONYMOUS ? $row['username'] : $user->lang['GUEST'], 'U_REPORTER' => $row['user_id'] != ANONYMOUS ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $row['user_id']) : '', 'USER_NOTIFY' => $row['user_notify'] ? true : false, 'REPORT_TIME' => $user->format_date($row['report_time']), 'REPORT_TEXT' => str_replace("\n", '<br />', trim($row['report_text']))));
            } while ($row = $db->sql_fetchrow($result));
        }
        $db->sql_freeresult($result);
    }
    // Get IP
    if ($auth->acl_get('m_info', $post_info['forum_id'])) {
        $rdns_ip_num = request_var('rdns', '');
        if ($rdns_ip_num != 'all') {
            $template->assign_vars(array('U_LOOKUP_ALL' => "{$url}&amp;i=main&amp;mode=post_details&amp;rdns=all"));
        }
        // Get other users who've posted under this IP
//.........这里部分代码省略.........
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:mcp_post.php

示例12: view_log

</th>
		<th width="15%"><?php 
echo $_CLASS['core_user']->lang['IP'];
?>
</th>
		<th width="20%"><?php 
echo $_CLASS['core_user']->lang['TIME'];
?>
</th>
		<th width="45%" nowrap="nowrap"><?php 
echo $_CLASS['core_user']->lang['ACTION'];
?>
</th>
	</tr>
<?php 
view_log('admin', $log_data, $log_count, 10);
$row_class = 'row2';
for ($i = 0; $i < sizeof($log_data); $i++) {
    $row_class = $row_class == 'row1' ? 'row2' : 'row1';
    ?>
	<tr>
		<td class="<?php 
    echo $row_class;
    ?>
"><?php 
    echo $log_data[$i]['username'];
    ?>
</td>
		<td class="<?php 
    echo $row_class;
    ?>
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:main.php

示例13: main


//.........这里部分代码省略.........
                if ($invite->cash_installed()) {
                    global $cash;
                    $template->assign_vars(array('S_CASH_INSTALLED' => true, 'S_CASH_CURRENCY_INVITE' => $cash->get_currencies($invite->config['cash_id_invite'], true), 'S_CASH_CURRENCY_REGISTER' => $cash->get_currencies($invite->config['cash_id_register'], true)));
                }
                break;
            case 'templates':
                $this->page_title = 'ACP_INVITE_TEMPLATES';
                $this->tpl_name = 'acp_invite_templates';
                $select = isset($_POST['select']) ? true : false;
                $tpl_type = request_var('template_type', '', true);
                $tpl_lang = request_var('template_language', $user->data['user_lang'], true);
                $tpl_subject = $select ? $invite->get_template("{$tpl_type}_subject.txt", $tpl_lang) : '';
                $tpl_message = $select ? $invite->get_template("{$tpl_type}_message.txt", $tpl_lang) : '';
                if ($submit) {
                    $tpl_subject = request_var('template_subject', $invite->get_template("{$tpl_type}_subject.txt", $tpl_lang), true);
                    $tpl_message = request_var('template_message', $invite->get_template("{$tpl_type}_message.txt", $tpl_lang), true);
                    if (!check_form_key($form_key)) {
                        $error[] = $user->lang['FORM_INVALID'];
                    }
                    // No errors.. continue!
                    if (!sizeof($error)) {
                        $invite->set_template($tpl_subject, "{$tpl_type}_subject.txt", $tpl_lang);
                        $invite->set_template($tpl_message, "{$tpl_type}_message.txt", $tpl_lang);
                        add_log('admin', 'LOG_INVITE_TEMPLATES_UPDATED');
                        trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
                    }
                }
                // Output wildcard tables
                $wildcards['general'] = $this->print_wildcard_array($invite, 'general');
                $wildcards['user'] = $this->print_wildcard_array($invite, 'user');
                foreach ($wildcards as $type => $data) {
                    foreach ($data as $wildcard => $example_value) {
                        $template->assign_block_vars($type . '_wildcards', array('WILDCARD' => $wildcard, 'EXAMPLE_VALUE' => $example_value));
                    }
                }
                $template->assign_vars(array('ERROR' => sizeof($error) ? array_pop($error) : '', 'TEMPLATE_SUBJECT' => $tpl_subject, 'TEMPLATE_MESSAGE' => $tpl_message, 'S_EDIT_TEMPLATE' => $select ? true : false, 'S_TEMPLATE_TYPE_SELECT' => $this->build_select('message', $invite->INVITE_MESSAGE_TYPE, $tpl_type), 'S_TEMPLATE_LANGUAGE_SELECT' => language_select($tpl_lang)));
                break;
            case 'log':
                $this->page_title = 'ACP_INVITE_LOG';
                $this->tpl_name = 'acp_invite_log';
                $this->log_type = LOG_INVITE;
                $start = request_var('start', 0);
                $show_info = request_var('info', 0);
                $marked = request_var('mark', array(0));
                $filter = request_var('filter', 'all');
                $deletemark = isset($_POST['delmarked']) ? true : false;
                $deleteall = isset($_POST['delall']) ? true : false;
                $entries_per_page = 25;
                // Sort keys
                $sort_days = request_var('st', 0);
                $sort_key = request_var('sk', 't');
                $sort_dir = request_var('sd', 'd');
                $sort_user = request_var('ui', '', true);
                // Delete entries if requested and able
                if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) {
                    if (confirm_box(true)) {
                        $where_sql = '';
                        if ($deletemark && sizeof($marked)) {
                            $sql_in = array();
                            foreach ($marked as $mark) {
                                $sql_in[] = $mark;
                            }
                            $where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in);
                            unset($sql_in);
                        }
                        if ($where_sql || $deleteall) {
                            $sql = 'DELETE FROM ' . LOG_TABLE . "\n\t\t\t\t\t\t\t\tWHERE log_type = {$this->log_type}\n\t\t\t\t\t\t\t\t{$where_sql}";
                            $db->sql_query($sql);
                        }
                        add_log('admin', 'LOG_INVITE_LOG_CLEARED');
                    } 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, 'i' => $id, 'mode' => $mode, 'action' => $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('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');
                $sql_user = $invite->user_return_data($db->sql_escape(utf8_clean_string($sort_user)), 'username_clean', 'user_id');
                // Grab log data
                $log_data = array();
                $log_count = 0;
                view_log('invite', $log_data, $log_count, $entries_per_page, $start, $sql_user, $filter, $sql_user, $sql_where, $sql_sort);
                $u_sort_param .= $sql_user ? "&amp;ui={$sort_user}" : '';
                $log_count = $sql_user ? $log_count : ($sort_user ? 0 : $log_count);
                $template->assign_vars(array('U_ACTION' => $this->u_action, 'S_FILTER' => $this->build_select('filter', '', $filter), 'S_ON_PAGE' => on_page($log_count, $entries_per_page, $start), 'PAGINATION' => generate_pagination($this->u_action . "&amp;{$u_sort_param}", $log_count, $entries_per_page, $start, true), 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, 'S_SORT_USER' => $sort_user ? $sort_user : '', 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), 'S_USER_ENTRY' => empty($sort_user) ? true : $sql_user));
                foreach ($log_data as $row) {
                    // Remove info to fix the bug 'Invitation log - Details'
                    $u_sort_param = $show_info ? str_replace("&amp;info={$show_info}", '', $u_sort_param) : $u_sort_param;
                    $data = array();
                    $template->assign_block_vars('log', array('USERNAME' => $row['username_full'], 'REPORTEE_USERNAME' => $row['reportee_username'] && $row['user_id'] != $row['reportee_id'] ? $row['reportee_username_full'] : '', 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'DATA' => sizeof($data) ? implode(' | ', $data) : '', 'ID' => $row['id']));
                }
                break;
        }
    }
开发者ID:janukobytsch,项目名称:invite-a-friend,代码行数:101,代码来源:acp_invite.php

示例14: mcp_post_details


//.........这里部分代码省略.........
                }
                $sql = 'DELETE FROM ' . LOG_TABLE . '
					WHERE log_type = ' . LOG_USERS . " \r\n\t\t\t\t\t\t{$where_sql}";
                $_CLASS['core_db']->sql_query($sql);
                add_log('admin', 'LOG_USERS_CLEAR');
                $msg = $deletemark ? 'MARKED_DELETED' : 'ALL_DELETED';
                $redirect = generate_link("{$url}&amp;i={$id}&amp;mode=post_details");
                $_CLASS['core_display']->meta_refresh(2, $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', $post_info['username']);
                add_log('user', $post_info['user_id'], 'LOG_USER_GENERAL', $usernote);
                $redirect = generate_link("{$url}&amp;i={$id}&amp;mode=post_details");
                $_CLASS['core_display']->meta_refresh(2, $redirect);
                trigger_error($_CLASS['core_user']->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
            }
            break;
        default:
    }
    // Set some vars
    $users_ary = array();
    $poster = $post_info['user_colour'] ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
    // Process message, leave it uncensored
    $message = $post_info['post_text'];
    if ($post_info['bbcode_bitfield']) {
        global $site_file_root;
        require_once $site_file_root . 'includes/forums/bbcode.php';
        $bbcode = new bbcode($post_info['bbcode_bitfield']);
        $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
    }
    $message = smiley_text($message);
    $_CLASS['core_template']->assign(array('U_MCP_ACTION' => generate_link($url . '&amp;i=main&amp;quickmod=1'), 'U_POST_ACTION' => generate_link("{$url}&amp;i={$id}&amp;mode=post_details"), 'U_APPROVE_ACTION' => generate_link('Forums&amp;file=mcp&amp;i=queue&amp;p=' . $post_id), 'S_CAN_VIEWIP' => $_CLASS['auth']->acl_get('m_ip', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $_CLASS['auth']->acl_get('m_', $post_info['forum_id']), 'S_CAN_LOCK_POST' => $_CLASS['auth']->acl_get('m_lock', $post_info['forum_id']), 'S_CAN_DELETE_POST' => $_CLASS['auth']->acl_get('m_delete', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_USER_WARNINGS' => $post_info['user_warnings'] ? true : false, 'S_SHOW_USER_NOTES' => true, 'S_CLEAR_ALLOWED' => $_CLASS['auth']->acl_get('a_clearlogs') ? true : false, 'U_VIEW_PROFILE' => generate_link('Members_List&amp;mode=viewprofile&amp;u=' . $post_info['user_id']), 'U_EDIT' => $_CLASS['auth']->acl_get('m_edit', $post_info['forum_id']) ? generate_link("Forums&amp;file=posting&amp;mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '', 'RETURN_TOPIC' => sprintf($_CLASS['core_user']->lang['RETURN_TOPIC'], '<a href="' . generate_link("Forums&amp;file=viewtopic&amp;p={$post_id}#{$post_id}") . '">', '</a>'), 'RETURN_FORUM' => sprintf($_CLASS['core_user']->lang['RETURN_FORUM'], '<a href="' . generate_link("Forums&amp;file=viewforum&amp;f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'), 'REPORTED_IMG' => $_CLASS['core_user']->img('icon_reported', $_CLASS['core_user']->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $_CLASS['core_user']->img('icon_unapproved', $_CLASS['core_user']->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $_CLASS['core_user']->img('btn_edit', $_CLASS['core_user']->lang['EDIT_POST']), 'POSTER_NAME' => $poster, 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $_CLASS['core_user']->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => @gethostbyaddr($post_info['poster_ip']), 'POST_ID' => $post_info['post_id']));
    // Get User Notes
    $log_data = array();
    $log_count = 0;
    view_log('user', $log_data, $log_count, $config['posts_per_page'], 0, 0, 0, $post_info['user_id']);
    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'], 'ID' => $row['id']));
        }
    }
    // Get Reports
    if ($_CLASS['auth']->acl_get('m_', $post_info['forum_id'])) {
        $sql = 'SELECT r.*, re.*, u.user_id, u.username 
			FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REASONS_TABLE . " re\r\n\t\t\tWHERE r.post_id = {$post_id}\r\n\t\t\t\tAND r.reason_id = re.reason_id\r\n\t\t\t\tAND u.user_id = r.user_id\r\n\t\t\tORDER BY r.report_time DESC";
        $result = $_CLASS['core_db']->sql_query($sql);
        if ($row = $_CLASS['core_db']->sql_fetchrow($result)) {
            $_CLASS['core_template']->assign('S_SHOW_REPORTS', true);
            do {
                $_CLASS['core_template']->assign_vars_array('reports', array('REPORT_ID' => $row['report_id'], 'REASON_TITLE' => $_CLASS['core_user']->lang['report_reasons']['TITLE'][strtoupper($row['reason_name'])], 'REASON_DESC' => $_CLASS['core_user']->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_name'])], 'REPORTER' => $row['user_id'] != ANONYMOUS ? $row['username'] : $_CLASS['core_user']->lang['GUEST'], 'U_REPORTER' => $row['user_id'] != ANONYMOUS ? generate_link('Members_List&amp;mode=viewprofile&amp;u=' . $row['user_id']) : '', 'USER_NOTIFY' => $row['user_notify'] ? true : false, 'REPORT_TIME' => $_CLASS['core_user']->format_date($row['report_time']), 'REPORT_TEXT' => str_replace("\n", '<br />', trim($row['report_text']))));
            } while ($row = $_CLASS['core_db']->sql_fetchrow($result));
        }
        $_CLASS['core_db']->sql_freeresult($result);
    }
    // Get IP
    if ($_CLASS['auth']->acl_get('m_ip', $post_info['forum_id'])) {
        $rdns_ip_num = request_var('rdns', '');
        if ($rdns_ip_num != 'all') {
            $_CLASS['core_template']->assign(array('U_LOOKUP_ALL' => generate_link($url . '&amp;i=main&amp;mode=post_details&amp;rdns=all')));
        }
        // Get other users who've posted under this IP
        $sql = 'SELECT u.user_id, u.username, COUNT(*) as postings
			FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . " p\r\n\t\t\tWHERE p.poster_id = u.user_id\r\n\t\t\t\tAND p.poster_ip = '{$post_info['poster_ip']}'\r\n\t\t\t\tAND p.poster_id <> {$post_info['user_id']}\r\n\t\t\tGROUP BY u.user_id\r\n\t\t\tORDER BY postings DESC";
        $result = $_CLASS['core_db']->sql_query($sql);
        while ($row = $_CLASS['core_db']->sql_fetchrow($result)) {
            // Fill the user select list with users who have posted
            // under this IP
            if ($row['user_id'] != $post_info['poster_id']) {
                $users_ary[strtolower($row['username'])] = $row;
            }
            $_CLASS['core_template']->assign_vars_array('userrow', array('USERNAME' => $row['user_id'] == ANONYMOUS ? $_CLASS['core_user']->lang['GUEST'] : $row['username'], 'NUM_POSTS' => $row['postings'], 'L_POST_S' => $row['postings'] == 1 ? $_CLASS['core_user']->lang['POST'] : $_CLASS['core_user']->lang['POSTS'], 'U_PROFILE' => $row['user_id'] == ANONYMOUS ? '' : generate_link('Members_List&amp;mode=viewprofile&amp;u=' . $row['user_id']), 'U_SEARCHPOSTS' => generate_link('Forums&amp;file=search&amp;search_author=' . urlencode($row['username']) . '&amp;showresults=topics')));
        }
        $_CLASS['core_db']->sql_freeresult($result);
        // Get other IP's this user has posted under
        $sql = 'SELECT poster_ip, COUNT(*) AS postings
			FROM ' . POSTS_TABLE . '
			WHERE poster_id = ' . $post_info['poster_id'] . '
			GROUP BY poster_ip
			ORDER BY postings DESC';
        $result = $_CLASS['core_db']->sql_query($sql);
        while ($row = $_CLASS['core_db']->sql_fetchrow($result)) {
            $hostname = ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') && $row['poster_ip'] ? @gethostbyaddr($row['poster_ip']) : '';
            $_CLASS['core_template']->assign_vars_array('iprow', array('IP' => $row['poster_ip'], 'HOSTNAME' => $hostname, 'NUM_POSTS' => $row['postings'], 'L_POST_S' => $row['postings'] == 1 ? $_CLASS['core_user']->lang['POST'] : $_CLASS['core_user']->lang['POSTS'], 'U_LOOKUP_IP' => $rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all' ? '' : generate_link("{$url}&amp;i={$id}&amp;mode=post_details&amp;rdns={$row['poster_ip']}#ip"), 'U_WHOIS' => generate_link("Forums&amp;file=mcp&amp;i={$id}&amp;mode=whois&amp;ip={$row['poster_ip']}")));
        }
        $_CLASS['core_db']->sql_freeresult($result);
        // If we were not searching for a specific username fill
        // the user_select box with users who have posted under
        // the same IP
        if ($action != 'chgposter_search') {
            $user_select = '';
            ksort($users_ary);
            foreach ($users_ary as $row) {
                $user_select .= '<option value="' . $row['user_id'] . '">' . $row['username'] . "</option>\n";
            }
            $_CLASS['core_template']->assign('S_USER_SELECT', $user_select);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:101,代码来源:mcp_post.php

示例15: main

    function main($id, $mode)
    {
        global $auth, $db, $user, $template;
        global $config, $phpbb_root_path, $phpEx;
        $user->add_lang('acp/common');
        $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 = isset($_POST['del_marked']) ? true : false;
        $deleteall = isset($_POST['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_id = $topic_id = 0;
        switch ($mode) {
            case 'front':
                $where_sql = '';
                break;
            case 'forum_logs':
                $forum_id = request_var('f', 0);
                $where_sql = " AND forum_id = {$forum_id}";
                break;
            case 'topic_logs':
                $topic_id = request_var('t', 0);
                $where_sql = " AND topic_id = {$topic_id}";
                break;
        }
        // Delete entries if requested and able
        if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) {
            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 = ' . LOD_MOD . "\n\t\t\t\t\t{$where_sql}";
                $db->sql_query($sql);
                add_log('admin', 'LOG_CLEAR_MOD');
            }
        }
        // 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('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, $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), '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>';
                }
            }
            $template->assign_block_vars('log', array('USERNAME' => $row['username'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'DATA' => sizeof($data) ? implode(' | ', $data) : '', 'ID' => $row['id']));
        }
    }
开发者ID:yunsite,项目名称:gloryroad,代码行数:78,代码来源:mcp_logs.php


注:本文中的view_log函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。