Proof of concept:
[platal.git] / htdocs / trombipromo.php
index a499834..f7f1969 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -22,6 +22,7 @@
 require_once("xorg.inc.php");
 new_skinned_page('trombipromo.tpl', AUTH_COOKIE);
 require_once("trombi.inc.php");
+$page->assign('xorg_title','Polytechnique.org - Trombi Promo');
 
 function getList($offset,$limit) {
     global $globals;
@@ -37,7 +38,7 @@ function getList($offset,$limit) {
     $pnb = $res->fetchOneCell();
 
     $res = $globals->xdb->query(
-            "SELECT  promo,user_id,a.alias AS forlife,nom,prenom
+            "SELECT  promo,user_id,a.alias AS forlife,IF(nom_usage='', nom, nom_usage) AS nom,prenom
                FROM  photo         AS p
          INNER JOIN  auth_user_md5 AS u ON u.user_id=p.uid
          INNER JOIN  aliases       AS a ON ( u.user_id=a.id AND a.type='a_vie' )
@@ -59,6 +60,9 @@ if (Env::has('xpromo')) {
        $trombi->setAdmin();
        $page->assign_by_ref('trombi',$trombi);
     }
+} else {
+    $tmp = new Trombi();
+    $page->assign("limit", $tmp->limit);
 }
 
 $page->run();