diff options
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/comments.php | 143 | ||||
| -rw-r--r-- | admin/drafts.php | 100 | ||||
| -rw-r--r-- | admin/editPoll.php | 118 | ||||
| -rw-r--r-- | admin/editPost.php | 224 | ||||
| -rw-r--r-- | admin/editQuote.php | 69 | ||||
| -rw-r--r-- | admin/maintenance.php | 61 | ||||
| -rw-r--r-- | admin/modquotes.php | 136 | ||||
| -rw-r--r-- | admin/newPoll.php | 104 | ||||
| -rw-r--r-- | admin/newPost.php | 159 | ||||
| -rw-r--r-- | admin/pending.php | 180 | ||||
| -rw-r--r-- | admin/polls.php | 98 | ||||
| -rw-r--r-- | admin/posts.php | 100 | ||||
| -rw-r--r-- | admin/quotes.php | 116 | ||||
| -rw-r--r-- | admin/update.php | 36 | ||||
| -rw-r--r-- | admin/welcome.php | 71 |
15 files changed, 1715 insertions, 0 deletions
| diff --git a/admin/comments.php b/admin/comments.php new file mode 100644 index 0000000..4cda9ec --- /dev/null +++ b/admin/comments.php | |||
| @@ -0,0 +1,143 @@ | |||
| 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 admin/comments.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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'posts'; | ||
| 27 | $pageaid = 'comments'; | ||
| 28 | |||
| 29 | if (isset($_GET['action'])) | ||
| 30 | { | ||
| 31 | if (($_GET['action'] == 'deny') || ($_GET['action'] == 'approve')) | ||
| 32 | { | ||
| 33 | if (is_numeric($_POST['id'])) | ||
| 34 | { | ||
| 35 | $getcomment = "SELECT * FROM moderation WHERE id = " . $_POST['id']; | ||
| 36 | $getcomment2 = mysql_query($getcomment); | ||
| 37 | $getcomment3 = mysql_fetch_array($getcomment2); | ||
| 38 | |||
| 39 | if ($getcomment3['id'] == $_POST['id']) | ||
| 40 | { | ||
| 41 | if ($_GET['action'] == 'deny') | ||
| 42 | { | ||
| 43 | $delpost = "DELETE FROM moderation WHERE id = " . $_POST['id']; | ||
| 44 | $delpost2 = mysql_query($delpost); | ||
| 45 | |||
| 46 | $flashmsg = 'The selected comment has been deleted.'; | ||
| 47 | } else if ($_GET['action'] == 'approve') | ||
| 48 | { | ||
| 49 | $insanon = "INSERT INTO anon_commenters (username,email,website) VALUES (\"" . $getcomment3['author'] . "\",\"" . $getcomment3['email'] . "\",\"" . $getcomment3['website'] . "\")"; | ||
| 50 | $insanon2 = mysql_query($insanon); | ||
| 51 | |||
| 52 | $inscomment = "INSERT INTO comments (page_id,user_id,comment,is_anon) VALUES (\"" . $getcomment3['page_id'] . "\"," . mysql_insert_id() . ",\"" . $getcomment3['comment'] . "\",1)"; | ||
| 53 | $inscomment2 = mysql_query($inscomment); | ||
| 54 | |||
| 55 | $delcomment = "DELETE FROM moderation WHERE id = " . $getcomment3['id']; | ||
| 56 | $delcomment2 = mysql_query($delcomment); | ||
| 57 | |||
| 58 | $flashmsg = 'The selected comment has been approved.'; | ||
| 59 | } | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } else if (($_GET['action'] == 'denys') || ($_GET['action'] == 'approves')) | ||
| 63 | { | ||
| 64 | $ids = explode(',', $_POST['ids']); | ||
| 65 | |||
| 66 | if (is_array($ids) && !empty($ids)) | ||
| 67 | { | ||
| 68 | foreach ($ids as $id) | ||
| 69 | { | ||
| 70 | $getcomment = "SELECT * FROM moderation WHERE id = " . $id; | ||
| 71 | $getcomment2 = mysql_query($getcomment); | ||
| 72 | $getcomment3 = mysql_fetch_array($getcomment2); | ||
| 73 | |||
| 74 | if ($getcomment3['id'] == $id) | ||
| 75 | { | ||
| 76 | if ($_GET['action'] == 'denys') | ||
| 77 | { | ||
| 78 | $delpost = "DELETE FROM moderation WHERE id = " . $id; | ||
| 79 | $delpost2 = mysql_query($delpost); | ||
| 80 | |||
| 81 | $flashmsg = 'The selected comments have been deleted.'; | ||
| 82 | } else if ($_GET['action'] == 'approves') | ||
| 83 | { | ||
| 84 | $insanon = "INSERT INTO anon_commenters (username,email,website) VALUES (\"" . $getcomment3['author'] . "\",\"" . $getcomment3['email'] . "\",\"" . $getcomment3['website'] . "\")"; | ||
| 85 | $insanon2 = mysql_query($insanon); | ||
| 86 | |||
| 87 | $inscomment = "INSERT INTO comments (page_id,user_id,comment,is_anon) VALUES (\"" . $getcomment3['page_id'] . "\"," . mysql_insert_id() . ",\"" . $getcomment3['comment'] . "\",1)"; | ||
| 88 | $inscomment2 = mysql_query($inscomment); | ||
| 89 | |||
| 90 | $delcomment = "DELETE FROM moderation WHERE id = " . $getcomment3['id']; | ||
| 91 | $delcomment2 = mysql_query($delcomment); | ||
| 92 | |||
| 93 | $flashmsg = 'The selected comments have been approved.'; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | } | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | $template = new FITemplate('admin/comments'); | ||
| 102 | |||
| 103 | $getcomments = "SELECT * FROM moderation ORDER BY id ASC"; | ||
| 104 | $getcomments2 = mysql_query($getcomments); | ||
| 105 | $i=0; | ||
| 106 | while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) | ||
| 107 | { | ||
| 108 | $i++; | ||
| 109 | } | ||
| 110 | |||
| 111 | if ($i != 0) | ||
| 112 | { | ||
| 113 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 114 | } else { | ||
| 115 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 116 | } | ||
| 117 | |||
| 118 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 119 | 'perPage' => 20, | ||
| 120 | 'delta' => 2, | ||
| 121 | 'itemData' => $getcomments3)); | ||
| 122 | |||
| 123 | $j=0; | ||
| 124 | |||
| 125 | foreach ($pager->getPageData() as $comment) | ||
| 126 | { | ||
| 127 | if (!empty($comment)) | ||
| 128 | { | ||
| 129 | $template->adds_block('COMMENT', array( 'TEXT' => parseText($comment['comment']), | ||
| 130 | 'AUTHOR' => $comment['author'], | ||
| 131 | 'ID' => $comment['id'], | ||
| 132 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 133 | } | ||
| 134 | |||
| 135 | $j++; | ||
| 136 | } | ||
| 137 | |||
| 138 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 139 | $template->add('PAGINATION', $pager->links); | ||
| 140 | |||
| 141 | $template->display(); | ||
| 142 | |||
| 143 | ?> | ||
| diff --git a/admin/drafts.php b/admin/drafts.php new file mode 100644 index 0000000..22d8a09 --- /dev/null +++ b/admin/drafts.php | |||
| @@ -0,0 +1,100 @@ | |||
| 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 admin/drafts.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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'posts'; | ||
| 27 | $pageaid = 'drafts'; | ||
| 28 | |||
| 29 | if (isset($_GET['action'])) | ||
| 30 | { | ||
| 31 | if ($_GET['action'] == 'delete') | ||
| 32 | { | ||
| 33 | if (is_numeric($_POST['id'])) | ||
| 34 | { | ||
| 35 | $delpost = "DELETE FROM drafts WHERE id = " . $_POST['id']; | ||
| 36 | $delpost2 = mysql_query($delpost); | ||
| 37 | |||
| 38 | $flashmsg = 'The selected draft has been deleted.'; | ||
| 39 | } | ||
| 40 | } else if ($_GET['action'] == 'deletes') | ||
| 41 | { | ||
| 42 | $ids = explode(',', $_POST['ids']); | ||
| 43 | |||
| 44 | if (is_array($ids) && !empty($ids)) | ||
| 45 | { | ||
| 46 | foreach ($ids as $id) | ||
| 47 | { | ||
| 48 | $delpost = "DELETE FROM drafts WHERE id = " . $id; | ||
| 49 | $delpost2 = mysql_query($delpost); | ||
| 50 | } | ||
| 51 | |||
| 52 | $flashmsg = 'The selected drafts have been deleted.'; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | $template = new FITemplate('admin/drafts'); | ||
| 58 | |||
| 59 | $getposts = "SELECT * FROM drafts ORDER BY id ASC"; | ||
| 60 | $getposts2 = mysql_query($getposts); | ||
| 61 | $i=0; | ||
| 62 | while ($getposts3[$i] = mysql_fetch_array($getposts2)) | ||
| 63 | { | ||
| 64 | $i++; | ||
| 65 | } | ||
| 66 | |||
| 67 | if ($i != 0) | ||
| 68 | { | ||
| 69 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 70 | } else { | ||
| 71 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 72 | } | ||
| 73 | |||
| 74 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 75 | 'perPage' => 20, | ||
| 76 | 'delta' => 2, | ||
| 77 | 'itemData' => $getposts3)); | ||
| 78 | |||
| 79 | $j=0; | ||
| 80 | |||
| 81 | foreach ($pager->getPageData() as $post) | ||
| 82 | { | ||
| 83 | if (!empty($post)) | ||
| 84 | { | ||
| 85 | $template->adds_block('POST', array( 'TITLE' => $post['title'], | ||
| 86 | 'AUTHOR' => $post['author'], | ||
| 87 | 'ID' => $post['id'], | ||
| 88 | 'CODED' => $post['slug'], | ||
| 89 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 90 | } | ||
| 91 | |||
| 92 | $j++; | ||
| 93 | } | ||
| 94 | |||
| 95 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 96 | $template->add('PAGINATION', $pager->links); | ||
| 97 | |||
| 98 | $template->display(); | ||
| 99 | |||
| 100 | ?> | ||
| diff --git a/admin/editPoll.php b/admin/editPoll.php new file mode 100644 index 0000000..3a154a3 --- /dev/null +++ b/admin/editPoll.php | |||
| @@ -0,0 +1,118 @@ | |||
| 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 admin/editPoll.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 | $category = 'polls'; | ||
| 26 | $pageaid = 'quotes'; | ||
| 27 | |||
| 28 | $template = new FITemplate('admin/writePoll'); | ||
| 29 | $template->add('TITLE', 'Edit Poll'); | ||
| 30 | $template->add('ACTION', '/admin/editPoll.php?id=' . $_GET['id'] . '&submit='); | ||
| 31 | |||
| 32 | if (isset($_GET['submit'])) | ||
| 33 | { | ||
| 34 | if (empty($_POST['question'])) | ||
| 35 | { | ||
| 36 | $errors[] = array( 'field' => 'question', | ||
| 37 | 'text' => 'Question is a required field'); | ||
| 38 | } | ||
| 39 | |||
| 40 | if (empty($_POST['option1'])) | ||
| 41 | { | ||
| 42 | $errors[] = array( 'field' => 'option1', | ||
| 43 | 'text' => 'Option 1 is a required field'); | ||
| 44 | } | ||
| 45 | |||
| 46 | if (empty($_POST['option2'])) | ||
| 47 | { | ||
| 48 | $errors[] = array( 'field' => 'option2', | ||
| 49 | 'text' => 'Option 2 is a required field'); | ||
| 50 | } | ||
| 51 | |||
| 52 | if (empty($_POST['option3'])) | ||
| 53 | { | ||
| 54 | $errors[] = array( 'field' => 'option3', | ||
| 55 | 'text' => 'Option 3 is a required field'); | ||
| 56 | } | ||
| 57 | |||
| 58 | if (empty($_POST['option4'])) | ||
| 59 | { | ||
| 60 | $errors[] = array( 'field' => 'option4', | ||
| 61 | 'text' => 'Option 4 is a required field'); | ||
| 62 | } | ||
| 63 | |||
| 64 | if (isset($errors)) | ||
| 65 | { | ||
| 66 | $template->adds_block('ISERROR',array('exi'=>1)); | ||
| 67 | |||
| 68 | $eid = 0; | ||
| 69 | foreach ($errors as $error) | ||
| 70 | { | ||
| 71 | $template->adds_block('ERROR', array( 'ID' => $eid, | ||
| 72 | 'TEXT' => $error['text'])); | ||
| 73 | $template->add('IS' . strtoupper($error['field']) . 'ERROR', ' error'); | ||
| 74 | $template->adds_block(strtoupper($error['field']) . 'ERROR', array( 'ID' => $eid, | ||
| 75 | 'TEXT' => $error['text'])); | ||
| 76 | |||
| 77 | $eid++; | ||
| 78 | } | ||
| 79 | |||
| 80 | $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $_GET['id']; | ||
| 81 | $getpoll2 = mysql_query($getpoll); | ||
| 82 | $getpoll3 = mysql_fetch_array($getpoll2); | ||
| 83 | |||
| 84 | $template->add('QUESTIONVALUE', $_POST['question']); | ||
| 85 | $template->add('OPTION1VALUE', $_POST['option1']); | ||
| 86 | $template->add('OPTION2VALUE', $_POST['option2']); | ||
| 87 | $template->add('OPTION3VALUE', $_POST['option3']); | ||
| 88 | $template->add('OPTION4VALUE', $_POST['option4']); | ||
| 89 | $template->add('TEXTVALUE', $_POST['text']); | ||
| 90 | } else { | ||
| 91 | $inspoll = "UPDATE polloftheweek SET question = \"" . mysql_real_escape_string($_POST['question']) . "\", option1 = \"" . mysql_real_escape_string($_POST['option1']) . "\", option2 = \"" . mysql_real_escape_string($_POST['option2']) . "\", option3 = \"" . mysql_real_escape_string($_POST['option3']) . "\", option4 = \"" . mysql_real_escape_string($_POST['option4']) . "\", text = \"" . mysql_real_escape_string($_POST['text']) . "\" WHERE id = " . $_GET['id']; | ||
| 92 | $inspoll2 = mysql_query($inspoll); | ||
| 93 | |||
| 94 | $template->add('QUESTIONVALUE', $_POST['question']); | ||
| 95 | $template->add('OPTION1VALUE', $_POST['option1']); | ||
| 96 | $template->add('OPTION2VALUE', $_POST['option2']); | ||
| 97 | $template->add('OPTION3VALUE', $_POST['option3']); | ||
| 98 | $template->add('OPTION4VALUE', $_POST['option4']); | ||
| 99 | $template->add('TEXTVALUE', $_POST['text']); | ||
| 100 | |||
| 101 | $template->adds_block('FLASH', array('TEXT' => 'Your poll has been sucessfully edited. <a href="/poll/' . $_GET['id'] . '.php">View poll</a>.')); | ||
| 102 | } | ||
| 103 | } else { | ||
| 104 | $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $_GET['id']; | ||
| 105 | $getpoll2 = mysql_query($getpoll); | ||
| 106 | $getpoll3 = mysql_fetch_array($getpoll2); | ||
| 107 | |||
| 108 | $template->add('QUESTIONVALUE', $getpoll3['question']); | ||
| 109 | $template->add('OPTION1VALUE', $getpoll3['option1']); | ||
| 110 | $template->add('OPTION2VALUE', $getpoll3['option2']); | ||
| 111 | $template->add('OPTION3VALUE', $getpoll3['option3']); | ||
| 112 | $template->add('OPTION4VALUE', $getpoll3['option4']); | ||
| 113 | $template->add('TEXTVALUE', $getpoll3['text']); | ||
| 114 | } | ||
| 115 | |||
| 116 | $template->display(); | ||
| 117 | |||
| 118 | ?> | ||
| diff --git a/admin/editPost.php b/admin/editPost.php new file mode 100644 index 0000000..b01d1e2 --- /dev/null +++ b/admin/editPost.php | |||
| @@ -0,0 +1,224 @@ | |||
| 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 admin/editPost.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 | $category = 'posts'; | ||
| 26 | |||
| 27 | if ($_GET['type'] == 'updates') | ||
| 28 | { | ||
| 29 | $pageaid = 'posts'; | ||
| 30 | } else { | ||
| 31 | $pageaid = $_GET['type']; | ||
| 32 | } | ||
| 33 | |||
| 34 | $tableToForm = array( 'drafts' => 'draft', | ||
| 35 | 'pending' => 'article', | ||
| 36 | 'updates' => 'instant'); | ||
| 37 | $tableToTags = array( 'drafts' => 'draft', | ||
| 38 | 'pending' => 'pending', | ||
| 39 | 'updates' => 'published'); | ||
| 40 | |||
| 41 | if (!isset($_GET['type']) || !isset($_GET['id']) || !is_numeric($_GET['id'])) | ||
| 42 | { | ||
| 43 | generateError('404'); | ||
| 44 | } else if (!(($_GET['type'] == 'drafts') || ($_GET['type'] == 'pending') || ($_GET['type'] == 'updates'))) | ||
| 45 | { | ||
| 46 | generateError('404'); | ||
| 47 | } else { | ||
| 48 | $getpost = 'SELECT * FROM ' . $_GET['type'] . ' WHERE id = ' . $_GET['id']; | ||
| 49 | $getpost2 = mysql_query($getpost); | ||
| 50 | $getpost3 = mysql_fetch_array($getpost2); | ||
| 51 | |||
| 52 | if ($getpost3['id'] == $_GET['id']) | ||
| 53 | { | ||
| 54 | $template = new FITemplate('admin/writePost'); | ||
| 55 | |||
| 56 | $template->add('TITLE', 'Edit Post'); | ||
| 57 | |||
| 58 | if (isset($_GET['submit'])) | ||
| 59 | { | ||
| 60 | if (empty($_POST['title'])) | ||
| 61 | { | ||
| 62 | $errors[] = array( 'field' => 'title', | ||
| 63 | 'text' => 'Title is a required field'); | ||
| 64 | } | ||
| 65 | |||
| 66 | if (empty($_POST['text'])) | ||
| 67 | { | ||
| 68 | $errors[] = array( 'field' => 'text', | ||
| 69 | 'text' => 'The content of a blog post cannot be empty'); | ||
| 70 | } | ||
| 71 | |||
| 72 | if (empty($_POST['tags'])) | ||
| 73 | { | ||
| 74 | $errors[] = array( 'field' => 'tags', | ||
| 75 | 'text' => 'Tags is a required field'); | ||
| 76 | } | ||
| 77 | |||
| 78 | if ( | ||
| 79 | (strpos($_POST['tags'], ',') === 0) || | ||
| 80 | (strrpos($_POST['tags'], ',') === strlen($_POST['tags'])-1) || | ||
| 81 | (strpos($_POST['tags'], ',,') !== FALSE) | ||
| 82 | ) | ||
| 83 | { | ||
| 84 | $errors[] = array( 'field' => 'tags', | ||
| 85 | 'text' => 'Blank tags are not allowed'); | ||
| 86 | } | ||
| 87 | |||
| 88 | if (empty($_POST['type'])) | ||
| 89 | { | ||
| 90 | $errors[] = array( 'field' => 'type', | ||
| 91 | 'text' => 'Type is a required field'); | ||
| 92 | } | ||
| 93 | |||
| 94 | if (isset($errors)) | ||
| 95 | { | ||
| 96 | $template->adds_block('ISERROR',array('exi'=>1)); | ||
| 97 | |||
| 98 | $eid = 0; | ||
| 99 | foreach ($errors as $error) | ||
| 100 | { | ||
| 101 | $template->adds_block('ERROR', array( 'ID' => $eid, | ||
| 102 | 'TEXT' => $error['text'])); | ||
| 103 | $template->add('IS' . strtoupper($error['field']) . 'ERROR', ' error'); | ||
| 104 | $template->adds_block(strtoupper($error['field']) . 'ERROR', array( 'ID' => $eid, | ||
| 105 | 'TEXT' => $error['text'])); | ||
| 106 | |||
| 107 | $eid++; | ||
| 108 | } | ||
| 109 | |||
| 110 | $template->add('ACTION', '/admin/editPost.php?type=' . $_GET['type'] . '&id=' . $_GET['id'] . '&submit='); | ||
| 111 | } else { | ||
| 112 | $tags = explode(',', $_POST['tags']); | ||
| 113 | removeTags($_GET['id'], $tableToTags[$_GET['type']]); | ||
| 114 | |||
| 115 | if ($tableToForm[$_GET['type']] != $_POST['type']) | ||
| 116 | { | ||
| 117 | $delold = "DELETE FROM " . $_GET['type'] . " WHERE id = " . $_GET['id']; | ||
| 118 | $delold2 = mysql_query($delold); | ||
| 119 | |||
| 120 | if ($_POST['type'] == 'draft') | ||
| 121 | { | ||
| 122 | $insdraft = "INSERT INTO drafts (title,author,text,slug) VALUES (\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; | ||
| 123 | $insdraft2 = mysql_query($insdraft); | ||
| 124 | |||
| 125 | $id = mysql_insert_id(); | ||
| 126 | $type = 'drafts'; | ||
| 127 | addTags($id, $tags, 'draft'); | ||
| 128 | } else if ($_POST['type'] == 'instant') | ||
| 129 | { | ||
| 130 | $id = postBlogPost($_POST['title'], getSessionUsername(), $tags, $_POST['text']); | ||
| 131 | $type = 'updates'; | ||
| 132 | } else { | ||
| 133 | if ($_POST['type'] == 'article') | ||
| 134 | { | ||
| 135 | $getpending = "SELECT * FROM pending ORDER BY id DESC LIMIT 0,1"; | ||
| 136 | $getpending2 = mysql_query($getpending); | ||
| 137 | $getpending3 = mysql_fetch_array($getpending2); | ||
| 138 | if (isset($getpending3['id']) === FALSE) | ||
| 139 | { | ||
| 140 | $id = 50; | ||
| 141 | } else { | ||
| 142 | $id = $getpending3['id']+1; | ||
| 143 | } | ||
| 144 | } else if ($_POST['type'] == 'high') | ||
| 145 | { | ||
| 146 | $getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1"; | ||
| 147 | $getpending2 = mysql_query($getpending); | ||
| 148 | $getpending3 = mysql_fetch_array($getpending2); | ||
| 149 | if (isset($getpending3['id']) === FALSE) | ||
| 150 | { | ||
| 151 | $id = 50; | ||
| 152 | } else { | ||
| 153 | $id = $getpending3['id']-1; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | $inspending = "INSERT INTO pending (id,title,author,text,slug) VALUES (" . $id . ",\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; | ||
| 158 | $inspending2 = mysql_query($inspending); | ||
| 159 | |||
| 160 | $type = 'pending'; | ||
| 161 | addTags($id, $tags, 'pending'); | ||
| 162 | } | ||
| 163 | } else if ($_POST['type'] == 'draft') | ||
| 164 | { | ||
| 165 | $setdraft = "UPDATE drafts SET title = \"" . mysql_real_escape_string($_POST['title']) . "\", text = \"" . mysql_real_escape_string($_POST['text']) . "\" WHERE id = " . $_GET['id']; | ||
| 166 | $setdraft2 = mysql_query($setdraft); | ||
| 167 | |||
| 168 | $type = 'drafts'; | ||
| 169 | $id = $_GET['id']; | ||
| 170 | addTags($_GET['id'], $tags, 'draft'); | ||
| 171 | } else if ($_POST['type'] == 'article') | ||
| 172 | { | ||
| 173 | $setpending = "UPDATE pending SET title = \"" . mysql_real_escape_string($_POST['title']) . "\", text = \"" . mysql_real_escape_string($_POST['text']) . "\" WHERE id = " . $_GET['id']; | ||
| 174 | $setpending2 = mysql_query($setpending); | ||
| 175 | |||
| 176 | $type = 'pending'; | ||
| 177 | $id = $_GET['id']; | ||
| 178 | addTags($_GET['id'], $tags, 'pending'); | ||
| 179 | } else if ($_POST['type'] == 'instant') | ||
| 180 | { | ||
| 181 | $setpost = "UPDATE updates SET title = \"" . mysql_real_escape_string($_POST['title']) . "\", text = \"" . mysql_real_escape_string($_POST['text']) . "\" WHERE id = " . $_GET['id']; | ||
| 182 | $setpost2 = mysql_query($setpost); | ||
| 183 | |||
| 184 | $type = 'updates'; | ||
| 185 | $id = $_GET['id']; | ||
| 186 | addTags($_GET['id'], $tags); | ||
| 187 | } | ||
| 188 | |||
| 189 | if ($type == 'updates') | ||
| 190 | { | ||
| 191 | $getpost = "SELECT * FROM updates WHERE id = " . $id; | ||
| 192 | $getpost2 = mysql_query($getpost); | ||
| 193 | $getpost3 = mysql_fetch_array($getpost2); | ||
| 194 | |||
| 195 | $url = '/blog/' . $getpost3['slug'] . '/'; | ||
| 196 | } else { | ||
| 197 | $url = '/viewPost.php?type=' . $type . '&id=' . $id; | ||
| 198 | } | ||
| 199 | |||
| 200 | $template->adds_block('FLASH', array('TEXT' => 'Your post has been sucessfully edited. <a href="' . $url . '">View post</a>.')); | ||
| 201 | $template->add('ACTION', '/admin/editPost.php?type=' . $type . '&id=' . $id . '&submit='); | ||
| 202 | } | ||
| 203 | |||
| 204 | $template->add('TITLEVALUE', $_POST['title']); | ||
| 205 | $template->add('TEXTVALUE', $_POST['text']); | ||
| 206 | $template->add('TAGSVALUE', $_POST['tags']); | ||
| 207 | $template->add(strtoupper($_POST['type']) . 'SELECTED', ' checked="checked"'); | ||
| 208 | if ($_POST['type'] != 'draft') $template->add('TAGSDISABLED', ' readonly="readonly"'); | ||
| 209 | } else { | ||
| 210 | $template->add('TITLEVALUE', $getpost3['title']); | ||
| 211 | $template->add('TEXTVALUE', $getpost3['text']); | ||
| 212 | $template->add('TAGSVALUE', implode(',', getTags($_GET['id'], $tableToTags[$_GET['type']]))); | ||
| 213 | $template->add(strtoupper($tableToForm[$_GET['type']]) . 'SELECTED', ' checked="checked"'); | ||
| 214 | if ($_GET['type'] != 'drafts') $template->add('TAGSDISABLED', ' readonly="readonly"'); | ||
| 215 | $template->add('ACTION', '/admin/editPost.php?type=' . $_GET['type'] . '&id=' . $_GET['id'] . '&submit='); | ||
| 216 | } | ||
| 217 | |||
| 218 | $template->display(); | ||
| 219 | } else { | ||
| 220 | generateError('404'); | ||
| 221 | } | ||
| 222 | } | ||
| 223 | |||
| 224 | ?> | ||
| diff --git a/admin/editQuote.php b/admin/editQuote.php new file mode 100644 index 0000000..b250ece --- /dev/null +++ b/admin/editQuote.php | |||
| @@ -0,0 +1,69 @@ | |||
| 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 admin/editQuote.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 | $category = 'quotes'; | ||
| 26 | $pageaid = 'quotes'; | ||
| 27 | |||
| 28 | $template = new FITemplate('admin/writeQuote'); | ||
| 29 | $template->add('TITLE', 'Edit Quote'); | ||
| 30 | $template->add('ACTION', '/admin/editQuote.php?id=' . $_GET['id'] . '&submit='); | ||
| 31 | |||
| 32 | if (isset($_GET['submit'])) | ||
| 33 | { | ||
| 34 | if (isset($errors)) | ||
| 35 | { | ||
| 36 | $template->adds_block('ISERROR',array('exi'=>1)); | ||
| 37 | |||
| 38 | $eid = 0; | ||
| 39 | foreach ($errors as $error) | ||
| 40 | { | ||
| 41 | $template->adds_block('ERROR', array( 'ID' => $eid, | ||
| 42 | 'TEXT' => $error['text'])); | ||
| 43 | $template->add('IS' . strtoupper($error['field']) . 'ERROR', ' error'); | ||
| 44 | $template->adds_block(strtoupper($error['field']) . 'ERROR', array( 'ID' => $eid, | ||
| 45 | 'TEXT' => $error['text'])); | ||
| 46 | |||
| 47 | $eid++; | ||
| 48 | } | ||
| 49 | |||
| 50 | $template->add('QUOTEVALUE', $_POST['quote']); | ||
| 51 | } else { | ||
| 52 | $insquote = "UPDATE rash_quotes SET quote = \"" . mysql_real_escape_string($_POST['quote']) . "\" WHERE id = " . $_GET['id']; | ||
| 53 | $insquote2 = mysql_query($insquote); | ||
| 54 | |||
| 55 | $template->add('QUOTEVALUE', $_POST['quote']); | ||
| 56 | |||
| 57 | $template->adds_block('FLASH', array('TEXT' => 'Your quote has been sucessfully edited. <a href="/quotes/' . $_GET['id'] . '.php">View quote</a>.')); | ||
| 58 | } | ||
| 59 | } else { | ||
| 60 | $getquote = "SELECT * FROM rash_quotes WHERE id = " . $_GET['id']; | ||
| 61 | $getquote2 = mysql_query($getquote); | ||
| 62 | $getquote3 = mysql_fetch_array($getquote2); | ||
| 63 | |||
| 64 | $template->add('QUOTEVALUE', $getquote3['quote']); | ||
| 65 | } | ||
| 66 | |||
| 67 | $template->display(); | ||
| 68 | |||
| 69 | ?> | ||
| diff --git a/admin/maintenance.php b/admin/maintenance.php new file mode 100644 index 0000000..57f2646 --- /dev/null +++ b/admin/maintenance.php | |||
| @@ -0,0 +1,61 @@ | |||
| 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 admin/maintenance.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 | $category = 'home'; | ||
| 26 | $pageaid = 'maintenance'; | ||
| 27 | |||
| 28 | if (isset($_GET['submit'])) | ||
| 29 | { | ||
| 30 | if ($_POST['mode'] == 'on') | ||
| 31 | { | ||
| 32 | $set = 1; | ||
| 33 | } else if ($_POST['mode'] == 'off') | ||
| 34 | { | ||
| 35 | $set = 0; | ||
| 36 | } | ||
| 37 | |||
| 38 | if (isset($set)) | ||
| 39 | { | ||
| 40 | $setconfig = "UPDATE config SET value = \"" . $set . "\" WHERE name = \"maintenanceMode\""; | ||
| 41 | $setconfig2 = mysql_query($setconfig); | ||
| 42 | |||
| 43 | $flashmsg = 'Maintenance Mode has successfully been set to "' . $_POST['mode'] . '"'; | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | $template = new FITemplate('admin/maintenance'); | ||
| 48 | |||
| 49 | $getconfig = "SELECT * FROM config WHERE name = \"maintenanceMode\""; | ||
| 50 | $getconfig2 = mysql_query($getconfig); | ||
| 51 | $getconfig3 = mysql_fetch_array($getconfig2); | ||
| 52 | if ($getconfig3['value'] == '1') | ||
| 53 | { | ||
| 54 | $template->add('ON', ' selected="selected"'); | ||
| 55 | } else { | ||
| 56 | $template->add('OFF', ' selected="selected"'); | ||
| 57 | } | ||
| 58 | |||
| 59 | $template->display(); | ||
| 60 | |||
| 61 | ?> | ||
| diff --git a/admin/modquotes.php b/admin/modquotes.php new file mode 100644 index 0000000..8340fd1 --- /dev/null +++ b/admin/modquotes.php | |||
| @@ -0,0 +1,136 @@ | |||
| 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 admin/modquotes.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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'quotes'; | ||
| 27 | $pageaid = 'modquotes'; | ||
| 28 | |||
| 29 | if (isset($_GET['action'])) | ||
| 30 | { | ||
| 31 | if (($_GET['action'] == 'deny') || ($_GET['action'] == 'approve')) | ||
| 32 | { | ||
| 33 | if (is_numeric($_POST['id'])) | ||
| 34 | { | ||
| 35 | $getpending = "SELECT * FROM rash_queue WHERE id = " . $_POST['id']; | ||
| 36 | $getpending2 = mysql_query($getpending); | ||
| 37 | $getpending3 = mysql_fetch_array($getpending2); | ||
| 38 | |||
| 39 | if ($getpending3['id'] == $_POST['id']) | ||
| 40 | { | ||
| 41 | if ($_GET['action'] == 'deny') | ||
| 42 | { | ||
| 43 | $delpending = "DELETE FROM rash_queue WHERE id = " . $_POST['id']; | ||
| 44 | $delpending2 = mysql_query($delpending); | ||
| 45 | |||
| 46 | $flashmsg = 'The selected quote has been deleted.'; | ||
| 47 | } else if ($_GET['action'] == 'approve') | ||
| 48 | { | ||
| 49 | $insquote = "INSERT INTO rash_quotes (quote,date) VALUES (\"" . mysql_real_escape_string($getpending3['quote']) . "\",\"" . time() . "\")"; | ||
| 50 | $insquote2 = mysql_query($insquote); | ||
| 51 | |||
| 52 | $delpending = "DELETE FROM rash_queue WHERE id = " . $_POST['id']; | ||
| 53 | $delpending2 = mysql_query($delpending); | ||
| 54 | |||
| 55 | $flashmsg = 'The selected quote has been approved.'; | ||
| 56 | } | ||
| 57 | } | ||
| 58 | } | ||
| 59 | } else if (($_GET['action'] == 'denys') || ($_GET['action'] == 'approves')) | ||
| 60 | { | ||
| 61 | $ids = explode(',', $_POST['ids']); | ||
| 62 | |||
| 63 | if (is_array($ids) && !empty($ids)) | ||
| 64 | { | ||
| 65 | foreach ($ids as $id) | ||
| 66 | { | ||
| 67 | $getcomment = "SELECT * FROM rash_queue WHERE id = " . $id; | ||
| 68 | $getcomment2 = mysql_query($getcomment); | ||
| 69 | $getcomment3 = mysql_fetch_array($getcomment2); | ||
| 70 | |||
| 71 | if ($getcomment3['id'] == $id) | ||
| 72 | { | ||
| 73 | if ($_GET['action'] == 'denys') | ||
| 74 | { | ||
| 75 | $delpending = "DELETE FROM rash_queue WHERE id = " . $id; | ||
| 76 | $delpending2 = mysql_query($delpending); | ||
| 77 | |||
| 78 | $flashmsg = 'The selected quote has been deleted.'; | ||
| 79 | } else if ($_GET['action'] == 'approves') | ||
| 80 | { | ||
| 81 | $insquote = "INSERT INTO rash_quotes (quote,date) VALUES (\"" . mysql_real_escape_string($getpending3['quote']) . "\",\"" . time() . "\")"; | ||
| 82 | $insquote2 = mysql_query($insquote); | ||
| 83 | |||
| 84 | $delpending = "DELETE FROM rash_queue WHERE id = " . $id; | ||
| 85 | $delpending2 = mysql_query($delpending); | ||
| 86 | |||
| 87 | $flashmsg = 'The selected quote has been approved.'; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | } | ||
| 91 | } | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | $template = new FITemplate('admin/modquotes'); | ||
| 96 | |||
| 97 | $getpendingq = "SELECT * FROM rash_queue ORDER BY id ASC"; | ||
| 98 | $getpendingq2 = mysql_query($getpendingq); | ||
| 99 | $i=0; | ||
| 100 | while ($getpendingq3[$i] = mysql_fetch_array($getpendingq2)) | ||
| 101 | { | ||
| 102 | $i++; | ||
| 103 | } | ||
| 104 | |||
| 105 | if ($i != 0) | ||
| 106 | { | ||
| 107 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 108 | } else { | ||
| 109 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 110 | } | ||
| 111 | |||
| 112 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 113 | 'perPage' => 20, | ||
| 114 | 'delta' => 2, | ||
| 115 | 'itemData' => $getpendingq3)); | ||
| 116 | |||
| 117 | $j=0; | ||
| 118 | |||
| 119 | foreach ($pager->getPageData() as $quote) | ||
| 120 | { | ||
| 121 | if (!empty($quote)) | ||
| 122 | { | ||
| 123 | $template->adds_block('QUOTE', array( 'TEXT' => str_replace("\n","<br />",htmlentities(stripslashes($quote['quote']))), | ||
| 124 | 'ID' => $quote['id'], | ||
| 125 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 126 | } | ||
| 127 | |||
| 128 | $j++; | ||
| 129 | } | ||
| 130 | |||
| 131 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 132 | $template->add('PAGINATION', $pager->links); | ||
| 133 | |||
| 134 | $template->display(); | ||
| 135 | |||
| 136 | ?> | ||
| diff --git a/admin/newPoll.php b/admin/newPoll.php new file mode 100644 index 0000000..0373980 --- /dev/null +++ b/admin/newPoll.php | |||
| @@ -0,0 +1,104 @@ | |||
| 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 admin/newPoll.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 | $category = 'polls'; | ||
| 26 | $pageaid = 'newpoll'; | ||
| 27 | |||
| 28 | $template = new FITemplate('admin/writePoll'); | ||
| 29 | |||
| 30 | if (isset($_GET['submit'])) | ||
| 31 | { | ||
| 32 | if (empty($_POST['question'])) | ||
| 33 | { | ||
| 34 | $errors[] = array( 'field' => 'question', | ||
| 35 | 'text' => 'Question is a required field'); | ||
| 36 | } | ||
| 37 | |||
| 38 | if (empty($_POST['option1'])) | ||
| 39 | { | ||
| 40 | $errors[] = array( 'field' => 'option1', | ||
| 41 | 'text' => 'Option 1 is a required field'); | ||
| 42 | } | ||
| 43 | |||
| 44 | if (empty($_POST['option2'])) | ||
| 45 | { | ||
| 46 | $errors[] = array( 'field' => 'option2', | ||
| 47 | 'text' => 'Option 2 is a required field'); | ||
| 48 | } | ||
| 49 | |||
| 50 | if (empty($_POST['option3'])) | ||
| 51 | { | ||
| 52 | $errors[] = array( 'field' => 'option3', | ||
| 53 | 'text' => 'Option 3 is a required field'); | ||
| 54 | } | ||
| 55 | |||
| 56 | if (empty($_POST['option4'])) | ||
| 57 | { | ||
| 58 | $errors[] = array( 'field' => 'option4', | ||
| 59 | 'text' => 'Option 4 is a required field'); | ||
| 60 | } | ||
| 61 | |||
| 62 | if (isset($errors)) | ||
| 63 | { | ||
| 64 | $template->adds_block('ISERROR',array('exi'=>1)); | ||
| 65 | |||
| 66 | $eid = 0; | ||
| 67 | foreach ($errors as $error) | ||
| 68 | { | ||
| 69 | $template->adds_block('ERROR', array( 'ID' => $eid, | ||
| 70 | 'TEXT' => $error['text'])); | ||
| 71 | $template->add('IS' . strtoupper($error['field']) . 'ERROR', ' error'); | ||
| 72 | $template->adds_block(strtoupper($error['field']) . 'ERROR', array( 'ID' => $eid, | ||
| 73 | 'TEXT' => $error['text'])); | ||
| 74 | |||
| 75 | $eid++; | ||
| 76 | } | ||
| 77 | |||
| 78 | $template->add('TITLE', 'New Poll'); | ||
| 79 | $template->add('ACTION', '/admin/newPoll.php?submit='); | ||
| 80 | } else { | ||
| 81 | $inspoll = "INSERT INTO polloftheweek (question,option1,option2,option3,option4,text) VALUES (\"" . mysql_real_escape_string($_POST['question']) . "\",\"" . mysql_real_escape_string($_POST['option1']) . "\",\"" . mysql_real_escape_string($_POST['option2']) . "\",\"" . mysql_real_escape_string($_POST['option3']) . "\",\"" . mysql_real_escape_string($_POST['option4']) . "\",\"" . mysql_real_escape_string($_POST['text']) . "\")"; | ||
| 82 | $inspoll2 = mysql_query($inspoll); | ||
| 83 | |||
| 84 | $id = mysql_insert_id(); | ||
| 85 | |||
| 86 | $template->add('QUESTIONVALUE', $_POST['question']); | ||
| 87 | $template->add('OPTION1VALUE', $_POST['option1']); | ||
| 88 | $template->add('OPTION2VALUE', $_POST['option2']); | ||
| 89 | $template->add('OPTION3VALUE', $_POST['option3']); | ||
| 90 | $template->add('OPTION4VALUE', $_POST['option4']); | ||
| 91 | $template->add('TEXTVALUE', $_POST['text']); | ||
| 92 | |||
| 93 | $template->add('TITLE', 'Edit Poll'); | ||
| 94 | $template->add('ACTION', '/admin/editPoll.php?id=' . $id . '&submit='); | ||
| 95 | $template->adds_block('FLASH', array('TEXT' => 'Your poll has been sucessfully created. <a href="/poll/' . $id . '.php">View poll</a>.')); | ||
| 96 | } | ||
| 97 | } else { | ||
| 98 | $template->add('TITLE', 'New Poll'); | ||
| 99 | $template->add('ACTION', '/admin/newPoll.php?submit='); | ||
| 100 | } | ||
| 101 | |||
| 102 | $template->display(); | ||
| 103 | |||
| 104 | ?> | ||
| diff --git a/admin/newPost.php b/admin/newPost.php new file mode 100644 index 0000000..eb6b4e0 --- /dev/null +++ b/admin/newPost.php | |||
| @@ -0,0 +1,159 @@ | |||
| 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 admin/newPost.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 | $category = 'posts'; | ||
| 26 | $pageaid = 'newpost'; | ||
| 27 | |||
| 28 | $template = new FITemplate('admin/writePost'); | ||
| 29 | |||
| 30 | if (isset($_GET['submit'])) | ||
| 31 | { | ||
| 32 | if (empty($_POST['title'])) | ||
| 33 | { | ||
| 34 | $errors[] = array( 'field' => 'title', | ||
| 35 | 'text' => 'Title is a required field'); | ||
| 36 | } | ||
| 37 | |||
| 38 | if (empty($_POST['text'])) | ||
| 39 | { | ||
| 40 | $errors[] = array( 'field' => 'text', | ||
| 41 | 'text' => 'The content of a blog post cannot be empty'); | ||
| 42 | } | ||
| 43 | |||
| 44 | if (empty($_POST['tags'])) | ||
| 45 | { | ||
| 46 | $errors[] = array( 'field' => 'tags', | ||
| 47 | 'text' => 'Tags is a required field'); | ||
| 48 | } | ||
| 49 | |||
| 50 | if ( | ||
| 51 | (strpos($_POST['tags'], ',') === 0) || | ||
| 52 | (strrpos($_POST['tags'], ',') === strlen($_POST['tags'])-1) || | ||
| 53 | (strpos($_POST['tags'], ',,') !== FALSE) | ||
| 54 | ) | ||
| 55 | { | ||
| 56 | $errors[] = array( 'field' => 'tags', | ||
| 57 | 'text' => 'Blank tags are not allowed'); | ||
| 58 | } | ||
| 59 | |||
| 60 | if (empty($_POST['type'])) | ||
| 61 | { | ||
| 62 | $errors[] = array( 'field' => 'type', | ||
| 63 | 'text' => 'Type is a required field'); | ||
| 64 | } | ||
| 65 | |||
| 66 | if (isset($errors)) | ||
| 67 | { | ||
| 68 | $template->adds_block('ISERROR',array('exi'=>1)); | ||
| 69 | |||
| 70 | $eid = 0; | ||
| 71 | foreach ($errors as $error) | ||
| 72 | { | ||
| 73 | $template->adds_block('ERROR', array( 'ID' => $eid, | ||
| 74 | 'TEXT' => $error['text'])); | ||
| 75 | $template->add('IS' . strtoupper($error['field']) . 'ERROR', ' error'); | ||
| 76 | $template->adds_block(strtoupper($error['field']) . 'ERROR', array( 'ID' => $eid, | ||
| 77 | 'TEXT' => $error['text'])); | ||
| 78 | |||
| 79 | $eid++; | ||
| 80 | } | ||
| 81 | |||
| 82 | $template->add('TITLE', 'Write New Post'); | ||
| 83 | $template->add('ACTION', '/admin/newPost.php?submit='); | ||
| 84 | } else { | ||
| 85 | $tags = explode(',', $_POST['tags']); | ||
| 86 | |||
| 87 | if ($_POST['type'] == 'draft') | ||
| 88 | { | ||
| 89 | $insdraft = "INSERT INTO drafts (title,author,text,slug) VALUES (\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; | ||
| 90 | $insdraft2 = mysql_query($insdraft); | ||
| 91 | |||
| 92 | $id = mysql_insert_id(); | ||
| 93 | $type = 'drafts'; | ||
| 94 | addTags($id, $tags, 'draft'); | ||
| 95 | } else if ($_POST['type'] == 'instant') | ||
| 96 | { | ||
| 97 | $id = postBlogPost($_POST['title'], getSessionUsername(), $tags, $_POST['text']); | ||
| 98 | $type = 'updates'; | ||
| 99 | } else { | ||
| 100 | if ($_POST['type'] == 'article') | ||
| 101 | { | ||
| 102 | $getpending = "SELECT * FROM pending ORDER BY id DESC LIMIT 0,1"; | ||
| 103 | $getpending2 = mysql_query($getpending); | ||
| 104 | $getpending3 = mysql_fetch_array($getpending2); | ||
| 105 | if (isset($getpending3['id']) === FALSE) | ||
| 106 | { | ||
| 107 | $id = 50; | ||
| 108 | } else { | ||
| 109 | $id = $getpending3['id']+1; | ||
| 110 | } | ||
| 111 | } else if ($_POST['type'] == 'high') | ||
| 112 | { | ||
| 113 | $getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1"; | ||
| 114 | $getpending2 = mysql_query($getpending); | ||
| 115 | $getpending3 = mysql_fetch_array($getpending2); | ||
| 116 | if (isset($getpending3['id']) === FALSE) | ||
| 117 | { | ||
| 118 | $id = 50; | ||
| 119 | } else { | ||
| 120 | $id = $getpending3['id']-1; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 124 | $inspending = "INSERT INTO pending (id,title,author,text,slug) VALUES (" . $id . ",\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; | ||
| 125 | $inspending2 = mysql_query($inspending); | ||
| 126 | |||
| 127 | $type = 'pending'; | ||
| 128 | addTags($id, $tags, 'pending'); | ||
| 129 | } | ||
| 130 | |||
| 131 | if ($type == 'updates') | ||
| 132 | { | ||
| 133 | $getpost = "SELECT * FROM updates WHERE id = " . $id; | ||
| 134 | $getpost2 = mysql_query($getpost); | ||
| 135 | $getpost3 = mysql_fetch_array($getpost2); | ||
| 136 | |||
| 137 | $url = '/blog/' . $getpost3['slug'] . '/'; | ||
| 138 | } else { | ||
| 139 | $url = '/viewPost.php?type=' . $type . '&id=' . $id; | ||
| 140 | } | ||
| 141 | |||
| 142 | $template->add('ACTION', '/admin/editPost.php?type=' . $type . '&id=' . $id . '&submit='); | ||
| 143 | $template->adds_block('FLASH', array('TEXT' => 'Your post has been sucessfully created. <a href="' . $url . '">View post</a>.')); | ||
| 144 | $template->add('TITLE', 'Edit Post'); | ||
| 145 | if ($type != 'drafts') $template->add('TAGSDISABLED', ' readonly="readonly"'); | ||
| 146 | } | ||
| 147 | |||
| 148 | $template->add('TITLEVALUE', $_POST['title']); | ||
| 149 | $template->add('TEXTVALUE', $_POST['text']); | ||
| 150 | $template->add('TAGSVALUE', $_POST['tags']); | ||
| 151 | $template->add(strtoupper($_POST['type']) . 'SELECTED', ' checked="checked"'); | ||
| 152 | } else { | ||
| 153 | $template->add('TITLE', 'Write New Post'); | ||
| 154 | $template->add('ACTION', '/admin/newPost.php?submit='); | ||
| 155 | } | ||
| 156 | |||
| 157 | $template->display(); | ||
| 158 | |||
| 159 | ?> | ||
| diff --git a/admin/pending.php b/admin/pending.php new file mode 100644 index 0000000..407cd35 --- /dev/null +++ b/admin/pending.php | |||
| @@ -0,0 +1,180 @@ | |||
| 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 admin/pending.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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'posts'; | ||
| 27 | $pageaid = 'pending'; | ||
| 28 | |||
| 29 | if (isset($_GET['action'])) | ||
| 30 | { | ||
| 31 | if ($_GET['action'] == 'delete') | ||
| 32 | { | ||
| 33 | if (is_numeric($_POST['id'])) | ||
| 34 | { | ||
| 35 | $delpost = "DELETE FROM pending WHERE id = " . $_POST['id']; | ||
| 36 | $delpost2 = mysql_query($delpost); | ||
| 37 | |||
| 38 | $flashmsg = 'The selected pending post has been deleted.'; | ||
| 39 | } | ||
| 40 | } else if (($_GET['action'] == 'moveup') || ($_GET['action'] == 'movedown')) | ||
| 41 | { | ||
| 42 | if (is_numeric($_GET['id'])) | ||
| 43 | { | ||
| 44 | $getpending = "SELECT * FROM pending WHERE id = " . $_GET['id']; | ||
| 45 | $getpending2 = mysql_query($getpending); | ||
| 46 | $getpending3 = mysql_fetch_array($getpending2); | ||
| 47 | |||
| 48 | if ($getpending3['id'] == $_GET['id']) | ||
| 49 | { | ||
| 50 | if ($_GET['action'] == 'moveup') | ||
| 51 | { | ||
| 52 | $get2pending = "SELECT * FROM pending WHERE id < " . $_GET['id'] . " ORDER BY id DESC LIMIT 0,1"; | ||
| 53 | $get2pending2 = mysql_query($get2pending); | ||
| 54 | $get2pending3 = mysql_fetch_array($get2pending2); | ||
| 55 | |||
| 56 | if (isset($get2pending3['id'])) | ||
| 57 | { | ||
| 58 | $otherPending = $get2pending3; | ||
| 59 | } | ||
| 60 | } else if ($_GET['action'] == 'movedown') | ||
| 61 | { | ||
| 62 | $get2pending = "SELECT * FROM pending WHERE id > " . $_GET['id'] . " ORDER BY id ASC LIMIT 0,1"; | ||
| 63 | $get2pending2 = mysql_query($get2pending); | ||
| 64 | $get2pending3 = mysql_fetch_array($get2pending2); | ||
| 65 | |||
| 66 | if (isset($get2pending3['id'])) | ||
| 67 | { | ||
| 68 | $otherPending = $get2pending3; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | if (isset($otherPending)) | ||
| 73 | { | ||
| 74 | $delpending = "DELETE FROM pending WHERE id = " . $_GET['id'] . " OR id = " . $otherPending['id']; | ||
| 75 | $delpending2 = mysql_query($delpending); | ||
| 76 | |||
| 77 | $inspending = "INSERT INTO pending (id, title, author, text, slug) VALUES (" . $_GET['id'] . ",\"" . $otherPending['title'] . "\",\"" . $otherPending['author'] . "\",\"" . mysql_real_escape_string($otherPending['text']) . "\",\"" . $otherPending['slug'] . "\")"; | ||
| 78 | $inspending2 = mysql_query($inspending); | ||
| 79 | |||
| 80 | $ins2pending = "INSERT INTO pending (id, title, author, text, slug) VALUES (" . $otherPending['id'] . ",\"" . $getpending3['title'] . "\",\"" . $getpending3['author'] . "\",\"" . mysql_real_escape_string($getpending3['text']) . "\",\"" . $getpending3['slug'] . "\")"; | ||
| 81 | $ins2pending2 = mysql_query($ins2pending) or die($ins2pending); | ||
| 82 | |||
| 83 | $tags1 = getTags($_GET['id'], 'pending'); | ||
| 84 | $tags2 = getTags($otherPending['id'], 'pending'); | ||
| 85 | removeTags($_GET['id'], 'pending'); | ||
| 86 | removeTags($otherPending['id'], 'pending'); | ||
| 87 | addTags($_GET['id'], $tags2, 'pending'); | ||
| 88 | addTags($otherPending['id'], $tags1, 'pending'); | ||
| 89 | |||
| 90 | $flashmsg = 'The selected post was moved sucessfully.'; | ||
| 91 | } | ||
| 92 | } | ||
| 93 | } | ||
| 94 | } else if ($_GET['action'] == 'deletes') | ||
| 95 | { | ||
| 96 | $ids = explode(',', $_POST['ids']); | ||
| 97 | |||
| 98 | if (is_array($ids) && !empty($ids)) | ||
| 99 | { | ||
| 100 | foreach ($ids as $id) | ||
| 101 | { | ||
| 102 | $delpost = "DELETE FROM pending WHERE id = " . $id; | ||
| 103 | $delpost2 = mysql_query($delpost); | ||
| 104 | } | ||
| 105 | |||
| 106 | $flashmsg = 'The selected posts have been deleted.'; | ||
| 107 | } | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 111 | $template = new FITemplate('admin/pending'); | ||
| 112 | |||
| 113 | $getposts = "SELECT * FROM pending ORDER BY id ASC"; | ||
| 114 | $getposts2 = mysql_query($getposts); | ||
| 115 | $i=0; | ||
| 116 | while ($getposts3[$i] = mysql_fetch_array($getposts2)) | ||
| 117 | { | ||
| 118 | $i++; | ||
| 119 | } | ||
| 120 | |||
| 121 | if ($i != 0) | ||
| 122 | { | ||
| 123 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 124 | } else { | ||
| 125 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 126 | } | ||
| 127 | |||
| 128 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 129 | 'perPage' => 20, | ||
| 130 | 'delta' => 2, | ||
| 131 | 'itemData' => $getposts3)); | ||
| 132 | |||
| 133 | $j=0; | ||
| 134 | |||
| 135 | if ($pager->isLastPage()) | ||
| 136 | { | ||
| 137 | foreach (array_reverse($pager->getPageData()) as $post) | ||
| 138 | { | ||
| 139 | if (!empty($post)) | ||
| 140 | { | ||
| 141 | $last = $post; | ||
| 142 | break; | ||
| 143 | } | ||
| 144 | } | ||
| 145 | } | ||
| 146 | |||
| 147 | foreach ($pager->getPageData() as $post) | ||
| 148 | { | ||
| 149 | if (!empty($post)) | ||
| 150 | { | ||
| 151 | $template->add_ref($j, 'POST', array( 'TITLE' => $post['title'], | ||
| 152 | 'AUTHOR' => $post['author'], | ||
| 153 | 'ID' => $post['id'], | ||
| 154 | 'CODED' => $post['slug'], | ||
| 155 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 156 | |||
| 157 | if ($pager->isFirstPage() && ($j == 0)) | ||
| 158 | { | ||
| 159 | $template->adds_ref_sub($j, 'NOMOVEUP', array('exi'=>1)); | ||
| 160 | } else { | ||
| 161 | $template->adds_ref_sub($j, 'CANMOVEUP', array('exi'=>1)); | ||
| 162 | } | ||
| 163 | |||
| 164 | if ($pager->isLastPage() && ($post == $last)) | ||
| 165 | { | ||
| 166 | $template->adds_ref_sub($j, 'NOMOVEDOWN', array('exi'=>1)); | ||
| 167 | } else { | ||
| 168 | $template->adds_ref_sub($j, 'CANMOVEDOWN', array('exi'=>1)); | ||
| 169 | } | ||
| 170 | } | ||
| 171 | |||
| 172 | $j++; | ||
| 173 | } | ||
| 174 | |||
| 175 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 176 | $template->add('PAGINATION', $pager->links); | ||
| 177 | |||
| 178 | $template->display(); | ||
| 179 | |||
| 180 | ?> | ||
| diff --git a/admin/polls.php b/admin/polls.php new file mode 100644 index 0000000..8e1465c --- /dev/null +++ b/admin/polls.php | |||
| @@ -0,0 +1,98 @@ | |||
| 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 admin/polls.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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'polls'; | ||
| 27 | $pageaid = 'polls'; | ||
| 28 | |||
| 29 | if (isset($_GET['action'])) | ||
| 30 | { | ||
| 31 | if ($_GET['action'] == 'delete') | ||
| 32 | { | ||
| 33 | if (is_numeric($_POST['id'])) | ||
| 34 | { | ||
| 35 | $delpoll = "DELETE FROM polloftheweek WHERE id = " . $_POST['id']; | ||
| 36 | $delpoll2 = mysql_query($delpoll); | ||
| 37 | |||
| 38 | $flashmsg = 'The selected poll has been deleted.'; | ||
| 39 | } | ||
| 40 | } else if ($_GET['action'] == 'deletes') | ||
| 41 | { | ||
| 42 | $ids = explode(',', $_POST['ids']); | ||
| 43 | |||
| 44 | if (is_array($ids) && !empty($ids)) | ||
| 45 | { | ||
| 46 | foreach ($ids as $id) | ||
| 47 | { | ||
| 48 | $delpoll = "DELETE FROM polloftheweek WHERE id = " . $id; | ||
| 49 | $delpoll2 = mysql_query($delpoll); | ||
| 50 | } | ||
| 51 | |||
| 52 | $flashmsg = 'The selected polls have been deleted.'; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | $template = new FITemplate('admin/polls'); | ||
| 58 | |||
| 59 | $getposts = "SELECT * FROM polloftheweek ORDER BY id DESC"; | ||
| 60 | $getposts2 = mysql_query($getposts); | ||
| 61 | $i=0; | ||
| 62 | while ($getposts3[$i] = mysql_fetch_array($getposts2)) | ||
| 63 | { | ||
| 64 | $i++; | ||
| 65 | } | ||
| 66 | |||
| 67 | if ($i != 0) | ||
| 68 | { | ||
| 69 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 70 | } else { | ||
| 71 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 72 | } | ||
| 73 | |||
| 74 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 75 | 'perPage' => 20, | ||
| 76 | 'delta' => 2, | ||
| 77 | 'itemData' => $getposts3)); | ||
| 78 | |||
| 79 | $j=0; | ||
| 80 | |||
| 81 | foreach ($pager->getPageData() as $post) | ||
| 82 | { | ||
| 83 | if (!empty($post)) | ||
| 84 | { | ||
| 85 | $template->adds_block('POST', array( 'TITLE' => $post['question'], | ||
| 86 | 'ID' => $post['id'], | ||
| 87 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 88 | } | ||
| 89 | |||
| 90 | $j++; | ||
| 91 | } | ||
| 92 | |||
| 93 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 94 | $template->add('PAGINATION', $pager->links); | ||
| 95 | |||
| 96 | $template->display(); | ||
| 97 | |||
| 98 | ?> | ||
| diff --git a/admin/posts.php b/admin/posts.php new file mode 100644 index 0000000..ac5b612 --- /dev/null +++ b/admin/posts.php | |||
| @@ -0,0 +1,100 @@ | |||
| 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 admin/pages.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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'posts'; | ||
| 27 | $pageaid = 'posts'; | ||
| 28 | |||
| 29 | if (isset($_GET['action'])) | ||
| 30 | { | ||
| 31 | if ($_GET['action'] == 'delete') | ||
| 32 | { | ||
| 33 | if (is_numeric($_POST['id'])) | ||
| 34 | { | ||
| 35 | $delpost = "DELETE FROM updates WHERE id = " . $_POST['id']; | ||
| 36 | $delpost2 = mysql_query($delpost); | ||
| 37 | |||
| 38 | $flashmsg = 'The selected post has been deleted.'; | ||
| 39 | } | ||
| 40 | } else if ($_GET['action'] == 'deletes') | ||
| 41 | { | ||
| 42 | $ids = explode(',', $_POST['ids']); | ||
| 43 | |||
| 44 | if (is_array($ids) && !empty($ids)) | ||
| 45 | { | ||
| 46 | foreach ($ids as $id) | ||
| 47 | { | ||
| 48 | $delpost = "DELETE FROM updates WHERE id = " . $id; | ||
| 49 | $delpost2 = mysql_query($delpost); | ||
| 50 | } | ||
| 51 | |||
| 52 | $flashmsg = 'The selected posts have been deleted.'; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | $template = new FITemplate('admin/posts'); | ||
| 58 | |||
| 59 | $getposts = "SELECT * FROM updates ORDER BY id DESC"; | ||
| 60 | $getposts2 = mysql_query($getposts); | ||
| 61 | $i=0; | ||
| 62 | while ($getposts3[$i] = mysql_fetch_array($getposts2)) | ||
| 63 | { | ||
| 64 | $i++; | ||
| 65 | } | ||
| 66 | |||
| 67 | if ($i != 0) | ||
| 68 | { | ||
| 69 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 70 | } else { | ||
| 71 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 72 | } | ||
| 73 | |||
| 74 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 75 | 'perPage' => 20, | ||
| 76 | 'delta' => 2, | ||
| 77 | 'itemData' => $getposts3)); | ||
| 78 | |||
| 79 | $j=0; | ||
| 80 | |||
| 81 | foreach ($pager->getPageData() as $post) | ||
| 82 | { | ||
| 83 | if (!empty($post)) | ||
| 84 | { | ||
| 85 | $template->adds_block('POST', array( 'TITLE' => $post['title'], | ||
| 86 | 'AUTHOR' => $post['author'], | ||
| 87 | 'ID' => $post['id'], | ||
| 88 | 'CODED' => $post['slug'], | ||
| 89 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 90 | } | ||
| 91 | |||
| 92 | $j++; | ||
| 93 | } | ||
| 94 | |||
| 95 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 96 | $template->add('PAGINATION', $pager->links); | ||
| 97 | |||
| 98 | $template->display(); | ||
| 99 | |||
| 100 | ?> | ||
| diff --git a/admin/quotes.php b/admin/quotes.php new file mode 100644 index 0000000..e222b39 --- /dev/null +++ b/admin/quotes.php | |||
| @@ -0,0 +1,116 @@ | |||
| 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 admin/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 | require_once('Pager.php'); | ||
| 25 | |||
| 26 | $category = 'quotes'; | ||
| 27 | |||
| 28 | if (isset($_GET['flagged'])) | ||
| 29 | { | ||
| 30 | $pageaid = 'flagged'; | ||
| 31 | } else { | ||
| 32 | $pageaid = 'quotes'; | ||
| 33 | } | ||
| 34 | |||
| 35 | if (isset($_GET['action'])) | ||
| 36 | { | ||
| 37 | if ($_GET['action'] == 'delete') | ||
| 38 | { | ||
| 39 | if (is_numeric($_POST['id'])) | ||
| 40 | { | ||
| 41 | $delpost = "DELETE FROM rash_quotes WHERE id = " . $_POST['id']; | ||
| 42 | $delpost2 = mysql_query($delpost); | ||
| 43 | |||
| 44 | $flashmsg = 'The selected quote has been deleted.'; | ||
| 45 | } | ||
| 46 | } else if ($_GET['action'] == 'deletes') | ||
| 47 | { | ||
| 48 | $ids = explode(',', $_POST['ids']); | ||
| 49 | |||
| 50 | if (is_array($ids) && !empty($ids)) | ||
| 51 | { | ||
| 52 | foreach ($ids as $id) | ||
| 53 | { | ||
| 54 | $delpost = "DELETE FROM rash_quotes WHERE id = " . $id; | ||
| 55 | $delpost2 = mysql_query($delpost); | ||
| 56 | } | ||
| 57 | |||
| 58 | $flashmsg = 'The selected quotes have been deleted.'; | ||
| 59 | } | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | $template = new FITemplate('admin/quotes'); | ||
| 64 | |||
| 65 | if (isset($_GET['flagged'])) | ||
| 66 | { | ||
| 67 | $template->add('TITLE', 'Manage Flagged Quotes'); | ||
| 68 | $template->add('FLAGGED', 'flagged=&'); | ||
| 69 | |||
| 70 | $getposts = "SELECT * FROM rash_quotes WHERE flag = 1 ORDER BY id DESC"; | ||
| 71 | } else { | ||
| 72 | $template->add('TITLE', 'Manage Quotes'); | ||
| 73 | $template->add('FLAGGED', ''); | ||
| 74 | |||
| 75 | $getposts = "SELECT * FROM rash_quotes ORDER BY id DESC"; | ||
| 76 | } | ||
| 77 | |||
| 78 | $getposts2 = mysql_query($getposts); | ||
| 79 | $i=0; | ||
| 80 | while ($getposts3[$i] = mysql_fetch_array($getposts2)) | ||
| 81 | { | ||
| 82 | $i++; | ||
| 83 | } | ||
| 84 | |||
| 85 | if ($i != 0) | ||
| 86 | { | ||
| 87 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 88 | } else { | ||
| 89 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 90 | } | ||
| 91 | |||
| 92 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 93 | 'perPage' => 20, | ||
| 94 | 'delta' => 2, | ||
| 95 | 'itemData' => $getposts3)); | ||
| 96 | |||
| 97 | $j=0; | ||
| 98 | |||
| 99 | foreach ($pager->getPageData() as $post) | ||
| 100 | { | ||
| 101 | if (!empty($post)) | ||
| 102 | { | ||
| 103 | $template->adds_block('QUOTE', array( 'EXCERPT' => htmlspecialchars(strpos($post['quote'],"\n") !== FALSE ? substr($post['quote'],0,strpos($post['quote'],"\n")) : $post['quote']), | ||
| 104 | 'ID' => $post['id'], | ||
| 105 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 106 | } | ||
| 107 | |||
| 108 | $j++; | ||
| 109 | } | ||
| 110 | |||
| 111 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 112 | $template->add('PAGINATION', $pager->links); | ||
| 113 | |||
| 114 | $template->display(); | ||
| 115 | |||
| 116 | ?> | ||
| diff --git a/admin/update.php b/admin/update.php new file mode 100644 index 0000000..05d4706 --- /dev/null +++ b/admin/update.php | |||
| @@ -0,0 +1,36 @@ | |||
| 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 admin/update.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 | $category = 'home'; | ||
| 26 | $pageaid = 'update'; | ||
| 27 | |||
| 28 | if (!isset($_GET['submit'])) | ||
| 29 | { | ||
| 30 | $template = new FITemplate('admin/hgupdate'); | ||
| 31 | $template->display(); | ||
| 32 | } else { | ||
| 33 | system('hg update'); | ||
| 34 | } | ||
| 35 | |||
| 36 | ?> | ||
| diff --git a/admin/welcome.php b/admin/welcome.php new file mode 100644 index 0000000..76b42b1 --- /dev/null +++ b/admin/welcome.php | |||
| @@ -0,0 +1,71 @@ | |||
| 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 admin/welcome.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 | $category = 'home'; | ||
| 26 | |||
| 27 | $template = new FITemplate('admin/welcome'); | ||
| 28 | |||
| 29 | $cntposts = "SELECT COUNT(*) FROM updates"; | ||
| 30 | $cntposts2 = mysql_query($cntposts); | ||
| 31 | $cntposts3 = mysql_fetch_array($cntposts2); | ||
| 32 | $template->add('POSTS', $cntposts3['COUNT(*)']); | ||
| 33 | |||
| 34 | $cntpending = "SELECT COUNT(*) FROM pending"; | ||
| 35 | $cntpending2 = mysql_query($cntpending); | ||
| 36 | $cntpending3 = mysql_fetch_array($cntpending2); | ||
| 37 | $template->add('PENDING', $cntpending3['COUNT(*)']); | ||
| 38 | |||
| 39 | $cntdrafts = "SELECT COUNT(*) FROM drafts"; | ||
| 40 | $cntdrafts2 = mysql_query($cntdrafts); | ||
| 41 | $cntdrafts3 = mysql_fetch_array($cntdrafts2); | ||
| 42 | $template->add('DRAFTS', $cntdrafts3['COUNT(*)']); | ||
| 43 | |||
| 44 | $cntcomments = "SELECT COUNT(*) FROM moderation"; | ||
| 45 | $cntcomments2 = mysql_query($cntcomments); | ||
| 46 | $cntcomments3 = mysql_fetch_array($cntcomments2); | ||
| 47 | $template->add('COMMENTS', $cntcomments3['COUNT(*)']); | ||
| 48 | |||
| 49 | $cntpolls = "SELECT COUNT(*) FROM polloftheweek"; | ||
| 50 | $cntpolls2 = mysql_query($cntpolls); | ||
| 51 | $cntpolls3 = mysql_fetch_array($cntpolls2); | ||
| 52 | $template->add('POLLS', $cntpolls3['COUNT(*)']); | ||
| 53 | |||
| 54 | $cntquotes = "SELECT COUNT(*) FROM rash_quotes"; | ||
| 55 | $cntquotes2 = mysql_query($cntquotes); | ||
| 56 | $cntquotes3 = mysql_fetch_array($cntquotes2); | ||
| 57 | $template->add('QUOTES', $cntquotes3['COUNT(*)']); | ||
| 58 | |||
| 59 | $cntflagged = "SELECT COUNT(*) FROM rash_quotes WHERE flag = 1"; | ||
| 60 | $cntflagged2 = mysql_query($cntflagged); | ||
| 61 | $cntflagged3 = mysql_fetch_array($cntflagged2); | ||
| 62 | $template->add('FLAGGED', $cntflagged3['COUNT(*)']); | ||
| 63 | |||
| 64 | $cntmodcom = "SELECT COUNT(*) FROM rash_queue"; | ||
| 65 | $cntmodcom2 = mysql_query($cntmodcom); | ||
| 66 | $cntmodcom3 = mysql_fetch_array($cntmodcom2); | ||
| 67 | $template->add('MODCOM', $cntmodcom3['COUNT(*)']); | ||
| 68 | |||
| 69 | $template->display(); | ||
| 70 | |||
| 71 | ?> | ||
