From 6ce5dee4a8ab767a1a8606eee566d1ae94441275 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Tue, 27 Feb 2007 17:29:48 +0000 Subject: [PATCH] Add a new special tip to announce the upgrade of the site git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1527 839d8a87-29fc-0310-9880-83ba4fa771e5 --- include/xorg/session.inc.php | 2 +- modules/events.php | 20 ++++++++++++++++++++ modules/profile.php | 1 + templates/include/tips.tpl | 8 ++++++-- upgrade/0.9.14/02_auth_user_quick.tpl | 3 +++ 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 upgrade/0.9.14/02_auth_user_quick.tpl diff --git a/include/xorg/session.inc.php b/include/xorg/session.inc.php index 9669564..a5383b3 100644 --- a/include/xorg/session.inc.php +++ b/include/xorg/session.inc.php @@ -225,7 +225,7 @@ function start_connexion ($uid, $identified) SELECT u.user_id AS uid, prenom, nom, perms, promo, matricule, password, FIND_IN_SET('femme', u.flags) AS femme, UNIX_TIMESTAMP(s.start) AS lastlogin, s.host, a.alias AS forlife, a2.alias AS bestalias, q.core_mail_fmt AS mail_fmt, UNIX_TIMESTAMP(q.banana_last) AS banana_last, q.watch_last, q.core_rss_hash, - FIND_IN_SET('watch', u.flags) AS watch_account + FIND_IN_SET('watch', u.flags) AS watch_account, q.last_version FROM auth_user_md5 AS u INNER JOIN auth_user_quick AS q USING(user_id) INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type='a_vie') diff --git a/modules/events.php b/modules/events.php index 3601aef..96885f8 100644 --- a/modules/events.php +++ b/modules/events.php @@ -37,6 +37,26 @@ class EventsModule extends PLModule function get_tips($exclude = null) { + global $globals; + // Add a new special tip when changing plat/al version + if ($globals->version != S::v('last_version') && is_null($exclude)) { + XDB::execute('UPDATE auth_user_quick + SET last_version = {?} + WHERE user_id = {?}', + $globals->version, S::i('uid')); + return array('id' => 0, + 'titre' => 'Bienvenue sur la nouvelle version du site !', + 'text' => 'Le site a été mis à jour depuis ta dernière visite vers la version ' . $globals->version + . '. Nous t\'invitons à en découvrir les nouveautés en te rendant sur ' + . 'nos forums ou en consultant ' + . 'la liste exhaustive des modifications', + 'priorite' => 255, + 'promo_min' => 0, + 'promo_max' => 0, + 'state' => 'active', + 'special' => true); + } + $exclude = is_null($exclude) ? '' : ' AND id != ' . $exclude . ' '; $priority = rand(0, 510); do { diff --git a/modules/profile.php b/modules/profile.php index 75ea8a3..fccc738 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -259,6 +259,7 @@ class ProfileModule extends PLModule $page->assign('virtualalias', $res->fetchOneCell()); $page->addJsLink('close_on_esc.js'); + header('Last-Modified: ' . date('r', strtotime($user['date']))); } function handler_p_edit(&$page, $opened_tab = 'general') diff --git a/templates/include/tips.tpl b/templates/include/tips.tpl index 43b8b3a..27b2ccf 100644 --- a/templates/include/tips.tpl +++ b/templates/include/tips.tpl @@ -24,9 +24,13 @@ {if $full}
{/if} - {icon name=lightbulb}Astuce : {$tips.titre}      + {icon name=lightbulb}{if !$tips.special} + Astuce : {$tips.titre} + {else} + {$tips.titre} + {/if} {if !$nochange} - +       {icon name=resultset_next title="Astuce suivante"} {/if} diff --git a/upgrade/0.9.14/02_auth_user_quick.tpl b/upgrade/0.9.14/02_auth_user_quick.tpl new file mode 100644 index 0000000..b7bd154 --- /dev/null +++ b/upgrade/0.9.14/02_auth_user_quick.tpl @@ -0,0 +1,3 @@ +alter table auth_user_quick add column last_version varchar(16) not null default '0.9.13'; + +# vim:set syntax=mysql: -- 2.1.4