Permalink
Browse files

New module layout for status

  • Loading branch information...
1 parent 3b654bb commit 284a60c8ad489f01bb8ab0d6d153c33d27b8ee49 @marcusmyers committed Apr 30, 2012
View
0 .gitignore 100644 → 100755
File mode changed.
View
0 README.md 100644 → 100755
File mode changed.
View
9 config.json 100644 → 100755
@@ -1,13 +1,10 @@
{
- "width": 1000,
"title": "Status",
- "rotate": "no",
"modules": [
{
- "name": "trello",
- "desc": "Project Manager",
- "key": "d82fd533350a70b9e229403e9b8d4648",
- "oauth_token": "2856d7465a39808f35877f735fb91fcfcf6488d2d1e67aa54916426eb41314ca",
+ "name":"meta",
+ "class":"full-size meta",
+ "update":0
}
]
}
View
34 config.json~
@@ -0,0 +1,34 @@
+{
+ "title": "Status",
+ "modules": [
+ {
+ "name":"meta",
+ "class":"full-size meta",
+ "update":0
+ },
+ {
+ "name":"tickets",
+ "desc":"Open Tickets",
+ "class":"left",
+ "update":15,
+ "args": {
+ "title-header":"OPEN TICKETS"
+ }
+ },
+ {
+ "name":"jdigiclock",
+ "desc":"Android Clock widget",
+ "class":"right",
+ "update":3600
+ },
+ {
+ "name":"twitter-timeline",
+ "desc": "ticker of user tweets",
+ "class":"full-size",
+ "update":3600,
+ "args" : {
+ "username" : "nastechdept"
+ }
+ }
+ ]
+}
View
87 default.css → css/default.css
@@ -4,43 +4,42 @@ body {
color:#494949;
}
-#wrap > div { overflow:hidden; }
+#board {margin: 0 auto;}
+#board > div { overflow:hidden; }
-h1 { margin:0; padding:0; font-size:40px; }
-
-/* ===== Data =====*/
+.module {
+ width: 49%;
+}
-#data {
-/* margin-bottom:40px;*/
+.left {
+ float:left;
}
-#tickets {
- width:49%;
- background-color: #494949;
- color: #f3f3f3;
- text-align: center;
- float:left;
- border-radius:15px;
- -moz-border-radius:15px;
- -webkit-border-radius:15px;
+.right {
+ float: right;
}
-#tickets h1 {
- background-color: #000046;
+.full-size {
width: 100%;
- border-top-right-radius: 15px;
- border-top-left-radius: 15px;
- -moz-border-radius-topright: 15px;
- -moz-border-radius-topleft: 15px;
- -webkit-border-top-right-radius: 15px;
- -webkit-border-top-left-radius: 15px;
+ overflow:hidden;
}
-#tickets p {
- margin:0px;
- font-size: 825%;
+h1 { margin:0; padding:0; font-size:40px; }
+
+meta {
+ background-color: #dedede;
+ font-size: 20pt;
}
+/*############## OLD #################*/
+/* ===== Data =====*/
+
+#data {
+/* margin-bottom:40px;*/
+}
+
+
+
#tooltip {
position:absolute;
display:none;
@@ -101,13 +100,6 @@ h1 { margin:0; padding:0; font-size:40px; }
font-style:italic;
}
-
-/* ==== digiclock ==== */
-#digiclock {
- width: 49%;
- float: right;
-}
-
/* ===== visitors ===== */
#sitestats {
@@ -146,7 +138,7 @@ h1 { margin:0; padding:0; font-size:40px; }
}
#projects td {
padding:2px;
- background-color:#494949;
+ background-color:#494949;
color: #f3f3f3;
border-radius:5px;
-moz-border-radius:5px;
@@ -160,32 +152,5 @@ h1 { margin:0; padding:0; font-size:40px; }
vertical-align:middle;
}
-/* ===== twitter ===== */
-#twitter {
- background-color: #ededed;
- width: 100%;
-}
-#twitter > div {
- overflow:hidden;
- font-size:20px;
-}
-
-#twitter ul {
- list-style-type:none;
- width:5000px;
- position:relative;
-}
-#twitter li {
- float:left;
- margin-right:10px;
-}
-#twitter img {
- vertical-align:center;
- margin-right:10px;
- border:0;
- height:20px;
- width:20px;
-}
-
View
150 css/default.css~
@@ -0,0 +1,150 @@
+body {
+ background-color: #000000;
+ font:bold 25px/1.5 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; /* 960.gs*/
+ color:#494949;
+}
+
+#board {margin: 0 auto;}
+#board > div { overflow:hidden; }
+
+.module {
+ width: 49%;
+}
+
+.left {
+ float:left;
+}
+
+.right {
+ float: right;
+}
+
+.full-size {
+ width: 100%;
+ overflow:hidden;
+}
+
+h1 { margin:0; padding:0; font-size:40px; }
+
+/* ===== Data =====*/
+
+#data {
+/* margin-bottom:40px;*/
+}
+
+
+
+#tooltip {
+ position:absolute;
+ display:none;
+ padding:2px 5px;
+ background-color:#494949;
+ color:#fefefe;
+ border-radius:15px;
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+}
+
+#schedule {
+ width:50%;
+ float: right;
+ background-color:#494949;
+ color:#f3f3f3;
+ overflow:hidden;
+ border-radius:15px;
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+}
+
+#schedule h1 {
+ text-align: center;
+ background-color: #000046;
+ width: 100%;
+ border-top-right-radius: 15px;
+ border-top-left-radius: 15px;
+ -moz-border-radius-topright: 15px;
+ -moz-border-radius-topleft: 15px;
+ -webkit-border-top-right-radius: 15px;
+ -webkit-border-top-left-radius: 15px;
+}
+#schedule ul {
+ list-style-type:none;
+ margin:0;
+ padding:4%;
+}
+#schedule li {
+ margin-bottom:5px;
+ width:1000px;
+}
+#schedule em {
+ font-style:normal;
+ background-color:#000046;
+ margin-right:10px;
+ display:inline-block;
+ width:50px;
+ padding:0 10px;
+ border-radius:15px;
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+ font-size: 20px;
+}
+#schedule small {
+ font-size:20px;
+ color:#bababa;
+ font-style:italic;
+}
+
+/* ===== visitors ===== */
+
+#sitestats {
+ margin-top: 40px;
+ width: 50%;
+ float: left;
+ background-color: #000000;
+ color: #ffffff;
+ border-radius:15px;
+ -moz-border-radius: 15px;
+ -webkit-border-radius: 15px;
+ font-size: 19pt;
+}
+
+/*#sitestats h1 {
+ background-color: #000046;
+ width: 100%;
+ border-top-right-radius: 15px;
+ border-top-left-radius: 15px;
+ -moz-border-radius-topright: 15px;
+ -moz-border-radius-topleft: 15px;
+ -webkit-border-top-right-radius: 15px;
+ -webkit-border-top-left-radius: 15px;
+}*/
+
+
+/* ===== projects ===== */
+
+#projects {
+ margin-top: 30px;
+}
+
+#projects table {
+ width:100%;
+ border-spacing:10px;
+}
+#projects td {
+ padding:2px;
+ background-color:#494949;
+ color: #f3f3f3;
+ border-radius:5px;
+ -moz-border-radius:5px;
+ -webkit-border-radius:5px;
+ font-size: 180%;
+}
+#projects td:not(:last-child) {
+ text-align:center;
+}
+#projects img {
+ vertical-align:middle;
+}
+
+
+
View
0 jquery.jdigiclock.css → css/jquery.jdigiclock.css
File renamed without changes.
View
82 index.php
@@ -1,20 +1,43 @@
-<?php require('statBoard.php'); ?>
+<?php
+define('CONFIG','./config.json');
+
+// FIRST: read in the configuration
+$data = file_get_contents(CONFIG);
+$data = json_decode($data);
+
+if (!$data) die('JSON syntax error in "'.CONFIG.'"');
+
+function render($module) {
+ $argstr = array();
+ $args = $module->args;
+ $args->width = $module->width;
+ foreach($args as $key => $val) {
+ $argstr[] = "$key=" . urlencode($val);
+ }
+ $argstr = "'" . implode("&", $argstr) . "'";
+
+ //$style = "width: {$module->width}px;";
+ //if ($module->height) $style .= " height: {$module->height}px";
+ echo "<div class='module $module->class' id='$module->name' "/*style='$style'*/."></div>\n";
+ echo "\t<script type='text/javascript'>activate_module('$module->name', $module->update, $argstr);</script>\n\n";
+}
+
+//require('statBoard.php'); ?>
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
<meta charset='utf-8' />
<meta http-equiv="refresh" content="1800" />
- <title>Status Board</title>
+ <title><?php echo (isset($data->title) ? $data->title : 'generic status board') ?></title>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
- <script src="/status/js/jquery.jdigiclock.js"></script>
- <script src="/status/js/twitterlib.min.js"></script>
- <script src="/status/js/jquery.flot.min.js"></script>
- <script src="/status/js/jquery.pauseanimate.js"></script>
- <script src="/status/js/statBoard.js"></script>
- <link rel="stylesheet" type="text/css" href="jquery.jdigiclock.css" />
- <link rel="stylesheet" type="text/css" href="default.css" />
+ <script src="js/jquery.flot.min.js"></script>
+ <script src="js/jquery.pauseanimate.js"></script>
+ <script src="js/statBoard.js"></script>
+ <script src="js/board.js"></script>
+ <link rel="stylesheet" type="text/css" href="css/jquery.jdigiclock.css" />
+ <link rel="stylesheet" type="text/css" href="css/default.css" />
<script>
function draw(){
var canvas = document.getElementById('tutorial');
@@ -24,22 +47,10 @@ function draw(){
}
$(document).ready(function() {
var board = statBoard();
- board.getTickets();
- board.twitterize('#our_tweets','timeline','nastechdept');
- $('#digiclock').jdigiclock(
- {
- clockImagesPath: '/status/images/clock/',
- weatherImagesPath: '/status/images/weather/',
- lang: 'en',
- am_pm: true,
- weatherLocationCode: '43545',
- weatherMetric: 'F',
- weatherUpdate: 10,
- proxyType: 'php'
-
- }
- );
- board.getSiteStats('#sitestats');
+ //board.getTickets();
+ //board.twitterize('#our_tweets','timeline','nastechdept');
+
+ //board.getSiteStats('#sitestats');
});
</script>
<style>
@@ -48,30 +59,33 @@ function draw(){
</head>
<body onload="draw();">
- <div id="wrap">
- <div id="data">
+ <div id="board">
+ <!--<div id="data">
<div id="tickets">
<h1>OPEN TICKETS</h1>
<p></p>
</div>
<div id="schedule">
<h1>Events</h1>
<ul>
- <?php echo getSchedule(); ?>
+ <?php //echo getSchedule(); ?>
</ul>
</div>
</div>
<div id="data2">
- <div id="sitestats"></div>
- <div id="digiclock"></div>
- </div>
+ <div id="sitestats"></div>-->
+ <?php
+ foreach($data->modules as $module)
+ render($module);
+ ?>
+ <!--</div>
<br/>
<div id="twitter">
<div id="our_tweets"></div>
- </div>
+ </div>-->
<div id="projects">
<?php
- echo getProjects();
+ //echo getProjects();
?>
</div>
</div>
View
93 index.php~
@@ -0,0 +1,93 @@
+<?php
+define('CONFIG','./config.json');
+
+// FIRST: read in the configuration
+$data = file_get_contents(CONFIG);
+$data = json_decode($data);
+
+if (!$data) die('JSON syntax error in "'.CONFIG.'"');
+
+function render($module) {
+ $argstr = array();
+ $args = $module->args;
+ $args->width = $module->width;
+ foreach($args as $key => $val) {
+ $argstr[] = "$key=" . urlencode($val);
+ }
+ $argstr = "'" . implode("&", $argstr) . "'";
+
+ //$style = "width: {$module->width}px;";
+ if ($module->height) $style .= " height: {$module->height}px";
+ echo "<div class='module $module->class' id='$module->name' "/*style='$style'*/."></div>\n";
+ echo "\t<script type='text/javascript'>activate_module('$module->name', $module->update, $argstr);</script>\n\n";
+}
+
+//require('statBoard.php'); ?>
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset='utf-8' />
+ <meta http-equiv="refresh" content="1800" />
+ <title><?php echo (isset($data->title) ? $data->title : 'generic status board') ?></title>
+
+ <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
+ <script src="js/jquery.flot.min.js"></script>
+ <script src="js/jquery.pauseanimate.js"></script>
+ <script src="js/statBoard.js"></script>
+ <script src="js/board.js"></script>
+ <link rel="stylesheet" type="text/css" href="css/jquery.jdigiclock.css" />
+ <link rel="stylesheet" type="text/css" href="css/default.css" />
+ <script>
+ function draw(){
+ var canvas = document.getElementById('tutorial');
+ if (canvas.getContext){
+ var ctx = canvas.getContext('2d');
+ }
+ }
+ $(document).ready(function() {
+ var board = statBoard();
+ //board.getTickets();
+ //board.twitterize('#our_tweets','timeline','nastechdept');
+
+ //board.getSiteStats('#sitestats');
+ });
+ </script>
+ <style>
+ canvas { border: 1px solid #fffff; }
+ </style>
+
+</head>
+<body onload="draw();">
+ <div id="board">
+ <!--<div id="data">
+ <div id="tickets">
+ <h1>OPEN TICKETS</h1>
+ <p></p>
+ </div>
+ <div id="schedule">
+ <h1>Events</h1>
+ <ul>
+ <?php //echo getSchedule(); ?>
+ </ul>
+ </div>
+ </div>
+ <div id="data2">
+ <div id="sitestats"></div>-->
+ <?php
+ foreach($data->modules as $module)
+ render($module);
+ ?>
+ <!--</div>
+ <br/>
+ <div id="twitter">
+ <div id="our_tweets"></div>
+ </div>-->
+ <div id="projects">
+ <?php
+ //echo getProjects();
+ ?>
+ </div>
+ </div>
+</body>
+</html>
View
81 js/board.js
@@ -0,0 +1,81 @@
+function render_module(name, args, firstrun) {
+ $('#' + name).load('modules/' + name + '.module.php?' + args , function() {
+ if (firstrun==1)
+ module_init (name);
+ });
+}
+
+function activate_module(name, seconds, args) {
+ render_module(name, args, 1);
+ if (seconds > 0) {
+ setInterval("render_module('"+name+"', '"+args+"', '0')", (seconds * 1000));
+ }
+}
+
+$(document).ready(function() {
+ $('.middle').each(function(id, val) {
+ var outer_height = $(val).height();
+ var inner_height = $(val).children().first().height();
+ var buffer = (outer_height - inner_height) / 2;
+ var SEL = '#' + $(val).attr('id') + '>div';
+ $(SEL).css('marginTop', buffer);
+ $(SEL).css('marginBottom', buffer);
+ });
+});
+
+
+function module_init (name) {
+ switch (name) {
+ default:
+ break;
+ }
+}
+
+function twitterlib_init(selector, fn, subject) {
+ var container = $(selector);
+
+ twitterlib.timeline(subject, { limit : 10 }, function (tweets) {
+ var list = $('<ul />'), i
+ len = tweets.length,
+ totalWidth = 0;
+ for (i = 0; i < len; i++ ) {
+ $('<li><a><img/></a></li>')
+ .find('a')
+ .attr('href', 'http://www.twitter.com/' + tweets[i].user.screen_name + '/status/' + tweets[i].id)
+ .end()
+ .find('img')
+ .attr('src', tweets[i].user.profile_image_url)
+ .end()
+ .append(this.ify.clean(tweets[i].text))
+ .appendTo(list);
+ }
+ container.append(list);
+
+ $('li', list).each(function (i, el) {
+
+ totalWidth += $(el).outerWidth(true);
+ });
+
+ list.width(totalWidth);
+
+ function scrollTweets() {
+ var rand = totalWidth * Math.floor(Math.random() * 10 + 15);
+ list.startAnimation({
+ right: totalWidth
+ }, rand, 'linear', function () {
+ list.css('right', - container.width());
+ scrollTweets();
+ });
+ }
+
+ scrollTweets();
+
+ list.hover(function () {
+ list.pauseAnimation();
+ }, function () {
+ list.resumeAnimation();
+ });
+ }); // end of twitterlib
+
+}
+});
View
32 js/board.js~
@@ -0,0 +1,32 @@
+function render_module(name, args, firstrun) {
+ $('#' + name).load('modules/' + name + '.module.php?' + args , function() {
+ if (firstrun==1)
+ module_init (name);
+ });
+}
+
+function activate_module(name, seconds, args) {
+ render_module(name, args, 1);
+ if (seconds > 0) {
+ setInterval("render_module('"+name+"', '"+args+"', '0')", (seconds * 1000));
+ }
+}
+
+$(document).ready(function() {
+ $('.middle').each(function(id, val) {
+ var outer_height = $(val).height();
+ var inner_height = $(val).children().first().height();
+ var buffer = (outer_height - inner_height) / 2;
+ var SEL = '#' + $(val).attr('id') + '>div';
+ $(SEL).css('marginTop', buffer);
+ $(SEL).css('marginBottom', buffer);
+ });
+});
+
+
+function module_init (name) {
+ switch (name) {
+ default:
+ break;
+ }
+}
View
48 js/statBoard.js
@@ -1,53 +1,5 @@
var statBoard = function () {
return {
- twitterize : function (selector, fn, subject) {
- var container = $(selector);
-
- twitterlib.timeline(subject, { limit : 10 }, function (tweets) {
- var list = $('<ul />'), i
- len = tweets.length,
- totalWidth = 0;
- for (i = 0; i < len; i++ ) {
- $('<li><a><img/></a></li>')
- .find('a')
- .attr('href', 'http://www.twitter.com/' + tweets[i].user.screen_name + '/status/' + tweets[i].id)
- .end()
- .find('img')
- .attr('src', tweets[i].user.profile_image_url)
- .end()
- .append(this.ify.clean(tweets[i].text))
- .appendTo(list);
- }
- container.append(list);
-
- $('li', list).each(function (i, el) {
-
- totalWidth += $(el).outerWidth(true);
- });
-
- list.width(totalWidth);
-
- function scrollTweets() {
- var rand = totalWidth * Math.floor(Math.random() * 10 + 15);
- list.startAnimation({
- right: totalWidth
- }, rand, 'linear', function () {
- list.css('right', - container.width());
- scrollTweets();
- });
- }
-
- scrollTweets();
-
- list.hover(function () {
- list.pauseAnimation();
- }, function () {
- list.resumeAnimation();
- });
- }); // end of twitterlib
-
- },
-
iconizeWorkers : function (selector) {
$(selector).each(function (i, el) {
var el = $(el),
View
125 js/statBoard.js~
@@ -0,0 +1,125 @@
+var statBoard = function () {
+ return {
+ twitterize : function (selector, fn, subject) {
+ var container = $(selector);
+
+ twitterlib.timeline(subject, { limit : 10 }, function (tweets) {
+ var list = $('<ul />'), i
+ len = tweets.length,
+ totalWidth = 0;
+ for (i = 0; i < len; i++ ) {
+ $('<li><a><img/></a></li>')
+ .find('a')
+ .attr('href', 'http://www.twitter.com/' + tweets[i].user.screen_name + '/status/' + tweets[i].id)
+ .end()
+ .find('img')
+ .attr('src', tweets[i].user.profile_image_url)
+ .end()
+ .append(this.ify.clean(tweets[i].text))
+ .appendTo(list);
+ }
+ container.append(list);
+
+ $('li', list).each(function (i, el) {
+
+ totalWidth += $(el).outerWidth(true);
+ });
+
+ list.width(totalWidth);
+
+ function scrollTweets() {
+ var rand = totalWidth * Math.floor(Math.random() * 10 + 15);
+ list.startAnimation({
+ right: totalWidth
+ }, rand, 'linear', function () {
+ list.css('right', - container.width());
+ scrollTweets();
+ });
+ }
+
+ scrollTweets();
+
+ list.hover(function () {
+ list.pauseAnimation();
+ }, function () {
+ list.resumeAnimation();
+ });
+ }); // end of twitterlib
+
+ },
+
+ iconizeWorkers : function (selector) {
+ $(selector).each(function (i, el) {
+ var el = $(el),
+ workers = el.text().split(' '),
+ path = '';
+
+ $.each(workers, function (i, val) {
+ path += '<img src="images/' + val.toLowerCase() + '.png" alt="'+ val + '" />';
+ });
+
+ el.html(path);
+ });
+ },
+
+ getTickets : function () {
+ setInterval(tickets, 3000);
+
+ function tickets(){
+ $.getJSON('/status/proxy/php/ticketNum.php', function(data) {
+ $("div#tickets p").html(data.tickets);
+ });
+ }
+ },
+
+ getSiteStats : function (selector){
+ var el = $(selector),
+ data = [],
+ prev = null, i,
+ showTooltip = function(x, y, contents){
+ $("<div />", {
+ id: 'tooltip',
+ text: contents,
+ css: {
+ top: y+5,
+ left: x+5
+ }
+ }).appendTo('body').fadeIn(200);
+ };
+
+ el.height( $('#schedule').outerHeight());
+
+
+ $.ajax({
+ url: '/status/proxy/php/sitestats.php',
+ dataType: 'json',
+ success: function(pata) {
+ $.each(pata, function(i, it){
+ data.push([i, it]);
+ $.plot(el, [{ label: "Last 10 Days", data: data, color:'#000046', lines : { show: true }, points : { show : true} }],
+ { xaxis : { mode : 'time', timeformat : '%b %d' }, grid : { hoverable : true, clickable : true, backgroundColor: { colors: ["#fff", "#eee"]} } });
+ });
+ },
+ timeout: 3000
+ });
+
+
+
+
+
+ el.bind('plothover', function (event, pos, item) {
+ if (item) {
+ if (prev != item.datapoint) {
+ prev = item.datapoint;
+ $('#tooltip').remove();
+ showTooltip(item.pageX, item.pageY, item.datapoint[1]);
+ }
+ }
+ else {
+ $('#tooltip').remove();
+ prev = null;
+ }
+ });
+ }
+ }
+};
View
20 modules/jdigiclock.module.php
@@ -0,0 +1,20 @@
+<script src="js/jquery.jdigiclock.js"></script>
+<script>
+$(document).ready(function(){
+ $('#jdigiclock').jdigiclock(
+ {
+ clockImagesPath: '/status/images/clock/',
+ weatherImagesPath: '/status/images/weather/',
+ lang: 'en',
+ am_pm: true,
+ weatherLocationCode: '43545',
+ weatherMetric: 'F',
+ weatherUpdate: 10,
+ proxyType: 'php'
+
+ }
+ );
+});
+
+</script>
+
View
21 modules/jdigiclock.module.php~
@@ -0,0 +1,21 @@
+<script src="js/jquery.jdigiclock.js"></script>
+ <?php
+echo "<script>
+$(document).ready(function(){
+ $('#jdigiclock').jdigiclock(
+ {";
+
+ foreach($_GET as $key=>$value){
+ if(is_string($value)){
+ echo $key.":'".urldecode($value)."'";
+ } else {
+ echo $key.":".urldecode($value);
+ }
+ }
+echo "
+ }
+ );
+});
+
+</script>";
+ ?>
View
4 modules/meta.module.php
@@ -0,0 +1,4 @@
+<div class='meta'>
+Created by <a href='http://emoxter.com'>Mark Myers</a><br />
+Get it at <a href='http://github.com/marcusmyers/status'>GitHub</a>
+</div>
View
35 modules/tickets.module.php
@@ -0,0 +1,35 @@
+<?php
+$title = $_GET['title-header'];
+?>
+<style>
+#tickets {
+
+ background-color: #494949;
+ color: #f3f3f3;
+ text-align: center;
+ border-radius:15px;
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+}
+
+#tickets h1 {
+ background-color: #000046;
+ width: 100%;
+ border-top-right-radius: 15px;
+ border-top-left-radius: 15px;
+ -moz-border-radius-topright: 15px;
+ -moz-border-radius-topleft: 15px;
+ -webkit-border-top-right-radius: 15px;
+ -webkit-border-top-left-radius: 15px;
+}
+
+#tickets p {
+ margin:0px;
+ font-size: 825%;
+}
+</style>
+<div id="tickets">
+ <h1><?php echo $title; ?></h1>
+ <p>15</p>
+</div>
+
View
35 modules/tickets.module.php~
@@ -0,0 +1,35 @@
+<?php
+$title = $_GET['title-header'];
+?>
+<style>
+#tickets {
+
+ background-color: #494949;
+ color: #f3f3f3;
+ text-align: center;
+ border-radius:15px;
+ -moz-border-radius:15px;
+ -webkit-border-radius:15px;
+}
+
+#tickets h1 {
+ background-color: #000046;
+ width: 100%;
+ border-top-right-radius: 15px;
+ border-top-left-radius: 15px;
+ -moz-border-radius-topright: 15px;
+ -moz-border-radius-topleft: 15px;
+ -webkit-border-top-right-radius: 15px;
+ -webkit-border-top-left-radius: 15px;
+}
+
+#tickets p {
+ margin:0px;
+ font-size: 825%;
+}
+</style>
+<div id="tickets">
+ <h1><?php echo $title; ?></h1>
+ <p></p>
+</div>
+
View
35 modules/twitter-timeline.module.php
@@ -0,0 +1,35 @@
+<style>
+/* ===== twitter ===== */
+#twitter {
+ background-color: #ededed;
+ font-size: 20pt;
+}
+
+
+#twitter ul {
+ list-style-type:none;
+ width:5000px;
+ position:relative;
+}
+#twitter li {
+ float:left;
+ margin-right:10px;
+}
+#twitter img {
+ vertical-align:center;
+ margin-right:10px;
+ border:0;
+ height:20px;
+ width:20px;
+}
+</style>
+<script type="text/javascript" src="js/twitterlib.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+ var twitterize =
+twitterize('#our_tweets','timeline',<?php echo $_GET['username']; ?>);
+</script>
+
+<div id="twitter">
+ <div id="our_tweets"></div>
+</div>
View
82 modules/twitter-timeline.module.php~
@@ -0,0 +1,82 @@
+<style>
+/* ===== twitter ===== */
+#twitter {
+ background-color: #ededed;
+ font-size: 20pt;
+}
+
+
+#twitter ul {
+ list-style-type:none;
+ width:5000px;
+ position:relative;
+}
+#twitter li {
+ float:left;
+ margin-right:10px;
+}
+#twitter img {
+ vertical-align:center;
+ margin-right:10px;
+ border:0;
+ height:20px;
+ width:20px;
+}
+</style>
+<script type="text/javascript" src="js/twitterlib.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+ var twitterize = function (selector, fn, subject) {
+ var container = $(selector);
+
+ twitterlib.timeline(subject, { limit : 10 }, function (tweets) {
+ var list = $('<ul />'), i
+ len = tweets.length,
+ totalWidth = 0;
+ for (i = 0; i < len; i++ ) {
+ $('<li><a><img/></a></li>')
+ .find('a')
+ .attr('href', 'http://www.twitter.com/' + tweets[i].user.screen_name + '/status/' + tweets[i].id)
+ .end()
+ .find('img')
+ .attr('src', tweets[i].user.profile_image_url)
+ .end()
+ .append(this.ify.clean(tweets[i].text))
+ .appendTo(list);
+ }
+ container.append(list);
+
+ $('li', list).each(function (i, el) {
+
+ totalWidth += $(el).outerWidth(true);
+ });
+
+ list.width(totalWidth);
+
+ function scrollTweets() {
+ var rand = totalWidth * Math.floor(Math.random() * 10 + 15);
+ list.startAnimation({
+ right: totalWidth
+ }, rand, 'linear', function () {
+ list.css('right', - container.width());
+ scrollTweets();
+ });
+ }
+
+ scrollTweets();
+
+ list.hover(function () {
+ list.pauseAnimation();
+ }, function () {
+ list.resumeAnimation();
+ });
+ }); // end of twitterlib
+
+}
+});
+twitterize('#our_tweets','timeline',<?php echo $_GET['username']; ?>);
+</script>
+
+<div id="twitter">
+ <div id="our_tweets"></div>
+</div>
View
2 statBoard.php
@@ -113,5 +113,3 @@ function getProjects() {
return $html;
}
-
-?>
View
117 statBoard.php~
@@ -0,0 +1,117 @@
+<?php
+
+function parseCalendarFeed($feed_url, $count = 6) {
+ $fCache = new Memcache();
+ $fCache->connect('localhost',11211);
+ $arr = array();
+ if($fCache->get('events')){
+ $arr = $fCache->get('events');
+ } else {
+ $content = simplexml_load_file($feed_url,'SimpleXmlElement');
+ foreach($content->children() as $node){
+ foreach($node->children() as $element){
+ $arrTemp['Desc'] = $element->ShortDesc;
+ $arrTemp['Date'] = parseDate($element->Date);
+ $arr[] = $arrTemp;
+ }
+ }
+ }
+ $arr = array_slice($arr, 0, $count);
+ return $arr;
+} // end parseCalendarFeed
+
+function parseDate($date)
+{
+ $arrDate = explode("/",$date);
+ return $arrDate[0]."/".$arrDate[1];
+}
+
+function getVisitors()
+{
+ $url = "http://chart.apis.google.com/chart?chf=a,s,000000AF|bg,s,000000|c,s,E0E0E0&chxr=0,0,46&chxt=y&chs=450x300&cht=lc&chco=3D7930&chd=s:Xhiugtqi&chdlp=l&chg=14.3,-1,1,1&chls=2,4,0&chm=B,C5D4B5BB,0,0,0&chtt=Website+Visitors";
+
+}
+
+function getSchedule() {
+ $feed = "http://www.dynacal.com/napoleon.k12.oh/WebToolBox_WS.asp?XML=Y&DR=7&CalType=C&CATIDS=6940,6974,7002,6899,18764,30797,7003,6975,30802,38029,9012,35733,35734,35735,35736,35738,35740,35741,35743,59845,59543,53796,59544,35745,7350,59843,38257,36006,38256,35746,35748,35749,39165,59821,35751,35752,45577,35762,35764,35753,35755,35758,35760,38947,6150,35766,38259,35767,38258,38554,59842,48440,44214,35768,35770,35771,65894,35772,56575,35773,35775,35776,38897,44926,35777,35781,35780,35778,35779,52597,35782,35783,59844,6962,30804,31854,45094,45095,6963,6969,45096,31855,45092,45093,6968,45097,6965,45098,6966,45099,6970,6971,6972,6942,";
+ $events = parseCalendarFeed($feed);
+ $html = "";
+ foreach($events as $event) {
+ $html .= "<li><em>".$event['Date']."</em>";
+ if(isset($event['Desc'])) {
+ $html .= " <small>".$event['Desc']."</small></li>";
+ } else {
+ $html .= "</li>";
+ }
+ }
+ return $html;
+}
+
+function getProjectUsers($pid){
+ $sql = new mysqli('10.20.15.56', 'projuser', 'ttwu*data', 'projects') or die('could not connect');
+ $resultpp = $sql->query("SELECT * FROM tbl_project_perms WHERE pid='".$pid."'");
+
+ $arrProjPerms = array();
+ while($row = $resultpp->fetch_object()){
+ $arrProjPerms[] = $row->uid;
+ }
+ return $arrProjPerms;
+}
+
+function getProjectTask($pid){
+ $sql = new mysqli('10.20.15.56', 'projuser', 'ttwu*data', 'projects') or die('could not connect');
+ $resultt = $sql->query("SELECT * FROM tbl_task WHERE pid='".$pid."' AND is_todo = '1' and is_active='1'");
+ $arrDone = array();
+ $arrTotal = array();
+ while($row = $resultt->fetch_object()){
+ if($row->is_done == '1'){
+ $arrDone[] = 1;
+ }
+ $arrTotal[] = 1;
+ }
+ $final = sizeof($arrTotal);
+ $less = sizeof($arrDone);
+ $count1 = $less / $final;
+ $count2 = $count1 * 100;
+ $count = number_format($count2, 0);
+ return $count;
+}
+
+function getProjects() {
+ $sql = new mysqli('10.20.15.56', 'projuser', 'ttwu*data', 'projects') or die('could not connect');
+ $resultu = $sql->query("SELECT * FROM tbl_users");
+
+ $html = "<table>";
+
+ $arrUsers = array();
+ while($row = $resultu->fetch_object()){
+ $arrUsers[$row->id] = $row->f_name;
+ }
+
+ $resultp = $sql->query("SELECT * FROM tbl_projects WHERE is_active = '1'");
+
+ $arrProjects = array();
+ while($row = $resultp->fetch_object()){
+ $arrProjects[$row->id] = $row->p_name;
+ }
+
+
+ foreach($arrProjects as $pid=>$name){
+ $html .= "<tr><td>$name</td>";
+ $html .= "<td>";
+ $html .= getProjectTask($pid);
+ $html .= "%</td>";
+ $html .= "<td>";
+ $arrPUser = getProjectUsers($pid);
+ foreach($arrPUser as $key=>$uid){
+ $imgName = $arrUsers[$uid];
+ $html .= "<img src='/status/images/$imgName.png' alt='$imgName' />";
+ }
+ $html .= "</td>";
+ }
+ $html .= "</table>";
+ return $html;
+
+}
+
+?>

0 comments on commit 284a60c

Please sign in to comment.