[ Index ]
 

Code source de WikiNi 0.4.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/actions/ -> mychanges.php (source)

   1  <?php
   2  /*
   3  mychanges.php
   4  Copyright (c) 2003, Carlo Zottmann
   5  Copyright  2003 David DELON
   6  Copyright 2003 Charles NEPOTE
   7  All rights reserved.
   8  Redistribution and use in source and binary forms, with or without
   9  modification, are permitted provided that the following conditions
  10  are met:
  11  1. Redistributions of source code must retain the above copyright
  12  notice, this list of conditions and the following disclaimer.
  13  2. Redistributions in binary form must reproduce the above copyright
  14  notice, this list of conditions and the following disclaimer in the
  15  documentation and/or other materials provided with the distribution.
  16  3. The name of the author may not be used to endorse or promote products
  17  derived from this software without specific prior written permission.
  18  
  19  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  20  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  21  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  23  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  24  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  28  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29  */
  30  if ($user = $this->GetUser())
  31  {
  32      $my_edits_count = 0;
  33      $curChar = '';
  34      $curday = '';
  35      $last_tag = '';
  36  
  37      if (($bydate = $this->GetParameter("bydate")))
  38      {
  39          echo "<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par date de modification.</b><br /><br />\n";    
  40  
  41          if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user = '".mysql_escape_string($this->UserName())."' AND tag NOT LIKE 'Comment%' ORDER BY time ASC, tag ASC"))
  42          {
  43              foreach ($pages as $page)
  44              {
  45                  $edited_pages[$page["tag"]] = $page["time"];
  46              }
  47  
  48               arsort($edited_pages);
  49  
  50              foreach ($edited_pages as $page["tag"] => $page["time"])
  51              {
  52                  // day header
  53                  list($day, $time) = explode(" ", $page["time"]);
  54                  if ($day != $curday)
  55                  {
  56                      if ($curday) echo "<br />\n";
  57                      echo "<b>$day:</b><br />\n";
  58                      $curday = $day;
  59                  }
  60  
  61                  // echo entry
  62                  echo "&nbsp;&nbsp;&nbsp;($time) (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n";
  63  
  64                  $my_edits_count++;
  65              }
  66              
  67              if ($my_edits_count == 0)
  68              {
  69                  echo "<i>Vous n'avez pas modifi&eacute; de page.</i>";
  70              }
  71          }
  72          else
  73          {
  74              echo "<i>Aucune page trouv&eacute;e.</i>";
  75          }
  76      }
  77      else
  78      {
  79          echo "<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par ordre alphab&eacute;tique.</b><br /><br />\n";    
  80  
  81          if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user = '".mysql_escape_string($this->UserName())."' AND tag NOT LIKE 'Comment%' ORDER BY tag ASC, time DESC"))
  82          {
  83              foreach ($pages as $page)
  84              {
  85                  if ($last_tag != $page["tag"]) {
  86                      $last_tag = $page["tag"];
  87                      $firstChar = strtoupper($page["tag"][0]);
  88                      if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
  89                          $firstChar = "#";
  90                      }
  91          
  92                      if ($firstChar != $curChar) {
  93                          if ($curChar) echo "<br />\n";
  94                          echo "<b>$firstChar</b><br />\n";
  95                          $curChar = $firstChar;
  96                      }
  97      
  98                      // echo entry
  99                      echo "&nbsp;&nbsp;&nbsp;(",$page["time"],") (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n";
 100      
 101                      $my_edits_count++;
 102                  }
 103              }
 104              
 105              if ($my_edits_count == 0)
 106              {
 107                  echo "<i>Vous n'avez pas modifi&eacute; de page.</i>";
 108              }
 109          }
 110          else
 111          {
 112              echo "<i>Aucune page trouv&eacute;e.</i>";
 113          }
 114      }
 115  }
 116  else
 117  {
 118      echo "<i>Vous n'&ecirc;tes pas identifi&eacute; : impossible d'afficher la liste des pages que vous avez modifi&eacute;es.</i>";
 119  }
 120  
 121  ?>


Généré le : Mon Nov 26 12:05:46 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics