julmud / phpDVDProfiler

Adoption of the defunct phpDVDProfiler
MIT License
1 stars 4 forks source link

Add the possibility to always display the media banner on thumbnails #34

Closed julmud closed 1 year ago

julmud commented 1 year ago

Request received by email: "Many years ago, Fred Looks told me how, on the front & back cover galleries, to have all DVDs display a banner above them, such as 4K, Blu-ray, DVD, etc. Mine display fine when a movie is selected, and the front & back covers are displayed near the top-right. But I wish them to all be displayed when front cover gallery & back cover gallery are selected. Would you by any chance know what code to add or change, in order for those banners to be displayed?"

julmud commented 1 year ago

After changing the value of the new configuration $AddBannerOnThumbnails, a full update of the collection is needed, and removal of all images in imagecache too.

MotyerJM commented 1 year ago

After many hours of testing & troubleshooting, your phpDVDProfiler-feature-force-banner-on-thumbnails.zip file seems to be for php7, maybe? I get the following error with PHP v8.0.10 selected on my server:

Fatal error: Uncaught ArgumentCountError: mysqli_error() expects exactly 1 argument, 0 given in D:\Web\~phpDVDProfiler\~~julmud (thumbnail banners)\22ea1ca-dvd\mysqli.php:53 Stack trace: #0 D:\Web\~phpDVDProfiler\~~julmud (thumbnail banners)\22ea1ca-dvd\mysqli.php(53): mysqli_error() #1 D:\Web\~phpDVDProfiler\~~julmud (thumbnail banners)\22ea1ca-dvd\global.php(699): sql_db->__construct() #2 D:\Web\~phpDVDProfiler\~~julmud (thumbnail banners)\22ea1ca-dvd\index.php(4): include_once('...') #3 {main} thrown in D:\Web\~phpDVDProfiler\~~julmud (thumbnail banners)\22ea1ca-dvd\mysqli.php on line 53

When I switch to PHP v7.4.0 on my server, you can see the results at these 2 links (default Login and Password):

https://www.fusionwings.com/22ea1ca-dvd/

Sorry to be a pest.

julmud commented 1 year ago

Thanks for your tests. It looks like you have some database connection problem, you should check the database information in your configuration (localsiteconfig.php).

I have now improved the detection of incorrect database connection configuration, and made sure that it works from PHP 7.4 to 8.2.

Could you please:

MotyerJM commented 1 year ago

Under PHP v8.0.10:

  1. Import was successful;
  2. Banners display above all thumbnails in both Front and Back Galleries; and
  3. No errors or warnings when individual profiles are displayed.

Under PHP v7.4.0:

  1. Import was successful;
  2. Banners display above all thumbnails in both Front and Back Galleries; and
  3. When individual profiles are selected for display, the following warning appear, but everything works fine: Warning: sql_db::sql_freeresult(): Couldn't fetch mysqli_result in D:\Web\~phpDVDProfiler\~~julmud (thumbnail banners)\996dd06-dvd\mysqli.php on line 439 The above error does NOT appear under PHP v8.0.10

https://www.fusionwings.com/996dd06-dvd/

Note: My website, under which all my phpDVDProfiler collections run, the CMS on that website is currently restricted to PHP v8.0.10, hence all my phpDVDProfiler testing is done up to PHP v8.0.10. However, I can also test using PHP v8.1.11, if you wish & if it might help you.

Please let me know if you wish any further testing regarding this enhancement.

Regards & have a great day.

julmud commented 1 year ago

I can't seem to be able to reproduce the warning message... but as it has nothing to do with this feature request and you've verified that the gallery enhancements work, I'll consider this issue as having been fixed.

MotyerJM commented 1 year ago

I should be able to get my site back to where it was producing those errors, if you wish.

Edit: I remember now what the problem was... I had switched from MySQL to MariaDB maybe 6 months ago, and my localsiteconfig had the MySQL password in it, instead of the MariaDB password. Totally my fault.

If you wish, I can put the wrong password back in, so as to reproduce that error.

julmud commented 1 year ago

I should be able to get my site back to where it was producing those errors, if you wish.

Edit: I remember now what the problem was... I had switched from MySQL to MariaDB maybe 6 months ago, and my localsiteconfig had the MySQL password in it, instead of the MariaDB password. Totally my fault.

If you wish, I can put the wrong password back in, so as to reproduce that error.

Don't bother: if the wrong password was indeed the problem, with the fixed DB connection errors, the software will now display an error message way earlier than before, and will end the processing earlier too. So it probably won't be easy to reproduce.