Statistics
| Branch: | Revision:

colonymech / docs / www / colonyscout / index.php @ 781890a0

History | View | Annotate | Download (5.59 KB)

1
<?php
2
$cacheFile="cache/index.html";
3
if (file_exists($cacheFile)) //we can read this cache file back reduce database load
4
{
5
   header("Content-Type: text/html");
6
   readfile($cacheFile);
7
   exit;
8
} else {
9
   ob_start(); //start buffering so we can cache for future accesses
10
}
11

    
12
?>
13
<!DOCTYPE html>
14
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
15
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
16
                <meta name="google-site-verification" content="hwSOLj8uDUaKyOjQ4eAfxBHhnmCH0C-tS5hlC-wk0lw" />
17
                <meta name="description" content="A low cost, versatile research platform for autonomous systems in collaborative robotics"> 
18
                <meta name="keywords" content="Scout, robotics, Carnegie Mellon University, autonomous, engineer"> 
19
 
20
<?php include("header.php"); ?>
21
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
22
<script type="text/javascript">
23
        google.load("jquery", "1.6.4");
24
        
25
        numphotos = 7;
26
        photoselect = (Math.floor(Math.random() * numphotos) + 1);
27
        
28
        photo = new Image();
29
        photo.src = "photos/" + photoselect + ".jpg";
30
        
31
        nextphoto = new Image();
32
        nextphoto.src = "photos/" + ((photoselect % numphotos) + 1) + ".jpg";
33
        
34
        google.setOnLoadCallback(function() {        
35
                $(document).ready(function() {
36
                        $('#photo').css('background-image', "url('" + photo.src + "')");
37
                        $('#photo').fadeIn();
38
                });
39
        });
40
        
41
        
42
        function changephoto(){
43
                photoselect = ((photoselect % numphotos) + 1);
44
                photo = nextphoto;
45
                
46
                $('#photo').fadeOut(300, function(){
47
                        $('#photo').css('background-image', "url('" + photo.src + "')");
48
                        $('#photo').fadeIn();
49
                });
50
                
51
                nextphoto = new Image();
52
                nextphoto.src = "photos/" + ((photoselect % numphotos) + 1) + ".jpg";
53
        }
54
        
55
        setInterval('changephoto()',3000);
56
</script>
57
<script src="Cambria_400.font.js" type="text/javascript"></script>
58
<script type="text/javascript">
59
        Cufon.replace('#hero-banner-text', { fontFamily:'Cambria', textShadow:'#CCCCCC 1px 1px' });
60
</script>
61
                <title>Home | ColonyScout.com</title>
62
 
63
</head>
64
<body bgcolor="#eeeeee"> 
65

    
66
<div id="fb-root"></div>
67
<script>(function(d, s, id) {
68
  var js, fjs = d.getElementsByTagName(s)[0];
69
  if (d.getElementById(id)) {return;}
70
  js = d.createElement(s); js.id = id;
71
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=191699214990";
72
  fjs.parentNode.insertBefore(js, fjs);
73
}(document, 'script', 'facebook-jssdk'));</script>
74

    
75
<div id="general"> 
76
<?php include("nav.php"); ?> 
77
        <div id="body">
78
                <div id="body-boxes">
79
                        <div class="box-row">
80
                                <div id="hero-banner">
81
                                        <div id="hero-banner-text">An affordable, versatile research platform for autonomous systems in collaborative robotics
82
                                                <br/>
83
                                                <a href="intro.php" class="small">Learn More &gt;&gt;&nbsp;|&nbsp;</a><a href="gallery.php" class="small">See it in action &gt;&gt;</a>
84
                                                <div class="fb-like-box" style="float:right;margin:-25px 0px 0px 0px;" data-href="http://www.facebook.com/pages/Colony-Scout/160977077328204" data-width="250" data-border-color="#CCCCCC" data-show-faces="false" data-stream="false" data-header="false"></div>
85
                                        </div>
86
                                </div>
87
                                <div id="hero-banner-side"></div>
88
                        </div>
89

    
90
                        <div class="box-row topmargin">
91
                                <div class="white-top"></div>
92
                                <div class="white-body text-box">
93
                                        <a href="/computing.php"><img src="/photos/software_logos.png" style="float:left;border-right:1px solid #CCCCCC;"></a>
94
                                        <div id="photo" style="width:358px; height:201px; float:left; margin:0px 15px 0px 15px;background-color: #ffffff; background-image:url('photos/1.jpg'); 
95
                                                background-repeat:no-repeat;">
96
                                                <a href="javascript: changephoto();" style="width:358px; height:201px; margin:0 0 10 0; float:left; text-decoration: none; color: #000000;"></a>
97
                                        </div>
98
                                        <div style="float:left; height:201px; width:330px;border-left:1px solid #CCCCCC;padding-left:15px;">
99
                                                <h2>Latest Updates</h2>
100
                                                <div class="hr" style="width:100%;"></div>
101
<?php
102
        $url_re = '((https?|ftp|gopher|telnet|file|notes|ms-help):((\/)|(\\\\))+[\w\d:#@\/\%;$()~_?\+-=\\\.&]*)';
103
        $twitterUsername = 'colonyscout';
104
        $twitterStatusURL = 'http://twitter.com/statuses/user_timeline/' . $twitterUsername . '.json';
105
        
106
        $session = curl_init($twitterStatusURL);
107
        curl_setopt($session, CURLOPT_HEADER, false); 
108
        curl_setopt($session, CURLOPT_RETURNTRANSFER, true);  
109
        $resultsJson = curl_exec($session);
110
        curl_close($session);
111
        
112
        $results = json_decode($resultsJson);
113
        
114
        for ($i=0;$i<3;$i++) {
115
                $twitterStatus = $results[$i]->{'text'};
116
                $twitterStatus = preg_replace('%' . $url_re . '%', '<a href="$0" target="about:blank">$0</a>', $twitterStatus);
117
                $twitterDate = date_parse($results[$i]->{'created_at'});
118
                echo '<b>'.$twitterDate['month'].'/'.$twitterDate['day'].'/'.$twitterDate['year'].'</b>- 
119
                        '.$twitterStatus.'<br><br>';
120
        }
121
?>
122
                                        </div>
123
                                </div>
124
                                <div class="white-bottom"></div>
125
                        </div>                                
126
                        
127
                        <div class="box-row topmargin">
128
                                <div class="white-top"></div>
129
                                <div class="white-body text-box">                                        
130
                                        <div style="float:left;">
131
                                                <h2>Meet the team &gt;&gt;></h2><br>
132
                                                <a href="/team.php"><img src="images/team.jpg" alt="Colony Scout Team"></a>
133
                                        </div>
134
                                        <div id="twitter-box" style="float:right; margin-right:80px;">
135
                                                <a href="http://www.twitter.com/colonyscout/" title="Colony Scout Twitter Feed">
136
                                                <img src="images/team_twitter.jpg" alt="Colony Scout Twitter Feed"/></a>
137
                                        </div>
138
                                        <div class="bot-gray"></div>
139
                                </div>
140
                                <div class="white-bottom"></div>
141
                        </div>                                                
142
                        
143
                </div>        
144
        </div> <!--BODY!--> 
145

    
146

    
147
<?php include("footer.php"); ?>
148

    
149
</div><!--GENERAL!--> 
150
 
151
</body></html>
152
<?php
153
$buffer = ob_get_contents();
154
ob_end_flush();
155
//$fp = fopen($cacheFile, "w"); fwrite($fp, $buffer); fclose($fp);
156
?>