Accueil
Forum PHPBoost
Personnalisation
Personnalisation fonctionnelle
Date en Anglais au lieu de Francais
Forum PHPBoost
Personnalisation
Personnalisation fonctionnelle
Date en Anglais au lieu de Francais
Forum PHPBoost
• Personnalisation fonctionnelle » [Réglé] Date en Anglais au lieu de Francais So british !!!
Bonjour tout le monde,
Cela fait longtemps que je n'ai pas fait appel à vos talent.
je travail sur mon nouveau thème (qui sera dispo pour tous cette fois-ci ) et je rencontre un problème avec la mise en forme de la date :
dans le module news, j'ai modifié la ligne suivante :
Code PHP :
j'ai donc modifié le 'date_format_short' en 'd M Y' pour afficher la date de cette façon : 5 Février 2012.
Le problème c'est que ce vilain m'affiche la date en anglais : 5 Feb 2012. Ce qui est dérangeant
.
J'ai cherché sur le forum et tout, et j'ai trouvé un truc setlocal, mais cela ne fonctionne pas.
Je suis dans le fichier suivant : "news_interface.class.php"
Code PHP :
Si quelqu'un peut me venir en aide, je le remercie d'avance.
ElenWii
Edité par elenwe Le 06/02/12 à 00h35
Cela fait longtemps que je n'ai pas fait appel à vos talent.
je travail sur mon nouveau thème (qui sera dispo pour tous cette fois-ci ) et je rencontre un problème avec la mise en forme de la date :
dans le module news, j'ai modifié la ligne suivante :
Code PHP :
'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' .gmdate_format('d M Y', $row['timestamp']) : '',
j'ai donc modifié le 'date_format_short' en 'd M Y' pour afficher la date de cette façon : 5 Février 2012.
Le problème c'est que ce vilain m'affiche la date en anglais : 5 Feb 2012. Ce qui est dérangeant
.J'ai cherché sur le forum et tout, et j'ai trouvé un truc setlocal, mais cela ne fonctionne pas.
Je suis dans le fichier suivant : "news_interface.class.php"
Code PHP :
$tpl_news->assign_block_vars('news', array( 'C_IMG' => !empty($row['img']), 'C_ICON' => (!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1), 'C_NEWS_ROW' => $new_row, 'ID' => $row['id'], 'IDCAT' => $row['idcat'], 'CATNAME' => second_parse($row['name']), 'ICON' => second_parse_url($row['icon']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'EXTEND_CONTENTS' => (!empty($row['extend_contents']) ? '<a style="font-size:10px" href="' . PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '.php') . '">[' . $LANG['extend_contents'] . ']</a><br /><br />' : ''), 'IMG' => second_parse_url($row['img']), 'IMG_DESC' => $row['alt'], 'PSEUDO' => $CONFIG_NEWS['display_author'] ? $row['login'] : '', 'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' .gmdate_format('d M Y', $row['timestamp']) : '', 'TOKEN' => $Session->get_token(), 'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($row['nbr_com'], PATH_TO_ROOT . '/news/news' . url('.php?cat=0&id=' . $row['id'] . '&com=0', '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php?com=0'), $row['id'], 'news') : '', 'NEW_ROW' => $new_row, 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_NEWS_LINK' => url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL) ));
Si quelqu'un peut me venir en aide, je le remercie d'avance.
ElenWii
Edité par elenwe Le 06/02/12 à 00h35
Salut,
Le problème dans ce cas là, c'est PHP.
Le seul moyen c'est de faire un tableau avec tous les mois de l'année et faire un autre tableau avec ce qui est généré par PHP.
Ensuite tu utilises str_replace() et c'est bon
ReidLos
Le problème dans ce cas là, c'est PHP.
Le seul moyen c'est de faire un tableau avec tous les mois de l'année et faire un autre tableau avec ce qui est généré par PHP.
Ensuite tu utilises str_replace() et c'est bon

