本文整理汇总了PHP中Robots::get_robot_by_ip方法的典型用法代码示例。如果您正苦于以下问题:PHP Robots::get_robot_by_ip方法的具体用法?PHP Robots::get_robot_by_ip怎么用?PHP Robots::get_robot_by_ip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Robots
的用法示例。
在下文中一共展示了Robots::get_robot_by_ip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTMLForm
$i++;
}
$result->dispose();
//Advises
$advises_form = new HTMLForm('advises_list', '', false);
AdminServerSystemReportController::get_advises($advises_form);
//Header logo
$theme = ThemesManager::get_theme(AppContext::get_current_user()->get_theme());
$customize_interface = $theme->get_customize_interface();
$header_logo_path = $customize_interface->get_header_logo_path();
$tpl->put_all(array('L_QUICK_ACCESS' => $LANG['quick_access'], 'L_ADD_CONTENT' => $LANG['add_content'], 'L_MODULES_MANAGEMENT' => $LANG['modules_management'], 'L_ADD_ARTICLES' => $LANG['add_articles'], 'L_ADD_NEWS' => $LANG['add_news'], 'L_CUSTOMIZE_SITE' => $LANG['customize_site'], 'L_ADD_TEMPLATE' => $LANG['add_template'], 'L_MENUS_MANAGEMENT' => $LANG['menus_management'], 'L_CUSTOMIZE_TEMPLATE' => $LANG['customize_template'], 'L_SITE_MANAGEMENT' => $LANG['site_management'], 'L_GENERAL_CONFIG' => $LANG['general_config'], 'L_EMPTY_CACHE' => $LANG['empty_cache'], 'L_SAVE_DATABASE' => $LANG['save_database'], 'L_WELCOME_TITLE' => $LANG['welcome_title'], 'L_WELCOME_DESC' => $LANG['welcome_desc'], 'WRITING_PAD_CONTENT' => WritingPadConfig::load()->get_content(), 'C_HEADER_LOGO' => !empty($header_logo_path), 'HEADER_LOGO' => Url::to_rel($header_logo_path), 'C_NO_COM' => $i == 0, 'C_UNREAD_ALERTS' => (bool) AdministratorAlertService::get_number_unread_alerts(), 'L_INDEX_ADMIN' => $LANG['administration'], 'L_ADMIN_ALERTS' => $LANG['administrator_alerts'], 'L_NO_UNREAD_ALERT' => $LANG['no_unread_alert'], 'L_UNREAD_ALERT' => $LANG['unread_alerts'], 'L_DISPLAY_ALL_ALERTS' => $LANG['display_all_alerts'], 'L_ADMINISTRATOR_ALERTS' => $LANG['administrator_alerts'], 'L_QUICK_LINKS' => $LANG['quick_links'], 'L_ACTION_USERS_MANAGEMENT' => $LANG['action.members_management'], 'L_ACTION_MENUS_MANAGEMENT' => $LANG['action.menus_management'], 'L_ACTION_MODULES_MANAGEMENT' => $LANG['action.modules_management'], 'L_ACTION_THEMES_MANAGEMENT' => $LANG['action.themes_management'], 'L_ACTION_LANGS_MANAGEMENT' => $LANG['action.langs_management'], 'L_NO_COMMENT' => LangLoader::get_message('no_item_now', 'common'), 'L_LAST_COMMENTS' => $LANG['last_comments'], 'L_VIEW_ALL_COMMENTS' => $LANG['view_all_comments'], 'L_WRITING_PAD' => $LANG['writing_pad'], 'L_STATS' => $LANG['stats'], 'L_USER_ONLINE' => $LANG['user_online'], 'L_USER_IP' => $LANG['user_ip'], 'L_LOCALISATION' => $LANG['localisation'], 'L_LAST_UPDATE' => $LANG['last_update'], 'L_WEBSITE_UPDATES' => $LANG['website_updates'], 'L_BY' => $LANG['by'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'ADVISES' => $advises_form->display()));
//Liste des personnes en lignes.
$result = PersistenceContext::get_querier()->select("SELECT s.user_id, s.ip, s.timestamp, s.location_script, s.location_title, m.display_name, m.groups, m.level\nFROM " . DB_TABLE_SESSIONS . " s\nLEFT JOIN " . DB_TABLE_MEMBER . " m ON s.user_id = m.user_id\nWHERE s.timestamp > :timestamp\nORDER BY s.timestamp DESC", array('timestamp' => time() - SessionsConfig::load()->get_active_session_duration()));
while ($row = $result->fetch()) {
//On vérifie que la session ne correspond pas à un robot.
$robot = Robots::get_robot_by_ip($row['ip']);
switch ($row['level']) {
case User::MEMBER_LEVEL:
$class = 'member';
break;
case User::MODERATOR_LEVEL:
$class = 'modo';
break;
case User::ADMIN_LEVEL:
$class = 'admin';
break;
}
if (!empty($robot)) {
$login = '<span class="robot">' . ($robot == 'unknow_bot' ? $LANG['unknow_bot'] : $robot) . '</span>';
} else {
$group_color = User::get_group_color($row['groups'], $row['level']);