diff options
Diffstat (limited to 'admin/links.php')
| -rw-r--r-- | admin/links.php | 114 |
1 files changed, 114 insertions, 0 deletions
| diff --git a/admin/links.php b/admin/links.php new file mode 100644 index 0000000..d1ab878 --- /dev/null +++ b/admin/links.php | |||
| @@ -0,0 +1,114 @@ | |||
| 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/links.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 | if (isset($_GET['type'])) | ||
| 27 | { | ||
| 28 | $type = $_GET['type']; | ||
| 29 | } else { | ||
| 30 | $type = 'affiliates'; | ||
| 31 | } | ||
| 32 | |||
| 33 | $category = 'links'; | ||
| 34 | $pageaid = $type; | ||
| 35 | |||
| 36 | if (isset($_GET['action'])) | ||
| 37 | { | ||
| 38 | if ($_GET['action'] == 'delete') | ||
| 39 | { | ||
| 40 | if (is_numeric($_POST['id'])) | ||
| 41 | { | ||
| 42 | $dellink = "DELETE FROM links WHERE id = " . $_POST['id']; | ||
| 43 | $dellink2 = mysql_query($dellink); | ||
| 44 | |||
| 45 | $flashmsg = 'The selected link has been deleted.'; | ||
| 46 | } | ||
| 47 | } else if ($_GET['action'] == 'deletes') | ||
| 48 | { | ||
| 49 | $ids = explode(',', $_POST['ids']); | ||
| 50 | |||
| 51 | if (is_array($ids) && !empty($ids)) | ||
| 52 | { | ||
| 53 | foreach ($ids as $id) | ||
| 54 | { | ||
| 55 | $dellink = "DELETE FROM links WHERE id = " . $id; | ||
| 56 | $dellink2 = mysql_query($dellink); | ||
| 57 | } | ||
| 58 | |||
| 59 | $flashmsg = 'The selected links have been deleted.'; | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | $template = new FITemplate('admin/links'); | ||
| 65 | |||
| 66 | if ($type == 'affiliates') | ||
| 67 | { | ||
| 68 | $template->add('TITLE', 'Manage Affiliates'); | ||
| 69 | } else if ($type == 'webprojs') | ||
| 70 | { | ||
| 71 | $template->add('TITLE', 'Manage Website Projects'); | ||
| 72 | } | ||
| 73 | |||
| 74 | $getlinks = "SELECT * FROM links WHERE type = \"" . mysql_real_escape_string($type) . "\" ORDER BY id ASC"; | ||
| 75 | $getlinks2 = mysql_query($getlinks); | ||
| 76 | $i=0; | ||
| 77 | while ($getlinks3[$i] = mysql_fetch_array($getlinks2)) | ||
| 78 | { | ||
| 79 | $i++; | ||
| 80 | } | ||
| 81 | |||
| 82 | if ($i != 0) | ||
| 83 | { | ||
| 84 | $template->adds_block('AVAIL',array('exi'=>1)); | ||
| 85 | } else { | ||
| 86 | $template->adds_block('NOTAVAIL',array('exi'=>1)); | ||
| 87 | } | ||
| 88 | |||
| 89 | $pager = &Pager::factory(array( 'mode' => 'Sliding', | ||
| 90 | 'perPage' => 20, | ||
| 91 | 'delta' => 2, | ||
| 92 | 'itemData' => $getlinks3)); | ||
| 93 | |||
| 94 | $j=0; | ||
| 95 | |||
| 96 | foreach ($pager->getPageData() as $link) | ||
| 97 | { | ||
| 98 | if (!empty($link)) | ||
| 99 | { | ||
| 100 | $template->adds_block('LINK', array( 'TITLE' => $link['title'], | ||
| 101 | 'URL' => $link['url'], | ||
| 102 | 'ID' => $link['id'], | ||
| 103 | 'ODD' => ($j % 2 ? '' : ' class="odd"'))); | ||
| 104 | } | ||
| 105 | |||
| 106 | $j++; | ||
| 107 | } | ||
| 108 | |||
| 109 | $template->add('PAGEID', $pager->getCurrentPageID()); | ||
| 110 | $template->add('PAGINATION', $pager->links); | ||
| 111 | |||
| 112 | $template->display(); | ||
| 113 | |||
| 114 | ?> | ||
