crappy ui for threads
This commit is contained in:
parent
1f56e6df3c
commit
22756c834e
3 changed files with 25 additions and 4 deletions
11
docs/comment.php
Normal file
11
docs/comment.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
require("../libs/page.php");
|
||||||
|
require("../libs/form.php");
|
||||||
|
require("../libs/comment.php");
|
||||||
|
|
||||||
|
$ref = 1732684297;
|
||||||
|
|
||||||
|
page_header();
|
||||||
|
comments("comment",$_GET['id']);
|
||||||
|
page_footer();
|
||||||
|
?>
|
|
@ -6,8 +6,8 @@
|
||||||
$ref = 1732684297;
|
$ref = 1732684297;
|
||||||
|
|
||||||
function getOut($typer, $idr) {
|
function getOut($typer, $idr) {
|
||||||
if ($typer == 'user') {
|
if ($typer == 'user' || $typer == 'comment') {
|
||||||
header("Location: " . '/user.php?id=' . htmlspecialchars($idr));
|
header("Location: " . '/' . $typer . '.php?id=' . htmlspecialchars($idr));
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$stmt = $db->prepare("SELECT * FROM comment WHERE id = ? ORDER BY date DESC");
|
||||||
|
$stmt->execute([
|
||||||
|
$idr
|
||||||
|
]);
|
||||||
|
$posts1 = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||||
|
|
||||||
$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC LIMIT ? OFFSET ?");
|
$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC LIMIT ? OFFSET ?");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
$typer,
|
$typer,
|
||||||
|
@ -45,7 +51,9 @@
|
||||||
$page * 10
|
$page * 10
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$posts = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
$posts2 = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||||
|
|
||||||
|
$posts = array_merge($posts1,$posts2);
|
||||||
|
|
||||||
foreach ($posts as $post) { ?>
|
foreach ($posts as $post) { ?>
|
||||||
<div class='comment'>
|
<div class='comment'>
|
||||||
|
@ -58,7 +66,9 @@
|
||||||
</a>
|
</a>
|
||||||
</b></div>
|
</b></div>
|
||||||
<div><b>
|
<div><b>
|
||||||
<?php echo date(DATE_RFC2822,$post['date'] + $ref) ?>
|
<a class='link' href='/comment.php?id=<?php echo $post['id'] ?>'>
|
||||||
|
<?php echo date(DATE_RFC2822,$post['date'] + $ref) ?>
|
||||||
|
</a>
|
||||||
</b></div>
|
</b></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue