Merge lp:~xabilon/ubuntu-fr-forum/limit-recherches+CSS-admin into lp:ubuntu-fr-forum

Proposed by xabilon
Status: Merged
Merged at revision: 159
Proposed branch: lp:~xabilon/ubuntu-fr-forum/limit-recherches+CSS-admin
Merge into: lp:ubuntu-fr-forum
Diff against target: 147 lines (+62/-55)
2 files modified
search.php (+3/-3)
style/imports/base_admin.css (+59/-52)
To merge this branch: bzr merge lp:~xabilon/ubuntu-fr-forum/limit-recherches+CSS-admin
Reviewer Review Type Date Requested Status
nesthib (community) Approve
Review via email: mp+207065@code.launchpad.net

Description of the change

Limitation à 300 résultats des recherches (nécessaire pour les gros forums)
Correction du CSS pour les pages d'admin

To post a comment you must log in.
Revision history for this message
nesthib (nesthib) wrote :

L'ajout de la limite + le changement de config PHP semble corriger le problème de avec search.php?action=show_unanswered

review: Approve
Revision history for this message
nesthib (nesthib) wrote :

L'erreur était :

FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1139950 bytes) in /srv/www/forum.ubuntu-fr.org/htdocs/search.php on line 439

et le changement de config (/etc/php5/fpm/php-fpm.conf) :