ReidLos
Je te remercie, ReidLos.
Je suis d'un sens rassuré, après 3h à éplucher le code et essayer de comprendre, cela me rassure, ce n'est pas entièrement la faute de ma méconnaissance du PHP.
Donc avec ton astuce ReidLos, j'ai réussi à faire ce que souhaitais.
Pour ceux qui souhaite, voici ce que cela donne :
On déclare nos deux tableaux, avec IMPÉRATIVEMENT, le même nombre de valeur
Code PHP :
On ajoute un petit str_replace(valeur cherchée, valeur de remplacement, chaine de recherche)
Code PHP :
Et cela nous donne pour le mois de Février, un beau 06 Fév 2012.
Merci encore une fois ReidLos,
sujet réglé
Je suis d'un sens rassuré, après 3h à éplucher le code et essayer de comprendre, cela me rassure, ce n'est pas entièrement la faute de ma méconnaissance du PHP.
Donc avec ton astuce ReidLos, j'ai réussi à faire ce que souhaitais.
Pour ceux qui souhaite, voici ce que cela donne :
On déclare nos deux tableaux, avec IMPÉRATIVEMENT, le même nombre de valeur
Code PHP :
$EnglishMonth = array( 'Feb', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Dec'); $FrenchMonth = array( 'Fév', 'Avr', 'Mai', 'Juin', 'Jui', 'Août', 'Sept', 'Déc');
On ajoute un petit str_replace(valeur cherchée, valeur de remplacement, chaine de recherche)
Code PHP :
'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' .str_replace($EnglishMonth, $FrenchMonth, gmdate_format('d M Y', $row['timestamp']))
Et cela nous donne pour le mois de Février, un beau 06 Fév 2012.
Merci encore une fois ReidLos,
sujet réglé
Au plaisir 
ReidLos

ReidLos
Qu'il est bon de lire ce genre de message.
Une personne qui a fait des recherches et testé des solutions, qui n'y arrive pas complétement et pose donc une question claire, précise, dans laquelle il y a de l'information pour comprendre le problème.
Ce qui permet d'amener également une réponse claire et précise.
Problème réglé en l'espace de 2 posts, tout le monde est content
Une personne qui a fait des recherches et testé des solutions, qui n'y arrive pas complétement et pose donc une question claire, précise, dans laquelle il y a de l'information pour comprendre le problème.
Ce qui permet d'amener également une réponse claire et précise.
Problème réglé en l'espace de 2 posts, tout le monde est content
____________________
1/ Avant de poster votre question, faite une recherche sur le forum et/ou le site
2/ Plus votre question sera détaillée, plus les éventuelles réponses seront pertinentes
3/ Plus votre français sera correct, plus vous donnerez envie que l'on vous réponde
1/ Avant de poster votre question, faite une recherche sur le forum et/ou le site
2/ Plus votre question sera détaillée, plus les éventuelles réponses seront pertinentes
3/ Plus votre français sera correct, plus vous donnerez envie que l'on vous réponde
4/ ==> Libérez les Huitres du bassin d'Arcachon <== 
J'aime pas trop déranger nos chers développeurs pour des problèmes basiques, alors j'essaye d'apprendre tous seul
.
j'en profite pour apporter mon soutient (mentale pour l'instant), à toute l'équipe. Après la lecture de quelques posts, j'ai eu un peu peur de l'avenir. J'ai passé une soirée entière à tester tout plein de CMS (Joomla, Concrete, Wordpress, etc...). Soucieux d'assurer l'avenir du site de ma communauté, j'ai beaucoup réflechi au pour et contre de phpboost. Une petite communauté, peu de développeurs, etc... mais au final, voila le fond de ma reflection.
Phpboost est un CMS pas comme les autres. Il est simple, intuitif, facile à prendre en main, il est complet (news/articles/forum), pas besoin d'ajouter des extensions à gogo. Pas beaucoup de monde ? Il y a surtout les meilleurs, un staff toujours soucieux d'apporter des conseils à leur fan.
Verdict, mon nouveau thème sera sur Phpboost v3..... et oui, la v4, on l'attend, mais la v3 est tellement bien que la v4 sera la cerise sur le gâteau (comme dirait mon anglais préféré, the cherry over the cake).
Si je peux, mon prochain thème sera adapté à la v4 lors de sa sortie. Après 4/5 ans d'utilisation (je suis plus très sûr) de ce magnifique CMS, soit il met difficile de lui tourner le dos, soit il est tout simplement génial (ou ptêtre les deux ?).
Longue vie à l’Éléphant, longue vie à la Tornade
Petit question pour mon prochain theme. Pour ceux qui ne savent pas, je ne suis pas friand des modules dans un design, je fais donc beaucoup de refonte des .tpl voir des .php, ce qui implique que mes thèmes ne sont pas facilement adaptable. Néanmoins j'aimerais en faire profiter la communauté et les personnes qui souhaiteraient. Avez-vous quelques idées pour que mes modifications .php passe simplement ?
Have Fun !!
ElenWii
Edité par elenwe Le 06/02/12 à 21h55
.j'en profite pour apporter mon soutient (mentale pour l'instant), à toute l'équipe. Après la lecture de quelques posts, j'ai eu un peu peur de l'avenir. J'ai passé une soirée entière à tester tout plein de CMS (Joomla, Concrete, Wordpress, etc...). Soucieux d'assurer l'avenir du site de ma communauté, j'ai beaucoup réflechi au pour et contre de phpboost. Une petite communauté, peu de développeurs, etc... mais au final, voila le fond de ma reflection.
Phpboost est un CMS pas comme les autres. Il est simple, intuitif, facile à prendre en main, il est complet (news/articles/forum), pas besoin d'ajouter des extensions à gogo. Pas beaucoup de monde ? Il y a surtout les meilleurs, un staff toujours soucieux d'apporter des conseils à leur fan.
Verdict, mon nouveau thème sera sur Phpboost v3..... et oui, la v4, on l'attend, mais la v3 est tellement bien que la v4 sera la cerise sur le gâteau (comme dirait mon anglais préféré, the cherry over the cake).
Si je peux, mon prochain thème sera adapté à la v4 lors de sa sortie. Après 4/5 ans d'utilisation (je suis plus très sûr) de ce magnifique CMS, soit il met difficile de lui tourner le dos, soit il est tout simplement génial (ou ptêtre les deux ?).
Longue vie à l’Éléphant, longue vie à la Tornade
Petit question pour mon prochain theme. Pour ceux qui ne savent pas, je ne suis pas friand des modules dans un design, je fais donc beaucoup de refonte des .tpl voir des .php, ce qui implique que mes thèmes ne sont pas facilement adaptable. Néanmoins j'aimerais en faire profiter la communauté et les personnes qui souhaiteraient. Avez-vous quelques idées pour que mes modifications .php passe simplement ?
Have Fun !!
ElenWii
Edité par elenwe Le 06/02/12 à 21h55
Bonsoir elenwe.
Je tenais à te remercier tout d'abord pour ta contribution (et j'espère ce futur thème
),ainsi que pour l'encouragement que tu portes à l'équipe de PBT, tes messages font vraiment du bien ^^
Je tenais à te remercier tout d'abord pour ta contribution (et j'espère ce futur thème
),ainsi que pour l'encouragement que tu portes à l'équipe de PBT, tes messages font vraiment du bien ^^
Citation:
Tu as un exemple des fichiers PHP que tu souhaites modifier ?
Avez-vous quelques idées pour que mes modifications .php passe simplement ?
Tu as un exemple des fichiers PHP que tu souhaites modifier ?
Voici quelques exemples de modification :
module connect :
Code PHP :
=> Je récupère en plus le pseudo et l'avatar pour l'afficher dans mon module connect
module news :
Code SQL :
Dans le tableau "news", je récupère en plus, le nom de la catégorie, le L_EDIT et L_DELETE, je modifie la date pour un affichage "6 fev 2012"
idem pour le fichier news_interface.classe.php
fichier commentaire "comments.class.php" :
Code PHP :
Je modifie l'avatar pour gerer sa taille fixe.
Et il y aura aussi toutes les modifications pour la ligthbox que j'ajouterais.
module connect :
Code PHP :
<?php /*################################################## * connect_mini.php * ------------------- * begin : December 10, 2007 * copyright : (C) 2007 Viarre Régis * email : crowkait@phpboost.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. * ###################################################*/ if (defined('PHPBOOST') !== true) exit; function connect_mini($position, $block) { global $User, $LANG, $CONFIG_USER, $CONTRIBUTION_PANEL_UNREAD, $ADMINISTRATOR_ALERTS, $Session, $Sql; // Modif ElenWii : global $User, $LANG, $CONFIG_USER, $CONTRIBUTION_PANEL_UNREAD, $ADMINISTRATOR_ALERTS, $Session; $tpl = new Template('connect/connect_mini.tpl'); import('core/menu_service'); MenuService::assign_positions_conditions($tpl, $block); if ($User->check_level(MEMBER_LEVEL)) //Connecté. { //Vaut 0 si l'utilisateur n'a aucune contribution. Est > 0 si on connait le nombre de contributions //Vaut -1 si l'utilisateur a au moins une contribution (mais on ne sait pas combien à cause des recoupements entre les groupes) $contribution_number = 0; //Panneau de contributions, y-a-t'il des contributions que le membre peut lire ? if ($User->check_level(ADMIN_LEVEL)) $contribution_number = $CONTRIBUTION_PANEL_UNREAD['r2']; elseif ($User->check_level(MODERATOR_LEVEL)) $contribution_number = $CONTRIBUTION_PANEL_UNREAD['r1']; //On vérifie les groupes et les levels ou tout simplement si il y en a pour les membres else { //Si tous les membres ont une contribution non lue if ($CONTRIBUTION_PANEL_UNREAD['r0'] > 0) $contribution_number = -1; //On regarde si ce membre en particulier en a une if ($contribution_number == 0) if (!empty($CONTRIBUTION_PANEL_UNREAD['m' . $User->get_attribute('user_id')]) && $CONTRIBUTION_PANEL_UNREAD['m' . $User->get_attribute('user_id')] == 1) $contribution_number = -1; //On regarde dans ses groupes if ($contribution_number == 0) { foreach ($User->get_groups() as $id_group) { if (!empty($CONTRIBUTION_PANEL_UNREAD['g' . $id_group]) && $CONTRIBUTION_PANEL_UNREAD['g' . $id_group] == 1) { $contribution_number = -1; break; } } } } // Ajout ElenWii : $Avatar = $User->get_attribute('avatar') ; $Avatar2 = $User->get_attribute('avatar') ; $noavat = $LANG['no_avatar'] ; if ($Avatar =='') { $Avatar = '<img src="../connect/templates/images/no_avatar.jpg" height="24px" title ="no_avatar" alt ="no_avatar"/>'; $Avatar2 = '<img src="../connect/templates/images/no_avatar.jpg" height="92px" title ="no_avatar" alt ="no_avatar"/>'; } else { $Avatar = '<img src="' .$Avatar. '" height="20px" title ="'.$User->get_attribute('login').'" alt ="'.$User->get_attribute('login').'"/>'; $Avatar2 = '<img src="' .$Avatar2. '" height="92px" title ="'.$User->get_attribute('login').'" alt ="'.$User->get_attribute('login').'"/>'; } $user_LC = $Sql->query("SELECT last_connect FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__); // Fin Ajout ElenWii : import('events/administrator_alert_service'); $tpl->assign_vars(array( // Ajout ElenWii : 'L_PSEUDO' => $User->get_attribute('login'), 'L_AVATAR' => $Avatar, 'L_AVATAR2' => $Avatar2, // Fin Ajout ElenWii : 'C_ADMIN_AUTH' => $User->check_level(ADMIN_LEVEL), 'C_MODERATOR_AUTH' => $User->check_level(MODERATOR_LEVEL), 'C_UNREAD_CONTRIBUTION' => $contribution_number != 0, 'C_KNOWN_NUMBER_OF_UNREAD_CONTRIBUTION' => $contribution_number > 0, 'C_UNREAD_ALERT' => (bool)AdministratorAlertService::get_number_unread_alerts(), 'NUM_UNREAD_CONTRIBUTIONS' => $contribution_number, 'NUMBER_UNREAD_ALERTS' => AdministratorAlertService::get_number_unread_alerts(), 'IMG_PM' => $User->get_attribute('user_pm') > 0 ? 'new_pm.gif' : 'pm_mini.png', 'U_USER_PM' => TPL_PATH_TO_ROOT . '/member/pm' . url('.php?pm=' . $User->get_attribute('user_id'), '-' . $User->get_attribute('user_id') . '.php'), 'U_USER_ID' => url('.php?id=' . $User->get_attribute('user_id') . '&view=1', '-' . $User->get_attribute('user_id') . '.php?view=1'), 'U_DISCONNECT' => HOST . DIR . '/member/member.php?disconnect=true&token=' . $Session->get_token(), 'L_NBR_PM' => ($User->get_attribute('user_pm') > 0 ? ($User->get_attribute('user_pm') . ' ' . (($User->get_attribute('user_pm') > 1) ? $LANG['message_s'] : $LANG['message'])) : $LANG['private_messaging']), 'L_NBR_PM2' => $User->get_attribute('user_pm'), 'L_PROFIL' => $LANG['profile'], 'L_ADMIN_PANEL' => $LANG['admin_panel'], 'L_MODO_PANEL' => $LANG['modo_panel'], 'L_PRIVATE_PROFIL' => $LANG['my_private_profile'], 'L_DISCONNECT' => $LANG['disconnect'], 'L_CONTRIBUTION_PANEL' => $LANG['contribution_panel'] )); } else { $tpl->assign_vars(array( 'C_USER_REGISTER' => (bool)$CONFIG_USER['activ_register'], 'L_REQUIRE_PSEUDO' => $LANG['require_pseudo'], 'L_REQUIRE_PASSWORD' => $LANG['require_password'], 'L_CONNECT' => $LANG['connect'], 'L_PSEUDO' => $LANG['pseudo'], 'L_PASSWORD' => $LANG['password'], 'L_AUTOCONNECT' => $LANG['autoconnect'], 'L_FORGOT_PASS' => $LANG['forget_pass'], 'L_REGISTER' => $LANG['register'], 'U_CONNECT' => (QUERY_STRING != '') ? '?' . str_replace('&', '&', QUERY_STRING) . '&' : '', 'U_REGISTER' => TPL_PATH_TO_ROOT . '/member/register.php' . SID )); } return $tpl->parse(TEMPLATE_STRING_MODE); } ?>
=> Je récupère en plus le pseudo et l'avatar pour l'afficher dans mon module connect
module news :
Code SQL :
<?php /*################################################## * news.php * ------------------- * begin : June 20, 2005 * copyright : (C) 2005 Viarre Régis * email : crowkait@phpboost.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. * ###################################################*/ require_once('../kernel/begin.php'); require_once('../news/news_begin.php'); require_once('../kernel/header.php'); //$idnews, $idcat, $show_archive définies dans news_begin.php $is_admin = $User->check_level(ADMIN_LEVEL); IF (empty($idnews) && empty($idcat)) // Accueil du module de news { import('modules/modules_discovery_service'); $modulesLoader = new ModulesDiscoveryService(); $module_name = 'news'; $module = $modulesLoader->get_module($module_name); IF ($module->has_functionality('get_home_page')) { echo $module->functionality('get_home_page'); require_once('../kernel/footer.php'); exit; } elseif (!$no_alert_on_error) { global $Errorh; $Errorh->handler('Le module <strong>' . $module_name . '</strong> n\'a pas de fonction get_home_page!', E_USER_ERROR, __LINE__, __FILE__); exit; } } elseif (!empty($idnews)) //ON affiche la news correspondant à l'id envoyé. { if (empty($news['id'])) $Errorh->handler('e_unexist_news', E_USER_REDIRECT); import('content/comments'); import('content/syndication/feed'); $tpl_news = new Template('news/news.tpl'); $next_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id > '" . $idnews . "' " . $Sql->limit(0, 1), __LINE__, __FILE__); $previous_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id < '" . $idnews . "' ORDER BY id DESC " . $Sql->limit(0, 1), __LINE__, __FILE__); $tpl_news->assign_vars(array( 'C_IS_ADMIN' => $is_admin, 'C_NEWS_BLOCK' => true, 'C_NEWS_NAVIGATION_LINKS' => true, 'C_PREVIOUS_NEWS' => !empty($previous_news['id']), 'C_NEXT_NEWS' =>!empty($next_news['id']), 'TOKEN' => $Session->get_token(), 'PREVIOUS_NEWS' => $previous_news['title'], 'NEXT_NEWS' => $next_news['title'], 'U_PREVIOUS_NEWS' => url('.php?id=' . $previous_news['id'], '-0-' . $previous_news['id'] . '+' . url_encode_rewrite($previous_news['title']) . '.php'), 'U_NEXT_NEWS' => url('.php?id=' . $next_news['id'], '-0-' . $next_news['id'] . '+' . url_encode_rewrite($next_news['title']) . '.php'), 'L_SYNDICATION' => $LANG['syndication'], 'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'], 'L_ON' => $LANG['ON'], 'L_DELETE' => $LANG['DELETE'], 'L_EDIT' => $LANG['edit'], )); $EnglishMonth = array( 'Feb', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Dec'); $FrenchMonth = array( 'Fév', 'Avr', 'Mai', 'Juin', 'Jui', 'Août', 'Sept', 'Déc'); $tpl_news->assign_block_vars('news', array( 'C_IMG' => !empty($news['img']), 'C_ICON' => (!empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1), 'ID' => $news['id'], 'IDCAT' => $news['idcat'], 'CATNAME' => $news['name'], 'ICON' => ((!empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '<a href="' . PATH_TO_ROOT . '/news/news' . url('.php?cat=' . $news['idcat'], '-' . $news['idcat'] . '.php') . '"><img class="valign_middle" src="' . $news['icon'] . '" alt="" height="40px;"/></a>' : ''), 'TITLE' => $news['title'], 'CONTENTS' => second_parse($news['contents']), 'EXTEND_CONTENTS' => second_parse($news['extend_contents']) . '<br /><br />', 'IMG' => second_parse_url($news['img']), 'IMG_DESC' => $news['alt'], 'L_DELETE' => $LANG['DELETE'], 'L_EDIT' => $LANG['edit'], 'PSEUDO' => $CONFIG_NEWS['display_author'] ? $news['login'] : '', 'DATE' => $CONFIG_NEWS['display_date'] ? str_replace($EnglishMonth, $FrenchMonth, gmdate_format('d M Y', $news['timestamp'])) : '', 'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($news['nbr_com'], '../news/news' . url('.php?cat=0&id=' . $idnews . '&com=0', '-0-' . $idnews . '+' . url_encode_rewrite($news['title']) . '.php?com=0'), $idnews, 'news') : '', 'U_USER_ID' => url('.php?id=' . $news['user_id'], '-' . $news['user_id'] . '.php'), 'U_NEWS_LINK' => url('.php?id=' . $news['id'], '-0-' . $news['id'] . '+' . url_encode_rewrite($news['title']) . '.php'), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL) )); } elseif (!empty($idcat)) { $tpl_news = new Template('news/news_cat.tpl'); $cat = $Sql->query_array(PREFIX . 'news_cat', 'id', 'name', 'icon', "WHERE id = '" . $idcat . "'", __LINE__, __FILE__); if (empty($cat['id'])) $Errorh->handler('error_unexist_cat', E_USER_REDIRECT); $tpl_news->assign_vars(array( 'C_IS_ADMIN' => $is_admin, 'C_NEWS_LINK' => true, 'CAT_NAME' => $cat['name'], 'IDCAT' => $cat['id'], 'L_EDIT' => $LANG['edit'], 'L_CATEGORY' => $LANG['category'] )); $result = $Sql->query_while("SELECT n.id, n.title, n.nbr_com, nc.id AS idcat, nc.icon FROM " . PREFIX . "news n LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat WHERE n.visible = 1 AND n.idcat = '" . $idcat . "' ORDER BY n.timestamp DESC", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $tpl_news->assign_block_vars('list', array( 'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '<a href="news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . '"><img class="valign_middle" src="' . $row['icon'] . '" alt="" height="40px" /></a>' : ''), 'TITLE' => $row['title'], 'COM' => $row['nbr_com'], 'U_NEWS' => 'news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php') )); } } //Affichage commentaires. if (isset($_GET['com']) && $idnews > 0) { $tpl_news->assign_vars(array( 'COMMENTS' => display_comments('news', $idnews, url('news.php?id=' . $idnews . '&com=%s', 'news-0-' . $idnews . '.php?com=%s')) )); } $tpl_news->parse(); require_once('../kernel/footer.php'); ?>
Dans le tableau "news", je récupère en plus, le nom de la catégorie, le L_EDIT et L_DELETE, je modifie la date pour un affichage "6 fev 2012"
idem pour le fichier news_interface.classe.php
fichier commentaire "comments.class.php" :
Code PHP :
<?php define('INTEGRATED_IN_ENVIRONMENT',true); define('POP_UP_WINDOW',false); define('KERNEL_SCRIPT',true); class Comments { ## Public Methods ## function Comments($script,$idprov,$vars,$module_folder='',$is_kernel_script=false) { $this->module_folder=!empty($module_folder)?strprotect($module_folder):strprotect($script); list($this->script,$this->idprov,$this->vars,$this->path)=array(strprotect($script),numeric($idprov),$vars,PATH_TO_ROOT.'/'.$this->module_folder.'/'); $this->is_kernel_script=$is_kernel_script; } function add($contents,$login) { global $Sql,$User; $Sql->query_inject("INSERT INTO ".DB_TABLE_COM." (idprov, login, user_id, contents, timestamp, script, path, user_ip) VALUES('".$this->idprov."', '".$login."', '".$User->get_attribute('user_id')."', '".$contents."', '".time()."', '".$this->script."', '".PATH_TO_ROOT.strprotect(str_replace(DIR,'',SCRIPT).'?'.QUERY_STRING)."', '".USER_IP."')",__LINE__,__FILE__); $idcom=$Sql->insert_id("SELECT MAX(idcom) FROM ".DB_TABLE_COM); $Sql->query_inject("UPDATE ".PREFIX.$this->sql_table." SET nbr_com = nbr_com + 1 WHERE id = '".$this->idprov."'",__LINE__,__FILE__); return $idcom; } function update($contents,$login) { global $Sql; $Sql->query_inject("UPDATE ".DB_TABLE_COM." SET contents = '".$contents."', login = '".$login."' WHERE idcom = '".$this->idcom."' AND idprov = '".$this->idprov."' AND script = '".$this->script."'",__LINE__,__FILE__); } function del() { global $Sql; $lastid_com=$Sql->query("SELECT idcom FROM ".PREFIX."com WHERE idcom < '".$this->idcom."' AND script = '".$this->script."' AND idprov = '".$this->idprov."' ORDER BY idcom DESC ".$Sql->limit(0,1),__LINE__,__FILE__); $resource=$Sql->query_inject("DELETE FROM ".DB_TABLE_COM." WHERE idcom = '".$this->idcom."' AND script = '".$this->script."' AND idprov = '".$this->idprov."'",__LINE__,__FILE__); if($Sql->affected_rows($resource)>0) { $Sql->query_inject("UPDATE ".PREFIX.$this->sql_table." SET nbr_com= nbr_com - 1 WHERE id = '".$this->idprov."'",__LINE__,__FILE__); } return $lastid_com; } function delete_all($idprov) { global $Sql; $Sql->query_inject("DELETE FROM ".DB_TABLE_COM." WHERE idprov = '".$idprov."' AND script = '".$this->script."'",__LINE__,__FILE__); } function lock($lock) { global $Sql; $Sql->query_inject("UPDATE ".PREFIX.$this->sql_table." SET lock_com = '".$lock."' WHERE id = '".$this->idprov."'",__LINE__,__FILE__); } function is_loaded() { global $Errorh; if(empty($this->sql_table)) $Errorh->handler('e_unexist_page',E_USER_REDIRECT); return(!empty($this->script)&&!empty($this->idprov)&&!empty($this->vars)); } function set_arg($idcom,$path='') { if(!empty($path)) $this->path=$path; $this->idcom=(int)max($idcom,0); if(!$this->is_kernel_script) list($this->sql_table,$this->nbr_com,$this->lock_com)=$this->_get_info_module(); else list($this->sql_table,$this->nbr_com,$this->lock_com)=$this->_get_info_kernel_script(); } function get_attribute($varname) { return $this->$varname; } function display($integrated_in_environment=INTEGRATED_IN_ENVIRONMENT,$Template=false,$page_path_to_root='') { global $Cache,$User,$Errorh,$Sql,$LANG,$CONFIG,$CONFIG_USER,$CONFIG_COM,$_array_rank,$_array_groups_auth,$Session; if($integrated_in_environment) { $idcom_get=retrieve(GET,'com',0); $idcom_post=retrieve(POST,'idcom',0); $idcom=$idcom_post>0?$idcom_post:$idcom_get; $this->set_arg($idcom); } $vars_simple=sprintf($this->vars,0); $delcom=retrieve(GET,'delcom',0); $editcom=retrieve(GET,'editcom',0); $updatecom=retrieve(GET,'updatecom',false); $path_redirect=$this->path.sprintf(str_replace('&','&',$this->vars),0).((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:''); if(!is_object($Template)|| strtolower(get_class($Template))!='template') $Template=new Template('framework/content/com.tpl'); if($this->is_loaded()) { $Cache->load('com'); import('util/captcha'); $captcha=new Captcha(); $captcha->set_difficulty($CONFIG_COM['com_verif_code_difficulty']); ###########################Insertion############################## if(retrieve(POST,'valid_com',false)&&!$updatecom) { if($User->get_attribute('user_readonly')>time()) $Errorh->handler('e_auth',E_USER_REDIRECT); $login=retrieve(POST,'login',''); $contents=retrieve(POST,'contents','',TSTRING_UNCHANGE); if(!empty($login)&&!empty($contents)) { if($this->lock_com>=1&&!$User->check_level(MODO_LEVEL)) redirect($path_redirect); if($User->check_level($CONFIG_COM['com_auth'])) { $check_time=($User->get_attribute('user_id')!==-1&&$CONFIG['anti_flood']==1)?$Sql->query("SELECT MAX(timestamp) as timestamp FROM ".DB_TABLE_COM." WHERE user_id = '".$User->get_attribute('user_id')."'",__LINE__,__FILE__):''; if(!empty($check_time)&&!$User->check_max_value(AUTH_FLOOD)) { if($check_time>=(time()-$CONFIG['delay_flood'])) redirect($path_redirect.'&errorh=flood#errorh'); } if($CONFIG_COM['com_verif_code']&&!$captcha->is_valid()) { redirect($path_redirect.'&errorh=verif#errorh'); } $contents=strparse($contents,$CONFIG_COM['forbidden_tags']); if(!check_nbr_links($login,0)) redirect($path_redirect.'&errorh=l_pseudo#errorh'); if(!check_nbr_links($contents,$CONFIG_COM['max_link'])) redirect($path_redirect.'&errorh=l_flood#errorh'); $last_idcom=$this->add($contents,$login); redirect($path_redirect.'#m'.$last_idcom); } else redirect($path_redirect.'&errorh=auth#errorh'); } else redirect($path_redirect.'&errorh=incomplete#errorh'); } elseif($updatecom || $delcom>0 || $editcom>0) { if($User->get_attribute('user_readonly')>time()) $Errorh->handler('e_auth',E_USER_REDIRECT); $row=$Sql->query_array(DB_TABLE_COM,'*',"WHERE idcom = '".$this->idcom."' AND idprov = '".$this->idprov."' AND script = '".$this->script."'",__LINE__,__FILE__); $row['user_id']=(int)$row['user_id']; if($this->idcom!=0&&($User->check_level(MODO_LEVEL)||($row['user_id']===$User->get_attribute('user_id')&&$User->get_attribute('user_id')!==-1))) { if($delcom>0) { $Session->csrf_get_protect(); $lastid_com=$this->del(); $lastid_com=!empty($lastid_com)?'#m'.$lastid_com:''; redirect($path_redirect.$lastid_com); } elseif($editcom>0) { $Template->assign_vars(array( 'CURRENT_PAGE_COM'=>$integrated_in_environment, 'POPUP_PAGE_COM'=>!$integrated_in_environment, 'AUTH_POST_COM'=>true )); if($row['user_id']!==-1) $Template->assign_vars(array( 'C_HIDDEN_COM'=>true, 'LOGIN'=>$User->get_attribute('login') )); else $Template->assign_vars(array( 'C_VISIBLE_COM'=>true, 'LOGIN'=>$row['login'] )); $Template->assign_vars(array( 'IDPROV'=>$row['idprov'], 'IDCOM'=>$row['idcom'], 'SCRIPT'=>$this->script, 'CONTENTS'=>unparse($row['contents']), 'DATE'=>gmdate_format('date_format',$row['timestamp']), 'THEME'=>get_utheme(), 'KERNEL_EDITOR'=>display_editor($this->script.'contents',$CONFIG_COM['forbidden_tags']), 'L_LANGUAGE'=>substr(get_ulang(),0,2), 'L_EDIT_COMMENT'=>$LANG['edit_comment'], 'L_REQUIRE_LOGIN'=>$LANG['require_pseudo'], 'L_REQUIRE_TEXT'=>$LANG['require_text'], 'L_DELETE_MESSAGE'=>$LANG['alert_delete_msg'], 'L_LOGIN'=>$LANG['pseudo'], 'L_MESSAGE'=>$LANG['message'], 'L_RESET'=>$LANG['reset'], 'L_PREVIEW'=>$LANG['preview'], 'L_PREVIEW'=>$LANG['preview'], 'L_SUBMIT'=>$LANG['update'], 'U_ACTION'=>$this->path.sprintf($this->vars,$this->idcom).'&token='.$Session->get_token().'&updatecom=1'.((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'') )); } elseif($updatecom) { $contents=retrieve(POST,'contents','',TSTRING_UNCHANGE); $login=retrieve(POST,'login',''); if(!empty($contents)&&!empty($login)) { $contents=strparse($contents,$CONFIG_COM['forbidden_tags']); if(!check_nbr_links($contents,$CONFIG_COM['max_link'])) redirect($path_redirect.'&errorh=l_flood#errorh'); $this->update($contents,$login); redirect($path_redirect.'#m'.$this->idcom); } else redirect($path_redirect.'&errorh=incomplete#errorh'); } else redirect($path_redirect.'&errorh=incomplete#errorh'); } else $Errorh->handler('e_auth',E_USER_REDIRECT); } elseif(isset($_GET['lock'])&&$User->check_level(MODO_LEVEL)) { $Session->csrf_get_protect(); if($User->check_level(MODO_LEVEL)) { $lock=retrieve(GET,'lock',0); $this->lock($lock); } redirect($path_redirect.'#anchor_'.$this->script); } else { ###########################Affichage############################## $get_quote=retrieve(GET,'quote',0); $contents=''; if($get_quote>0) { $info_com=$Sql->query_array(DB_TABLE_COM,'login','contents',"WHERE script = '".$this->script."' AND idprov = '".$this->idprov."' AND idcom = '".$get_quote."'",__LINE__,__FILE__); $contents='[quote='.$info_com['login'].']'.$info_com['contents'].'[/quote]'; } import('util/pagination'); $pagination=new Pagination(); $Template->assign_vars(array( 'ERROR_HANDLER'=>'', 'CURRENT_PAGE_COM'=>$integrated_in_environment, 'POPUP_PAGE_COM'=>!$integrated_in_environment )); if($User->check_level(MODO_LEVEL)) { $Template->assign_vars(array( 'COM_LOCK'=>true, 'IMG'=>($this->lock_com>=1)?'unlock':'lock', 'L_LOCK'=>($this->lock_com>=1)?$LANG['unlock']:$LANG['lock'], 'U_LOCK'=>$this->path.(($this->lock_com>=1)?$vars_simple.'&lock=0&token='.$Session->get_token():$vars_simple.'&lock=1&token='.$Session->get_token()).((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'') )); } $get_error=!empty($_GET['errorh'])?trim($_GET['errorh']):''; $errno=E_USER_NOTICE; switch($get_error) { case 'auth': $errstr=$LANG['e_unauthorized']; $errno=E_USER_WARNING; break; case 'verif': $errstr=$LANG['e_incorrect_verif_code']; $errno=E_USER_WARNING; break; case 'l_flood': $errstr=sprintf($LANG['e_l_flood'],$CONFIG_COM['max_link']); break; case 'l_pseudo': $errstr=$LANG['e_link_pseudo']; break; case 'flood': $errstr=$LANG['e_flood']; break; case 'incomplete': $errstr=$LANG['e_incomplete']; break; default: $errstr=''; } $Errorh->set_template($Template); if(!empty($errstr)) { $Template->assign_vars(array( 'ERROR_HANDLER'=>$Errorh->display($errstr,E_USER_NOTICE) )); } if(!$this->lock_com || $User->check_level(MODO_LEVEL)) { if($captcha->is_available()&&$CONFIG_COM['com_verif_code']) { $Template->assign_vars(array( 'C_VERIF_CODE'=>true, 'VERIF_CODE'=>$captcha->display_form(), 'L_REQUIRE_VERIF_CODE'=>$captcha->js_require() )); } if($User->check_level($CONFIG_COM['com_auth'])) { $Template->assign_vars(array( 'AUTH_POST_COM'=>true )); } else { $Template->assign_vars(array( 'ERROR_HANDLER'=>$Errorh->display($LANG['e_unauthorized'],E_USER_NOTICE) )); } if($User->get_attribute('user_id')!==-1) { $Template->assign_vars(array( 'C_HIDDEN_COM'=>true, 'LOGIN'=>$User->get_attribute('login') )); } else { $Template->assign_vars(array( 'C_VISIBLE_COM'=>true, 'LOGIN'=>$LANG['guest'] )); } } else { $Template->assign_vars(array( 'ERROR_HANDLER'=>$Errorh->display($LANG['com_locked'],E_USER_NOTICE) )); } $get_pos=strpos($_SERVER['QUERY_STRING'],'&pc'); if($get_pos) $get_page=substr($_SERVER['QUERY_STRING'],0,$get_pos).'&pc'; else $get_page=$_SERVER['QUERY_STRING'].'&pc'; $is_modo=$User->check_level(MODO_LEVEL); $Template->assign_vars(array( 'C_COM_DISPLAY'=>$this->get_attribute('nbr_com')>0?true:false, 'C_IS_MODERATOR'=>$is_modo, 'PAGINATION_COM'=>$pagination->display($this->path.$vars_simple.'&pc=%d#anchor_'.$this->script,$this->nbr_com,'pc',$CONFIG_COM['com_max'],3), 'LANG'=>get_ulang(), 'IDCOM'=>'', 'IDPROV'=>$this->idprov, 'SCRIPT'=>$this->script, 'PATH'=>SCRIPT, 'UPDATE'=>($integrated_in_environment==true)?SID:'', 'VAR'=>$vars_simple, 'KERNEL_EDITOR'=>display_editor($this->script.'contents',$CONFIG_COM['forbidden_tags']), 'C_BBCODE_TINYMCE_MODE'=>$User->get_attribute('user_editor')=='tinymce', 'L_XML_LANGUAGE'=>$LANG['xml_lang'], 'L_TITLE'=>($CONFIG['com_popup']==0 || $integrated_in_environment===true)?$LANG['title_com']:'', 'THEME'=>get_utheme(), 'CONTENTS'=>unparse($contents), 'L_REQUIRE_LOGIN'=>$LANG['require_pseudo'], 'L_REQUIRE_TEXT'=>$LANG['require_text'], 'L_VERIF_CODE'=>$LANG['verif_code'], 'L_DELETE_MESSAGE'=>$LANG['alert_delete_msg'], 'L_ADD_COMMENT'=>$LANG['add_comment'], 'L_PUNISHMENT_MANAGEMENT'=>$LANG['punishment_management'], 'L_WARNING_MANAGEMENT'=>$LANG['warning_management'], 'L_LOGIN'=>$LANG['pseudo'], 'L_MESSAGE'=>$LANG['message'], 'L_QUOTE'=>$LANG['quote'], 'L_EDIT'=>"Editer", 'L_DELETE'=>"Supprimer", 'L_RESET'=>$LANG['reset'], 'L_PREVIEW'=>$LANG['preview'], 'L_SUBMIT'=>$LANG['submit'], 'U_ACTION'=>$this->path.sprintf($this->vars,$this->idcom).((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'').'&token='.$Session->get_token() )); $array_ranks=array(-1=>$LANG['guest'],0=>$LANG['member'],1=>$LANG['modo'],2=>$LANG['admin']); $Cache->load('ranks'); $j=0; $result=$Sql->query_while("SELECT c.idprov, c.idcom, c.login, c.timestamp, m.user_id, m.login as mlogin, m.level, m.user_mail, m.user_show_mail, m.timestamp AS registered, m.user_avatar, m.user_msg, m.user_local, m.user_web, m.user_sex, m.user_msn, m.user_yahoo, m.user_sign, m.user_warning, m.user_ban, m.user_groups, s.user_id AS connect, c.contents FROM ".DB_TABLE_COM." c LEFT JOIN ".DB_TABLE_MEMBER." m ON m.user_id = c.user_id LEFT JOIN ".DB_TABLE_SESSIONS." s ON s.user_id = c.user_id AND s.session_time > '".(time()-$CONFIG['site_session_invit'])."' WHERE c.script = '".$this->script."' AND c.idprov = '".$this->idprov."' GROUP BY c.idcom ORDER BY c.timestamp DESC ".$Sql->limit($pagination->get_first_msg($CONFIG_COM['com_max'],'pc'),$CONFIG_COM['com_max']),__LINE__,__FILE__); while($row=$Sql->fetch_assoc($result)) { list($edit,$del)=array(false,false); $is_guest=empty($row['user_id']); if($is_modo ||($row['user_id']==$User->get_attribute('user_id')&&$User->get_attribute('user_id')!==-1)) { list($edit,$del)=array(true,true); } if(!$is_guest) $com_pseudo='<a class="msg_link_pseudo" href="'.PATH_TO_ROOT.'/member/member'.url('.php?id='.$row['user_id'],'-'.$row['user_id'].'.php').'" title="'.$row['mlogin'].'"><span style="font-weight: bold;">'.wordwrap_html($row['mlogin'],13).'</span></a>'; else $com_pseudo='<span style="font-style:italic;">'.(!empty($row['login'])?wordwrap_html($row['login'],13):$LANG['guest']).'</span>'; $user_rank=($row['level']==='0')?$LANG['member']:$LANG['guest']; $user_group=$user_rank; $user_rank_icon=''; if($row['level']==='2') { $user_rank=$_array_rank[-2][0]; $user_group=$user_rank; $user_rank_icon=$_array_rank[-2][1]; } elseif($row['level']==='1') { $user_rank=$_array_rank[-1][0]; $user_group=$user_rank; $user_rank_icon=$_array_rank[-1][1]; } else { foreach($_array_rank as $msg=>$ranks_info) { if($msg>=0&&$msg<=$row['user_msg']) { $user_rank=$ranks_info[0]; $user_rank_icon=$ranks_info[1]; break; } } } $user_assoc_img=!empty($user_rank_icon)?'<img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/ranks/'.$user_rank_icon.'" alt="" />':''; if(!empty($row['user_groups'])&&$_array_groups_auth) { $user_groups=''; $array_user_groups=explode('|',$row['user_groups']); foreach($_array_groups_auth as $idgroup=>$array_group_info) { if(is_numeric(array_search($idgroup,$array_user_groups))) $user_groups.=!empty($array_group_info['img'])?'<img src="'.PATH_TO_ROOT.'/images/group/'.$array_group_info['img'].'" alt="'.$array_group_info['name'].'" title="'.$array_group_info['name'].'"/><br />':$LANG['group'].': '.$array_group_info['name']; } } else $user_groups=$LANG['group'].': '.$user_group; $user_online=!empty($row['connect'])?'online':'offline'; if(empty($row['user_avatar'])) $user_avatar=($CONFIG_USER['activ_avatar']=='1'&&!empty($CONFIG_USER['avatar_url']))?'<img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.$CONFIG_USER['avatar_url'].'" alt="" height="90px" />':''; else $user_avatar='<img src="'.$row['user_avatar'].'" alt="" height="90px" />'; $user_sex=''; if($row['user_sex']==1) $user_sex=$LANG['sex'].': <img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/man.png" alt="" /><br />'; elseif($row['user_sex']==2) $user_sex=$LANG['sex'].': <img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/woman.png" alt="" /><br />'; $user_msg=($row['user_msg']>1)?$LANG['message_s'].': '.$row['user_msg']:$LANG['message'].': '.$row['user_msg']; if(!empty($row['user_local'])) { $user_local=$LANG['place'].': '.$row['user_local']; $user_local=$user_local>15?substr_html($user_local,0,15).'...<br />':$user_local.'<br />'; } else $user_local=''; $contents=ucfirst(second_parse($row['contents'])); if(!$integrated_in_environment&&!empty($page_path_to_root)) $contents=str_replace('"'.$page_path_to_root.'/','"'.PATH_TO_ROOT.'/',$contents); $Template->assign_block_vars('com_list',array( 'ID'=>$row['idcom'], 'CONTENTS'=>$contents, 'DATE'=>$LANG['on'].': '.gmdate_format('date_format',$row['timestamp']), 'CLASS_COLOR'=>($j%2==0)?'':2, 'USER_ONLINE'=>'<img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.$user_online.'.png" alt="" class="valign_middle" />', 'USER_PSEUDO'=>$com_pseudo, 'USER_RANK'=>(($row['user_warning']<'100' ||(time()-$row['user_ban'])<0)?$user_rank:$LANG['banned']), 'USER_IMG_ASSOC'=>$user_assoc_img, 'USER_AVATAR'=>$user_avatar, 'USER_GROUP'=>$user_groups, 'USER_DATE'=>!$is_guest?$LANG['registered_on'].': '.gmdate_format('date_format_short',$row['registered']):'', 'USER_SEX'=>$user_sex, 'USER_MSG'=>!$is_guest?$user_msg:'', 'USER_LOCAL'=>$user_local, 'USER_MAIL'=>(!empty($row['user_mail'])&&($row['user_show_mail']=='1'))?'<a href="mailto:'.$row['user_mail'].'"><img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.get_ulang().'/email.png" alt="'.$row['user_mail'].'" title="'.$row['user_mail'].'" /></a>':'', 'USER_MSN'=>!empty($row['user_msn'])?'<a href="mailto:'.$row['user_msn'].'"><img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.get_ulang().'/msn.png" alt="'.$row['user_msn'].'" title="'.$row['user_msn'].'" /></a>':'', 'USER_YAHOO'=>!empty($row['user_yahoo'])?'<a href="mailto:'.$row['user_yahoo'].'"><img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.get_ulang().'/yahoo.png" alt="'.$row['user_yahoo'].'" title="'.$row['user_yahoo'].'" /></a>':'', 'USER_SIGN'=>!empty($row['user_sign'])?'____________________<br />'.second_parse($row['user_sign']):'', 'USER_WEB'=>!empty($row['user_web'])?'<a href="'.$row['user_web'].'"><img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.get_ulang().'/user_web.png" alt="'.$row['user_web'].'" title="'.$row['user_yahoo'].'" /></a>':'', 'USER_WARNING'=>(!empty($row['user_warning'])?$row['user_warning']:'0'), 'C_COM_MSG_EDIT'=>$del, 'C_COM_MSG_DEL'=>$edit, 'U_COM_EDIT'=>$this->path.sprintf($this->vars,$row['idcom']).'&editcom=1'.((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'').'#anchor_'.$this->script, 'U_COM_DEL'=>$this->path.sprintf($this->vars,$row['idcom']).'&token='.$Session->get_token().'&delcom=1'.((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'').'#anchor_'.$this->script, 'U_COM_WARNING'=>($is_modo&&!$is_guest)?PATH_TO_ROOT.'/member/moderation_panel'.url('.php?action=warning&id='.$row['user_id'].((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'')).'" title="'.$LANG['warning_management']:'', 'U_COM_PUNISHEMENT'=>($is_modo&&!$is_guest)?PATH_TO_ROOT.'/member/moderation_panel'.url('.php?action=punish&id='.$row['user_id'].((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'')).'" title="'.$LANG['punishment_management']:'', 'U_USER_PM'=>!$is_guest?'<a href="'.PATH_TO_ROOT.'/member/pm'.url('.php?pm='.$row['user_id'],'-'.$row['user_id'].'.php').'"><img src="'.PATH_TO_ROOT.'/templates/'.get_utheme().'/images/'.get_ulang().'/pm.png" alt="" /></a>':'', 'U_ANCHOR'=>$this->path.$vars_simple.((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'').'#m'.$row['idcom'], 'U_QUOTE'=>$this->path.sprintf($this->vars,$row['idcom']).'&quote='.$row['idcom'].((!empty($page_path_to_root)&&!$integrated_in_environment)?'&path_to_root='.$page_path_to_root:'').'#anchor_'.$this->script )); $j++; } $Sql->query_close($result); } return $Template->parse(TEMPLATE_STRING_MODE); } else return 'error : class Comments loaded uncorrectly'; } function com_display_link($nbr_com,$path,$idprov,$script,$options=0) { global $CONFIG,$LANG; $link=''; if ($nbr_com>1) { $l_com=$nbr_com.' '.$LANG['com_s']; } else { $l_com=!empty($nbr_com)?$nbr_com.' '.$LANG['com']:$LANG['post_com']; } $link_pop="javascript:popup('".HOST.DIR.url('/kernel/framework/ajax/pop_up_comments.php?com='.$idprov.$script)."', '".$script."')"; $link_current=$path.'#anchor_'.$script; $link.='<a class="com" href="'.(($CONFIG['com_popup']=='0')?$link_current:$link_pop).'">'.$l_com.'</a>'; return $link; } ## Private Methods ## function _get_info_module() { global $Sql,$CONFIG; $info_module=load_ini_file(PATH_TO_ROOT.'/'.$this->module_folder.'/lang/',get_ulang()); $check_script=false; if(isset($info_module['com'])) { if($info_module['com']==$this->script) { $info_sql_module=$Sql->query_array(PREFIX.strprotect($info_module['com']),"id","nbr_com","lock_com","WHERE id = '".$this->idprov."'",__LINE__,__FILE__); if($info_sql_module['id']==$this->idprov) $check_script=true; } } return $check_script?array(strprotect($info_module['com']),$info_sql_module['nbr_com'],(bool)$info_sql_module['lock_com']):array('',0,0); } function _get_info_kernel_script() { global $Sql,$CONFIG; $row_infos=$Sql->query_array(PREFIX.$this->script,"id","nbr_com","lock_com","WHERE id = '".$this->idprov."'",__LINE__,__FILE__); return array($this->script,$row_infos['nbr_com'],(bool)$row_infos['lock_com']); } ## Private attributes ## var $script=''; var $idprov=0; var $idcom=0; var $path=''; var $vars=''; var $module_folder=''; var $sql_table=''; var $nbr_com=0; var $lock_com=0; var $is_kernel_script=false; } ?>
Je modifie l'avatar pour gerer sa taille fixe.
Et il y aura aussi toutes les modifications pour la ligthbox que j'ajouterais.
Peux tu plutôt me donner des diff ? Les lignes avec les rajouts ou modification ?
Je vais faire une comparaison de fichier lorsque j'aurai tout fini, on regardera la compatibilité à ce moment là. Je voudrais pas rater des choses
• Personnalisation fonctionnelle » [Réglé] Date en Anglais au lieu de Francais So british !!!
1 Utilisateur en ligne :: 0 Administrateur, 0 Modérateur, 0 Membre et 1 Visiteur
Utilisateur en ligne: Aucun membre connecté
Utilisateur en ligne: Aucun membre connecté
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie





PHPBoost

Support
Téléchargements
Développement
Communauté
















