New:
+ * Banana:
+ - Show poster photo -FRU
+
* Core:
- Auto-redirect HTML pages to HTTPS -FRU
}
}
+function hook_hasXFace($headers)
+{
+ return isset($headers['x-org-id']) || isset($headers['x-org-mail']);
+}
+
+function hook_getXFace($headers)
+{
+ $login = @$headers['x-org-id'];
+ if (!$login) {
+ @list($login, ) = explode('@', $headers['x-org-mail']);
+ }
+ if (!$login) {
+ return false;
+ }
+ if (isset($headers['x-face'])) {
+ $res = XDB::query("SELECT p.uid
+ FROM forums.profils AS p
+ INNER JOIN aliases AS a ON (p.uid = a.id)
+ WHERE FIND_IN_SET('xface', p.flags) AND a.alias = {?}",
+ $login);
+ if ($res->numRows()) {
+ return false;
+ }
+ }
+ pl_redirect('photo/' . $login);
+}
+
function hook_makeJs($src)
{
global $page;
&& Post::has('bananaupdate') && Post::v('action')=="OK" ))
{
$req = XDB::query("
- SELECT nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
- IF(FIND_IN_SET('automaj',flags),'1','0')
+ SELECT nom, mail, sig,
+ FIND_IN_SET('threads', flags),
+ FIND_IN_SET('automaj', flags),
+ FIND_IN_SET('xface', flags)
FROM forums.profils
WHERE uid = {?}", S::v('uid'));
- if (!(list($nom,$mail,$sig,$disp,$maj) = $req->fetchOneRow())) {
- $nom = S::v('prenom').' '.S::v('nom');
- $mail = S::v('forlife').'@'.$globals->mail->domain;
- $sig = $nom.' ('.S::v('promo').')';
- $disp = 0;
- $maj = 0;
+ if (!(list($nom, $mail, $sig, $disp, $maj, $xface) = $req->fetchOneRow())) {
+ $nom = S::v('prenom').' '.S::v('nom');
+ $mail = S::v('forlife').'@'.$globals->mail->domain;
+ $sig = $nom.' ('.S::v('promo').')';
+ $disp = 0;
+ $maj = 0;
+ $xface = 0;
}
- $page->assign('nom' , $nom);
- $page->assign('mail', $mail);
- $page->assign('sig' , $sig);
- $page->assign('disp', $disp);
- $page->assign('maj' , $maj);
+ $page->assign('nom' , $nom);
+ $page->assign('mail', $mail);
+ $page->assign('sig', $sig);
+ $page->assign('disp', $disp);
+ $page->assign('maj', $maj);
+ $page->assign('xface', $xface);
} else {
- XDB::execute(
- 'REPLACE INTO forums.profils (uid,sig,mail,nom,flags)
- VALUES ({?},{?},{?},{?},{?})',
- S::v('uid'), Post::v('bananasig'),
- Post::v('bananamail'), Post::v('banananame'),
- (Post::b('bananadisplay') ? 'threads,' : '') .
- (Post::b('bananaupdate') ? 'automaj' : '')
- );
+ $flags = array();
+ if (Post::b('bananadisplay')) {
+ $flags[] = 'threads';
+ }
+ if (Post::b('bananaupdate')) {
+ $flags[] = 'automaj';
+ }
+ if (Post::b('bananaxface')) {
+ $flags[] = 'xface';
+ }
+ XDB::execute("REPLACE INTO forums.profils (uid, sig, mail, nom, flags)
+ VALUES ({?}, {?}, {?}, {?}, {?})",
+ S::v('uid'), Post::v('bananasig'),
+ Post::v('bananamail'), Post::v('banananame'),
+ implode(',', $flags));
}
}
{if !$smarty.post.action}
<p class="normal">
- Tu peux régler quelques paramètres qui apparaîtront sur les messages lorsque
+ Tu peux régler quelques paramètres qui apparaîtront sur les messages lorsque
tu posteras sur les forums. Cela ne te permettra pas d'être anonyme, puisque
tout le monde pourra remonter à ton identité en regardant ta fiche. L'objectif
est simplement de permettre plus de convivialité.
<form action="banana/profile" method="post">
<table class="bicol" cellpadding="3" cellspacing="0" summary="Configuration de Banana">
<tr>
- <th colspan="2">
- Profil Banana
- </th>
+ <th colspan="2">Profil Banana</th>
</tr>
- <tr class="pair">
- <td class="bicoltitre">
- Nom
- </td>
- <td>
- <input type="text" name="banananame" value="{$nom}" />
- </td>
+ <tr>
+ <td class="titre">Nom</td>
+ <td><input type="text" name="banananame" value="{$nom}" /></td>
</tr>
- <tr class="impair">
- <td class="bicoltitre">
- Adresse électronique
- </td>
- <td>
- <input type="text" name="bananamail" value="{$mail}" />
- </td>
+ <tr>
+ <td class="titre">Adresse électronique</td>
+ <td><input type="text" name="bananamail" value="{$mail}" /></td>
</tr>
- <tr class="pair">
- <td class="bicoltitre">
- Signature
- </td>
- <td>
- <textarea name="bananasig" cols="50" rows="4">{$sig}</textarea>
- </td>
+ <tr>
+ <td class="titre">Signature</td>
+ <td><textarea name="bananasig" cols="50" rows="4">{$sig}</textarea></td>
</tr>
- <tr class="impair">
- <td class="bicoltitre">
- Affichage des fils de discussion
- </td>
+ <tr class="pair">
+ <td class="titre">Affichage des fils de discussion</td>
<td>
- <input type="radio" name="bananadisplay" value="0"
- {if !$disp}checked="checked"{/if} /> Afficher tous
+ <input type="radio" name="bananadisplay" value="0"
+ {if !$disp}checked="checked"{/if} /> Afficher tous
les messages
<br />
- <input type="radio" name="bananadisplay" value="1"
- {if $disp}checked="checked"{/if} /> Afficher
- seulement les fils de discussion contenant des messages non lus
+ <input type="radio" name="bananadisplay" value="1"
+ {if $disp}checked="checked"{/if} /> Afficher
+ seulement les fils de discussion contenant des messages non lus
</td>
</tr>
<tr class="pair">
- <td class="bicoltitre">
- Mise à jour des messages non lus
- </td>
+ <td class="titre">Mise à jour des messages non lus</td>
<td>
- <input type="radio" name="bananaupdate" value="1"
+ <input type="radio" name="bananaupdate" value="1"
{if $maj}checked="checked"{/if} /> Automatique
<br />
- <input type="radio" name="bananaupdate" value="0"
+ <input type="radio" name="bananaupdate" value="0"
{if !$maj}checked="checked"{/if} /> Manuelle
</td>
</tr>
- <tr class="impair">
- <td class="bouton" colspan="2">
- <input type="submit" name="action" value="OK" />
+ <tr class="pair">
+ <td class="titre" colspan="2">
+ <input type="checkbox" {if $xface}checked="checked"{/if} name="bananaxface" id="xface" />
+ <label for="xface">Afficher mon X-Face plutôt que ma photo si il est disponible</label>
</td>
</tr>
</table>
+ <div class="center"><input type="submit" name="action" value="Enregistrer" /></div>
</form>
{else}
</tr>
</table>
+<p class="smaller">
+ {icon name="lightbulb" title="Astuce"}Astuce :
+ Tu peux également consulter les fora en utilisant un client NNTP tel que
+ Outlook Express ou Thunderbird.<br />N'hésite pas à <a href="password/smtp?doc=nntp">
+ consulter la documentation et à activer ton accès</a> pour utiliser ce service.
+</p>
+
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+use forums;
+alter table profils change flags flags set('threads','automaj','xface') not null;
+use x4dat;
+
+# vim:set syntax=mysql: