diff options
| author | Georgi Nikolov <ggeorgi60@gmail.com> | 2025-01-25 17:01:26 +0200 |
|---|---|---|
| committer | Georgi Nikolov <ggeorgi60@gmail.com> | 2025-01-25 17:01:26 +0200 |
| commit | e143770fc296e34862d95272fc79a56fa9d20a34 (patch) | |
| tree | 2bcbf53e686619bddec5da28d5775656b26b5ea0 /models/webpage.php | |
| parent | db285a4be28e6da35be65424b2f324dd04e9becf (diff) | |
| download | nowayforward_human-e143770fc296e34862d95272fc79a56fa9d20a34.tar nowayforward_human-e143770fc296e34862d95272fc79a56fa9d20a34.tar.gz nowayforward_human-e143770fc296e34862d95272fc79a56fa9d20a34.zip | |
Added additional table column for the favicon in the database
With that commit handled the saving of that favicon as well
Diffstat (limited to 'models/webpage.php')
| -rw-r--r-- | models/webpage.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/models/webpage.php b/models/webpage.php index 1a2f4a6..5dd44e0 100644 --- a/models/webpage.php +++ b/models/webpage.php @@ -9,12 +9,13 @@ class Webpage extends Table { public $Date; public $Visits; public $RequesterUID; + public $FaviconPath; - static function create(string $Path, string $URL, int $RequesterUID) : int { + static function create(string $Path, string $URL, int $RequesterUID, string $FaviconPath) : int { return Table::_create( 'Webpages', - '(Path, URL, Date, Visits, RequesterUID)', - "(\"$Path\", \"$URL\", (NOW() + INTERVAL 2 HOUR), 0, \"$RequesterUID\")" + '(Path, URL, Date, Visits, RequesterUID, FaviconPath)', + "(\"$Path\", \"$URL\", (NOW() + INTERVAL 2 HOUR), 0, \"$RequesterUID\", \"$FaviconPath\")" ); } @@ -25,6 +26,10 @@ class Webpage extends Table { ); } + static function getPagesCount() : int { + return Table::_get_entries_count("Webpages"); + } + static function mostVisited(int $count) : array { return Table::_get_all( 'Webpages', |
