diff --git a/src/index.php b/src/index.php index f6e4c26..43ef737 100644 --- a/src/index.php +++ b/src/index.php @@ -190,7 +190,7 @@ else { $sortby = "rankorder {$_SESSION['sortdir']}, i.name"; } } -$stmt = $smarty->dbh()->prepare("SELECT itemid, name, description, i.category as catid, c.category, price, price as pricenum, source, url, i.ranking as rankid, rendered, comment, quantity, image_filename, public FROM {$opt["table_prefix"]}items i LEFT OUTER JOIN {$opt["table_prefix"]}categories c ON c.categoryid = i.category LEFT OUTER JOIN {$opt["table_prefix"]}ranks r ON r.ranking = i.ranking WHERE userid = ? and i.archive = false ORDER BY " . $sortby); +$stmt = $smarty->dbh()->prepare("SELECT itemid, name, description, i.category as catid, c.category, price, price as pricenum, source, url, i.ranking as rankid, rendered, comment, quantity, created, image_filename, public FROM {$opt["table_prefix"]}items i LEFT OUTER JOIN {$opt["table_prefix"]}categories c ON c.categoryid = i.category LEFT OUTER JOIN {$opt["table_prefix"]}ranks r ON r.ranking = i.ranking WHERE userid = ? and i.archive = false ORDER BY " . $sortby); $stmt->bindParam(1, $userid, PDO::PARAM_INT); $stmt->execute(); $myitems_count = 0; diff --git a/src/item.php b/src/item.php index 28cf1a6..34e095f 100644 --- a/src/item.php +++ b/src/item.php @@ -304,8 +304,8 @@ if (!empty($_REQUEST["action"])) { } else if ($action == "insert") { if (!$haserror) { - $stmt = $smarty->dbh()->prepare("INSERT INTO {$opt["table_prefix"]}items(userid,name,description,price,source,category,url,ranking,comment,public,quantity,image_filename) " . - "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt = $smarty->dbh()->prepare("INSERT INTO {$opt["table_prefix"]}items(userid,name,description,price,source,category,url,ranking,comment,public,quantity,created,image_filename) " . + "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->bindParam(1, $userid, PDO::PARAM_INT); $stmt->bindParam(2, $name, PDO::PARAM_STR); $stmt->bindParam(3, $description, PDO::PARAM_STR); @@ -317,10 +317,11 @@ if (!empty($_REQUEST["action"])) { $stmt->bindParam(9, $comment, PDO::PARAM_STR); $stmt->bindParam(10, $public, PDO::PARAM_BOOL); $stmt->bindParam(11, $quantity, PDO::PARAM_INT); + $stmt->bindParam(12, date('Y-m-d H:i:s')); if (!isset($image_base_filename) || $image_base_filename == "") { $image_base_filename = NULL; } - $stmt->bindParam(12, $image_base_filename, PDO::PARAM_STR); + $stmt->bindParam(13, $image_base_filename, PDO::PARAM_STR); $stmt->execute(); stampUser($userid, $smarty->dbh(), $smarty->opt()); diff --git a/src/shop.php b/src/shop.php index efe45d4..26231b4 100644 --- a/src/shop.php +++ b/src/shop.php @@ -226,7 +226,7 @@ else { $sql = "SELECT i.itemid, name, description, price, price as pricenum, source, i.category as catid, c.category, url, r.title as rank, i.ranking as rankid, image_filename, public, " . "ub.fullname AS bfullname, ub.userid AS boughtid, " . "ur.fullname AS rfullname, ur.userid AS reservedid, " . - "rendered, i.comment, i.quantity " . + "rendered, i.comment, i.quantity, created " . "FROM {$opt["table_prefix"]}items i " . "LEFT OUTER JOIN {$opt["table_prefix"]}categories c ON c.categoryid = i.category " . "LEFT OUTER JOIN {$opt["table_prefix"]}ranks r ON r.ranking = i.ranking " . diff --git a/src/sql/create-phpgiftregdb.sql b/src/sql/create-phpgiftregdb.sql index 7fb6c06..7f721e7 100644 --- a/src/sql/create-phpgiftregdb.sql +++ b/src/sql/create-phpgiftregdb.sql @@ -80,6 +80,8 @@ CREATE TABLE `items` ( `image_filename` varchar(255) default NULL, `public` tinyint(1) NOT NULL default '0', `archive` tinyint(1) NOT NULL default '0', + `archive` tinyint(1) NOT NULL default '0', + `created` datetime default NULL, PRIMARY KEY (`itemid`) ); diff --git a/src/templates/home.tpl b/src/templates/home.tpl index 8326a36..e09b46e 100644 --- a/src/templates/home.tpl +++ b/src/templates/home.tpl @@ -229,21 +229,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - {$row.name|truncate:50|escape:'htmlall'} + {$row.name|truncate:50|escape:'htmlall'} {if $row.public == 1}   Item is Public{/if} diff --git a/src/templates/shop.tpl b/src/templates/shop.tpl index 5a5c840..ba6e6eb 100644 --- a/src/templates/shop.tpl +++ b/src/templates/shop.tpl @@ -173,35 +173,38 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - {$row.name|truncate:50|escape:'htmlall'} + {$row.name|truncate:50|escape:'htmlall'} {$row.rankid}