summary refs log tree commit diff stats
path: root/includes/footer.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-10-03 10:30:17 -0400
committerStarla Insigna <hatkirby@fourisland.com>2009-10-03 10:30:17 -0400
commitdc0fb9445e8a3ede8bc33d6779fadd89b7ea6893 (patch)
tree511b0f752889172163f3801cdbe311f0efc55540 /includes/footer.php
parent0e4089184a44719fbd1284acb047ab7547674412 (diff)
downloadfourisland-dc0fb9445e8a3ede8bc33d6779fadd89b7ea6893.tar.gz
fourisland-dc0fb9445e8a3ede8bc33d6779fadd89b7ea6893.tar.bz2
fourisland-dc0fb9445e8a3ede8bc33d6779fadd89b7ea6893.zip
Created Theme Switcher
Also rewrote the way layouts work. Now, each layout requires a "layout.tpl" file (which contains the header and footer for the layout) and a "style.php"
file (which contains and can include other files that contain the CSS for the layout). Each layout has it's own folder in theme/layouts and you can switch
between them using a combo box in the Hatbar.

Layouts 6.2 and 4.5 have been modified to work with new Layout 7 features such as AJAX, and they should be relatively free of bugs. Layout 3 has not yet
been transferred because since it is pre-The New Four Island, it will be very difficult to do so.

This changeset requires manual external code changes:

* The line below must be added above the functions.php include in The Fourm's funnctions.php
	require('/svr/www/hatkirby/fourisland/main/includes/session.php');
* The block of Four Island code in The Fourm's page_header() function should be replaced with:
	global $fi_pagetitle;
	$fi_pagetitle = $page_title;

	ob_start();
* The block of Four Island code in The Fourm's page_footer() function should be replaced with:
	global $fi_pagetitle;

	$content = ob_get_contents();
	ob_end_clean();

	$noRightbar = 1;
	$onFourm = 1;
	$pageCategory = 'fourm';

	if ($fi_pagetitle == 'Index page')
	{
		$title = 'The Fourm';
	} else if (strpos($fi_pagetitle, 'View topic') !== FALSE)
	{
		$title = str_replace('View topic - ', 'Topic: ', $fi_pagetitle) . ' - The Fourm';
	} else if (strpos($fi_pagetitle, 'View forum') !== FALSE)
	{
		$title = str_replace('View forum - ', 'Fourm: ', $fi_pagetitle) . ' - The Fourm';
	} else if (strpos($fi_pagetitle, 'Viewing profile') !== FALSE)
	{
		$title = str_replace('Viewing profile - ', 'Member: ', $fi_pagetitle) . ' - The Fourm';
	} else {
		$title = $fi_pagetitle . ' - The Fourm';
	}

	if ($_GET['view'] != 'print')
	{
		include('/svr/www/hatkirby/fourisland/main/includes/layout.php');
	} else {
		echo $content;
	}

