Add public facing files.

This commit is contained in:
Andrew Tomaka 2011-10-04 04:36:02 -04:00
parent 2dbac5b017
commit 4c19e7e3e7
33 changed files with 1011 additions and 0 deletions

227
public_html/css/main.css Normal file
View file

@ -0,0 +1,227 @@
body
{
padding: 0px;
margin: 0px;
text-align: center;
background-color: #74aa81;
color: #000000;
}
body, div, td
{
font-family: Verdana, Arial, Helvetica, sans-serif;
}
img
{
border: 0;
}
a
{
color: #000000;
}
h1
{
font-size: 48px;
font-weight: bold;
}
h2
{
font-size: 21px;
font-weight: bold;
padding: 0px;
margin: 0px;
border: 0px;
margin-bottom: 8px;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #9bc1a4;
}
h3
{
visibility: hidden;
display: none;
}
table
{
font-size: 11px;
color: #000000;
}
div#header
{
width: 979px;
text-align: right;
color: #216332;
margin: 0px auto;
}
div#content
{
background-color: #216332;
text-align: left;
width: 979px;
margin: 0px auto;
padding-top: 8px;
padding-bottom: 8px;
}
div#column1a
{
width: 313px;
float: left;
padding-left: 10px;
}
div#column1b
{
width: 313px;
float: left;
padding-left: 10px;
}
div#column1c
{
width: 313px;
float: left;
padding-left: 10px;
padding-right: 10px;
}
div#contact
{
font-size: 24px;
}
div#benchmark
{
font-size: 11px;
}
div#copyright
{
font-size: 11px;
}
.box
{
padding: 5px;
margin: 5px;
background-color: #ffffff;
font-size: 11px;
color: #000000;
}
.box a
{
color: #216332;
}
.box a:hover
{
color: #9bc1a4;
}
.tweet
{
font-size: 16px;
}
.right
{
float: right;
text-align:right;
}
.top {
vertical-align: top;
}
.center
{
text-align: center;
}
.justify
{
text-align: justify;
}
.clear
{
clear: both;
}
.contact {
border: 0;
}
.icon {
border: 0;
}
table.formatting {
width: 100%;
border-collapse: collapse;
}
td.formatting {
padding: 0;
width: 68px;
vertical-align: top;
}
td.gamesformatting {
padding: 0;
width: 68px;
vertical-align: top;
}
.cover {
border: 0;
width: 64px;
}
/*----------------------------------------------------------------------------*/
/*------------- NIFTY CORNERS -------------*/
/*----------------------------------------------------------------------------*/
/*Nifty Corners Cube CSS by Alessandro Fulciniti
The following classes are added dinamically by javascript,
and their use should be avoided in the markup */
b.niftycorners,b.niftyfill{display:block}
b.niftycorners *{display:block;height: 1px;line-height:1px;font-size: 1px;
overflow:hidden;border-style:solid;border-width: 0 1px}
/*normal*/
b.r1{margin: 0 3px;border-width: 0 2px}
b.r2{margin: 0 2px}
b.r3{margin: 0 1px}
b.r4{height: 2px}
b.rb1{margin: 0 8px;border-width:0 2px}
b.rb2{margin: 0 6px;border-width:0 2px}
b.rb3{margin: 0 5px}
b.rb4{margin: 0 4px}
b.rb5{margin: 0 3px}
b.rb6{margin: 0 2px}
b.rb7{margin: 0 1px;height:2px}
b.rb8{margin: 0;height:2px}
b.rs1{margin: 0 1px}
/*transparent inside*/
b.t1{border-width: 0 5px}
b.t2{border-width: 0 3px}
b.t3{border-width: 0 2px}
b.t4{height: 2px}
b.tb1{border-width: 0 10px}
b.tb2{border-width: 0 8px}
b.tb3{border-width: 0 6px}
b.tb4{border-width: 0 5px}
b.tb5{border-width: 0 4px}
b.tb6{border-width: 0 3px}
b.tb7{border-width: 0 2px;height:2px}
b.tb8{border-width: 0 1px;height:2px}
b.ts1{border-width: 0 2px}

BIN
public_html/img/album.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

210
public_html/index.php Normal file
View file

