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 | |
parent | 5b892eafafb1f41bab1a20f1524cef144042e3e1 (diff) | |
download | pillowcase-master.tar.gz pillowcase-master.tar.bz2 pillowcase-master.zip |
Diffstat (limited to 'pages')
-rwxr-xr-x | pages/archive.php | 20 | ||||
-rwxr-xr-x | pages/comic.php | 22 | ||||
-rw-r--r-- | pages/random.php | 5 | ||||
-rwxr-xr-x | pages/season.php | 19 |
4 files changed, 34 insertions, 32 deletions
diff --git a/pages/archive.php b/pages/archive.php index c5f0f52..114062c 100755 --- a/pages/archive.php +++ b/pages/archive.php | |||
@@ -10,25 +10,21 @@ | |||
10 | 10 | ||
11 | <?php | 11 | <?php |
12 | 12 | ||
13 | $getseasons = "SELECT * FROM seasons ORDER BY season_id ASC"; | 13 | $getseasons = $mysql_conn->query("SELECT * FROM seasons ORDER BY season_id ASC"); |
14 | $getseasons2 = mysql_query($getseasons); | 14 | foreach ($getseasons as $getseasons3) |
15 | while ($getseasons3 = mysql_fetch_array($getseasons2)) | ||
16 | { | 15 | { |
17 | $getfc = "SELECT * FROM comics WHERE comic_id = " . $getseasons3['first_comic_id']; | 16 | $getfc = $mysql_conn->query("SELECT * FROM comics WHERE comic_id = " . $getseasons3['first_comic_id']); |
18 | $getfc2 = mysql_query($getfc); | 17 | $getfc3 = $getfc->fetch_assoc(); |
19 | $getfc3 = mysql_fetch_array($getfc2); | ||
20 | 18 | ||
21 | if (!is_null($getseasons3['last_comic_id'])) | 19 | if (!is_null($getseasons3['last_comic_id'])) |
22 | { | 20 | { |
23 | $getlc = "SELECT * FROM comics WHERE comic_id = " . $getseasons3['last_comic_id']; | 21 | $getlc = $mysql_conn->query("SELECT * FROM comics WHERE comic_id = " . $getseasons3['last_comic_id']); |
24 | $getlc2 = mysql_query($getlc); | 22 | $getlc3 = $getlc->fetch_assoc(); |
25 | $getlc3 = mysql_fetch_array($getlc2); | ||
26 | 23 | ||
27 | $count = $getseasons3['last_comic_id'] - ($getseasons3['first_comic_id']-1); | 24 | $count = $getseasons3['last_comic_id'] - ($getseasons3['first_comic_id']-1); |
28 | } else { | 25 | } else { |
29 | $getcnt = "SELECT COUNT(*) FROM comics WHERE comic_id >= " . $getseasons3['first_comic_id']; | 26 | $getcnt = $mysql_conn->query("SELECT COUNT(*) FROM comics WHERE comic_id >= " . $getseasons3['first_comic_id']); |
30 | $getcnt2 = mysql_query($getcnt); | 27 | $getcnt3 = $getcnt->fetch_assoc(); |
31 | $getcnt3 = mysql_fetch_array($getcnt2); | ||
32 | 28 | ||
33 | $count = $getcnt3[0]; | 29 | $count = $getcnt3[0]; |
34 | } | 30 | } |
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 | ?> |
diff --git a/pages/random.php b/pages/random.php index 15d7758..049f151 100644 --- a/pages/random.php +++ b/pages/random.php | |||
@@ -1,8 +1,7 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | $getcomic = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY RAND() LIMIT 1"; | 3 | $getcomic = $mysql_conn->query("SELECT * FROM comics WHERE status = \"publish\" ORDER BY RAND() LIMIT 1"); |
4 | $getcomic2 = mysql_query($getcomic); | 4 | $getcomic3 = $getcomic->fetch_assoc(); |
5 | $getcomic3 = mysql_fetch_array($getcomic2); | ||
6 | 5 | ||
7 | header('Location: http://pillowcase.fourisland.com/comic' . $getcomic3['comic_id'] . '.htm'); | 6 | header('Location: http://pillowcase.fourisland.com/comic' . $getcomic3['comic_id'] . '.htm'); |
8 | 7 | ||
diff --git a/pages/season.php b/pages/season.php index 74568a0..f47ab13 100755 --- a/pages/season.php +++ b/pages/season.php | |||
@@ -2,9 +2,11 @@ | |||
2 | 2 | ||
3 | if (is_numeric($_GET['season'])) | 3 | if (is_numeric($_GET['season'])) |
4 | { | 4 | { |
5 | $getseason = "SELECT * FROM seasons WHERE season_id = " . $_GET['season']; | 5 | $getseason = $mysql_conn->prepare("SELECT * FROM seasons WHERE season_id = ?"); |
6 | $getseason2 = mysql_query($getseason); | 6 | $getseason->bind_param("i", $_GET['season']); |
7 | $getseason3 = mysql_fetch_array($getseason2); | 7 | $getseason->execute(); |
8 | $getseason2 = $getseason->get_result(); | ||
9 | $getseason3 = $getseason2->fetch_assoc(); | ||
8 | } | 10 | } |
9 | 11 | ||
10 | if (isset($getseason3) && ($getseason3['season_id'] == $_GET['season'])) | 12 | if (isset($getseason3) && ($getseason3['season_id'] == $_GET['season'])) |
@@ -18,13 +20,16 @@ if (isset($getseason3) && ($getseason3['season_id'] == $_GET['season'])) | |||
18 | 20 | ||
19 | if (!is_null($getseason3['last_comic_id'])) | 21 | if (!is_null($getseason3['last_comic_id'])) |
20 | { | 22 | { |
21 | $getcomics = "SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= " . $getseason3['first_comic_id'] . " AND comic_id <= " . $getseason3['last_comic_id'] . " ORDER BY comic_id ASC"; | 23 | $getcomics = $mysql_conn->prepare("SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= ? AND comic_id <= ? ORDER BY comic_id ASC"); |
24 | $getcomics->bind_param("ii", $getseason3["first_comic_id"], $getseason3["last_comic_id"]); | ||
22 | } else { | 25 | } else { |
23 | $getcomics = "SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= " . $getseason3['first_comic_id'] . " ORDER BY comic_id ASC"; | 26 | $getcomics = $mysql_conn->prepare("SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= ? ORDER BY comic_id ASC"); |
27 | $getcomics->bind_param("i", $getseason3["first_comic_id"]); | ||
24 | } | 28 | } |
25 | 29 | ||
26 | $getcomics2 = mysql_query($getcomics); | 30 | $getcomics->execute(); |
27 | while ($getcomics3 = mysql_fetch_array($getcomics2)) | 31 | $getcomics2 = $getcomics->get_result(); |
32 | foreach ($getcomics2 as $getcomics3) | ||
28 | { | 33 | { |
29 | ?> <LI><A HREF="/comic<?php echo($getcomics3['comic_id']); ?>.htm"><?php echo($getcomics3['title']); ?></A></LI> | 34 | ?> <LI><A HREF="/comic<?php echo($getcomics3['comic_id']); ?>.htm"><?php echo($getcomics3['title']); ?></A></LI> |
30 | <?php | 35 | <?php |