From 2e44329b536f42f7d6397c54186fef1baded8c29 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Sat, 26 Oct 2024 19:51:04 -0400 Subject: [PATCH] add quantity to shop and home; allow for much larger messages --- src/index.php | 3 +++ src/shop.php | 4 ++++ src/sql/create-phpgiftregdb.sql | 2 +- src/templates/home.tpl | 2 ++ src/templates/shop.tpl | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/index.php b/src/index.php index 5f7e526..009d885 100644 --- a/src/index.php +++ b/src/index.php @@ -177,6 +177,9 @@ else { case "source": $sortby = "source {$_SESSION['sortdir']}, rankorder, i.name"; break; + case "quantity": + $sortby = "quantity {$_SESSION['sortdir']}, rankorder, i.name"; + break; case "price": $sortby = "price {$_SESSION['sortdir']}, rankorder, i.name"; break; diff --git a/src/shop.php b/src/shop.php index 24e568f..2880ee4 100644 --- a/src/shop.php +++ b/src/shop.php @@ -172,6 +172,10 @@ else { $sortby = "source $sortdir, rankorder, name"; $sort = "source"; break; + case "quantity": + $sortby = "quantity $sortdir, rankorder, name"; + $sort = "quantity"; + break; case "price": $sortby = "price $sortdir, rankorder, name"; $sort = "price"; diff --git a/src/sql/create-phpgiftregdb.sql b/src/sql/create-phpgiftregdb.sql index f7cd14b..bcdd6e1 100644 --- a/src/sql/create-phpgiftregdb.sql +++ b/src/sql/create-phpgiftregdb.sql @@ -89,7 +89,7 @@ CREATE TABLE `messages` ( `messageid` int(11) NOT NULL auto_increment, `sender` int(11) NOT NULL default '0', `recipient` int(11) NOT NULL default '0', - `message` varchar(255) NOT NULL default '', + `message` varchar(4096) NOT NULL default '', `isread` tinyint(1) NOT NULL default '0', `created` date NOT NULL default '2000-01-01', PRIMARY KEY (`messageid`) diff --git a/src/templates/home.tpl b/src/templates/home.tpl index fc4006a..2a7a934 100644 --- a/src/templates/home.tpl +++ b/src/templates/home.tpl @@ -81,6 +81,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Name{if $mysort == "name"} {/if} Ranking{if $mysort == "ranking"} {/if} + Quantity{if $mysort == "quantity"} {/if} Category{if $mysort == "category"} {/if} Store{if $mysort == "source"} {/if} Price{if $mysort == "price"} {/if} @@ -229,6 +230,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA {$row.rankid} + {$row.quantity} {$row.category|default:" "} {$row.source|default:" "} {$row.price} diff --git a/src/templates/shop.tpl b/src/templates/shop.tpl index b7c6859..025b61a 100644 --- a/src/templates/shop.tpl +++ b/src/templates/shop.tpl @@ -66,6 +66,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Name{if $sort == "name"} {/if} Ranking{if $sort == "ranking"} {/if} + Quantity{if $sort == "quantity"} {/if} Category{if $sort == "category"} {/if} Store{if $sort == "source"} {/if} Price{if $sort == "price"} {/if} @@ -196,6 +197,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA {$row.rankid} + {$row.quantity} {$row.category|default:" "} {$row.source|escape:'htmlall'} {$row.price}