diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-08 21:09:05 +0000 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-08 21:09:05 +0000 |
commit | 459e929311d8806f604c0b914ba4b37aa731fbfc (patch) | |
tree | d81247d7ee4f768c9df552df07aad6d6896047f8 /pages/comic.php | |
parent | 5b892eafafb1f41bab1a20f1524cef144042e3e1 (diff) | |
download | pillowcase-459e929311d8806f604c0b914ba4b37aa731fbfc.tar.gz pillowcase-459e929311d8806f604c0b914ba4b37aa731fbfc.tar.bz2 pillowcase-459e929311d8806f604c0b914ba4b37aa731fbfc.zip |
Diffstat (limited to 'pages/comic.php')
-rwxr-xr-x | pages/comic.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/pages/comic.php b/pages/comic.php index 620a038..53b0538 100755 --- a/pages/comic.php +++ b/pages/comic.php | |||
@@ -2,12 +2,16 @@ | |||
2 | 2 | ||
3 | if (isset($_GET['id']) && is_numeric($_GET['id'])) | 3 | if (isset($_GET['id']) && is_numeric($_GET['id'])) |
4 | { | 4 | { |
5 | $getcomic = "SELECT * FROM comics WHERE comic_id = " . $_GET['id'] . " AND status = \"publish\""; | 5 | $getcomic = $mysql_conn->prepare("SELECT * FROM comics WHERE comic_id = ? AND status = \"publish\""); |
6 | $comic_id = $_GET['id']; | ||
7 | $getcomic->bind_param("i", $comic_id); | ||
8 | $getcomic->execute(); | ||
9 | $getcomic2 = $getcomic->get_result(); | ||
10 | $getcomic3 = $getcomic2->fetch_assoc(); | ||
6 | } else { | 11 | } else { |
7 | $getcomic = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1"; | 12 | $getcomic = $mysql_conn->query("SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1"); |
13 | $getcomic3 = $getcomic->fetch_assoc(); | ||
8 | } | 14 | } |
9 | $getcomic2 = mysql_query($getcomic); | ||
10 | $getcomic3 = mysql_fetch_array($getcomic2); | ||
11 | 15 | ||
12 | $date = strtotime(get_meta($getcomic3['id'], 'pubDate')); | 16 | $date = strtotime(get_meta($getcomic3['id'], 'pubDate')); |
13 | 17 | ||
@@ -64,9 +68,8 @@ if (has_meta($getcomic3['id'], 'link')) | |||
64 | 68 | ||
65 | $id = $getcomic3['comic_id']; | 69 | $id = $getcomic3['comic_id']; |
66 | 70 | ||
67 | $cntcomics = "SELECT COUNT(*) FROM comics WHERE status = \"publish\""; | 71 | $cntcomics = $mysql_conn->query("SELECT COUNT(*) FROM comics WHERE status = \"publish\""); |
68 | $cntcomics2 = mysql_query($cntcomics); | 72 | $cntcomics3 = $cntcomics->fetch_assoc(); |
69 | $cntcomics3 = mysql_fetch_array($cntcomics2); | ||
70 | $all = $cntcomics3['COUNT(*)']; | 73 | $all = $cntcomics3['COUNT(*)']; |
71 | 74 | ||
72 | if ($id > 2) | 75 | if ($id > 2) |
@@ -98,9 +101,8 @@ if ($id < $all) | |||
98 | } | 101 | } |
99 | } | 102 | } |
100 | 103 | ||
101 | $cntpending = "SELECT COUNT(*) FROM comics WHERE status = \"pending\""; | 104 | $cntpending = $mysql_conn->query("SELECT COUNT(*) FROM comics WHERE status = \"pending\""); |
102 | $cntpending2 = mysql_query($cntpending); | 105 | $cntpending3 = $cntpending->fetch_assoc(); |
103 | $cntpending3 = mysql_fetch_array($cntpending2); | ||
104 | $numpending = $cntpending3['COUNT(*)']; | 106 | $numpending = $cntpending3['COUNT(*)']; |
105 | 107 | ||
106 | ?> | 108 | ?> |