Closes #117
Diffstat (limited to 'includes/footer.php')
-rwxr-xr-xincludes/footer.php180
1 files changed, 0 insertions, 180 deletions
diff --git a/includes/footer.php b/includes/footer.php deleted file mode 100755 index d1f9668..0000000 --- a/includes/footer.php +++ /dev/null
@@ -1,180 +0,0 @@
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 includes/footer.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');
24
25$template = new FITemplate('footer');
26
27if (isset($onFourm))
28{
29 $template->adds_block('ONFOURM',array('exi'=>1));
30}
31
32$getcomments = "SELECT * FROM comments ORDER BY id DESC LIMIT 0,5";
33$getcomments2 = mysql_query($getcomments);
34$i=0;
35while ($getcomments3[$i] = mysql_fetch_array($getcomments2))
36{
37 if ($getcomments3[$i]['is_anon'] == 0)
38 {
39 $getuser = "SELECT * FROM phpbb_users WHERE user_id = " . $getcomments3[$i]['user_id'];
40 $getuser2 = mysql_query($getuser);
41 $getuser3 = mysql_fetch_array($getuser2);
42
43 $username = $getuser3['username'];
44 $website = $getuser3['user_website'];
45 } else if ($getcomments3[$i]['is_anon'] == 1)
46 {
47 $getanon = "SELECT * FROM anon_commenters WHERE id = " . $getcomments3[$i]['user_id'];
48 $getanon2 = mysql_query($getanon);
49 $getanon3 = mysql_fetch_array($getanon2);
50
51 if ($getanon3['id'] == $getcomments3[$i]['user_id'])
52 {
53 $username = $getanon3['username'] . ' (Guest)';
54 $website = $getanon3['website'];
55 }
56 }
57
58 if (strpos($getcomments3[$i]['page_id'], 'updates') !== FALSE)
59 {
60 $getpost = "SELECT * FROM updates WHERE id = " . substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1);
61 $getpost2 = mysql_query($getpost);
62 $getpost3 = mysql_fetch_array($getpost2);
63
64 $template->adds_block('COMMENTS', array( 'ID' => $getcomments3[$i]['id'],
65 'AREA' => 'blog',
66 'CODED' => $getpost3['slug'],
67 'ENDING' => '/',
68 'TITLE' => stripslashes(htmlentities($getpost3['title'])),
69 'AUTHOR' => (($website != '') ? '<a href="' . $website . '">' . $username . '</a>' : $username)));
70 $i++;
71 } else if (strpos($getcomments3[$i]['page_id'], 'quote') !== FALSE)
72 {
73 $num = substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1);
74
75 $template->adds_block('COMMENTS', array( 'ID' => $getcomments3[$i]['id'],
76 'AREA' => 'quotes',
77 'CODED' => $num,
78 'ENDING' => '.php',
79 'TITLE' => 'Quote #' . $num,
80 'AUTHOR' => (($website != '') ? '<a href="' . $website . '">' . $username . '</a>' : $username)));
81 $i++;
82 } else if (strpos($getcomments3[$i]['page_id'], 'polloftheweek') !== FALSE)
83 {
84 $getpotw = "SELECT * FROM polloftheweek WHERE id = " . substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1);
85 $getpotw2 = mysql_query($getpotw);
86 $getpotw3 = mysql_fetch_array($getpotw2);
87
88 $template->adds_block('COMMENTS', array( 'ID' => $getcomments3[$i]['id'],
89 'AREA' => 'poll',
90 'CODED' => $getpotw3['id'],
91 'ENDING' => '.php',
92 'TITLE' => 'Poll "' . htmlentities($getpotw3['question']) . '"',
93 'AUTHOR' => (($website != '') ? '<a href="' . $website . '">' . $username . '</a>' : $username)));
94 $i++;
95 }
96}
97
98$users = array();
99$getusers = "SELECT DISTINCT user_id FROM comments WHERE is_anon = 0";
100$getusers2 = mysql_query($getusers);
101$i=0;
102while ($getusers3[$i] = mysql_fetch_array($getusers2))
103{
104 $getcount = "SELECT COUNT(*) FROM comments WHERE user_id = " . $getusers3[$i]['user_id'];
105 $getcount2 = mysql_query($getcount);
106 $getcount3 = mysql_fetch_array($getcount2);
107
108 $getuser = "SELECT * FROM phpbb_users WHERE user_id = " . $getusers3[$i]['user_id'];
109 $getuser2 = mysql_query($getuser);
110 $getuser3 = mysql_fetch_array($getuser2);
111
112 $username = $getuser3['username'];
113 $website = $getuser3['user_website'];
114
115 $name = (($website != '') ? '<a href="' . $website . '">' . $username . '</a>' : $username);
116 $users[] = array('name' => $name, 'count' => $getcount3['COUNT(*)']);
117
118 $i++;
119}
120
121function count_sort($a, $b)
122{
123 $a = $a['count'];
124 $b = $b['count'];
125
126 if ($a > $b)
127 {
128 return -1;
129 } else if ($a < $b)
130 {
131 return 1;
132 } else {
133 return 0;
134 }
135}
136
137usort($users, 'count_sort');
138$i=0;
139foreach ($users as $value)
140{
141 if ($i == 5)
142 {
143 break;
144 }
145
146 $template->adds_block('TOP', array( 'USERNAME' => $value['name'],
147 'COUNT' => $value['count']));
148 $i++;
149}
150
151$getpost = "SELECT * FROM phpbb_posts ORDER BY post_id DESC LIMIT 0,5";
152$getpost2 = mysql_query($getpost) or die($getpost);
153$i=0;
154while ($getpost3[$i] = mysql_fetch_array($getpost2))
155{
156 $getuser = "SELECT * FROM phpbb_users WHERE user_id = " . $getpost3[$i]['poster_id'];
157 $getuser2 = mysql_query($getuser) or die($getuser);
158 $getuser3 = mysql_fetch_array($getuser2);
159
160 $template->adds_block('FOURM', array( 'SUBJECT' => $getpost3[$i]['post_subject'],
161 'TOPIC' => $getpost3[$i]['topic_id'],
162 'POST' => $getpost3[$i]['post_id'],
163 'USERNAME' => $getuser3['username']));
164}
165
166$getpopular = "SELECT * FROM updates ORDER BY popularity DESC LIMIT 0,5";
167$getpopular2 = mysql_query($getpopular);
168$i=0;
169while ($getpopular3[$i] = mysql_fetch_array($getpopular2))
170{
171 $template->adds_block('POPULAR', array( 'CODED' => $getpopular3[$i]['slug'],
172 'TITLE' => stripslashes(htmlentities($getpopular3[$i]['title']))));
173 $i++;
174}
175
176$template->add('REVISION', exec('hg -R "' . $_SERVER['DOCUMENT_ROOT'] . '" tip --template {rev}'));
177
178$template->display();
179
180?>