Working on naming GalleryImages
This commit is contained in:
parent
ded03e22f1
commit
b4f20ded42
1 changed files with 27 additions and 0 deletions
|
|
@ -52,7 +52,15 @@ class GalleryController extends Controller
|
|||
$before = $image;
|
||||
if (str_ends_with($image, "_gross.jpg")) {
|
||||
$image = substr($image, 0, -10); # Remove last 10 characters
|
||||
$imagenames=[$image, $image]; # filename, displayname
|
||||
|
||||
$imagefilename=$image.".jpg";
|
||||
Log::info("Searching displayname for filenamename $imagefilename");
|
||||
$displayname = DB::table('gallery_items')->select('displayname')->where('filename',$imagefilename)->get();
|
||||
Log::info($displayname);
|
||||
|
||||
array_push($imagelist, $image);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +167,26 @@ class GalleryController extends Controller
|
|||
public function name_image(Request $request, $tour_id, $image_name) {
|
||||
$new_image_name = $request->new_image_name;
|
||||
Log::info("GalleryController::name_image for tour $tour_id , current name=$image_name, new name=$new_image_name");
|
||||
|
||||
|
||||
$new_image_name = $new_image_name . ".jpg";
|
||||
|
||||
str_replace($new_image_name, "'" , "");
|
||||
str_replace($new_image_name, '"' , '"');
|
||||
str_replace($new_image_name, '"' , '"');
|
||||
str_replace($new_image_name, '\\' , '/');
|
||||
str_replace($new_image_name, '\r\n' , ' ');
|
||||
str_replace($new_image_name, '\n' , ' ');
|
||||
|
||||
|
||||
DB::table('gallery_items')->where('gallery_id',"=", $tour_id)->where('filename','=',$image_name)->delete();
|
||||
|
||||
DB::table('gallery_items')->insert( [
|
||||
'gallery_id' => $tour_id, 'filename' => $new_image_name
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private function storeImage($bild, $category, $name) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue