summary refs log tree commit diff stats
path: root/admin/links.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-08-17 15:52:44 -0400
committerStarla Insigna <hatkirby@fourisland.com>2009-08-17 15:52:44 -0400
commit00586f1e8ada8f5baa6e3013525862dccac77b4a (patch)
tree8c456facf829646386ee039622e2df16140bcca8 /admin/links.php
parent49ff543541097a514cf8c836b74cd9514df2bf98 (diff)
downloadfourisland-00586f1e8ada8f5baa6e3013525862dccac77b4a.tar.gz
fourisland-00586f1e8ada8f5baa6e3013525862dccac77b4a.tar.bz2
fourisland-00586f1e8ada8f5baa6e3013525862dccac77b4a.zip
Added new files from previous commit
Diffstat (limited to 'admin/links.php')
-rw-r--r--admin/links.php114
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
104::::444444::::444
114::::::::::::::::4 admin/links.php
124444444444:::::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
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24require_once('Pager.php');
25
26if (isset($_GET['type']))
27{
28 $type = $_GET['type'];
29} else {
30 $type = 'affiliates';
31}
32
33$category = 'links';
34$pageaid = $type;
35
36if (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
66if ($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;
77while ($getlinks3[$i] = mysql_fetch_array($getlinks2))
78{
79 $i++;
80}
81
82if ($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
96foreach ($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?>