summary refs log tree commit diff stats
path: root/pages/welcome.php
blob: 6e060065ed5e4a0c7c64319cf3552133298d43d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/*
       444444444  
      4::::::::4  
     4:::::::::4  
    4::::44::::4  
   4::::4 4::::4   Four Island
  4::::4  4::::4  
 4::::4   4::::4   Written and maintained by Starla Insigna
4::::444444::::444
4::::::::::::::::4  pages/welcome.php
4444444444:::::444
          4::::4   Please do not use, reproduce or steal the
          4::::4   contents of this file without explicit
          4::::4   permission from Hatkirby.
        44::::::44
        4::::::::4
        4444444444
*/

if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}

require('headerproc.php');

$pageCategory = 'home';

$template = new FITemplate('post');
$template->adds_block('EXTERNAL',array('exi'=>1));

$curID = 0;

$getpost = "SELECT * FROM updates ORDER BY id DESC LIMIT 0,4";
$getpost2 = mysql_query($getpost);
while ($getpost3 = mysql_fetch_array($getpost2))
{
	updatePop($getpost3['id'],'home_views');

	$page_id = 'updates-' . $getpost3['id'];
	$getcomments = "SELECT * FROM comments WHERE page_id = \"" . $page_id . "\" ORDER BY posttime";
	$getcomments2 = mysql_query($getcomments);
	$total_post=0;
	while ($getcomments3[$total_post] = mysql_fetch_array($getcomments2))
	{
		$total_post++;
	}
	if ($total_post >= 2)
	{
		$plural = 's';
	}
	if ($total_post == 0)
	{
		$comText = 'No Comments';
	} elseif ($total_post == 1)
	{
		$comText = '1 Comment';
	} else {
		$comText = $total_post . ' Comments';
	}

	$template->add_ref($curID, 'POST', array(	'ID' => $getpost3['id'],
							'YEARID' => ((date('Y',strtotime($getpost3['pubDate']))-2006) % 4),
							'DATE' => date('F dS Y \a\\t g:i:s a',strtotime($getpost3['pubDate'])),
							'MONTH' => date('M',strtotime($getpost3['pubDate'])),
							'DAY' => date('d',strtotime($getpost3['pubDate'])),
							'CODED' => $getpost3['slug'],
							'TITLE' => $getpost3['title'],
							'AUTHOR' => $getpost3['author'],
							'PLURALCOMMENT' => (isset($plural) ? $plural : ''),
							'COMMENTS' => $comText,
							'RATING' => $getpost3['rating'],
							'TEXT' => parseBBCode($getpost3['text'])));

	$tags = getTags($getpost3['id']);
	foreach ($tags as $tag)
	{
		$template->adds_ref_sub($curID, 'TAGS', array('TAG' => $tag));
	}

	$curID++;
}

$template->display();

?>