summary refs log tree commit diff stats
path: root/pages/projects.php
blob: 4129cdf258a3dab0a8250547943125f148cf0c76 (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
85
86
87
88
89
90
91
92
93
94
<?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/projects.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');

include('includes/phpsvnclient.php');

if (!isset($_GET['project']))
{

} else {
	if (!isset($_GET['folder']) && !isset($_GET['file']))
	{
	} else if (isset($_GET['folder']))
	{
		if ($_GET['folder'] == 'browse')
		{
			$template = new FITemplate('projects/browse');

			if (!isset($_GET['id']))
			{
				$path = '/';
			} else {
				$path = '/' . $_GET['id'];
			}
			if (!isset($_GET['rev']))
			{
				$rev = -1;
			} else {
				$rev = $_GET['rev'];
			}

			$svn = new phpSVNclient();
			$svn->setRespository('http://svn.fourisland.com/' . $_GET['project']);
			$svn->setAuth('hatkirby','popstartwo506');
			$data = $svn->getFile($path,$rev);

			if (substr($path,strlen($path)-1,1) != '/')
			{
				$template->add('DATA', str_replace('	','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',str_replace('  ','&nbsp;&nbsp;',nl2br(htmlentities($data)))));
				$template->adds_block('FILE', array('NAME' => $path));
			} else {
				$template->add('DATA', $data);
			}

			$logs = $svn->getFileLogs($path);
			$template->add('LOGDATA', str_replace("\n\n",'<P>',htmlentities($logs[count($logs)-1]['comment'])));
			$template->add('AUTHOR', $logs[count($logs)-1]['author']);
			$template->add('DATE', date('F dS Y \a\\t g:i:s a',strtotime($logs[count($logs)-1]['date'])));

			if ($rev != -1)
			{
				$template->adds_block('FORWARD', array(	'URL' => ('/projects/' . $_GET['project'] . '/browse' . $path . '?rev=' . ($rev+1)),
									'NUM' => ($rev+1)));
			}

			if ($rev == -1)
			{
				$rev = $svn->getVersion();
			}

			if ($rev != 1)
			{
				$template->adds_block('BACK', array(	'URL' => ('/projects/' . $_GET['project'] . '/browse' . $path . '?rev=' . ($rev-1)),
									'NUM' => ($rev-1)));
			}
		}
	} else if (isset($_GET['file']))
	{
	}
}

$template->display();

?>