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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
<?php
require_once('../includes/config.php');
//Si pas connecté OU si le profil n'appartient pas au membre = pas d'accès
if(!$user->is_logged_in()) {
header('Location: login.php');
}
if(!isset($_GET['membre'])) {
header('Location: ./');
}
$stmt = $db->prepare('SELECT * FROM blog_members WHERE username = :username');
$stmt->bindValue(':username', $_GET['membre'], PDO::PARAM_STR);
$stmt->execute();
$row = $stmt->fetch();
if($row['username'] == '') {
header('Location: '.SITEURL.'/membres.php?action=noexistmember');
}
// Il n'y a pas de page profil pour le compte Visiteur
if($_GET['membre'] == 'Visiteur') {
header('Location: ./');
}
// C'est parti !!!
else {
// titre de la page
$pagetitle = 'Page Profil de '.html($_GET['membre']);
include_once('../includes/header.php');
?>
<body>
<div id="container">
<?php
include_once('../includes/header-logo.php');
include_once('../includes/nav.php');
?>
<div id="body">
<div id="content">
<?php
//On affiche le résultat de l'édition du profil
if(isset($_GET['action'])){
echo '<div class="alert-msg rnd8 success">Votre profil a été mis à jour !</div>';
}
//On affiche le résultat de l'envoi de message interne
if(isset($_GET['message'])){
echo '<div class="alert-msg rnd8 success">Le message a été envoyé !</div>';
}
try {
$stmt = $db->prepare('SELECT * FROM blog_members,xbt_users WHERE blog_members.memberID = xbt_users.uid AND username = :username');
$stmt->bindValue(':username', $_GET['membre'], PDO::PARAM_STR);
$stmt->execute();
$row = $stmt->fetch();
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>
<?php
if(isset($_SESSION['username']) && $_SESSION['username'] != $_GET['membre']) {
?>
<table>
<tr>
<td>ID de membre : </td><td><?php echo html($row['memberID']); ?></td>
<?php
if(empty($row['avatar'])) {
?>
<td rowspan="6" style="text-align: center;"><img style="width:125px; height:125px;" src="<?php echo SITEURL; ?>/images/avatars/avatar-profil.png" alt="Pas d'avatar pour <?php echo html($row['username']); ?>" /></td>
<?php }
else {
?>
<td rowspan="7" style="text-align: center;"><img style="width:125px; height:125px;" src="<?php echo SITEURL; ?>/images/avatars/<?php echo html($row['avatar']); ?>" alt="Avatar de <?php echo html($row['username']); ?>" /></td>
<?php } ?>
</tr>
<tr><td>Pseudo :</td><td style="font-weight: bold;"><?php echo html($row['username']); ?> <a style="text-decoration: none;" href="<?php echo SITEURL; ?>/messages_envoyer.php?destid=<?php echo html($row['memberID']); ?>&destuser=<?php echo html($row['username']); ?>"> <img style="vertical-align: text-bottom;" src="<?php echo SITEURL; ?>/images/Email-icon.png"></a>
<?php
if($row['memberID'] == 1) {
//echo '<span style="font-weight: bold; color: green;"> [ Webmaster ]</span> | Jabber : mumbly_58 AT jabber.fr';
echo '<span style="color: green; font-size: 9pt;"> [ Webmaster ] </span><span style="font-size: 9pt;"> [ <a href="mailto:mumbly_58@jabber.fr">Jabber</a> ]</span>';
}
?>
</td></tr>
<tr><td>Date d'inscription : </td><td>
<?php
sscanf($row['memberDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo 'Le '.$jour.'-'.$mois.'-'.$annee.' à '.$heure.':'.$minute.':'.$seconde;
?>
</td></tr>
<tr><td>Envoyé :</td><td><?php echo makesize($row['uploaded']); ?></td></tr>
<tr><td>Téléchargé :</td><td><?php echo makesize($row['downloaded']); ?></td></tr>
<?php
//Peer Ratio
if (intval($row["downloaded"])>0) {
$ratio=number_format($row["uploaded"]/$row["downloaded"],2);
}
else {
$ratio='∞';
}
?>
<tr><td>Ratio de partage :</td><td><?php echo $ratio; ?></td></tr>
</table>
<!-- Historique téléchargements -->
<table>
<tr><td colspan="6"><h3 id="historique">Ses Téléchargements :</h3></td></tr>
<?php
$pages = new Paginator('5','d');
$stmt = $db->prepare('SELECT fid FROM xbt_files_users WHERE uid = :uid');
$stmt->bindValue(':uid', $row['memberID'], PDO::PARAM_INT);
$stmt->execute();
$pages->set_total($stmt->rowCount());
// Tri de colonnes
$tri = 'postTitle';
$ordre = 'DESC';
if(isset($_GET['tri'])) {
// Les valeurs authorisee
$columns = array('postTitle','postDate','postTaille','seeders','leechers','xf.completed');
$direction = array('ASC','DESC','asc','desc');
if(in_array($_GET['tri'],$columns)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$tri = htmlentities($_GET['tri']);
}
if(isset($_GET['ordre']) and in_array($_GET['ordre'],$direction)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$ordre = htmlentities($_GET['ordre']);
}
}
$stmtorr1 = $db->prepare('
SELECT * FROM xbt_files_users xfu
LEFT JOIN blog_posts_seo bps ON bps.postID = xfu.fid
LEFT JOIN xbt_files xf ON xf.fid = bps.postID
WHERE xfu.uid = :uid
ORDER BY '.$tri.' '.$ordre.' '.$pages->get_limit()
);
$stmtorr1->execute(array(
':uid' => $row['memberID']
));
?>
<tr>
<th style="width: 420px;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=desc">↑</a>Nom<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=desc">↑</a>Ajouté<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=desc">↑</a>Taille<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=desc">↑</a>S<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=desc">↑</a>L<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=desc">↑</a>T<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=asc">↓</a></th>
</tr>
<?php
while($rowtorr = $stmtorr1->fetch()) {
?>
<tr>
<td style="font-weight: bold;">
<a style="text-decoration: none;" href="<?php echo SITEURL; ?>/<?php echo $rowtorr['postSlug']; ?>"><?php echo $rowtorr['postTitle'];?></a>
</td>
<?php
sscanf($rowtorr['postDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo '<td>'.$jour.'-'.$mois.'-'.$annee.'</td>';
?>
<td><?php echo makesize($rowtorr['postTaille']); ?></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr['postHash']; ?>"><?php echo $rowtorr['seeders']; ?></a></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr['postHash']; ?>"><?php echo $rowtorr['leechers']; ?></a></td>
<td style="text-align: center;"><?php echo $rowtorr['completed']; ?></td>
</tr>
<?php } ?>
</table>
<!-- //historique téléchargements -->
<?php
echo '<div style="text-align: center;">';
//echo $pages->page_links('?membre='.$row['username'].'&');
echo $pages->page_links('?membre='.$row['username'].'&tri='.$tri.'&ordre='.$ordre.'&');
echo '</div>';
?>
<br />
<!-- Historique uploads -->
<table>
<tr><td colspan="6"><h3 id="historique">Ses Uploads :</h3></td></tr>
<?php
$pages = new Paginator('5','u');
$stmt = $db->prepare('SELECT postID FROM blog_posts_seo WHERE postAuthor = :postAuthor');
//$stmt = $db->prepare('SELECT fid FROM xbt_files_users WHERE uid = :uid');
$stmt->execute(array(
':postAuthor' => $row['username']
));
$pages->set_total($stmt->rowCount());
/*
// TRI
if(isset($_GET['tri'])) {
$tri = htmlentities($_GET['tri']);
}
else {
$tri = 'postID';
}
if(isset($_GET['ordre'])) {
$ordre = htmlentities($_GET['ordre']);
}
else {
$ordre = 'DESC';
}
*/
if(isset($_GET['tri'])) {
// Les valeurs authorisee
$columns = array('postTitle','postDate','postTaille','seeders','leechers','xf.completed');
$direction = array('ASC','DESC','asc','desc');
if(in_array($_GET['tri'],$columns)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$tri = htmlentities($_GET['tri']);
}
if(isset($_GET['ordre']) and in_array($_GET['ordre'],$direction)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$ordre = htmlentities($_GET['ordre']);
}
}
$stmtorr2 = $db->prepare('
SELECT * FROM blog_posts_seo
LEFT JOIN xbt_files xf ON xf.fid = blog_posts_seo.postID
WHERE blog_posts_seo.postAuthor = :postAuthor
ORDER BY '.$tri.' '.$ordre.' '.$pages->get_limit()
);
$stmtorr2->execute(array(
':postAuthor' => $row['username']
));
?>
<tr>
<th style="width: 420px;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=desc">↑</a>Nom<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=desc">↑</a>Ajouté<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=desc">↑</a>Taille<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=desc">↑</a>S<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=desc">↑</a>L<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=desc">↑</a>T<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=asc">↓</a></th>
</tr>
<?php
while($rowtorr2 = $stmtorr2->fetch()) {
?>
<tr>
<td style="font-weight: bold;">
<a style="text-decoration: none;" href="<?php echo SITEURL; ?>/<?php echo $rowtorr2['postSlug']; ?>"><?php echo $rowtorr2['postTitle'];?></a>
</td>
<?php
sscanf($rowtorr2['postDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo '<td>'.$jour.'-'.$mois.'-'.$annee.'</td>';
?>
<td><?php echo makesize($rowtorr2['postTaille']); ?></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr2['postHash']; ?>"><?php echo $rowtorr2['seeders']; ?></a></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr2['postHash']; ?>"><?php echo $rowtorr2['leechers']; ?></a></td>
<td style="text-align: center;"><?php echo $rowtorr2['completed']; ?></td>
</tr>
<?php } ?>
</table>
<!-- //historique téléchargements -->
<?php
echo '<div style="text-align: center;">';
echo $pages->page_links('?membre='.$row['username'].'&tri='.$tri.'&ordre='.$ordre.'&');
echo '</div>';
?>
<br />
<?php
}// fin if($_SESSION)
else {
?>
<span style="font-size: 15pt; font-weight: bold;">
Profil membre de : <?php echo $row['username']; ?>
</span>
<span style="font-size: 9pt;">[ <a style="text-decoration: none;" href="<?php echo SITEURL; ?>/admin/edit-profil.php?membre=<?php echo $row['username']; ?>"><img style="vertical-align: text-bottom;" src="<?php echo SITEURL; ?>/images/user.png" /> Editer votre profil</a></span>
|
<span style="font-size: 9pt;"><a style="text-decoration: none;" href="<?php echo SITEURL; ?>/admin/messagerie.php?membre=<?php echo $row['username']; ?>"><img style="vertical-align: text-bottom;" src="<?php echo SITEURL; ?>/images/Email-icon.png" /> Messagerie interne</a> ]</span>
<br /><br />
<table>
<tr>
<td>ID de membre : </td><td><?php echo $row['memberID']; ?></td>
<?php
if(empty($row['avatar'])) {
?>
<td rowspan="7" stule="text-align: center;"><img style="width: 125px; height: 125px;" src="<?php echo SITEURL; ?>/images/avatars/avatar-profil.png" alt="Pas d'avatar pour <?php echo $row['username']; ?>" /></td>
<?php }
else {
?>
<td rowspan="7" style="text-align: center;"><img style="width: 125px; height: 125px;" src="<?php echo SITEURL; ?>/images/avatars/<?php echo $row['avatar']; ?>" alt="Avatar de <?php echo $row['username']; ?>" /></td>
<?php } ?>
</tr>
<tr><td>E-mail : </td><td><?php echo $row['email']; ?></td></tr>
<tr><td>Pid : </td><td><?php echo $row['pid']; ?></td></tr>
<tr><td>Date d'inscription : </td><td>
<?php
sscanf($row['memberDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo 'Le '.$jour.'-'.$mois.'-'.$annee.' à '.$heure.':'.$minute.':'.$seconde;
?>
</td></tr>
<tr><td>Envoyé :</td><td><?php echo makesize($row['uploaded']); ?></td></tr>
<tr><td>Téléchargé :</td><td><?php echo makesize($row['downloaded']); ?></td></tr>
<?php
//$ratio = $row['uploaded'] / $row['downloaded'];
//$ratio = number_format($ratio, 2);
if (intval($row["downloaded"])>0) {
$ratio=number_format($row["uploaded"]/$row["downloaded"],2);
}
else {
$ratio='∞';
}
?>
<tr><td>Ratio de partage :</td><td><?php echo $ratio; ?></td></tr>
</table>
<br />
<!-- Historique téléchargements -->
<table>
<tr><td colspan="6"><h3 id="historique">Mes Téléchargements :</h3></td></tr>
<?php
$pages = new Paginator('5','d');
$stmt = $db->prepare('SELECT fid FROM xbt_files_users WHERE uid = :uid');
$stmt->execute(array(
':uid' => $row['memberID']
));
$pages->set_total($stmt->rowCount());
/*
// TRI
if(isset($_GET['tri'])) {
$tri = htmlentities($_GET['tri']);
}
else {
$tri = 'postID';
}
if(isset($_GET['ordre'])) {
$ordre = htmlentities($_GET['ordre']);
}
else {
$ordre = 'DESC';
}
*/
// Tri de colonnes
$tri = 'postDate';
$ordre = 'DESC';
if(isset($_GET['tri'])) {
// Les valeurs authorisee
$columns = array('postTitle','postDate','postTaille','seeders','leechers','xf.completed');
$direction = array('ASC','DESC','asc','desc');
if(in_array($_GET['tri'],$columns)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$tri = htmlentities($_GET['tri']);
}
if(isset($_GET['ordre']) and in_array($_GET['ordre'],$direction)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$ordre = htmlentities($_GET['ordre']);
}
}
$stmtorr1 = $db->prepare('
SELECT * FROM xbt_files_users xfu
LEFT JOIN blog_posts_seo bps ON bps.postID = xfu.fid
LEFT JOIN xbt_files xf ON xf.fid = bps.postID
WHERE xfu.uid = :uid
ORDER BY '.$tri.' '.$ordre.' '.$pages->get_limit()
);
$stmtorr1->execute(array(
':uid' => $row['memberID']
));
?>
<tr>
<th style="width: 420px;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=desc">↑</a>Nom<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=desc">↑</a>Ajouté<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=desc">↑</a>Taille<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=desc">↑</a>S<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=desc">↑</a>L<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=desc">↑</a>T<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=asc">↓</a></th>
</tr>
<?php
while($rowtorr = $stmtorr1->fetch()) {
?>
<tr>
<td style="font-weight: bold;">
<a style="text-decoration: none;" href="<?php echo SITEURL; ?>/<?php echo $rowtorr['postSlug']; ?>"><?php echo $rowtorr['postTitle'];?></a>
</td>
<?php
sscanf($rowtorr['postDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo '<td>'.$jour.'-'.$mois.'-'.$annee.'</td>';
?>
<td><?php echo makesize($rowtorr['postTaille']); ?></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr['postHash']; ?>"><?php echo $rowtorr['seeders']; ?></a></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr['postHash']; ?>"><?php echo $rowtorr['leechers']; ?></a></td>
<td style="text-align: center;"><?php echo $rowtorr['completed']; ?></td>
</tr>
<?php } ?>
</table>
<!-- //historique téléchargements -->
<?php
echo '<div style="text-align: center;">';
echo $pages->page_links('?membre='.$row['username'].'&tri='.$tri.'&ordre='.$ordre.'&');
echo '</div>';
?>
<!-- Historique uploads -->
<table>
<tr><td colspan="6"><h3 id="historique">Mes Uploads :</h3></td></tr>
<?php
$pages = new Paginator('5','u');
// On initialise la variable
$sessionuser = isset($_SESSION['username']) ? $_SESSION['username'] : NULL;
$stmt = $db->prepare('SELECT postID FROM blog_posts_seo WHERE postAuthor = :postAuthor');
$stmt->bindValue(':postAuthor',$sessionuser,PDO::PARAM_STR);
$stmt->execute();
$pages->set_total($stmt->rowCount());
// Tri de colonnes
$tri = 'postDate';
$ordre = 'DESC';
if(isset($_GET['tri'])) {
// Les valeurs authorisee
$columns = array('postTitle','postDate','postTaille','seeders','leechers','xf.completed');
$direction = array('ASC','DESC','asc','desc');
if(in_array($_GET['tri'],$columns)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$tri = htmlentities($_GET['tri']);
}
if(isset($_GET['ordre']) and in_array($_GET['ordre'],$direction)){ //Une des valeurs authorisee, on la set. Sinon ca sera la veleurs par defaut fixee au dessus
$ordre = htmlentities($_GET['ordre']);
}
}
$stmtorr2 = $db->prepare('
SELECT * FROM blog_posts_seo
LEFT JOIN xbt_files xf ON xf.fid = blog_posts_seo.postID
WHERE blog_posts_seo.postAuthor = :postAuthor
ORDER BY '.$tri.' '.$ordre.' '.$pages->get_limit()
);
$stmtorr2->execute(array(
':postAuthor' => $row['username']
));
?>
<tr>
<th style="width: 420px;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=desc">↑</a>Nom<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTitle&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=desc">↑</a>Ajouté<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postDate&ordre=asc">↓</a></th>
<th><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=desc">↑</a>Taille<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=postTaille&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=desc">↑</a>S<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=seeders&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=desc">↑</a>L<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=leechers&ordre=asc">↓</a></th>
<th style="text-align: center;"><a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=desc">↑</a>T<a style="color: #fff; text-decoration: none;" href="profil.php?membre=<?php echo $row['username']; ?>&tri=xf.completed&ordre=asc">↓</a></th>
</tr>
<?php
while($rowtorr2 = $stmtorr2->fetch()) {
?>
<tr>
<td style="font-weight: bold;">
<a style="text-decoration: none;" href="<?php echo SITEURL; ?>/<?php echo $rowtorr2['postSlug']; ?>"><?php echo $rowtorr2['postTitle'];?></a>
</td>
<?php
sscanf($rowtorr2['postDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo '<td>'.$jour.'-'.$mois.'-'.$annee.'</td>';
?>
<td><?php echo makesize($rowtorr2['postTaille']); ?></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr2['postHash']; ?>"><?php echo $rowtorr2['seeders']; ?></a></td>
<td style="text-align: center; font-weight: bold;"><a style="text-decoration: none;" href="../peers.php?hash=<?php echo $rowtorr2['postHash']; ?>"><?php echo $rowtorr2['leechers']; ?></a></td>
<td style="text-align: center;"><?php echo $rowtorr2['completed']; ?></td>
</tr>
<?php } ?>
</table>
<!-- //historique téléchargements -->
<?php
echo '<div style="text-align: center;">';
//echo $pages->page_links('?membre='.$row['username'].'&');
echo $pages->page_links('?membre='.$row['username'].'&tri='.$tri.'&ordre='.$ordre.'&');
echo '</div>';
?>
<br />
<?php /* ?>
<!-- Messages internes -->
<?php
$pages = new Paginator('10','m');
$stmt = $db->prepare('SELECT messages_id FROM blog_messages WHERE messages_id_destinataire = :destinataire');
$stmt->execute(array(
':destinataire' => $row['memberID']
));
$pages->set_total($stmt->rowCount());
// on prépare une requete SQL cherchant le titre, la date, l'expéditeur des messages pour le membre connecté
$stmt = $db->prepare('SELECT blog_messages.messages_titre, blog_messages.messages_date, blog_members.username as expediteur, blog_messages.messages_id as id_message, blog_messages.messages_lu FROM blog_messages, blog_members WHERE blog_messages.messages_id_destinataire = :id_destinataire AND blog_messages.messages_id_expediteur = blog_members.memberID ORDER BY blog_messages.messages_date DESC '.$pages->get_limit());
$stmt->execute(array(
':id_destinataire' => $row['memberID']
));
?>
<table>
<tr>
<td colspan="5">
<h3 id="messages">Mes Messages :
<a style="text-decoration: none;" href="<?php echo SITEURL; ?>/messages_envoyer.php"><input type="button" class="button" value="Envoyer un message à un membre" /></a>
</h3>
</td>
</tr>
<tr>
<th style="width: 150px;">Date</th>
<th>Titre</th>
<th style="width: 120px;">Expéditeur</th>
</tr>
<?php
while($data = $stmt->fetch()){
echo '<tr>';
sscanf($data['messages_date'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
echo '<td>'.$jour.'-'.$mois.'-'.$annee.' à '.$heure.':'.$minute.':'.$seconde.'</td>';
echo '<td>';
if($data['messages_lu'] == 0) {
echo '<img style="vertical-align: text-bottom; width: 16px; height: 16px;" src="'.SITEURL.'/images/envelope-newmail.gif" /> ';
}
echo '<a style="text-decoration: none;" href="'.SITEURL.'/messages_lire.php?id_message='.$data['id_message'].'">'.stripslashes(htmlentities(trim($data['messages_titre']), ENT_QUOTES, "UTF-8")).'</a>';
echo '</td>';
echo '<td>'.stripslashes(htmlentities(trim($data['expediteur']), ENT_QUOTES, "UTF-8")).'</td>';
echo '</tr>';
}
?>
</table>
<?php
echo '<div style="text-align: center;">';
echo $pages->page_links('?membre='.$row['username'].'&');
echo '</div>';
?>
<br /><br />
<?php */ ?>
<?php
}// fin else
?>
</div>
<?php require('../sidebar.php'); ?>
<div class="clear"></div>
</div>
</div>
<div id="footer">
<?php require('../includes/footer.php'); ?>
</div>
</body>
</html>
<?php } ?>
|