mettre la photo sur liste membre en ligne et liste des membres
tout est ds letitre
Support des Modules
ReidLos Membre non connecté
-
Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
-
Equipe Développement
Reprise du message précédent
Remplacer le fichier /online/phpboost/OnlineUser.class.php par :Code PHP :
<?php /*################################################## * OnlineUser.class.php * ------------------- * begin : February 01, 2012 * copyright : (C) 2012 Julien BRISWALTER * email : julien.briswalter@gmail.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Comments Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Comments Public License for more details. * * You should have received a copy of the GNU Comments Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ class OnlineUser extends User { protected $location_script; protected $location_title; protected $last_update; protected $avatar; public function set_location_script($location_script) { $this->location_script = $location_script; } public function get_location_script() { return $this->location_script; } public function set_location_title($location_title) { $this->location_title = $location_title; } public function get_location_title() { return $this->location_title; } public function set_last_update($last_update) { $this->last_update = $last_update; } public function get_last_update() { return $this->last_update; } public function set_avatar($avatar) { $this->avatar = $avatar; } public function get_avatar() { $user_accounts_config = UserAccountsConfig::load(); if (empty($this->avatar)) { return $user_accounts_config->is_default_avatar_enabled() == '1' ? PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . $user_accounts_config->get_default_avatar_name() : ''; } return Url::to_rel($this->avatar); } } ?>
Remplacer le fichier /online/services/OnlineService.class.php par :
Code PHP :
<?php /*################################################## * OnlineService.class.php * ------------------- * begin : February 1, 2012 * copyright : (C) 2012 Julien BRISWALTER * email : julien.briswalter@gmail.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ class OnlineService { private static $querier; public static function __static() { self::$querier = PersistenceContext::get_querier(); } public static function get_nbr_users_connected($condition, $parameters) { return self::$querier->count(DB_TABLE_SESSIONS, $condition, $parameters); } public static function get_online_users($condition, $parameters) { $users = array(); $result = self::$querier->select("SELECT s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM " . DB_TABLE_SESSIONS . " s LEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = s.user_id LEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " f ON f.user_id = s.user_id " . $condition, $parameters); while ($row = $result->fetch()) { $row['session_script_get'] = !empty($row['session_script_get']) ? '?' . $row['session_script_get'] : ''; $user = new OnlineUser(); $user->set_id($row['user_id']); $user->set_pseudo($row['login']); $user->set_level($row['level']); $user->set_groups(explode('|', $row['user_groups'])); $user->set_last_update(gmdate_format('date_format_long', $row['session_time'])); $user->set_location_script($row['session_script'] . $row['session_script_get']); $user->set_location_title(stripslashes($row['session_script_title'])); $user->set_avatar($row['user_avatar']); $users[] = $user; } return $users; } } ?>
Remplacer le fichier /online/phpboost/OnlineModuleHomePage.class.php par :
Code PHP :
<?php /*################################################## * OnlineModuleHomePage.class.php * ------------------- * begin : February 08, 2012 * copyright : (C) 2012 Julien BRISWALTER * email : julien.briswalter@gmail.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ class OnlineModuleHomePage implements ModuleHomePage { private $lang; private $view; public static function get_view() { $object = new self(); return $object->build_view(); } public function build_view() { $this->init(); $pagination = new OnlineUsersListPagination(AppContext::get_request()->get_int('page', 1)); $this->view->put_all(array( 'L_LOGIN' => LangLoader::get_message('pseudo', 'main'), 'PAGINATION' => '<strong>' . LangLoader::get_message('page', 'main') . ' :</strong> ' . $pagination->display()->render() )); $condition = 'WHERE s.session_time > :time ORDER BY '. OnlineConfig::load()->get_display_order_request() .' LIMIT '. $pagination->get_number_users_per_page() .' OFFSET '. $pagination->get_display_from(); $parameters = array( 'time' => (time() - SessionsConfig::load()->get_active_session_duration()) ); $users = OnlineService::get_online_users($condition, $parameters); foreach ($users as $user) { if ($user->get_id() == AppContext::get_current_user()->get_id()) { $user->set_location_script(OnlineUrlBuilder::home()->absolute()); $user->set_location_title($this->lang['online']); $user->set_last_update(gmdate_format('date_format_long', time())); } $group_color = User::get_group_color($user->get_groups(), $user->get_level(), true); if ($user->get_level() != User::VISITOR_LEVEL) { $this->view->assign_block_vars('users', array( 'U_PROFILE' => UserUrlBuilder::profile($user->get_id())->absolute(), 'U_LOCATION' => $user->get_location_script(), 'U_AVATAR' => $user->get_avatar(), 'PSEUDO' => $user->get_pseudo(), 'LEVEL_CLASS' => UserService::get_level_class($user->get_level()), 'C_GROUP_COLOR' => !empty($group_color), 'GROUP_COLOR' => $group_color, 'TITLE_LOCATION' => $user->get_location_title(), 'LAST_UPDATE' => $user->get_last_update() )); } } return $this->view; } private function init() { $this->lang = LangLoader::get('online_common', 'online'); $this->view = new FileTemplate('online/OnlineHomeController.tpl'); $this->view->add_lang($this->lang); } } ?>
Remplacer le fichier /online/templates/OnlineHomeController.tpl par :
Code TPL :
<div class="module_position"> <div class="module_top_l"></div> <div class="module_top_r"></div> <div class="module_top"> <div class="module_top_title">{@online} </div> </div> <div class="module_contents"> <table class="module_table"> <tr> <th colspan="4"> {@online} </th> </tr> <tr> <td class="row2" style="width:25%"> {L_LOGIN} </td> <td class="row2" style="width:25%"> </td> <td class="row2" style="width:25%"> {@online.location} </td> <td class="row2" style="width:25%"> {@online.last_update} </td> </tr> # START users # <tr> <td class="row3"> <a href="{users.U_PROFILE}" class="{users.LEVEL_CLASS}" # IF users.C_GROUP_COLOR # style="color:{users.GROUP_COLOR}" # ENDIF #>{users.PSEUDO}</a> </td> <td class="row3"> <img src="{users.U_AVATAR}" width="90px"/> </td> <td class="row3"> <a href="{users.U_LOCATION}">{users.TITLE_LOCATION}</a> </td> <td class="row3"> {users.LAST_UPDATE} </td> </tr> # END users # <tr> <td colspan="8" class="row1"> <span style="float:left;">{PAGINATION}</span> </td> </tr> </table> </div> <div class="module_bottom_l"></div> <div class="module_bottom_r"></div> <div class="module_bottom"></div> </div>
Ça devrait fonctionner
patgame Membre non connecté
Booster Missile
-
Booster Missile
- Voir le profil du membre patgame
- Inscrit le : 03/09/2009
- Site internet
- Groupes :
merci reidlos j'essaie et je te dis quoi
bonne soirée
pat
quand même hein même en temps de vacances service rapide
patgame Membre non connecté
Booster Missile
-
Booster Missile
- Voir le profil du membre patgame
- Inscrit le : 03/09/2009
- Site internet
- Groupes :
| Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375727008 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM phpboost_sessions s LEFT JOIN phpboost_member m ON m.user_id = s.user_id LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375727008 ORDER BY s.level DESC, s.session_time DESC [0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array) [1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int) [2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array) [3] /online/phpboost/OnlineModuleMiniMenu.class.php:57 - OnlineService::get_online_users(string, array) [4] /cache/menus.php:107 - OnlineModuleMiniMenu->display() [5] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:127 - include_once(string) [6] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:94 - SiteDisplayGraphicalEnvironment->display_menus(FileTemplate) [7] /kernel/framework/mvc/response/AbstractResponse.class.php:61 - SiteDisplayGraphicalEnvironment->display_header() [8] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:89 - AbstractResponse->send() [9] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:60 - UrlControllerMapper->do_call() [10] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:68 - UrlControllerMapper->call() [11] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:44 - Dispatcher->dispatch() [12] /user/index.php:52 - DispatchManager::dispatch(array) | 2013-08-05 20:28:28 |
| Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375727000 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM phpboost_sessions s LEFT JOIN phpboost_member m ON m.user_id = s.user_id LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375727000 ORDER BY s.level DESC, s.session_time DESC LIMIT 20 OFFSET 0 [0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array) [1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int) [2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array) [3] /online/phpboost/OnlineModuleHomePage.class.php:55 - OnlineService::get_online_users(string, array) [4] /online/phpboost/OnlineModuleHomePage.class.php:36 - OnlineModuleHomePage->build_view() [5] /online/controllers/OnlineHomeController.class.php:32 - OnlineModuleHomePage::get_view() [6] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:88 - OnlineHomeController->execute(HTTPRequestCustom) [7] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:60 - UrlControllerMapper->do_call() [8] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:68 - UrlControllerMapper->call() [9] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:44 - Dispatcher->dispatch() [10] /online/index.php:36 - DispatchManager::dispatch(array) | 2013-08-05 20:28:20 |
| Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375726996 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM phpboost_sessions s LEFT JOIN phpboost_member m ON m.user_id = s.user_id LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375726996 ORDER BY s.level DESC, s.session_time DESC [0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array) [1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int) [2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array) [3] /online/phpboost/OnlineModuleMiniMenu.class.php:57 - OnlineService::get_online_users(string, array) [4] /cache/menus.php:107 - OnlineModuleMiniMenu->display() [5] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:127 - include_once(string) [6] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:94 - SiteDisplayGraphicalEnvironment->display_menus(FileTemplate) [7] /kernel/framework/core/environment/Environment.class.php:546 - SiteDisplayGraphicalEnvironment->display_header() [8] /kernel/header.php:55 - Environment::display_header() [9] /wiki/wiki.php:96 - require_once(string) | 2013-08-05 20:28:16 |
| Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375726828 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM phpboost_sessions s LEFT JOIN phpboost_member m ON m.user_id = s.user_id LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375726828 ORDER BY s.level DESC, s.session_time DESC [0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array) [1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int) [2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array) [3] /online/phpboost/OnlineModuleMiniMenu.class.php:57 - OnlineService::get_online_users(string, array) [4] /cache/menus.php:107 - OnlineModuleMiniMenu->display() [5] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:127 - include_once(string) [6] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:94 - SiteDisplayGraphicalEnvironment->display_menus(FileTemplate) [7] /kernel/framework/mvc/response/AbstractResponse.class.php:61 - SiteDisplayGraphicalEnvironment->display_header() [8] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:89 - AbstractResponse->send() [9] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:60 - UrlControllerMapper->do_call() [10] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:68 - UrlControllerMapper->call() [11] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:44 - Dispatcher->dispatch() [12] /user/index.php:52 - DispatchManager::dispatch(array) | 2013-08-05 20:25:28 |
| Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375726821 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM phpboost_sessions s LEFT JOIN phpboost_member m ON m.user_id = s.user_id LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375726821 ORDER BY s.level DESC, s.session_time DESC [0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array) [1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int) [2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array) [3] /online/phpboost/OnlineModuleMiniMenu.class.php:57 - OnlineService::get_online_users(string, array) [4] /cache/menus.php:107 - OnlineModuleMiniMenu->display() [5] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:127 - include_once(string) [6] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:94 - SiteDisplayGraphicalEnvironment->display_menus(FileTemplate) [7] /kernel/framework/mvc/response/AbstractResponse.class.php:61 - SiteDisplayGraphicalEnvironment->display_header() [8] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:89 - AbstractResponse->send() [9] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:60 - UrlControllerMapper->do_call() [10] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:68 - UrlControllerMapper->call() [11] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:44 - Dispatcher->dispatch() [12] /user/index.php:52 - DispatchManager::dispatch(array) | 2013-08-05 20:25:21 |
| Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375726813 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM phpboost_sessions s LEFT JOIN phpboost_member m ON m.user_id = s.user_id LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375726813 ORDER BY s.level DESC, s.session_time DESC [0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array) [1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int) [2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array) [3] /online/phpboost/OnlineModuleMiniMenu.class.php:57 - OnlineService::get_online_users(string, array) [4] /cache/menus.php:107 - OnlineModuleMiniMenu->display() [5] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:133 - include_once(string) [6] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:94 - SiteDisplayGraphicalEnvironment->display_menus(FileTemplate) [7] /kernel/framework/mvc/response/AbstractResponse.class.php:61 - SiteDisplayGraphicalEnvironment->display_header() [8] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:89 - AbstractResponse->send() [9] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:60 - UrlControllerMapper->do_call() [10] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:68 - UrlControllerMapper->call() [11] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:44 - Dispatcher->dispatch() [12] /index.php:53 - DispatchManager::dispatch(array) | 2013-08-05 20:25:13 |
lobab Membre non connecté
Booster Mortier
-
Booster Mortier
- Voir le profil du membre lobab
- Inscrit le : 25/02/2012
- Groupes :
Dans le fichier /online/services/OnlineService.class.php, modifies la ligne :
Code PHP :
LEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " fON f.user_id = s.user_id "
par :
Code PHP :
LEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " f ON f.user_id = s.user_id "
Apparemment, ça supprime l'erreur, mais pour ma part je n'arrive pas à avoir l'affichage de l'avatar ...
La puissance est un sommet de connaissances et l'intelligence est le moyen d'y accéder ... Est-ce pour ça qu'il y a tant de cons en bas des pistes ???
Heureux celui qui est sourd, lui au moins, peut écouter le silence
Heureux celui qui est sourd, lui au moins, peut écouter le silence

patgame Membre non connecté
Booster Missile
-
Booster Missile
- Voir le profil du membre patgame
- Inscrit le : 03/09/2009
- Site internet
- Groupes :
par contre j'ai bien les avatars dans la liste des membres si tu a plusieurs listes (comme moi car des groupes )ànavigues dedans ça actualise et oh miracles les avatars s'affichent il reste a regler la liste on line je pense un probleme mineur de code je pense
Fatale : invalid query. (ERRNO 1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.user_id = s.user_id WHERE s.session_time > 1375733920 ORDER BY s.level DESC, s' at line 7query: SELECT
s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title,
m.login, m.user_groups,
f.user_avatar
FROM phpboost_sessions s
LEFT JOIN phpboost_member m ON m.user_id = s.user_id
LEFT JOIN phpboost_member_extended_fields fON f.user_id = s.user_id WHERE s.session_time > 1375733920 ORDER BY s.level DESC, s.session_time DESC
[0] /kernel/framework/io/db/driver/mysql/MySQLQuerier.class.php:49 - MySQLQuerier->execute(string, array)
[1] /kernel/framework/io/db/DBQuerier.class.php:51 - MySQLQuerier->select(string, array, int)
[2] /online/services/OnlineService.class.php:53 - DBQuerier->select(string, array)
[3] /online/phpboost/OnlineModuleMiniMenu.class.php:57 - OnlineService::get_online_users(string, array)
[4] /cache/menus.php:107 - OnlineModuleMiniMenu->display()
[5] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:127 - include_once(string)
[6] /kernel/framework/phpboost/environment/SiteDisplayGraphicalEnvironment.class.php:94 - SiteDisplayGraphicalEnvironment->display_menus(FileTemplate)
[7] /kernel/framework/mvc/response/AbstractResponse.class.php:61 - SiteDisplayGraphicalEnvironment->display_header()
[8] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:89 - AbstractResponse->send()
[9] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:60 - UrlControllerMapper->do_call()
[10] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:68 - UrlControllerMapper->call()
[11] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:44 - Dispatcher->dispatch()
[12] /user/index.php:52 - DispatchManager::dispatch(array)
Édité par patgame Le 05/08/2013 à 22h48
j1.seth Membre non connecté
-
Administrateur
- Voir le profil du membre j1.seth
- Inscrit le : 01/09/2008
- Site internet
- Groupes :
-
Chef de Projet
-
Equipe Développement

Remplacer le fichier /online/phpboost/OnlineUser.class.php par :
Code PHP :
<?php /*################################################## * OnlineUser.class.php * ------------------- * begin : February 01, 2012 * copyright : (C) 2012 Julien BRISWALTER * email : julien.briswalter@gmail.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Comments Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Comments Public License for more details. * * You should have received a copy of the GNU Comments Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ class OnlineUser extends User { protected $location_script; protected $location_title; protected $last_update; protected $avatar; public function set_location_script($location_script) { $this->location_script = $location_script; } public function get_location_script() { return $this->location_script; } public function set_location_title($location_title) { $this->location_title = $location_title; } public function get_location_title() { return $this->location_title; } public function set_last_update($last_update) { $this->last_update = $last_update; } public function get_last_update() { return $this->last_update; } public function set_avatar($avatar) { $this->avatar = $avatar; } public function get_avatar() { $user_accounts_config = UserAccountsConfig::load(); if (empty($this->avatar)) { return $user_accounts_config->is_default_avatar_enabled() == '1' ? PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . $user_accounts_config->get_default_avatar_name() : ''; } return Url::to_rel($this->avatar); } } ?>
Remplacer le fichier /online/services/OnlineService.class.php par :
Code PHP :
<?php /*################################################## * OnlineService.class.php * ------------------- * begin : February 1, 2012 * copyright : (C) 2012 Julien BRISWALTER * email : julien.briswalter@gmail.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ class OnlineService { private static $querier; public static function __static() { self::$querier = PersistenceContext::get_querier(); } public static function get_nbr_users_connected($condition, $parameters) { return self::$querier->count(DB_TABLE_SESSIONS, $condition, $parameters); } public static function get_online_users($condition, $parameters) { $users = array(); $result = self::$querier->select("SELECT s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, s.session_script_title, m.login, m.user_groups, f.user_avatar FROM " . DB_TABLE_SESSIONS . " s LEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = s.user_id LEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " f ON f.user_id = s.user_id " . $condition, $parameters); while ($row = $result->fetch()) { $row['session_script_get'] = !empty($row['session_script_get']) ? '?' . $row['session_script_get'] : ''; $user = new OnlineUser(); $user->set_id($row['user_id']); $user->set_pseudo($row['login']); $user->set_level($row['level']); $user->set_groups(explode('|', $row['user_groups'])); $user->set_last_update(gmdate_format('date_format_long', $row['session_time'])); $user->set_location_script($row['session_script'] . $row['session_script_get']); $user->set_location_title(stripslashes($row['session_script_title'])); $user->set_avatar($row['user_avatar']); $users[] = $user; } return $users; } } ?>
Remplacer le fichier /online/phpboost/OnlineModuleHomePage.class.php par :
Code PHP :
<?php /*################################################## * OnlineModuleHomePage.class.php * ------------------- * begin : February 08, 2012 * copyright : (C) 2012 Julien BRISWALTER * email : julien.briswalter@gmail.com * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ class OnlineModuleHomePage implements ModuleHomePage { private $lang; private $view; public static function get_view() { $object = new self(); return $object->build_view(); } public function build_view() { $this->init(); $pagination = new OnlineUsersListPagination(AppContext::get_request()->get_int('page', 1)); $this->view->put_all(array( 'L_LOGIN' => LangLoader::get_message('pseudo', 'main'), 'PAGINATION' => '<strong>' . LangLoader::get_message('page', 'main') . ' :</strong> ' . $pagination->display()->render() )); $condition = 'WHERE s.session_time > :time ORDER BY '. OnlineConfig::load()->get_display_order_request() .' LIMIT '. $pagination->get_number_users_per_page() .' OFFSET '. $pagination->get_display_from(); $parameters = array( 'time' => (time() - SessionsConfig::load()->get_active_session_duration()) ); $users = OnlineService::get_online_users($condition, $parameters); foreach ($users as $user) { if ($user->get_id() == AppContext::get_current_user()->get_id()) { $user->set_location_script(OnlineUrlBuilder::home()->absolute()); $user->set_location_title($this->lang['online']); $user->set_last_update(gmdate_format('date_format_long', time())); } $group_color = User::get_group_color($user->get_groups(), $user->get_level(), true); if ($user->get_level() != User::VISITOR_LEVEL) { $this->view->assign_block_vars('users', array( 'U_PROFILE' => UserUrlBuilder::profile($user->get_id())->absolute(), 'U_LOCATION' => $user->get_location_script(), 'U_AVATAR' => $user->get_avatar(), 'PSEUDO' => $user->get_pseudo(), 'LEVEL_CLASS' => UserService::get_level_class($user->get_level()), 'C_GROUP_COLOR' => !empty($group_color), 'GROUP_COLOR' => $group_color, 'TITLE_LOCATION' => $user->get_location_title(), 'LAST_UPDATE' => $user->get_last_update() )); } } return $this->view; } private function init() { $this->lang = LangLoader::get('online_common', 'online'); $this->view = new FileTemplate('online/OnlineHomeController.tpl'); $this->view->add_lang($this->lang); } } ?>
Remplacer le fichier /online/templates/OnlineHomeController.tpl par :
Code TPL :
<div class="module_position"> <div class="module_top_l"></div> <div class="module_top_r"></div> <div class="module_top"> <div class="module_top_title">{@online} </div> </div> <div class="module_contents"> <table class="module_table"> <tr> <th colspan="4"> {@online} </th> </tr> <tr> <td class="row2" style="width:25%"> {L_LOGIN} </td> <td class="row2" style="width:25%"> </td> <td class="row2" style="width:25%"> {@online.location} </td> <td class="row2" style="width:25%"> {@online.last_update} </td> </tr> # START users # <tr> <td class="row3"> <a href="{users.U_PROFILE}" class="{users.LEVEL_CLASS}" # IF users.C_GROUP_COLOR # style="color:{users.GROUP_COLOR}" # ENDIF #>{users.PSEUDO}</a> </td> <td class="row3"> <img src="{users.U_AVATAR}" style="min-width:90px"/> </td> <td class="row3"> <a href="{users.U_LOCATION}">{users.TITLE_LOCATION}</a> </td> <td class="row3"> {users.LAST_UPDATE} </td> </tr> # END users # <tr> <td colspan="8" class="row1"> <span style="float:left;">{PAGINATION}</span> </td> </tr> </table> </div> <div class="module_bottom_l"></div> <div class="module_bottom_r"></div> <div class="module_bottom"></div> </div>
Et cette fois ça fonctionne
patgame Membre non connecté
Booster Missile
-
Booster Missile
- Voir le profil du membre patgame
- Inscrit le : 03/09/2009
- Site internet
- Groupes :
et cette fois ci ne se mettent pas a jours ds la liste gale
http://funny-rockers.fr/user/index.php
j'ai raté un épisode ds le code??
cdlt pat
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie