Main issue I see would be people having different versions of plugins you're using and all that.
Just whipped up a quick class.
[code]<?php
/**
* @author Brandon Long
* @copyright 2012
*/
class db {
private $dbconnections;
private $mysql;
private $clientApiType;
/**
* function: __connect ( HOST , DB_USERNAME, DB_PASSWORD, DB_NAME , CLIENT_API_TYPE )
* Descrition: Makes a db connection
*/
public function __connect ( $host, $dbUsername, $dbPassword, $dbName, $clientApiType)
{
// check the client api type
if ($clientApiType == 'mysql')
{
if (!$mysql = mysql_connect($host, $dbUsername, $dbPassword))
{
die($this->killFunction('Unable to connect to MySQL Server'));
} else
{
if (!mysql_select_db($dbName))
{
die($this->killFunction('Unable to connect to MySQL Server'));
} else
{
return true;
}
}
} else if ($clientApiType == 'mysqli')
{
$mysql = new mysqli ( $host, $dbUsername, $dbPassword, $dbName );
if ($mysql->connect_error)
{
die($this->killFunction('Unable to connect to MySQL Server'));
} else
{
return true;
}
} else if ($clientApiType == 'mysqlPDO')
{
$dsn = sprintf("mysql:dbname=%s;host=%s", $dbName, $host);
try {
$mysql = new PDO ( $dsn, $dbUsername, $dbPassword );
} catch (PDOException $e)
{
die($this->killFunction('Unable to connect to MySQL Server'));
}
} else
{
die($this->killFunction('Invalid database identifer identified.'));
}
}
/**
* fuction: killFunction ( $errorMsg )
* Description: Handles all error handling from the class. Basically, if some idiot decides to puke all over my ish we gonna get our ------ and roll.
*/
private function killFunction ( $errorMsg )
{
include "./templates/" . TEMPLATE_NAME . "/dberror.html";
}
}
?>[/code]
[QUOTE=blong4life;35002000]-snipped to protect your eyes from more shit-[/QUOTE]
wow do you email your mother with that keyboard
[QUOTE=amcfaggot;35002013]wow do you email your mother with that keyboard[/QUOTE]
Sir, no I do not e-mail my mother. No need to, I am not lame. I can call her via TELEPHONE. It's an apparatus that allows you to talk to people. I understand you might not get out much, so I pictured one below.
Let me know if you need one, I can send you an extra one.
[img]http://www.eoncc.com/images/phones/32b_angle_v5_lg500.jpg[/img]
[php]
<?php
/**
* @author Brandon Long
* @copyright 2012
*/
class db {
private $dbconnections;
private $mysql;
private $clientApiType;
/**
* function: __connect ( HOST , DB_USERNAME, DB_PASSWORD, DB_NAME , CLIENT_API_TYPE )
* Descrition: Makes a db connection
*/
public function __connect($host, $dbUsername, $dbPassword, $dbName, $clientApiType){
// check the client api type
switch($clientApiType){
case 'mysql':
if (!$mysql = mysql_connect($host, $dbUsername, $dbPassword) || !mysql_select_db($dbName)){
$this->mysqlError();
} else {
return true;
}
break;
case 'mysqli':
$mysql = new mysqli($host, $dbUsername, $dbPassword, $dbName);
if($mysql->connect_error){
$this->mysqlError();
} else {
return true;
}
break;
case 'mysqlPDO':
try {
$mysql = new PDO("mysql:dbname={$dbName};host={$host}", $dbUsername, $dbPassword);
} catch (PDOException $e){
$this->mysqlError();
}
break;
default:
$this->mysqlError();
break;
}
}
/**
* fuction: mysqlError ( $errorMsg )
* Description: Fuck you.
*/
private function mysqlError(){
$this->killFunction('Unable to connect to MySQL Server');
}
/**
* fuction: killFunction ( $errorMsg )
* Description: Handles all error handling from the class. Basically, if some idiot decides to puke all over my ish we gonna get our ------ and roll.
*/
private function killFunction($errorMsg){
include "./templates/" . TEMPLATE_NAME . "/dberror.html";
exit;
}
}
[/php]
You're welcome.
I'm currently working on some kind of chess reader for a school project.
I wanted to use HTML5 for everything, but it would be difficult getting the coörds right I guess..
So I have made two parts now:
[url]http://zerfox.com/o_en_o/testje.php[/url] (Div version, reading the positions for a little bit)
[url]http://zerfox.com/o_en_o/schaakbord.php[/url] (HTML5 part)
This is what I need to read out:
[quote=http://zerfox.com/o_en_o/raw_posities.php]
e4,c5,c3,Nf6,e5,Nd5,d4,cxd4,Nf3,Nc6,cxd4,d6,a3,Bg4,Bc4,e6,Be2,dxe5,dxe5,Be7,O-O,O-O,Re1,Qc7,b4,Rfd8,Nfd2,Bf5,Bb2,Nxe5,Qb3,Bf6,Nc3,Nxc3,Bd1,Ng4,Bxc3,Qxc3,Bxg4,
[/quote]
The goal is to convert the flash version ([url]http://digitalgametechnology.com/site/index.php/Live.html[/url]) to something like HTML5 or C++ for mobile devices (i.e. iPad).
[QUOTE=Jelly;35002072][php]
<?php
/**
* @author Brandon Long
* @copyright 2012
*/
class db {
private $dbconnections;
private $mysql;
private $clientApiType;
/**
* function: __connect ( HOST , DB_USERNAME, DB_PASSWORD, DB_NAME , CLIENT_API_TYPE )
* Descrition: Makes a db connection
*/
public function __connect($host, $dbUsername, $dbPassword, $dbName, $clientApiType){
// check the client api type
switch($clientApiType){
case 'mysql':
if (!$mysql = mysql_connect($host, $dbUsername, $dbPassword) || !mysql_select_db($dbName)){
$this->mysqlError();
} else {
return true;
}
break;
case 'mysqli':
$mysql = new mysqli($host, $dbUsername, $dbPassword, $dbName);
if($mysql->connect_error){
$this->mysqlError();
} else {
return true;
}
break;
case 'mysqlPDO':
try {
$mysql = new PDO("mysql:dbname={$dbName};host={$host}", $dbUsername, $dbPassword);
} catch (PDOException $e){
$this->mysqlError();
}
break;
default:
$this->mysqlError();
break;
}
}
/**
* fuction: mysqlError ( $errorMsg )
* Description: Fuck you.
*/
private function mysqlError(){
$this->killFunction('Unable to connect to MySQL Server');
}
/**
* fuction: killFunction ( $errorMsg )
* Description: Handles all error handling from the class. Basically, if some idiot decides to puke all over my ish we gonna get our ------ and roll.
*/
private function killFunction($errorMsg){
include "./templates/" . TEMPLATE_NAME . "/dberror.html";
exit;
}
}
[/php]
You're welcome.[/QUOTE]
require 'active_record'
ure welcome
[QUOTE=swift and shift;35003005]require 'active_record'
ure welcome[/QUOTE]
ty, this is way bettere
[img]http://puu.sh/jz25[/img]
I initially turned down this project as it was for free, but I thought I would do the front end work.
Like all free projects you end up having the piss taken out of you, no brief up front, constant additions, etc.
I picked up where the last guy left off, all he had complete was a few wireframes.
It still needs tidying up in a few areas, but its better than their current monstrosity.
[url]http://www.westdurhammethodists.org.uk/[/url]
It looks like a corporate website that was designed 7 years ago, not a church site.
That sounds way harsher than I meant it too, but the cold grays and that blue don't really give off a church feel to me. The extra boxes around the content are kind of weird too. You don't need to put boxes around everything to separate elements.
[QUOTE=KmartSqrl;35007703]It looks like a corporate website that was designed 7 years ago, not a church site.
That sounds way harsher than I meant it too, but the cold grays and that blue don't really give off a church feel to me. The extra boxes around the content are kind of weird too. You don't need to put boxes around everything to separate elements.[/QUOTE]
Its the design that was given to me, unfortunately.
What kind of colour scheme would you recommend?
[QUOTE=inconspicious;35007717]Its the design that was given to me, unfortunately.
What kind of colour scheme would you recommend?[/QUOTE]
Complete white with an accent colour and a serif font like Georgia. Super clean, no bullshitâ„¢
[QUOTE=jaybuz;35007765]Complete white with an accent colour and a serif font like Georgia. Super clean, no bullshit™[/QUOTE]
Sounds good, thanks.
[QUOTE=inconspicious;35007717]Its the design that was given to me, unfortunately.
What kind of colour scheme would you recommend?[/QUOTE]
Warmer colors. Light browns instead of grays would probably help it feel less corporate pretty quickly.
[img]http://puu.sh/jzMk[/img]
I've ditched the unnecessary borders and backgrounds and warmed it up a little.
I think it looks better, but there is still something little off.
[QUOTE=inconspicious;35008591][img]http://puu.sh/jzMk[/img]
I've ditched the unnecessary borders and backgrounds and warmed it up a little.
I think it looks better, but there is still something little off.[/QUOTE]
That's a bit better but there's a complete lack of personality.
[QUOTE=TerabyteS_;35008668]That's a bit better but there's a complete lack of personality.[/QUOTE]
Corporate church websites don't really need that much of a personality.
Try left aligning the text instead of justifying it.
[t]http://puu.sh/jAdb[/t]
I think I'm going to leave it for now, until I actually get some content to put into it.
It does look better, its just not quite finished.
I might make a small game like [url]http://www.travian.us[/url] I'll see how it goes but so far I haven't really been challenged by my projects in PHP.
[QUOTE=toaster468;35013377]I might make a small game like [url]http://www.travian.us[/url] I'll see how it goes but so far I haven't really been challenged by my projects in PHP.[/QUOTE]
swift and shift: "every project I do in php has been a challenge, because I used php."
well php is a shit language you can't blame him
[QUOTE=wizard`;35013661]swift and shift: "every project I do in php has been a challenge, because I used php."[/QUOTE]
Probably because he has actually done something useful. I don't really do much with it other than a few lines, like my flash game "CMS" which has about 30 lines of code.
[editline]5th March 2012[/editline]
Also, maybe I don't have enough experience with the language or what but why do you guys always say it is a bad language? I've heard StinkyJoe say "you could shoot yourself in the foot" (or something of the like) on previous occasions.
[QUOTE=toaster468;35013732]Probably because he has actually done something useful. I don't really do much with it other than a few lines, like my flash game "CMS" which has about 30 lines of code.
[editline]5th March 2012[/editline]
Also, maybe I don't have enough experience with the language or what but why do you guys always say it is a bad language? I've heard StinkyJoe say "you could shoot yourself in the foot" (or something of the like) on previous occasions.[/QUOTE]
Sorry I probably should have used less subtlety. It was a joke, I wasn't saying he was wrong or anything I was just attempting to make humour of his almost inevitable response of "php is shit", which is a fine opinion that I would tend to agree with for the most part.
php is shit
I remember back in the day, Facepunch was busy bashing Ruby and PHP frameworks, and talking about how they preferred to write their own PHP frameworks like men. :v:
[QUOTE=Funcoot;35015773]I remember back in the day, Facepunch was busy bashing Ruby and PHP frameworks, and talking about how they preferred to write their own PHP frameworks like men. :v:[/QUOTE]
That was when there were less people that knew what the fuck they were doing.
[editline]5th March 2012[/editline]
I remember trying to push php frameworks on people a long time ago though and getting shit for it lol
[QUOTE=KmartSqrl;35015815]That was when there were less people that knew what the fuck they were doing.
[editline]5th March 2012[/editline]
I remember trying to push php frameworks on people a long time ago though and getting shit for it lol[/QUOTE]
Code Igniter, Cake, and the like were always getting heat.
[t]http://i.imgur.com/zHnYW.png[/t]
This is a great PHP framework: [url]http://laravel.com/3[/url]
Sorry, you need to Log In to post a reply to this thread.