From 3b6dfca6d6b59abd932e94d88f19a8eadcf0d8ca Mon Sep 17 00:00:00 2001 From: Georgi Nikolov Date: Sat, 25 Jan 2025 18:47:53 +0200 Subject: Fixed queries to include the title property --- models/webpage.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'models') diff --git a/models/webpage.php b/models/webpage.php index 5dd44e0..742b977 100644 --- a/models/webpage.php +++ b/models/webpage.php @@ -10,12 +10,13 @@ class Webpage extends Table { public $Visits; public $RequesterUID; public $FaviconPath; + public $Title; - static function create(string $Path, string $URL, int $RequesterUID, string $FaviconPath) : int { + static function create(string $Path, string $URL, int $RequesterUID, ?string $FaviconPath, ?string $Title) : int { return Table::_create( 'Webpages', - '(Path, URL, Date, Visits, RequesterUID, FaviconPath)', - "(\"$Path\", \"$URL\", (NOW() + INTERVAL 2 HOUR), 0, \"$RequesterUID\", \"$FaviconPath\")" + '(Path, URL, Date, Visits, RequesterUID, FaviconPath, Title)', + "(\"$Path\", \"$URL\", (NOW() + INTERVAL 2 HOUR), 0, \"$RequesterUID\", \"$FaviconPath\", \"$Title\")" ); } @@ -35,7 +36,7 @@ class Webpage extends Table { 'Webpages', 'Database\Webpage', "GROUP BY URL ORDER BY Visits DESC, Date DESC LIMIT $count", - 'WID,Path,URL,Date,MAX(Visits) as Visits,RequesterUID' + 'WID,Path,URL,Date,MAX(Visits) as Visits,RequesterUID,FaviconPath,Title' ); } -- cgit v1.2.3