@ -0,0 +1,210 @@
<?php
// retrieve cached data
$data = json_decode(file_get_contents('../data/index.txt'));
// retrieve links from database
$db_config = json_decode(file_get_contents('../conf/database.conf'));
include('lib/database.php');
$db = new Database($db_config->hostname,$db_config->username,$db_config->password,$db_config->table);
$links = $db->query("SELECT id,url,text,status,released_date FROM wia_links WHERE status = 2 OR status = 3 ORDER BY released_date DESC LIMIT 15");
?><!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Who is Andrew?</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="shortcut icon" href="favicon.ico" />
</head>
<body>
<!--<div id="header"><h1>who is andrew?</h1></div>-->
<br/><br/>
<div id="content">
<div id="column1a">
<h2>contact</h2>
<div id="contacts" class="box center">
<img src="img/badges/email.png" class="contact" alt="Email" title="atomaka@gmail.com" />
<img src="img/badges/aim.png" class="contact" alt="AIM" title="atomaka" />
<img src="img/badges/yahoo.png" class="contact" alt="Yahoo!" title="atomaka" />
<img src="img/badges/msn.png" class="contact" alt="MSN" title="atomaka@hotmail.com" />
<img src="img/badges/icq.png" class="contact" alt="ICQ" title="12534325" />
<img src="img/badges/google.png" class="contact" alt="Google Messaging" title="atomaka@gmail.com" />
<img src="img/badges/skype.png" class="contact" alt="Skype" title="andrewtomaka" />
<div id="contact"></div>
</div>
<br/>
<h2>twitter</h2>
<div id="twitter" class="box">
<span class="right"><a href="http://www.twitter.com/atomaka"><img src="img/badges/twitter.png" class="icon" alt="Follow me on Twitter"/></a></span>
<span class="tweet"><?php echo $data->twitter->text ?></span><br/>
<?php if($data->twitter->timeSince != 0) { echo $data->twitter->timeSince ?> ago <?php } ?>
</div>
<br/>
<h2>github</h2>
<div id="github" class="box">
Committed &quot;<?php echo $data->github->commit ?>&quot;
on <a href="<?php echo $data->github->url ?>"><?php echo $data->github->repo ?></a>.<br/>
</div>
<br/>
<h2>projects</h2>
<h3>project 1</h3>
<div id="projects">
<!--<div id ="tomtvgrid" class="box">
<table class="formatting">
<tr>
<td class="top">
<a href="/projects/TomTVGrid">TomTVGrid</a><br/><br/>
Takes your Hulu subscriptions and creates a grid displaying when your shows air live.
</td>
<td class="formatting">
<img src="img/projects/tomtvgrid.jpg" width="64" alt="sc2mmr" />
</td>
</tr>
</table>
</div>-->
</div>
</div>
<div id="column1b">
<h2>random</h2>
<div id="random">
<?php
while($link = $links->fetch_object()) {
$link_text = $link->text;
$link_text = preg_replace('/\[/','<a href="' . htmlentities($link->url) . '">',$link_text);
$link_text = preg_replace('/\]/','</a>',$link_text);
echo ' <p class="box">' . $link_text . '</p>' . "\n";
}
?>
</div>
</div>
<div id="column1c">
<h2>fitness</h2>
<div id="fitness" class="box">
Collecting data.
</div>
<h2>media</h2>
<div id="lastfm" class="box">
<table class="formatting">
<tr>
<td class="formatting">
<img src="<?php echo $data->lastfm->cover; ?>" class="cover" alt="<?php echo $data->lastfm->artist ?> - <?php echo $data->lastfm->name ?>"/>
</td>
<td class="top">
<span class="right"><a href="http://last.fm/user/atomaka"><img src="img/badges/lastfm.png" class="icon" alt="Last.fm" /></a></span>
<a href="<?php echo $data->lastfm->url ?>"><?php echo $data->lastfm->song ?></a><br/>
by <?php echo $data->lastfm->artist ?><br/><br/>
<?php echo $data->lastfm->timeSince ?><br/>
</td>
</tr>
</table>
</div>
<div id="hulu" class="box">
<table class="formatting">
<tr>
<td class="formatting">
<img src="<?php echo $data->hulu->thumb ?>" class="cover" alt="<?php echo $data->hulu->title ?> - <?php echo $data->hulu->series ?>" />
</td>
<td class="top">
<span class="right"><a href="http://www.hulu.com/profiles/atomaka"><img src="img/badges/hulu.png" class="icon" alt="Hulu" /></a></span>
<a href="<?php echo $data->hulu->url ?>"><?php echo $data->hulu->series ?></a><br/>
from <?php echo $data->hulu->title ?><br/><br/>
<?php echo $data->hulu->timeSince ?> ago<br/>
</td>
</tr>
</table>
</div>
<br/>
<h2>games</h2>
<h3>World of Warcraft</h3>
<div id="wow" class="box">
<table class="formatting">
<tr>
<td class="gamesformatting"><a href="http://battle.net/wow"><img src="img/badges/wow.jpg" alt="World of Warcraft" /></a></td>
<td class="top">
<a href="http://us.battle.net/wow/en/character/crushridge/veincane/advanced">Veincane</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/gaffer/advanced">Gaffer</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/ttg/advanced">Ttg</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/getburnt/advanced">Getburnt</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/levita/advanced">Levita</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/toppazz/advanced">Toppazz</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/toopro/advanced">Toopro</a>,
<a href="http://us.battle.net/wow/en/character/crushridge/notgaffer/advanced">Notgaffer</a>.<br/><br/>
</td>
</tr>
</table>
</div>
<h3>Starcraft 2</h3>
<div id="sc2" class="box">
<table class="formatting">
<tr>
<td class="gamesformatting"><a href="http://battle.net/sc2"><img src="img/badges/sc2.jpg" alt="Starcraft 2" /></a></td>
<td class="top">
<a href="http://us.battle.net/sc2/en/profile/1680730/1/Gaffer/">Gaffer.888</a><br/>
<?php echo $data->sc2ranks->division ?><br/>
<?php echo $data->sc2ranks->points ?> points, Rank <?php echo $data->sc2ranks->rank ?><br/>
<?php echo $data->sc2ranks->wins ?> wins<br/>
</td>
<td class="right,top"><img src="img/sc2/<?php echo $data->sc2ranks->league ?>.png" alt="<?php echo ucfirst($data->sc2ranks->league) ?> League" /></td>
</tr>
</table>
</div>
<h3>Steam</h3>
<div id="steam" class="box">
<table class="formatting">
<tr>
<td class="gamesformatting"><a href="http://steamcommunity.com/"><img src="img/badges/steam.jpg" alt="Steam" /></a></td>
<td class="top">
<a href="http://steamcommunity.com/id/toppazz">Toppazz</a><br/>
<?php echo $data->steam->hours ?> hours in the last two weeks.<br/>
<?php
foreach($data->steam->recent as $game) {
?>
<a href="<?php echo $game->link ?>"><?php echo $game->name ?></a>: <?php echo $game->hours ?> hours.<br/>
<?
}
?>
</td>
</tr>
</table>
</div>
</div>
<div class="clear">&nbsp;</div>
</div>
<br/>
<div id="copyright">&copy; Andrew Tomaka 2010-2011. [ <a href="admin">admin</a> ]</div>
<br/><br/>
<script type="text/javascript" src="js/niftycube.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.qtip-1.0.0-rc3.min.js"></script>
<script type="text/javascript">
window.onload=function() {
Nifty("div#content","big");
Nifty("div#about,div#contacts,div#twitter,div#github,div#tomtvgrid,div#blog,div#sc2mmr,");
Nifty("div#lastfm,div#hulu,div#wow,div#sc2,div#steam,div#sc2mmr,div#fitness");
Nifty("div#projects p");
Nifty("div#random p");
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('img[title]').qtip({
style: {
tip: true,
border: {
width: 0,
radius: 5,
color: '#74aa81'
},
color: '#216332'
}
})
});
</script>
</body>
</html>

