 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
12-28-2008, 03:49 AM
|
#1 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
To-do list (update 1/16/09)
We need the following done, please post if you wish to do it (please do not ask to do something if you can't do it well).
Needs Doing
- Edit Image class. Inherits Display Image class. Verifies ownership of image (based off of ID), delete image, add image, set watermark on/off.
- Registration system
- Create gallery/View galleries
- Create item/View items in gallery
- Submit comment/View comment
- Display Image class. Loads an image based off of an ID along with its information (name, tags, ect.).
Note: For the viewing pages, they are not mandatory. Create it as nothing more than a tool to view the raw data if you want to. We will actually develop the viewing pages in the next stage.
In Progress:- Login/page-to-page user authentication In progress by Village Idiot
Done
- SQL class. The object must have functions to connect, disconnect, clean variables, execute commands and execute queries with a return. Completed by Tanax.
- User class (cookie based). Log in, log out, auth (from cookie data) Completed by Village Idiot.
- Config class. Loads configs into an array (key=name and value=setting value), crates configs, deletes configs. Completed by Orc
Last edited by Village Idiot : 12-29-2008 at 05:31 AM.
|
|
|
|
|
The Following User Says Thank You to Village Idiot For This Useful Post:
|
|
12-28-2008, 11:16 AM
|
#2 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
We need the following done, please post if you wish to do it (please do not ask to do something if you can't do it well). I am capable of about all of this, and will do as much as I can, this is a list of things that need doing.
I first and foremost need someone who knows how to use SVN to set us up on google code.
Coding:- SQL class. The object must have functions to connect, disconnect, clean variables, execute commands and execute queries with a return.
- Display Image class. Loads an image based off of an ID along with its information (name, tags, ect.).
- Edit Image class. Inherits Display Image class. Verifies ownership of image (based off of ID), delete image, add image, set watermark on/off.
- User class (cookie based). Log in, log out, auth (from cookie data)
- Config class. Loads configs into an array (key=name and value=setting value), crates configs, deletes configs.
Resources:- A chat room for us to chat in. I would perfer not to set one up, but to use an existing solution (line www.campfirenow.com but free).
|
I'd like to take up the SQL Class, and Config class.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
12-28-2008, 12:46 PM
|
#3 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Not trying to take away Orc's job here, but I have this database class, perhaps it could be used? Or used as a base, and someone could modify it for the better?
php Code:
<?php/** |||||||||||||||||||||||||||||||||||||||||| |||| @author Tanax |||| @copyright 2008 |||||||||||||||||||||||||||||||||||||||||| **/ class DBmysql implements iDB { private $host; private $user; private $pass; private $data; private $tables = array(); private $rows = array(); private $query_sql; private $query_result; private $query_fetch = array(); public function setHandler ($array) { $this-> host = $array[ 'host']; $this-> user = $array[ 'user']; $this-> pass = $array[ 'pass']; $this-> data = $array[ 'data']; return $this; } public function connect () { @ mysql_connect($this-> host, $this-> user, $this-> pass) or die("Could not connect to the database."); return $this; } public function select () { @ mysql_select_db($this-> data) or die("Could not select database."); return $this; } public function disconnect () { @ mysql_close() or die("Could not close database connection. Perhaps because the connect isn't opened."); } public function loadQuery ($query) { $this-> query_sql = $query; return $this; } public function exeQuery () { if(isset($this-> query_sql)) { $this-> query_result = @ mysql_query($this-> query_sql); if(! $this-> query_result) { throw new Exception ('An error occured while querying: ' . mysql_error()); } else return $this; } else throw new Exception ('No query is loaded.'); } public function getQueryResult () { if(isset($this-> query_result)) { return $this-> query_result; } else throw new Exception ('No query has been executed.'); } function loadFetch ( $assoc = false, $sql = null ) { unset( $this-> query_fetch ); empty( $this-> query_fetch ); $sql = (is_null($sql) && isset($this-> query_result)) ? $this-> query_result : $sql; $fetchType = ($assoc == true) ? MYSQL_ASSOC : MYSQL_NUM; if(! empty($sql)) { while($fetch = mysql_fetch_array($sql, $fetchType)) { $this-> query_fetch[] = $fetch; } if(! is_array($this-> query_fetch)) { throw new Exception ("An error occured while fetching the array" . mysql_error()); } else { return $this; } } } public function getFetch () { if(is_array($this-> query_fetch) && isset($this-> query_fetch)) { return $this-> query_fetch; } else throw new Exception ('No fetch has been loaded.'); } public function secure ($string) { $escapedstring = mysql_real_escape_string($string); return $secure; } }?>
The secure method could probably be upgraded quite a bit.
Anyways, this is just a base for you start off with!
__________________
|
|
|
|
12-28-2008, 02:53 PM
|
#4 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Tanax
Not trying to take away Orc's job here, but I have this database class, perhaps it could be used? Or used as a base, and someone could modify it for the better?
php Code:
<?php/** |||||||||||||||||||||||||||||||||||||||||| |||| @author Tanax |||| @copyright 2008 |||||||||||||||||||||||||||||||||||||||||| **/ class DBmysql implements iDB { private $host; private $user; private $pass; private $data; private $tables = array(); private $rows = array(); private $query_sql; private $query_result; private $query_fetch = array(); public function setHandler ($array) { $this-> host = $array[ 'host']; $this-> user = $array[ 'user']; $this-> pass = $array[ 'pass']; $this-> data = $array[ 'data']; return $this; } public function connect () { @ mysql_connect($this-> host, $this-> user, $this-> pass) or die("Could not connect to the database."); return $this; } public function select () { @ mysql_select_db($this-> data) or die("Could not select database."); return $this; } public function disconnect () { @ mysql_close() or die("Could not close database connection. Perhaps because the connect isn't opened."); } public function loadQuery ($query) { $this-> query_sql = $query; return $this; } public function exeQuery () { if(isset($this-> query_sql)) { $this-> query_result = @ mysql_query($this-> query_sql); if(! $this-> query_result) { throw new Exception ('An error occured while querying: ' . mysql_error()); } else return $this; } else throw new Exception ('No query is loaded.'); } public function getQueryResult () { if(isset($this-> query_result)) { return $this-> query_result; } else throw new Exception ('No query has been executed.'); } function loadFetch ( $assoc = false, $sql = null ) { unset( $this-> query_fetch ); empty( $this-> query_fetch ); $sql = (is_null($sql) && isset($this-> query_result)) ? $this-> query_result : $sql; $fetchType = ($assoc == true) ? MYSQL_ASSOC : MYSQL_NUM; if(! empty($sql)) { while($fetch = mysql_fetch_array($sql, $fetchType)) { $this-> query_fetch[] = $fetch; } if(! is_array($this-> query_fetch)) { throw new Exception ("An error occured while fetching the array" . mysql_error()); } else { return $this; } } } public function getFetch () { if(is_array($this-> query_fetch) && isset($this-> query_fetch)) { return $this-> query_fetch; } else throw new Exception ('No fetch has been loaded.'); } public function secure ($string) { $escapedstring = mysql_real_escape_string($string); return $secure; } }?>
The secure method could probably be upgraded quite a bit.
Anyways, this is just a base for you start off with!
|
>:O lol (10char)
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
12-28-2008, 02:38 PM
|
#5 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
SVN should be up and running.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|
12-28-2008, 03:00 PM
|
#6 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Quote:
Originally Posted by Village Idiot
Resources:- A chat room for us to chat in. I would perfer not to set one up, but to use an existing solution (line www.campfirenow.com but free).
|
There's always the unused IRC channel at #talkphp. Campfire would be great if the free account wasn't so heavily restricted (only 4 people online allowed!)
|
|
|
|
12-29-2008, 01:24 AM
|
#7 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
I'm having trouble on my main computer (bad ram :(), so I am confined to my crappy computer for now. I probably wont be coding till tomorrow evening.
Quote:
Originally Posted by Salathe
There's always the unused IRC channel at #talkphp. Campfire would be great if the free account wasn't so heavily restricted (only 4 people online allowed!)
|
We can use that then. And campfire is amazing, I use it at work.
|
|
|
|
12-29-2008, 05:13 AM
|
#8 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Tanax, we will use that function as a base, although some modifications will probably be made. First will be the removal of the copyright, we wont want to start getting touchy with copyrights, we will have to have ownership of it if we are going to use it. We will have credits though, you can claim credit for the SQL code there.
|
|
|
|
12-29-2008, 05:14 AM
|
#9 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
Tanax, we will use that function as a base, although some modifications will probably be made. First will be the removal of the copyright, we wont want to start getting touchy with copyrights, we will have to have ownership of it if we are going to use it.
|
I'll just allow Tanax to do the DB Class, and as I can make the Config class..?
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
12-29-2008, 05:18 AM
|
#10 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Go ahead and do the config class, are you sure you understand what we need? I don't think I was incredibly clear in my description.
Tanax can do the DB class, but if it is going to be in the project we must own the copyright, I don't want members contributing code each under their own copyright. This is one of the few things I am going to put my foot down on.
In the meantime, I will get our user class together (I may have to wait till my main comp is working to get some code though).
|
|
|
|
12-29-2008, 05:36 AM
|
#11 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
Go ahead and do the config class, are you sure you understand what we need? I don't think I was incredibly clear in my description.
Tanax can do the DB class, but if it is going to be in the project we must own the copyright, I don't want members contributing code each under their own copyright. This is one of the few things I am going to put my foot down on.
In the meantime, I will get our user class together (I may have to wait till my main comp is working to get some code though).
|
Quote:
|
Config class. Loads configs into an array (key=name and value=setting value), crates configs, deletes configs. In progress by Orc
|
Seems kinda self explanatory. ;P Create Configs, delete configs, and loading configs into an array is no problemo. But one thing, where are configs stored? in database? or by flat file?
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
12-29-2008, 05:38 AM
|
#12 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
I see I'm being over descriptive here, I'll stop.
The configs are stored in a database with the following structure:

|
|
|
|
12-29-2008, 05:40 AM
|
#13 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
I'm heading to bed now, talk to you all tomorrow.
|
|
|
|
12-29-2008, 05:42 AM
|
#14 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
I'm heading to bed now, talk to you all tomorrow.
|
bye baby. lol 
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
12-29-2008, 12:59 PM
|
#15 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
I understand that the copyright will get removed and that I will get credit for it instead. I was just copying my script, and the copyright always gets there auto when I create a new file so that's why it's there. Feel free to remove it.
Fore future possible troubles: I, Tanax(Marcus Schumann), hereby say that it's okey to remove the copyright from my script.
Just tell me what the DB class needs more/needs editing, and I'll fix it!
One idea from the top of my head: How about being able to execute a query without having to load it first?
__________________
|
|
|
|
12-29-2008, 04:54 PM
|
#16 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Here is what I want done with it: - Make the connnection a variable so we can use the connection for every query.
- Have the SQL cleaning function return the variable as is if its an int type.
- Remove all output form the class as throw an exception instead.
As a general rule, classes are never to give output of any kind, they strictly process data.
Last edited by Village Idiot : 12-29-2008 at 05:29 PM.
|
|
|
|
12-29-2008, 06:00 PM
|
#17 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
To all coders, please start writing and saving it via source control.
|
|
|
|
12-29-2008, 07:30 PM
|
#18 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Quote:
Originally Posted by Village Idiot
Here is what I want done with it: - Make the connnection a variable so we can use the connection for every query.
- Have the SQL cleaning function return the variable as is if its an int type.
- Remove all output form the class as throw an exception instead.
As a general rule, classes are never to give output of any kind, they strictly process data.
|
I'm on it.
And yes, I know that.
Quote:
Originally Posted by Village Idiot
To all coders, please start writing and saving it via source control.
|
What's source control? 
__________________
|
|
|
|
12-31-2008, 11:32 PM
|
#19 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 360
Thanks: 24
|
Quote:
Originally Posted by Tanax
I'm on it.
And yes, I know that.
What's source control? 
|
Source control example is Subversion.  I hope that explains all...
__________________
Necessity is the mother of invention.
My blog
|
|
|
|
01-01-2009, 04:31 AM
|
#20 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Source control makes sure that we are all using the same code, it synchronizes us easily. Use google to get more info on it.
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|