Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails

Quote Reply
Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails In reply to
What i have done in the past in such situations:

1. Build a php-script and let it walk through the links.

or

2. Download all the pictures; use a batch resizer and do all the thumbnails new and upload them again.

I had both situations, depending on the situation.


At the moment i use a php-script to take files from the server, resize them, do the update to the links and move the file to the destination made by the links_files.id, if i remember right.


Code:
$query3 = "INSERT INTO bLinks_Files (ID, ForeignColName, ForeignColKey, File_Name, File_Directory, File_MimeType, File_Size, File_URL) VALUES
(NULL, 'b1', '$lid', '$fn', '/var/www/***/htdocs/***', '$imageMime', '$fileSize', '');
";
$result3 = $linkIS->prepare($query3);
$result3->execute();
$lastLid = $linkIS->lastInsertId();

and

Code:
$fn = "x.jpg";

$query32 = "
UPDATE bLinks_Files SET File_Name = '$fn' WHERE ID = '$lastLid';
UPDATE bLinks SET b1 = '$fn' WHERE bLinks.ID = '$lid';
";
$result32 = $linkIS->prepare($query32);
$result32->execute();

// last digit from lastLid
$dir = substr($lastLid,-1);

$finalfile = "/var/www/***/htdocs/***/" . $dir . "/" . $lastLid . "-" . $fn;
$i->writeImage($finalfile);
Subject Author Views Date
Thread ANDY - GalleryManagerGD cleanup deleted thumbnails MJB 7929 Jul 6, 2020, 12:49 PM
Post Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails
Andy 7775 Jul 14, 2020, 11:04 PM
Thread Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails
Andy 7777 Jul 14, 2020, 11:08 PM
Thread Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails
MJB 7770 Jul 15, 2020, 10:42 AM
Thread Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails
Andy 7768 Jul 15, 2020, 10:32 PM
Thread Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails
MJB 7760 Jul 16, 2020, 10:14 AM
Thread Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails
Andy 7751 Jul 16, 2020, 10:17 AM
Thread Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails
MJB 7756 Jul 16, 2020, 10:26 AM
Thread Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails
Andy 7756 Jul 16, 2020, 10:31 AM
Thread Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails
MJB 7747 Jul 16, 2020, 10:44 AM
Thread Re: [MJB] ANDY - GalleryManagerGD cleanup deleted thumbnails
Andy 7748 Jul 16, 2020, 10:49 AM
Post Re: [Andy] ANDY - GalleryManagerGD cleanup deleted thumbnails
Robert 7168 Sep 1, 2020, 10:42 AM