View file

@ -0,0 +1,222 @@
/*
* jQuery inlineEdit
*
* Copyright (c) 2009 Ca-Phun Ung <caphun at yelotofu dot com>
* Licensed under the MIT (MIT-LICENSE.txt) license.
*
* http://github.com/caphun/jquery.inlineedit/
*
* Inline (in-place) editing.
*/
(function($) {
// cached values
var namespace = '.inlineedit',
placeholderClass = 'inlineEdit-placeholder';
// define inlineEdit method
$.fn.inlineEdit = function( options ) {
var self = this;
return this
.each( function() {
$.inlineEdit.getInstance( this, options ).initValue();
})
.live( ['click', 'mouseenter','mouseleave'].join(namespace+' '), function( event ) {
var widget = $.inlineEdit.getInstance( this, options ),
editableElement = widget.element.find( widget.options.control ),
mutated = !!editableElement.length;
if ( event.target !== editableElement[0] ) {
switch ( event.type ) {
case 'click':
widget[ mutated ? 'mutate' : 'init' ]();
break;
case 'mouseover':
case 'mouseout':
if ( !mutated ) {
widget.hoverClassChange( event );
}
break;
}
}
});
}
// plugin constructor
$.inlineEdit = function( elem, options ) {
// deep extend
this.options = $.extend( true, {}, $.inlineEdit.defaults, options );
// the original element
this.element = $( elem );
}
// plugin instance
$.inlineEdit.getInstance = function( elem, options ) {
return ( $.inlineEdit.initialised( elem ) )
? $( elem ).data( 'widget' + namespace )
: new $.inlineEdit( elem, options );
}
// check if plugin initialised
$.inlineEdit.initialised = function( elem ) {
var init = $( elem ).data( 'init' + namespace );
return init !== undefined && init !== null ? true : false;
}
// plugin defaults
$.inlineEdit.defaults = {
hover: 'ui-state-hover',
value: '',
save: '',
buttons: '<button class="save">save</button> <button class="cancel">cancel</button>',
placeholder: 'Click to edit',
control: 'input',
cancelOnBlur: false
};
// plugin prototypes
$.inlineEdit.prototype = {
// initialisation
init: function() {
// set initialise flag
this.element.data( 'init' + namespace, true );
// initialise value
this.initValue();
// mutate
this.mutate();
// save widget data
this.element.data( 'widget' + namespace, this );
},
initValue: function() {
this.value( $.trim( this.element.text() ) || this.options.value );
if ( !this.value() ) {
this.element.html( $( this.placeholderHtml() ) );
} else if ( this.options.value ) {
this.element.html( this.options.value );
}
},
mutate: function() {
var self = this;
return self
.element
.html( self.mutatedHtml( self.value() ) )
.find( 'button.save' )
.bind( 'click', function( event ) {
self.save( self.element, event );
self.change( self.element, event );
return false;
})
.end()
.find( 'button.cancel' )
.bind( 'click', function( event ) {
self.change( self.element, event );
return false;
})
.end()
.find( self.options.control )
.bind( 'blur', function( event ) {
if (self.options.cancelOnBlur === true)
self.change( self.element, event );
})
.bind( 'keyup', function( event ) {
switch ( event.keyCode ) {
case 13: // save on ENTER
if (self.options.control !== 'textarea') {
self.save( self.element, event );
self.change( self.element, event );
}
break;
case 27: // cancel on ESC
self.change( self.element, event );
break;
}
})
.focus()
.end();
},
value: function( newValue ) {
if ( arguments.length ) {
this.element.data( 'value' + namespace, $( '.' + placeholderClass, this ).length ? '' : newValue && newValue.replace( /\n/g,"<br />" ) );
}
return this.element.data( 'value' + namespace );
},
mutatedHtml: function( value ) {
return this.controls[ this.options.control ].call( this, value );
},
placeholderHtml: function() {
return '<span class="'+ placeholderClass +'">'+ this.options.placeholder +'</span>';
},
buttonHtml: function( options ) {
var o = $.extend({}, {
before: ' ',
buttons: this.options.buttons,
after: ''
}, options);
return o.before + o.buttons + o.after;
},
save: function( elem, event ) {
var hash = {
value: this.element.find( this.options.control ).val()
};
if ( ( $.isFunction( this.options.save ) && this.options.save.call( this.element[0], event, hash ) ) !== false || !this.options.save ) {
this.value( hash.value );
}
},
change: function( elem, event ) {
var self = this;
if ( this.timer ) {
window.clearTimeout( this.timer );
}
this.timer = window.setTimeout( function() {
self.element.html( self.value() || self.placeholderHtml() );
self.element.removeClass( self.options.hover );
}, 200 );
},
controls: {
textarea: function( value ) {
return '<textarea>'+ value.replace(/<br\s?\/?>/g,"\n") +'</textarea>' + this.buttonHtml( { before: '<br />' } );
},
input: function( value ) {
return '<input type="text" value="'+ value.replace(/(\u0022)+/g, '') +'">' + this.buttonHtml();
}
},
hoverClassChange: function( event ) {
$( event.target )[event.type === 'mouseover' ? 'addClass':'removeClass']( this.options.hover );
}
};
})(jQuery);

