Subversion Repositories Applications.projet

Rev

Rev 147 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 ddelon 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
 
34
	if (($bydate = $this->GetParameter("bydate")))
35
	{
36
		echo "<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par date de modification.</b><br /><br />\n";
37
 
38
		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"))
39
		{
40
			foreach ($pages as $page)
41
			{
42
				$edited_pages[$page["tag"]] = $page["time"];
43
			}
44
 
45
			 arsort($edited_pages);
46
 
47
			foreach ($edited_pages as $page["tag"] => $page["time"])
48
			{
49
				// day header
50
				list($day, $time) = explode(" ", $page["time"]);
51
				if ($day != $curday)
52
				{
53
					if ($curday) echo "<br />\n";
54
					echo "<b>$day:</b><br />\n";
55
					$curday = $day;
56
				}
57
 
58
				// echo entry
59
				echo "&nbsp;&nbsp;&nbsp;($time) (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n";
60
 
61
				$my_edits_count++;
62
			}
63
 
64
			if ($my_edits_count == 0)
65
			{
66
				echo "<i>Vous n'avez pas modifi&eacute; de page.</i>";
67
			}
68
		}
69
		else
70
		{
71
			echo "<i>Aucune page trouv&eacute;e.</i>";
72
		}
73
	}
74
	else
75
	{
76
		echo "<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par ordre alphab&eacute;tique.</b><br /><br />\n";
77
 
78
		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"))
79
		{
80
			foreach ($pages as $page)
81
			{
82
				if ($last_tag != $page["tag"]) {
83
					$last_tag = $page["tag"];
84
					$firstChar = strtoupper($page["tag"][0]);
85
					if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
86
						$firstChar = "#";
87
					}
88
 
89
					if ($firstChar != $curChar) {
90
						if ($curChar) echo "<br />\n";
91
						echo "<b>$firstChar</b><br />\n";
92
						$curChar = $firstChar;
93
					}
94
 
95
					// echo entry
96
					echo "&nbsp;&nbsp;&nbsp;(",$page["time"],") (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n";
97
 
98
					$my_edits_count++;
99
				}
100
			}
101
 
102
			if ($my_edits_count == 0)
103
			{
104
				echo "<i>Vous n'avez pas modifi&eacute; de page.</i>";
105
			}
106
		}
107
		else
108
		{
109
			echo "<i>Aucune page trouv&eacute;e.</i>";
110
		}
111
	}
112
}
113
else
114
{
115
	echo "<i>Vous n'&ecirc;tes pas identifi&eacute; : impossible d'afficher la liste des pages que vous avez modifi&eacute;es.</i>";
116
}
117
 
118
?>