From ab4815fd88a3639d5eb83a1f3db367db6e82ec97 Mon Sep 17 00:00:00 2001 From: Mike Javorski Date: Wed, 29 Nov 2023 11:29:00 -0800 Subject: [PATCH 1/2] Bugfix: Correct syntax for prepared statement in "copy" action --- src/shop.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shop.php b/src/shop.php index 63784cd..7aa7599 100644 --- a/src/shop.php +++ b/src/shop.php @@ -66,7 +66,7 @@ if (!empty($_GET["action"])) { $price = (float) $row["price"]; $cat = (int) $row["category"]; - $stmt = $smarty->dbh()->prepare("INSERT INTO {$opt["table_prefix"]}items(userid,description,price,source,url,comment,category,ranking,quantity) VALUES(?, ?, ?, ?, ?, ?, ?, 1, 1"); + $stmt = $smarty->dbh()->prepare("INSERT INTO {$opt["table_prefix"]}items(userid,description,price,source,url,comment,category,ranking,quantity) VALUES(?, ?, ?, ?, ?, ?, ?, 1, 1)"); $stmt->bindParam(1, $userid, PDO::PARAM_INT); $stmt->bindParam(2, $desc, PDO::PARAM_STR); $stmt->bindParam(3, $price); From dfc3397f55a6bcc29d2e1601e275c8b44116562e Mon Sep 17 00:00:00 2001 From: Mike Javorski Date: Wed, 29 Nov 2023 11:32:06 -0800 Subject: [PATCH 2/2] Bugfix: Always show pagination controls on home page if offset > 0 If you have items_per_page+1 items in your list and delete the sole item on the second page, you would end up stuck without a way to navigate to the first page. --- src/templates/home.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/home.tpl b/src/templates/home.tpl index 96af606..1881122 100644 --- a/src/templates/home.tpl +++ b/src/templates/home.tpl @@ -124,7 +124,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA {/foreach} - {if $myitems_count > $opt.items_per_page} + {if $myitems_count > $opt.items_per_page || $offset > 0}