File diff suppressed because one or more lines are too long

319
public_html/js/niftycube.js Normal file
View file

@ -0,0 +1,319 @@
/* Nifty Corners Cube - rounded corners with CSS and Javascript
Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
var niftyOk=(document.getElementById && document.createElement && Array.prototype.push);
var niftyCss=false;
String.prototype.find=function(what){
return(this.indexOf(what)>=0 ? true : false);
}
var oldonload=window.onload;
if(typeof(NiftyLoad)!='function') NiftyLoad=function(){};
if(typeof(oldonload)=='function')
window.onload=function(){oldonload();AddCss();NiftyLoad()};
else window.onload=function(){AddCss();NiftyLoad()};
//commented out who knows if this was bad.
function AddCss(){
niftyCss=true;
//var l=CreateEl("link");
//l.setAttribute("type","text/css");
//l.setAttribute("rel","stylesheet");
//l.setAttribute("href","niftyCorners.css");
//l.setAttribute("media","screen");
//document.getElementsByTagName("head")[0].appendChild(l);
}
function Nifty(selector,options){
if(niftyOk==false) return;
if(niftyCss==false) AddCss();
var i,v=selector.split(","),h=0;
if(options==null) options="";
if(options.find("fixed-height"))
h=getElementsBySelector(v[0])[0].offsetHeight;
for(i=0;i<v.length;i++)
Rounded(v[i],options);
if(options.find("height")) SameHeight(selector,h);
}
function Rounded(selector,options){
var i,top="",bottom="",v=new Array();
if(options!=""){
options=options.replace("left","tl bl");
options=options.replace("right","tr br");
options=options.replace("top","tr tl");
options=options.replace("bottom","br bl");
options=options.replace("transparent","alias");
if(options.find("tl")){
top="both";
if(!options.find("tr")) top="left";
}
else if(options.find("tr")) top="right";
if(options.find("bl")){
bottom="both";
if(!options.find("br")) bottom="left";
}
else if(options.find("br")) bottom="right";
}
if(top=="" && bottom=="" && !options.find("none")){top="both";bottom="both";}
v=getElementsBySelector(selector);
for(i=0;i<v.length;i++){
FixIE(v[i]);
if(top!="") AddTop(v[i],top,options);
if(bottom!="") AddBottom(v[i],bottom,options);
}
}
function AddTop(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias") || (color=getBk(el))=="transparent"){
color="transparent";bk="transparent"; border=getParentBk(el);btype="t";
}
else{
bk=getParentBk(el); border=Mix(color,bk);
}
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Top");
if(options.find("small")){
d.style.marginBottom=(p-2)+"px";
btype+="s"; lim=2;
}
else if(options.find("big")){
d.style.marginBottom=(p-10)+"px";
btype+="b"; lim=8;
}
else d.style.marginBottom=(p-5)+"px";
for(i=1;i<=lim;i++)
d.appendChild(CreateStrip(i,side,color,border,btype));
el.style.paddingTop="0";
el.insertBefore(d,el.firstChild);
}
function AddBottom(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias") || (color=getBk(el))=="transparent"){
color="transparent";bk="transparent"; border=getParentBk(el);btype="t";
}
else{
bk=getParentBk(el); border=Mix(color,bk);
}
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Bottom");
if(options.find("small")){
d.style.marginTop=(p-2)+"px";
btype+="s"; lim=2;
}
else if(options.find("big")){
d.style.marginTop=(p-10)+"px";
btype+="b"; lim=8;
}
else d.style.marginTop=(p-5)+"px";
for(i=lim;i>0;i--)
d.appendChild(CreateStrip(i,side,color,border,btype));
el.style.paddingBottom=0;
el.appendChild(d);
}
function CreateStrip(index,side,color,border,btype){
var x=CreateEl("b");
x.className=btype+index;
x.style.backgroundColor=color;
x.style.borderColor=border;
if(side=="left"){
x.style.borderRightWidth="0";
x.style.marginRight="0";
}
else if(side=="right"){
x.style.borderLeftWidth="0";
x.style.marginLeft="0";
}
return(x);
}
function CreateEl(x){
return(document.createElement(x));
}
//added to fix ie8 width problem
function getIeVersion() {
var rv = -1;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null) {
rv = parseFloat(RegExp.$1);
}
}
return rv;
}
//end add
function FixIE(el){
if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false)
//el.style.display="inline-block"; //removed to fix ie8 width problem
//added to fix ie8 width problem
var ver = getIeVersion();
if (ver < 8) {
el.style.display="inline-block";
}
//end add
}
function SameHeight(selector,maxh){
var i,v=selector.split(","),t,j,els=[],gap;
for(i=0;i<v.length;i++){
t=getElementsBySelector(v[i]);
els=els.concat(t);
}
for(i=0;i<els.length;i++){
if(els[i].offsetHeight>maxh) maxh=els[i].offsetHeight;
els[i].style.height="auto";
}
for(i=0;i<els.length;i++){
gap=maxh-els[i].offsetHeight;
if(gap>0){
t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px";
nc=els[i].lastChild;
if(nc.className=="niftycorners")
els[i].insertBefore(t,nc);
else els[i].appendChild(t);
}
}
}
function getElementsBySelector(selector){
var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;
if(selector.find("#")){ //id selector like "tag#id"
if(selector.find(" ")){ //descendant selector like "tag#id tag"
s=selector.split(" ");
var fs=s[0].split("#");
if(fs.length==1) return(objlist);
f=document.getElementById(fs[1]);
if(f){
v=f.getElementsByTagName(s[1]);
for(i=0;i<v.length;i++) objlist.push(v[i]);
}
return(objlist);
}
else{
s=selector.split("#");
tag=s[0];
selid=s[1];
if(selid!=""){
f=document.getElementById(selid);
if(f) objlist.push(f);
return(objlist);
}
}
}
if(selector.find(".")){ //class selector like "tag.class"
s=selector.split(".");
tag=s[0];
selclass=s[1];
if(selclass.find(" ")){ //descendant selector like tag1.classname tag2
s=selclass.split(" ");
selclass=s[0];
tag2=s[1];
}
}
var v=document.getElementsByTagName(tag); // tag selector like "tag"
if(selclass==""){
for(i=0;i<v.length;i++) objlist.push(v[i]);
return(objlist);
}
for(i=0;i<v.length;i++){
c=v[i].className.split(" ");
for(j=0;j<c.length;j++){
if(c[j]==selclass){
if(tag2=="") objlist.push(v[i]);
else{
v2=v[i].getElementsByTagName(tag2);
for(k=0;k<v2.length;k++) objlist.push(v2[k]);
}
}
}
}
return(objlist);
}
function getParentBk(x){
var el=x.parentNode,c;
while(el.tagName.toUpperCase()!="HTML" && (c=getBk(el))=="transparent")
el=el.parentNode;
if(c=="transparent") c="#FFFFFF";
return(c);
}
function getBk(x){
var c=getStyleProp(x,"backgroundColor");
if(c==null || c=="transparent" || c.find("rgba(0, 0, 0, 0)"))
return("transparent");
if(c.find("rgb")) c=rgb2hex(c);
return(c);
}
function getPadding(x,side){
var p=getStyleProp(x,"padding"+side);
if(p==null || !p.find("px")) return(0);
return(parseInt(p));
}
function getStyleProp(x,prop){
if(x.currentStyle)
return(x.currentStyle[prop]);
if(document.defaultView.getComputedStyle)
return(document.defaultView.getComputedStyle(x,'')[prop]);
return(null);
}
function rgb2hex(value){
var hex="",v,h,i;
var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;
var h=regexp.exec(value);
for(i=1;i<4;i++){
v=parseInt(h[i]).toString(16);
if(v.length==1) hex+="0"+v;
else hex+=v;
}
return("#"+hex);
}
function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
x=parseInt(c1.substr(1+step1*i,step1),16);
if(step1==1) x=16*x+x;
y=parseInt(c2.substr(1+step2*i,step2),16);
if(step2==1) y=16*y+y;
r[i]=Math.floor((x*50+y*50)/100);
r[i]=r[i].toString(16);
if(r[i].length==1) r[i]="0"+r[i];
}
return("#"+r[0]+r[1]+r[2]);
}

View file

@ -0,0 +1,18 @@
<?php
class database extends mysqli
{
public function __construct($host,$username,$password,$database)
{
parent::init();
if(!parent::options(MYSQLI_INIT_COMMAND,'SET AUTOCOMMIT = 0'))
die('Setting MYSQLI_INIT_COMMAND failed');
if(!parent::options(MYSQLI_OPT_CONNECT_TIMEOUT,5))
die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed');
if(!parent::real_connect($host,$username,$password,$database))
die('Connect Error (' . mysqli_connect_errono() . ') ' . mysqli_connect_error());
}
}
?>