Gezocht bug fixer!
Sinds het de eerste is van deze nieuwe maand komen mijn forum berichten niet meer onderaan testaan maar boven aan, erg vervelend ik kan er zelf niet meer uit wellicht is er hier iemand die dit even voor mij kan doen voor een bedrag van 45 euro.
Stuur me dan even een PB.
Met vriendelijke groeten,
Bob
Gewijzigd op 01/12/2010 09:36:15 door Bob Marijnes
Is het een zelf gemaakt forum of een kant en klare (welke/waar vandaan)?
Inkopper: lijkt er op dat er met de sortering iets niet goed gaat.
Plaats eventueel wat code (tussen code-tags), zodat er naar gekeken kan worden.
De code:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?php
if(isset($_GET['x'])){
$_GET['x'] = mysql_real_escape_string($_GET['x']);
}
if(isset($_GET['p'])){
$_GET['p'] = mysql_real_escape_string($_GET['p']);
}
if(isset($_GET['id'])){
$_GET['id'] = mysql_real_escape_string($_GET['id']);
}
$dbresb = mysql_query("SELECT forum_id, id, login, titel, message, DATE_FORMAT(time,'%d/%m/%Y %H:%i') as time FROM `topic` WHERE `id`='{$_GET['x']}'");
$topic = mysql_fetch_object($dbresb);
$message = ubb($topic->message);
$dbresc = mysql_query("SELECT * FROM `gebruiker` WHERE `login`='{$topic->login}'");
$login1 = mysql_fetch_object($dbresc);
$dbresd = mysql_query("SELECT * FROM `gebruiker` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `login`='{$login1->login}'");
$controlle = mysql_num_rows($dbresd);
if($login1->avater == ""){
$avater = "/images/avater.jpg";
} else {
$avater = $login1->avater;
}
if($controlle == 1){
$status = "Online";
} else {
$status = "Offline";
}
if($_GET['actie'] == "delete"){
$dbres = mysql_query("SELECT login, topic_id FROM `topic_replay` WHERE `id`='{$_GET['id']}'");
if($topic = mysql_fetch_object($dbres)){
if($topic->login == $data->login || $data->level == 3){
mysql_query("UPDATE `topic` SET `replays`=`replays`-'1' WHERE `id`='{$topic->topic_id}'");
mysql_query("DELETE FROM `topic_replay` WHERE `id`='{$_GET['id']}'");
$sql = mysql_query("SELECT forum_id FROM topic WHERE id = '".$topic->topic_id."'");
$or_topic = mysql_fetch_object($sql);
echo 'Reply verwijderd.<br />
<a href="forum-topic.php?x='.$topic->topic_id.'" style="text-decoration: none;" class="whitetext">Ga terug naar het topic</a>';
//echo "<meta http-equiv=\"refresh\" content=\"0\" URL=\"http://http://www.zweinsteinonline.nl/ingame/forum-topic.php?x={$topic->topic_id}\">";
//exit;
}
}
}
if(!isset($_GET['actie'])){
?>
<table class="view-topic">
<tr class="topic-title">
<td colspan="2">
<strong> <?php echo $topic->titel; ?></strong>
</td>
</tr>
<tr>
<td class="subtitle" colspan="2" style="padding:0; spacing:0;">
<table class="info-box-table">
<tr class="info-box">
<td align="right" width="20">
<img src="/images/user.png" width="18" height="16" border="0">
</td>
<td width="240" align="left">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><strong><?php echo $login1->login; ?></strong></a>
(<?php echo $login1->posts; ?> posts)
</td>
<td align="left" width="115">
<?php echo $topic->time; ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="maintxt" align="center" valign="top" width="120">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><img src="<?php echo $avater; ?>" width="100" height="100" border="0"></a>
<br />
</td>
<td class="maintxt" align="left" valign="top" width="480">
<?php echo $message; ?>
</td>
</tr>
<?php
$begin = ($_GET['p'] >= 0) ? $_GET['p']*9 : 0;
$dbresa = mysql_query("SELECT id, login, message, DATE_FORMAT(time,'%d/%m/%Y %H:%i') as time FROM `topic_replay` WHERE `topic_id`='{$_GET['x']}' ORDER BY `time` LIMIT $begin,9");
$check_exist = mysql_num_rows(mysql_query("SELECT * FROM active_topics WHERE usrid = '".$_SESSION['uid']."' AND topid = '".$topic->id."'"));
if($check_exist >0){
} else {
$result = mysql_query("INSERT INTO active_topics (usrid,topid,frmid,date) VALUES ('".$_SESSION['uid']."','".$topic->id."','".$topic->forum_id."',now())")or die(mysql_error());
}
?>
<?php
while($replay = mysql_fetch_object($dbresa)){
$dbres1 = mysql_query("SELECT `login`,`posts`,`avater`,UNIX_TIMESTAMP(`online`) AS `online`,0 FROM `gebruiker` WHERE `login`='{$replay->login}'");
$login1 = mysql_fetch_object($dbres1);
$message = ubb($replay->message);
if($login1->online + 300 > time()){
$status = "Online";
} else {
$status = "Offline";
}
if($login1->avater == ""){
$avater = "/images/avater.jpg";
} else {
$avater = $login1->avater;
}
?>
<tr>
<td class="subtitle" width="275" colspan="2" style="padding:0; spacing:0;">
<table class="info-box-table">
<tr class="info-box">
<td align="right" width="20">
<img src="/images/user.png" width="18" height="16" border="0">
</td>
<td width="200" align="left">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><strong><?php echo $login1->login; ?></strong></a>
(<?php echo $login1->posts; ?> posts)
</td><td width="40"><?php if($data->level == 3){ ?><a href="forum-topic.php?actie=delete&id=<?php echo $replay->id; ?>" style='text-decoration: none;' class='whitetext'><img src="/images/delete.png" border=0 width="16" height="16" /></a><?php } if($data->level == 3 || ($_SESSION['login'] == $login1->login)){ ?><a href="forum-newtopic.php?actie=edit&type=reply&id=<?php echo $replay->id; ?>" style='text-decoration: none;' class='whitetext'><img src="/images/edit.png" border=0 width="16" height="16" /></a><?php } ?></td>
<td width="115">
<?php echo $replay->time; ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="120">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><img src="<?php echo $avater; ?>" width="100" height="100" border="0"></a>
<br /><b></b>
</td>
<td class="maintxt" valign="top" width="275">
<?php echo $message; ?>
</td>
</tr>
<?php
}
?>
</table>
<table align="center" width="275">
<?php
$dbres = mysql_query("SELECT * FROM `topic_replay` WHERE `topic_id`='{$_GET['x']}'");
if(mysql_num_rows($dbres) > 9){
echo "<tr><td class=\"maintxt\" align=\"center\" colspan=\"4\">";
if($begina/9 == 0){
echo "<<</font>";
} else {
echo "<a href=\"forum-topic.php?id={$_GET['id']}&x={$_GET['x']}&p=". ($begina/9-1) ."\" style='text-decoration: none;' class='whitetext'><<</a>";
}
for($i=0; $i<mysql_num_rows($dbres)/9; $i++){
echo " <a href=\"forum-topic.php?id={$_GET['id']}&x={$_GET['x']}&p=$i\" style='text-decoration: none;' class='whitetext'>". ($i+1) ."</a> ";
}
if($begina+9 >= mysql_num_rows($dbres)) {
echo ">>";
} else {
echo "<a href=\"forum-topic.php?id={$_GET['id']}&x={$_GET['x']}&p=". ($begina/9+1) ."\" style='text-decoration: none;' class='whitetext'>>></a>";
}
echo " </td></tr><tr>";
}
?>
</table>
<?php
}
?>
<table width="275">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2" align="center"></td>
</tr>
<?php
if($data->level == 3 OR $topic->soort != 2){
?>
<tr>
<td width="300" ><table><tr><td><img src="/images/new_topic.png" /></td><td><a href="forum-newtopic.php?z=<?php echo $topic->id; ?>" style='text-decoration: none;' class='whitetext'><strong>Reageren</strong></a></td></tr></table></td><td class="maintxt" width="300" align="center"><table><tr><td><img src="/images/forum.png" /></td><td><a href="forum-board.php?x=<?php echo $topic->forum_id; ?>" style='text-decoration: none;' class='whitetext'><strong>Terug naar forum</strong></a></td></tr></table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
<?php
} else {
?>
if(isset($_GET['x'])){
$_GET['x'] = mysql_real_escape_string($_GET['x']);
}
if(isset($_GET['p'])){
$_GET['p'] = mysql_real_escape_string($_GET['p']);
}
if(isset($_GET['id'])){
$_GET['id'] = mysql_real_escape_string($_GET['id']);
}
$dbresb = mysql_query("SELECT forum_id, id, login, titel, message, DATE_FORMAT(time,'%d/%m/%Y %H:%i') as time FROM `topic` WHERE `id`='{$_GET['x']}'");
$topic = mysql_fetch_object($dbresb);
$message = ubb($topic->message);
$dbresc = mysql_query("SELECT * FROM `gebruiker` WHERE `login`='{$topic->login}'");
$login1 = mysql_fetch_object($dbresc);
$dbresd = mysql_query("SELECT * FROM `gebruiker` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `login`='{$login1->login}'");
$controlle = mysql_num_rows($dbresd);
if($login1->avater == ""){
$avater = "/images/avater.jpg";
} else {
$avater = $login1->avater;
}
if($controlle == 1){
$status = "Online";
} else {
$status = "Offline";
}
if($_GET['actie'] == "delete"){
$dbres = mysql_query("SELECT login, topic_id FROM `topic_replay` WHERE `id`='{$_GET['id']}'");
if($topic = mysql_fetch_object($dbres)){
if($topic->login == $data->login || $data->level == 3){
mysql_query("UPDATE `topic` SET `replays`=`replays`-'1' WHERE `id`='{$topic->topic_id}'");
mysql_query("DELETE FROM `topic_replay` WHERE `id`='{$_GET['id']}'");
$sql = mysql_query("SELECT forum_id FROM topic WHERE id = '".$topic->topic_id."'");
$or_topic = mysql_fetch_object($sql);
echo 'Reply verwijderd.<br />
<a href="forum-topic.php?x='.$topic->topic_id.'" style="text-decoration: none;" class="whitetext">Ga terug naar het topic</a>';
//echo "<meta http-equiv=\"refresh\" content=\"0\" URL=\"http://http://www.zweinsteinonline.nl/ingame/forum-topic.php?x={$topic->topic_id}\">";
//exit;
}
}
}
if(!isset($_GET['actie'])){
?>
<table class="view-topic">
<tr class="topic-title">
<td colspan="2">
<strong> <?php echo $topic->titel; ?></strong>
</td>
</tr>
<tr>
<td class="subtitle" colspan="2" style="padding:0; spacing:0;">
<table class="info-box-table">
<tr class="info-box">
<td align="right" width="20">
<img src="/images/user.png" width="18" height="16" border="0">
</td>
<td width="240" align="left">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><strong><?php echo $login1->login; ?></strong></a>
(<?php echo $login1->posts; ?> posts)
</td>
<td align="left" width="115">
<?php echo $topic->time; ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="maintxt" align="center" valign="top" width="120">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><img src="<?php echo $avater; ?>" width="100" height="100" border="0"></a>
<br />
</td>
<td class="maintxt" align="left" valign="top" width="480">
<?php echo $message; ?>
</td>
</tr>
<?php
$begin = ($_GET['p'] >= 0) ? $_GET['p']*9 : 0;
$dbresa = mysql_query("SELECT id, login, message, DATE_FORMAT(time,'%d/%m/%Y %H:%i') as time FROM `topic_replay` WHERE `topic_id`='{$_GET['x']}' ORDER BY `time` LIMIT $begin,9");
$check_exist = mysql_num_rows(mysql_query("SELECT * FROM active_topics WHERE usrid = '".$_SESSION['uid']."' AND topid = '".$topic->id."'"));
if($check_exist >0){
} else {
$result = mysql_query("INSERT INTO active_topics (usrid,topid,frmid,date) VALUES ('".$_SESSION['uid']."','".$topic->id."','".$topic->forum_id."',now())")or die(mysql_error());
}
?>
<?php
while($replay = mysql_fetch_object($dbresa)){
$dbres1 = mysql_query("SELECT `login`,`posts`,`avater`,UNIX_TIMESTAMP(`online`) AS `online`,0 FROM `gebruiker` WHERE `login`='{$replay->login}'");
$login1 = mysql_fetch_object($dbres1);
$message = ubb($replay->message);
if($login1->online + 300 > time()){
$status = "Online";
} else {
$status = "Offline";
}
if($login1->avater == ""){
$avater = "/images/avater.jpg";
} else {
$avater = $login1->avater;
}
?>
<tr>
<td class="subtitle" width="275" colspan="2" style="padding:0; spacing:0;">
<table class="info-box-table">
<tr class="info-box">
<td align="right" width="20">
<img src="/images/user.png" width="18" height="16" border="0">
</td>
<td width="200" align="left">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><strong><?php echo $login1->login; ?></strong></a>
(<?php echo $login1->posts; ?> posts)
</td><td width="40"><?php if($data->level == 3){ ?><a href="forum-topic.php?actie=delete&id=<?php echo $replay->id; ?>" style='text-decoration: none;' class='whitetext'><img src="/images/delete.png" border=0 width="16" height="16" /></a><?php } if($data->level == 3 || ($_SESSION['login'] == $login1->login)){ ?><a href="forum-newtopic.php?actie=edit&type=reply&id=<?php echo $replay->id; ?>" style='text-decoration: none;' class='whitetext'><img src="/images/edit.png" border=0 width="16" height="16" /></a><?php } ?></td>
<td width="115">
<?php echo $replay->time; ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="120">
<a href="speler-profiel.php?x=<?php echo $login1->login; ?>" style='text-decoration: none;' class='whitetext'><img src="<?php echo $avater; ?>" width="100" height="100" border="0"></a>
<br /><b></b>
</td>
<td class="maintxt" valign="top" width="275">
<?php echo $message; ?>
</td>
</tr>
<?php
}
?>
</table>
<table align="center" width="275">
<?php
$dbres = mysql_query("SELECT * FROM `topic_replay` WHERE `topic_id`='{$_GET['x']}'");
if(mysql_num_rows($dbres) > 9){
echo "<tr><td class=\"maintxt\" align=\"center\" colspan=\"4\">";
if($begina/9 == 0){
echo "<<</font>";
} else {
echo "<a href=\"forum-topic.php?id={$_GET['id']}&x={$_GET['x']}&p=". ($begina/9-1) ."\" style='text-decoration: none;' class='whitetext'><<</a>";
}
for($i=0; $i<mysql_num_rows($dbres)/9; $i++){
echo " <a href=\"forum-topic.php?id={$_GET['id']}&x={$_GET['x']}&p=$i\" style='text-decoration: none;' class='whitetext'>". ($i+1) ."</a> ";
}
if($begina+9 >= mysql_num_rows($dbres)) {
echo ">>";
} else {
echo "<a href=\"forum-topic.php?id={$_GET['id']}&x={$_GET['x']}&p=". ($begina/9+1) ."\" style='text-decoration: none;' class='whitetext'>>></a>";
}
echo " </td></tr><tr>";
}
?>
</table>
<?php
}
?>
<table width="275">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2" align="center"></td>
</tr>
<?php
if($data->level == 3 OR $topic->soort != 2){
?>
<tr>
<td width="300" ><table><tr><td><img src="/images/new_topic.png" /></td><td><a href="forum-newtopic.php?z=<?php echo $topic->id; ?>" style='text-decoration: none;' class='whitetext'><strong>Reageren</strong></a></td></tr></table></td><td class="maintxt" width="300" align="center"><table><tr><td><img src="/images/forum.png" /></td><td><a href="forum-board.php?x=<?php echo $topic->forum_id; ?>" style='text-decoration: none;' class='whitetext'><strong>Terug naar forum</strong></a></td></tr></table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
<?php
} else {
?>
http://www.pfz.nl/forum/topic/1597-bug-fixer-gezocht/ biedt je euro 45,00......
Op Klopt excuus heb ik hier een typ fout gemaakt, heb me post ge-edit.
Wat is de URL naar de site? Dan kunnen we kijken hoe het er uitziet..
Ik vermoed dat dit werkt:
Code (php)
1
2
3
4
2
3
4
<?php
//regel 94
$dbresa = mysql_query("SELECT id, login, message, DATE_FORMAT(time,'%d/%m/%Y %H:%i') as format_time FROM `topic_replay` WHERE `topic_id`='{$_GET['x']}' ORDER BY `time` LIMIT $begin,9");
?>
//regel 94
$dbresa = mysql_query("SELECT id, login, message, DATE_FORMAT(time,'%d/%m/%Y %H:%i') as format_time FROM `topic_replay` WHERE `topic_id`='{$_GET['x']}' ORDER BY `time` LIMIT $begin,9");
?>
Je moet dan in je code wel format_time gebruiken i.p.v. time (je maakt er nu eerst een datum van waarop gesorteerd wordt. Hierdoor sorteert die als eerste op dag, dan op maand etc.
Als dit de oplossing is mag je die €45 overmaken naar World Servants ( http://www.worldservants.nl/inhoud.php?id=31 ) (Goed doel dus is het nog aftrekbaar als gift)
Gewijzigd op 01/12/2010 09:46:54 door TJVB tvb
Deze kolom heeft datetime type.
En die oplossing die ik geef, werkt die?
Is me niet gelukt met jou code krijg enkeld geen foutmelding maar hij sorteerd nog niet goed?
Zet dit eens bovenaan je code
Kun je me anders even een url pmen?
Toevoeging op 01/12/2010 10:10:47:
Het is gelukt met jou code!
Enkeld nu weergeven de datums niet meer boven de berichten?
Gewijzigd op 01/12/2010 10:03:49 door Bob Marijnes
Nee, dat moet dan $replay->format_time zijn.
Gebruik niet dezelfde naam van het veld als alias.
Maar iets als
DATE_FORMAT(time,'%d/%m/%Y %H:%i') as formatted_time
En dan even de rest daarop aanpassen.
Edit: Sorry, beetje laat.
Gewijzigd op 01/12/2010 10:18:43 door - SanThe -
Ik ga het thuis even editen, denk dat dat wel moet werken