[Astrospaces-commits] SF.net SVN: astrospaces: [46] trunk
Brought to you by:
p3net
From: <del...@us...> - 2007-07-30 20:52:42
|
Revision: 46 http://astrospaces.svn.sourceforge.net/astrospaces/?rev=46&view=rev Author: deltalabs Date: 2007-07-30 13:52:43 -0700 (Mon, 30 Jul 2007) Log Message: ----------- I *think* I got everything switched to the new schema. If anyone notices anything that didn't get changed, let me know. Modified Paths: -------------- trunk/gallery.php trunk/group.php trunk/images.php trunk/index.php trunk/profile.php trunk/viewspace.php Modified: trunk/gallery.php =================================================================== --- trunk/gallery.php 2007-07-30 20:32:28 UTC (rev 45) +++ trunk/gallery.php 2007-07-30 20:52:43 UTC (rev 46) @@ -36,7 +36,7 @@ { if($session->is_friend($id)) { - $_query = 'SELECT id FROM '.AS_TBL_IMG.' WHERE owner = '.$db->qstr($id,get_magic_quotes_gpc()); + $_query = 'SELECT img_id FROM '.AS_TBL_IMG.' WHERE owner_id = '.$db->qstr($id,get_magic_quotes_gpc()); $_query = $db->Execute($_query); $_query = $db->GetArray($_query); $gallery = new template(AS_DIR_TPL.'gallery.tpl'); @@ -59,10 +59,10 @@ { if( $session->is_friend($owner) ) { - $_query = 'SELECT * FROM '.AS_TBL_IMG.' WHERE id = '.$db->qstr($img_id,get_magic_quotes_gpc()); + $_query = 'SELECT * FROM '.AS_TBL_IMG.' WHERE img_id = '.$db->qstr($img_id,get_magic_quotes_gpc()); $img = $db->Execute( $_query ); - $_query = 'SELECT * FROM '.AS_TBL_IMG_CMT.' WHERE image = '.$db->qstr($img_id,get_magic_quotes_gpc()); + $_query = 'SELECT * FROM '.AS_TBL_IMG_CMT.' WHERE image_id = '.$db->qstr($img_id,get_magic_quotes_gpc()); $img_com = $db->Execute( $_query ); $count = $img_com->RecordCount(); @@ -84,7 +84,7 @@ if ( isset($user->data['user_id']) and $user->data['user_id'] != $img['owner'] ) { $img['views']++; - $_query = 'UPDATE '.AS_TBL_IMG." SET views = '" . $views . "' WHERE id = '" . $img_id . "'"; + $_query = 'UPDATE '.AS_TBL_IMG." SET views = '" . $views . "' WHERE img_id = '" . $img_id . "'"; $db->query($_query); } $drill = new template(AS_TPL.'drill.tpl'); Modified: trunk/group.php =================================================================== --- trunk/group.php 2007-07-30 20:32:28 UTC (rev 45) +++ trunk/group.php 2007-07-30 20:52:43 UTC (rev 46) @@ -1,21 +1,21 @@ -<?php -/******************************************************* - * Copyright (C) 2007 http://p3net.net - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - - @id: $Id$ -*********************************************************/ +<?php +/******************************************************* + * Copyright (C) 2007 http://p3net.net + + 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @id: $Id$ +*********************************************************/ ?> \ No newline at end of file Modified: trunk/images.php =================================================================== --- trunk/images.php 2007-07-30 20:32:28 UTC (rev 45) +++ trunk/images.php 2007-07-30 20:52:43 UTC (rev 46) @@ -33,7 +33,7 @@ { $error->general("Invalid ID specified", "Not an (int)"); } - $_query = 'SELECT * FROM '.AS_TBL_IMG.' WHERE id = '.$db->qstr($id,get_magic_quotes_gpc()); + $_query = 'SELECT * FROM '.AS_TBL_IMG.' WHERE img_id = '.$db->qstr($id,get_magic_quotes_gpc()); $img = $db->Execute($_query); $img = $img->GetArray(); @@ -53,7 +53,7 @@ { $error->general("Invalid ID specified", "Not an (int)"); } - $_query = 'SELECT * FROM '.AS_TBL_IMG.' WHERE id = '.$db->qstr($id,get_magic_quotes_gpc()); + $_query = 'SELECT * FROM '.AS_TBL_IMG.' WHERE img_id = '.$db->qstr($id,get_magic_quotes_gpc()); $_query = $db->Execute($_query); $img = $db->GetArray($_query); Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-07-30 20:32:28 UTC (rev 45) +++ trunk/index.php 2007-07-30 20:52:43 UTC (rev 46) @@ -20,12 +20,12 @@ *********************************************************/ include('globals.php'); /* 5 most recent users should be enough. We can fill the rest with ads or something */ -$_query = 'SELECT id, display_name, user_image FROM '.AS_TBL_USER.' SORT BY id DESC LIMIT 5'; +$_query = 'SELECT user_id, display_name, user_image FROM '.AS_TBL_USER.' SORT BY user_id DESC LIMIT 5'; $_query = $db->Execute($_query); while($user = $_query->FetchRow()) { $userdetail[$user['display_name']] = array( - 'id' => $user['id'], + 'id' => $user['user_id'], 'icon' => $user['user_image'] ); } Modified: trunk/profile.php =================================================================== --- trunk/profile.php 2007-07-30 20:32:28 UTC (rev 45) +++ trunk/profile.php 2007-07-30 20:52:43 UTC (rev 46) @@ -35,10 +35,10 @@ } else if($step == 2) { - $_query = 'INSERT INTO '.AS_TBL_USER.' (display_name, password, join, time_offset) '; + $_query = 'INSERT INTO '.AS_TBL_USER.' (display_name, password, join_date, time_offset) '; $_query .= 'VALUES('.$db->qstr($vars["display_name"],get_magic_quotes_gpc()).','; $_query .= $db->qstr(md5($vars["password"]),get_magic_quotes_gpc()).','; - $_query .= time().','.qstr($vars["offset"],get_magic_quotes_gpc()).')'; + $_query .= mktime().','.qstr($vars["offset"],get_magic_quotes_gpc()).')'; if ($db->Execute($_query) === false) { @@ -102,7 +102,7 @@ $content = addslashes($content); fclose($fp); - $_query = 'INSERT INTO '.AS_TBL_IMG.' (owner, content, mime_type, desc, width, height, name, views)' + $_query = 'INSERT INTO '.AS_TBL_IMG.' (owner_id, content, mime_type, desc, width, height, name, views)' .'VALUES('. $user->data["user_id"] . ',' . $db->qstr($content) . ',' . $db->qstr($file_type) . "', ''" .$db->qstr(htmlspecialchars($_POST["desc"]),get_magic_quotes_gpc()).','.$width.','.$height.','.$db->qstr($file_name,get_magic_quotes_gpc()).", '0')"; if ($db->Execute($_query) === false) @@ -133,13 +133,13 @@ { $var[$key] = $db->qstr(htmlspecialchars($value),get_magic_quotes_gpc()); } - $_query = 'SELECT id FROM '.AS_TBL_USER.' WHERE email = ' . $var['email'] . ' AND password = ' . qstr(md5($var['password'])); + $_query = 'SELECT user_id FROM '.AS_TBL_USER.' WHERE email = ' . $var['email'] . ' AND password = ' . qstr(md5($var['password'])); $_query = $db->Execute($_query); $num = $_query->RecordCount(); if($num > 0) { $id = $_query->GetArray(); - $session->login($id[0]['id']); + $session->login($id[0]['user_id']); $message->thank('logging in', 'to return to the index', 'index.php'); } else @@ -155,15 +155,18 @@ */ function inbox() { - $_query = 'SELECT id, from, date, subject, read FROM '.AS_TBL_PM.' ORDER BY id DESC'; + $_uid_query = 'SELECT user_id FROM '.AS_TBL_USER.' WHERE email = ' . $var['email'] . ' AND password = ' . qstr(md5($var['password'])); + $_uid_query = $db->Execute($_query); + $uid = $_query->GetArray(); + $_query = 'SELECT message_id, sender_id, send_date, subject, read FROM '.AS_TBL_PM.' WHERE recipient_id = '.$uid[0]['user_id'].' ORDER BY id DESC'; $_query = $db->Execute($_query); $count = $_query->RecordCount(); for ($i = 0; $i < $count; $i++) { $pm[$i] = array( - 'id' => $_query->Fields('id'), - 'from' => $session->get_username($_query->Fields('from')), - 'date' => $session->generate_timestamp($_query->Fields('date')), + 'id' => $_query->Fields('message_id'), + 'from' => $session->get_username($_query->Fields('sender_id')), + 'date' => $session->generate_timestamp($_query->Fields('send_date')), 'subject' => $_query->Fields('subject'), 'read' => $_query->Fields('read') ); @@ -184,12 +187,12 @@ $error->general('Invalid userID', "Invalid userID = Possible hack! Input value: \"".$id."\" User Hostname: ".$_SERVER['REMOTE_ADDR']); return false; } - $_query = 'SELECT * FROM '.AS_TBL_PM.' WHERE id = ' . $id; + $_query = 'SELECT * FROM '.AS_TBL_PM.' WHERE message_id = ' . $id; $_query = $db->Execute($_query); $array = $db->GetArray($_query); $read =& new template(AS_TPL.'read.tpl'); - $read->set_var('from', $session->get_username($array[0]["from"])); - $read->set_var('date', $session->generate_timestamp($array[0]["date"])); + $read->set_var('from', $session->get_username($array[0]["sender_id"])); + $read->set_var('date', $session->generate_timestamp($array[0]["send_date"])); $read->set_var('subject', $array[0]["subject"]); $read->set_var('message', $array[0]["message"]); if($array[0]['read'] != '1') Modified: trunk/viewspace.php =================================================================== --- trunk/viewspace.php 2007-07-30 20:32:28 UTC (rev 45) +++ trunk/viewspace.php 2007-07-30 20:52:43 UTC (rev 46) @@ -1,23 +1,23 @@ -<?php -/******************************************************* - * Copyright (C) 2007 http://p3net.net - - 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - - @id: $Id$ -*********************************************************/ -/* Todo: If no id is set or id is yours, show you owner view instead - Alternatively, actual view will be shown if &view=real is appended*/ +<?php +/******************************************************* + * Copyright (C) 2007 http://p3net.net + + 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @id: $Id$ +*********************************************************/ +/* Todo: If no id is set or id is yours, show you owner view instead + Alternatively, actual view will be shown if &view=real is appended*/ ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |