diff options
| author | Starla Insigna <hatkirby@fourisland.com> | 2008-11-19 17:27:03 -0500 |
|---|---|---|
| committer | Starla Insigna <hatkirby@fourisland.com> | 2008-11-19 17:27:03 -0500 |
| commit | 24503e3abe705acde2df159aeae61be0d009f92e (patch) | |
| tree | 8debbd53dcd0db2f5934c5e2af4e697e3787781d /pages/quotes.php | |
| download | fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.gz fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.bz2 fourisland-24503e3abe705acde2df159aeae61be0d009f92e.zip | |
Imported sources
Diffstat (limited to 'pages/quotes.php')
| -rw-r--r-- | pages/quotes.php | 166 |
1 files changed, 166 insertions, 0 deletions
| diff --git a/pages/quotes.php b/pages/quotes.php new file mode 100644 index 0000000..78cd543 --- /dev/null +++ b/pages/quotes.php | |||
| @@ -0,0 +1,166 @@ | |||
| 1 | <?php | ||
| 2 | /* | ||
| 3 | 444444444 | ||
| 4 | 4::::::::4 | ||
| 5 | 4:::::::::4 | ||
| 6 | 4::::44::::4 | ||
| 7 | 4::::4 4::::4 Four Island | ||
| 8 | 4::::4 4::::4 | ||
| 9 | 4::::4 4::::4 Written and maintained by Starla Insigna | ||
| 10 | 4::::444444::::444 | ||
| 11 | 4::::::::::::::::4 pages/quotes.php | ||
| 12 | 4444444444:::::444 | ||
| 13 | 4::::4 Please do not use, reproduce or steal the | ||
| 14 | 4::::4 contents of this file without explicit | ||
| 15 | 4::::4 permission from Hatkirby. | ||
| 16 | 44::::::44 | ||
| 17 | 4::::::::4 | ||
| 18 | 4444444444 | ||
| 19 | */ | ||
| 20 | |||
| 21 | if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} | ||
| 22 | |||
| 23 | require('headerproc.php'); | ||
| 24 | |||
| 25 | include('includes/functions_quotes.php'); | ||
| 26 | |||
| 27 | $pageCategory = 'quotes'; | ||
| 28 | |||
| 29 | if (isset($_GET['id'])) | ||
| 30 | { | ||
| 31 | $quote_num = $_GET['id']; | ||
| 32 | } | ||
| 33 | |||
| 34 | if ($_GET['act'] == 'add') | ||
| 35 | { | ||
| 36 | $template = new FITemplate('quotes/add'); | ||
| 37 | if (isset($_GET['submit'])) | ||
| 38 | { | ||
| 39 | $template->adds_block('SUBMITTED',array('QUOTE' => (nl2br(htmlspecialchars($_POST['rash_quote'])) . "\n"))); | ||
| 40 | if (!isLoggedIn()) | ||
| 41 | { | ||
| 42 | $insquote = "INSERT INTO rash_queue (quote) VALUES(\"" . addslashes(htmlspecialchars($_POST['rash_quote'])) . "\")"; | ||
| 43 | } else { | ||
| 44 | $today = mktime(date('G'),date('i'),date('s'),date('m'),date('d'),date('Y')); | ||
| 45 | $insquote = "INSERT INTO rash_quotes (quote, rating, flag, date) VALUES (\"" . addslashes($_POST['rash_quote']) . "\", 0, 0, \"" . $today . "\")"; | ||
| 46 | } | ||
| 47 | $insquote2 = mysql_query($insquote); | ||
| 48 | } | ||
| 49 | $template->display(); | ||
| 50 | } elseif ($_GET['act'] == 'bottom') | ||
| 51 | { | ||
| 52 | $query = "SELECT id, quote, rating, flag FROM rash_quotes WHERE rating < 0 ORDER BY rating ASC LIMIT 50"; | ||
| 53 | quote_generation($query, "Bottom", -1); | ||
| 54 | } elseif ($_GET['act'] == 'browse') | ||
| 55 | { | ||
| 56 | $query = "SELECT id, quote, rating, flag FROM rash_quotes ORDER BY id ASC "; | ||
| 57 | quote_generation($query, "Browse", (isset($_GET['page']) ? $_GET['page'] : 1), 10, 5); | ||
| 58 | } elseif ($_GET['act'] == 'flag') | ||
| 59 | { | ||
| 60 | $template = new FITemplate('msg'); | ||
| 61 | $tracking_verdict = user_quote_status('flag', $quote_num, $template); | ||
| 62 | if ($tracking_verdict < 3) | ||
| 63 | { | ||
| 64 | $getfla = "SELECT flag FROM rash_quotes WHERE id = " . $quote_num . " LIMIT 0,1"; | ||
| 65 | $getfla2 = mysql_query($getfla); | ||
| 66 | $getfla3 = mysql_fetch_array($getfla2); | ||
| 67 | |||
| 68 | if ($getfla3['flag'] == 2) | ||
| 69 | { | ||
| 70 | $template->add('MSG',"This quote has been flagged and rechecked by a moderator already."); | ||
| 71 | } elseif ($getfla3['flag'] == 1) | ||
| 72 | { | ||
| 73 | $template->add('MSG',"This quote is currently pending deletion."); | ||
| 74 | } else { | ||
| 75 | $template->add('MSG',"You have marked this quote for deletion."); | ||
| 76 | $setfla = "UPDATE rash_quotes SET flag = 1 WHERE id = " . $quote_num; | ||
| 77 | $setfla2 = mysql_query($setfla); | ||
| 78 | } | ||
| 79 | } | ||
| 80 | $template->add('BACK','Quote #' . $quote_num); | ||
| 81 | $template->display(); | ||
| 82 | } elseif ($_GET['act'] == 'latest') | ||
| 83 | { | ||
| 84 | $query = "SELECT id, quote, rating, flag FROM rash_quotes ORDER BY id DESC LIMIT 50"; | ||
| 85 | quote_generation($query, "Latest", -1); | ||
| 86 | } elseif ($_GET['act'] == 'random') | ||
| 87 | { | ||
| 88 | $query = "SELECT id, quote, rating, flag FROM rash_quotes ORDER BY rand() LIMIT 50"; | ||
| 89 | quote_generation($query, "Random", -1); | ||
| 90 | } elseif ($_GET['act'] == 'random2') | ||
| 91 | { | ||
| 92 | $query = "SELECT id, quote, rating, flag FROM rash_quotes WHERE rating > 1 ORDER BY rand() LIMIT 50"; | ||
| 93 | quote_generation($query, "Random2", -1); | ||
| 94 | } elseif ($_GET['act'] == 'search') | ||
| 95 | { | ||
| 96 | if (isset($_GET['fetch'])) | ||
| 97 | { | ||
| 98 | if ($_POST['sortby'] == 'rating') | ||
| 99 | { | ||
| 100 | $how = 'desc'; | ||
| 101 | } else { | ||
| 102 | $how = 'asc'; | ||
| 103 | } | ||
| 104 | $getquotes = "SELECT id, quote, rating, flag FROM rash_quotes WHERE quote LIKE \"%" . $_POST['search'] . "%\" ORDER BY " . $_POST['sortby'] . " " . $how . " LIMIT 0," . $_POST['number']; | ||
| 105 | quote_generation($getquotes, "Query Results", -1); | ||
| 106 | } | ||
| 107 | $template = new FITemplate('quotes/search'); | ||
| 108 | $template->display(); | ||
| 109 | } elseif ($_GET['act'] == 'top') | ||
| 110 | { | ||
| 111 | $query = "SELECT id, quote, rating, flag FROM rash_quotes WHERE rating > 0 ORDER BY rating DESC LIMIT 50"; | ||
| 112 | quote_generation($query, "Top", -1); | ||
| 113 | } elseif ($_GET['act'] == 'vote') | ||
| 114 | { | ||
| 115 | $template = new FITemplate('msg'); | ||
| 116 | $tracking_verdict = user_quote_status('vote', $quote_num,$template); | ||
| 117 | $template->add('BACK','Quote #' . $quote_num); | ||
| 118 | $template->display(); | ||
| 119 | if ($tracking_verdict < 3) | ||
| 120 | { | ||
| 121 | if ($_GET['dir'] == "plus") | ||
| 122 | { | ||
| 123 | $setquote = "UPDATE rash_quotes SET rating = rating+1 WHERE id = " . $quote_num; | ||
| 124 | $setquote2 = mysql_query($setquote); | ||
| 125 | } elseif($_GET['dir'] == "minus") | ||
| 126 | { | ||
| 127 | $setquote = "UPDATE rash_quotes SET rating = rating-1 WHERE id = " . $quote_num; | ||
| 128 | $setquote2 = mysql_query($setquote); | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } else { | ||
| 132 | if ((is_int($_GET['act']) || ($_GET['act'] != false)) && (verify_int($_GET['act']))) | ||
| 133 | { | ||
| 134 | $query = "SELECT id, quote, rating, flag FROM rash_quotes WHERE id = " . $_GET['act']; | ||
| 135 | quote_generation($query, "#" . $_GET['act'], -1); | ||
| 136 | $page_id = 'quote-' . $_GET['act']; | ||
| 137 | } else { | ||
| 138 | $template = new FITemplate('post'); | ||
| 139 | $template->adds_block('INTERNAL',array('exi'=>1)); | ||
| 140 | |||
| 141 | $getpost = "SELECT * FROM updates WHERE tag1 = \"quotes\" OR tag2 = \"tag2\" OR tag3 = \"tag3\" ORDER BY id DESC LIMIT 0,1"; | ||
| 142 | $getpost2 = mysql_query($getpost); | ||
| 143 | $getpost3 = mysql_fetch_array($getpost2); | ||
| 144 | |||
| 145 | $title = $getpost3['title'] . ' - Blog Archive'; | ||
| 146 | |||
| 147 | $template->adds_block('POST', array( 'ID' => $getpost3['id'], | ||
| 148 | 'YEARID' => ((date('Y',strtotime($getpost3['pubDate']))-2006) % 4), | ||
| 149 | 'DATE' => date('F dS Y \a\\t g:i:s a',strtotime($getpost3['pubDate'])), | ||
| 150 | 'MONTH' => date('M',strtotime($getpost3['pubDate'])), | ||
| 151 | 'DAY' => date('d',strtotime($getpost3['pubDate'])), | ||
| 152 | 'CODED' => urlencode($getpost3['title']), | ||
| 153 | 'TITLE' => $getpost3['title'], | ||
| 154 | 'AUTHOR' => $getpost3['author'], | ||
| 155 | 'TAG1' => $getpost3['tag1'], | ||
| 156 | 'TAG2' => $getpost3['tag2'], | ||
| 157 | 'TAG3' => $getpost3['tag3'], | ||
| 158 | 'TEXT' => parseBBCode($getpost3['text']))); | ||
| 159 | |||
| 160 | $template->display(); | ||
| 161 | $page_id = 'updates-' . $getpost3['id']; | ||
| 162 | } | ||
| 163 | include('includes/comments.php'); | ||
| 164 | } | ||
| 165 | |||
| 166 | ?> | ||