php_admin_value[memory_limit] = 128M

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'search.php'
2--- search.php 2013-09-04 20:38:50 +0000
3+++ search.php 2014-02-18 23:27:44 +0000
4@@ -337,7 +337,7 @@
5 if ($pun_user['is_guest'])
6 message($lang_common['No permission'], false, '403 Forbidden');
7
8- $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL'.(isset($_GET['fid']) ? ' AND t.forum_id='.intval($_GET['fid']) : '').$sql_fid.' ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
9+ $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL'.(isset($_GET['fid']) ? ' AND t.forum_id='.intval($_GET['fid']) : '').$sql_fid.' ORDER BY t.last_post DESC LIMIT 300') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
10 $num_hits = $db->num_rows($result);
11
12 if (!$num_hits)
13@@ -346,7 +346,7 @@
14 // If it's a search for recent posts (in a certain time interval)
15 else if ($action == 'show_recent')
16 {
17- $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - $interval).' AND t.moved_to IS NULL'.(isset($_GET['fid']) ? ' AND t.forum_id='.intval($_GET['fid']) : '').$sql_fid.' ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
18+ $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - $interval).' AND t.moved_to IS NULL'.(isset($_GET['fid']) ? ' AND t.forum_id='.intval($_GET['fid']) : '').$sql_fid.' ORDER BY t.last_post DESC LIMIT 300') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
19 $num_hits = $db->num_rows($result);
20
21 if (!$num_hits)
22@@ -405,7 +405,7 @@
23 // If it's a search for unanswered posts
24 else
25 {
26- $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
27+ $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT 300') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
28 $num_hits = $db->num_rows($result);
29
30 if (!$num_hits)
31
32=== modified file 'style/imports/base_admin.css' (properties changed: -x to +x)
33--- style/imports/base_admin.css 2013-09-04 20:38:50 +0000
34+++ style/imports/base_admin.css 2014-02-18 23:27:44 +0000
35@@ -1,52 +1,59 @@
36-#adminconsole .block2 {margin-top: 12px}
37-
38-/*** Admin Main Content ***/
39-* html #adstats dd {height: 1%}
40-#adstats dd {margin-left: 14em; padding: 3px; margin-bottom: 5px; line-height: 1.5em}
41-#adstats dt {float: left; width: 13em; padding: 3px; line-height: 1.5em}
42-#adstats {padding: 15px 15px 5px 10px}
43-#adintro {padding: 5px}
44-#adintro p {padding: 10px}
45-#adstats dl {padding: 5px 0 10px 5px}
46-
47-#adminconsole fieldset td {text-align: left; padding: 4px; white-space: normal}
48-#adminconsole fieldset th {text-align: left; padding: 4px; white-space: normal}
49-#adminconsole fieldset td span, #adminconsole fieldset th span {display: block; font-size: 1em; font-weight: normal}
50-#adminconsole th {width: 15em; font-weight: bold}
51-#adminconsole input, #adminconsole select, #adminconsole textarea {margin-bottom: 0; margin-top: 0; font-weight: normal}
52-#adminconsole table.aligntop th, #adminconsole table.aligntop td {vertical-align: top}
53-#adminconsole table.aligntop th {padding-top: 0.7em}
54-/* #adminconsole td, #adminconsole th {border-style: solid; border-width: 3px 0 3px 0} */
55-#adminconsole p {padding-bottom: 6px}
56-#adminconsole .topspace {padding-top: 6px}
57-#adminconsole p.submittop, #adminconsole p.submitend {text-align: center}
58-#adminconsole th.hidehead {color: #f1f1f1}
59-#adminconsole thead th {padding-bottom: 0}
60-#adminconsole p.linkactions {font-weight: bold; padding-left: 5px}
61-#adminconsole th input, #adminconsole div.fsetsubmit {margin-top: 6px}
62-
63-/*** Particular table settings ***/
64-#categoryedit .tcl {width: 25%}
65-#censoring .tcl, #censoring .tc2 {width: 20%}
66-#edforum .tcl, #edforum .tc2 {width: 8%}
67-#edforum .tc2 {width: 6%}
68-
69-table#forumperms th, table#forumperms td {white-space: normal; width: auto; text-align: center}
70-table#forumperms .atcl {text-align: left; width: 15em; white-space: nowrap}
71-#adminconsole td.nodefault {background-color: #d59b9b}
72-
73-/*** User/Ban Search Result Tables ***/
74-#users2 th, #bans1 th {text-align: left}
75-#users2 th.tcmod {text-align: center}
76-#users2 .tcl, #bans1 .tcl {width: auto; text-align: left; padding: 4px 6px}
77-#users2 .tc2, #bans1 .tc2 {width: 18%; text-align: left; padding: 4px 6px}
78-#users2 .tc3, #users2 .tc5, #bans1 .tc3, #bans1 .tc5, #bans1 .tc6 {width: 12%; text-align: left; padding: 4px 6px}
79-#users2 .tc4, #bans1 .tc4 {width: 10%; text-align: center}
80-#users2 .tcr {width: 20%; white-space: nowrap}
81-#bans1 .tcr {width: 15%; white-space: nowrap}
82-#users2 .tcmod {width: 10%; text-align: center}
83-#adminconsole #linkst, #adminconsole #linksb a {font-weight: bold}
84-
85-/*** Plugins ***/
86-.plugin .inbox {padding-bottom: 10px}
87-.plugin p {padding: 10px 10px 0}
88+
89+/****** PAGES D ADMINS *****/
90+
91+#adminconsole .blockform
92+{
93+float:left;
94+width:82%;
95+margin-top: 8px;
96+}
97+/* XABILON : Menu Admin */
98+
99+#adminconsole {
100+ width: 100%}
101+
102+#adminmenu {
103+ width: 15%;
104+ height: 100%;
105+ float: left;
106+ padding: 5px;
107+ margin-right: 5px;
108+ margin-top : 8px;
109+ background-color: #F0F0F0;
110+ border: 1px solid grey;
111+ -moz-border-radius: 5px;
112+ -khtml-border-radius: 5px;
113+ -webkit-border-radius: 5px;
114+}
115+
116+#adminmenu h2 {
117+ font-size: 1em;
118+ font-weight: bold;
119+ background-color: lightgrey;
120+}
121+
122+#adminmenu a:hover {
123+ font-weight: bold;
124+ color: black;
125+ text-decoration: none;
126+}
127+
128+#adminmenu li {display: block}
129+
130+#adminconsole .block {
131+ width: 80%;
132+ float: right;
133+}
134+
135+#edforum .tcl {width: 15%}
136+#edforum .tc2 {width: 15%}
137+
138+
139+/* AJOUTE PAR LA 1.4.7 */
140+#users2 .tcl, #bans1 .tcl {WIDTH: auto; TEXT-ALIGN: left; PADDING: 4px 6px}
141+#users2 .tc2, #bans1 .tc2 {WIDTH: 18%; TEXT-ALIGN: left; PADDING: 4px 6px}
142+#users2 .tc3, #users2 .tc5, #bans1 .tc3, #bans1 .tc5, #bans1 .tc6 {WIDTH: 12%; TEXT-ALIGN: left; PADDING: 4px 6px}
143+#users2 .tc4, #bans1 .tc4 {WIDTH: 10%; TEXT-ALIGN: center}
144+#users2 .tcr {WIDTH: 20%; WHITE-SPACE: nowrap}
145+#bans1 .tcr {WIDTH: 15%; WHITE-SPACE: nowrap}
146+#users2 .tcmod {WIDTH: 10%; TEXT-ALIGN: center}
147\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: