Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
433 ddelon 1
<?php
2
 
3
// actions/mychanges.php
4
// written by Carlo Zottmann
5
// http://wakkawikki.com/CarloZottmann
6
 
7
if ($user = $this->GetUser())
8
{
9
	$my_edits_count = 0;
10
 
11
	if ($_REQUEST["bydate"] == 1)
12
	{
13
		print("<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par date de modification (<a href=\"".$this->href("", $tag)."\">tri alphab&eacute;tique</a>).</b><br /><br />\n");
14
 
15
		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"))
16
		{
17
			foreach ($pages as $page)
18
			{
19
				$edited_pages[$page["tag"]] = $page["time"];
20
			}
21
 
22
			$edited_pages = array_reverse($edited_pages);
23
 
24
			foreach ($edited_pages as $page["tag"] => $page["time"])
25
			{
26
				// day header
27
				list($day, $time) = explode(" ", $page["time"]);
28
				if ($day != $curday)
29
				{
30
					if ($curday) print("<br />\n");
31
					print("<b>$day:</b><br />\n");
32
					$curday = $day;
33
				}
34
 
35
				// print entry
36
				print("&nbsp;&nbsp;&nbsp;($time) (".$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0).") ".$this->ComposeLinkToPage($page["tag"], "", "", 0)."<br />\n");
37
 
38
				$my_edits_count++;
39
			}
40
 
41
			if ($my_edits_count == 0)
42
			{
43
				print("<i>Vous n'avez pas modifi&eacute; de page.</i>");
44
			}
45
		}
46
		else
47
		{
48
			print("<i>Aucune page trouv&eacute;e.</i>");
49
		}
50
	}
51
	else
52
	{
53
		print("<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par date de modification (<a href=\"".$this->href("", $tag)."&amp;bydate=1\">tri par date</a>).</b><br /><br />\n");
54
 
55
		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"))
56
		{
57
			foreach ($pages as $page)
58
			{
59
				if ($last_tag != $page["tag"]) {
60
					$last_tag = $page["tag"];
61
					$firstChar = strtoupper($page["tag"][0]);
62
					if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
63
						$firstChar = "#";
64
					}
65
 
66
					if ($firstChar != $curChar) {
67
						if ($curChar) print("<br />\n");
68
						print("<b>$firstChar</b><br />\n");
69
						$curChar = $firstChar;
70
					}
71
 
72
					// print entry
73
					print("&nbsp;&nbsp;&nbsp;(".$page["time"].") (".$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0).") ".$this->ComposeLinkToPage($page["tag"], "", "", 0)."<br />\n");
74
 
75
					$my_edits_count++;
76
				}
77
			}
78
 
79
			if ($my_edits_count == 0)
80
			{
81
				print("<i>Vous n'avez pas modifi&eacute; de page.</i>");
82
			}
83
		}
84
		else
85
		{
86
			print("<i>Aucune page trouv&eacute;e.</i>");
87
		}
88
	}
89
}
90
else
91
{
92
	print("<i>Vous n'etes pas identifi&eacute; : impossible d'afficher la liste des pages que vous avez modifi&eacute;es.</i>");
93
}
94
 
95
?>