Git Product home page Git Product logo

phpdvdprofiler's People

Contributors

gjnoonan avatar julmud avatar sebk-666 avatar

Watchers

 avatar  avatar  avatar  avatar

phpdvdprofiler's Issues

Searches display first profile in right frame regardless of $InitialRightFrame

Hello, Julien,

This is NOT a issue, but thought I would mention it.

I do not know if the below is a bug in phpDVDProfiler, or if it has just been an inconsistency over the years, or if it was always supposed to be this way. Whichever is the case, it has probably been this way for more than a decade.

In localsiteconfig, we are able to set $InitialRightFrame to be whatever we wish: Front Gallery, Back Gallery, Statistics or default (which is the first profile). I use Front Gallery for all my collections, and this works as it is supposed to when a user first accesses my collections, and when they press the Clear button near the top-left.

However, if a user does a search, the Right Frame always displays the first profile, even though I have $InitialRightFrame='Front Gallery' set.

I realize that in $InitialRightFrame, the key word is Initial, as in when a user initially accesses a collection.

You would not want phpDVDProfiler to display the right frame in searches to always be whatever the administrator chooses with $InitialRightFrame, because some administrators may like it the way it is, with the right frame always displaying the first profile when searching.

But depending on how difficult it would be to implement, possibly, when you are reviewing the code for other fixes/enhancement that you're working on, you could think about maybe adding another setting to localsiteconfig in a future release, such as $SearchRightFrame (or whatever you wish to call it), to allow us administrators to choose what to display in the right frame when searches are done. Just a thought.

Thanks again for your dedication to it.

Problem with MySQL 8 and charset

When doing an update of the database contents on a database running with MySQL 8, the update fails as soon as it encounters some characters outside of the ASCII charset.
This seems to be due to the fact that the MySQL 8 server is configured by default for UTF-8, whereas the phpDvdProfiler only knows windows-1252.

Some warnings on PHP8.2

There are some minor issues:

[01-Jul-2023 17:32:52 UTC] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/phpdvdprofiler/functions.php on line 900
[01-Jul-2023 17:32:52 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/phpdvdprofiler/functions.php on line 900
[01-Jul-2023 17:33:04 UTC] PHP Warning:  Constant IN_SCRIPT already defined in /var/www/phpdvdprofiler/gallery.php on line 25

PHP 8.2.7 (cli) (built: Jun 9 2023 19:37:27) (NTS)

Missing case types

DVD Profiler 3.9 added two new case types: Handle and Fr4me. They are missing in the language files, so having a disc with one of those case types will either trigger a warning, or have no case type, when being displayed.

Adding the following two lines to all language files should do the trick:
$lang['FR4ME'] = 'Fr4me'; $lang['HANDLE'] = 'Handle';

Chooser.php seems to be broken

The Chooser.php (available in the navigation menu as "Pick-a-Flick" when the $AllowChooser variable is set to true in globalinits.php) file seems broken:

  • Clicking on a check-box doesn't alter its state
  • Clicking on the button "Make a random selection" reopens the page itself in the embedded frame instead of displaying the results from the Picker.php

Remove MySQL < 4.1 support

MySQL 4.0 extended support ended on December 2008. More than 11 years later, I think it should now be safe to remove the specific support of MySQL versions < 4.1.

This entails (the list is not exhaustive):

  • Removal of the schema.pre-4.1.sql file
  • Adaptations in the HandelOutOfDateSchema method in incupdate.php

A Notice is displayed if the collection is empty

If the collection is empty, or a search request returns no result, the following notice is displayed:

( ! ) Notice: Trying to access array offset on value of type null in W:\Web\mudry.org\web\dvds\index.php on line 1430

[question] gallery stays empty

As I recently updated my system, I also made an update to latest release (v_20200130). Works fine, but the gallery stays empty (i.e. although there is a page selector, there are no pictures).
Pictures in the profiles are ok though (thumbnail and full picture), but no luck in the gallery.

I'm pretty sure I missed some major part when installing, but I have absolutely no idea what I missed...

Profiles ignored during import are considered as added

If a profile is ignored during import (for example due to an empty ID), it's still considered as having been added in the summary:

Current file being processed: collection_movies_1970.xml
collection_movies_1970.xml: Profile IDs must not be blank. Profile #1
collection_movies_1970.xml: Profile IDs must not be blank. Profile #2
collection_movies_1970.xml: Profile IDs must not be blank. Profile #3
0.031: DVD profiles processed: 3
Adding Cast ... 0 items, 0 inserts in 0.001 seconds
Adding Crew ... 0 items, 0 inserts in 0.001 seconds
Updating Custom Media Types, Rating Descriptions and Custom Collections ...
Removing Profiles missing from XML file(s) ...
Updating Box Sets ...
Updating Stats table ...
Total DVD Profiles Processed: 3
Number of Profiles added: 3

'Number of Profiles added' should be 0 in this case.

Missing rating image causes profile display to throw a fatal error

Hi,

I recently added a disc profile to DVDProfiler with an "Unrated" disc (American Psycho 4K UHD, US, 031398-291886).
When trying to lookup the rating image, phpdvdprofiler throws an error and does not load the profile page:

PHP Fatal error:  Uncaught Error: Call to undefined function mb_ereg_replace() in /var/www/html/phpdvdprofiler/functions.php:1041\nStack trace:\n#0 /var/www/html/phpdvdprofiler/index.php(2893): GetRatingLogo('0', 'Film', 'Unrated')\n#1 {main}\n  thrown in /var/www/html/phpdvdprofiler/functions.php on line 1041

Looking at the gfx/Ratings folder, I see that the rating_0_film_unrated.gif image does not exist.
I copied the "_nr.gif" image to "rating_0_film_unrated.gif" which fixed the error, but apparently NR and Unrated is not the same as both are valid options in DVDProfiler.
So a valid rating_0_film_unrated.gif image seems to be required.

Sebastian

Mysqli errors aren't displayed correctly if the DB connection is not working

If the DB connection cannot be established, we either end up with no error message (in case of collection update) or with the following error and stack strace:

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

This is due to the fact that the mysqli_error and mysqli_errno method expect the DB connection as a parameter, and PHP is no longer silent about missing arguments.

Switch to UTF-8

Everything is set to use the charset windows-1252 (from the database, to the web pages served, including the source code and translations).

This forces charset conversions in some places in the code. For example, in functions.php we find:

function strftimeReplacement(string $format, ?int $timestamp = null)
{
	global $lang;
	return mb_convert_encoding(strftime($format, $timestamp, $lang['__strftime_locale']), 'WINDOWS-1252', 'UTF-8');
}

Making everything being UTF-8 would be a good choice going forward.

Watch out: the XML file generated by DVD Profiler would still be windows-1252, so we'd have to do some conversion when reading the XML file.

Location of current favicon code seems incorrect

phpDVDProfiler version: v20230108
Browser 1: Brave secure browser version 1.46.153 Chromium: 108.0.5359.128 (Official Build) (64-bit)
Browser 2: Iridium secure browser version 2021.12 (Official Build) (64-bit)
Browser 3: Microsoft Edge version 108.0.1462.76 (Official build) (64-bit)

Was unable to get phpDVDProfiler's favicon to display in any browsers' tabs.

There is a favicon that comes with phpDVDProfiler, /gfx/favicon.ico, with a size of 32x32px.

Located in index.php between lines 159-164, and specifically on line # 163, is the following call to that favicon (my bolding on that line below) :

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
<title>CoverScan</title>
<link rel=stylesheet type="text/css" href="format.css.php">
**<link rel="SHORTCUT ICON" href="/gfx/favicon.ico">**
</head>

However, all browsers that I had tried display only what seems to be a default (globe) icon when no specific favicon is found.

I converted that favicon to a PNG, but kept the same name, so favicon.png and changed line 163 to be:
<link rel="icon" type="image/png" href="/gfx/favicon.png">
However, I still saw only the default globe icon on browser tabs.

Through some experimentation, I discovered that if I add that favicon.png line below line 1458, AND remove the leading slash in front of gfx, the favicon is then displayed in the browser tabs:

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
  <title>$CurrentSiteTitle</title>
  <link rel="icon" type="image/png" href="gfx/favicon.png">
  $rssfeed
  <script type="text/javascript" src="top.js"></script>
</head>

Just thought I would mention the above, in case you wish to add that favicon capability in a future release... no idea for how many years the favicon had not been displayed, but I don't recall seeing it for many years, if ever.

And extremely happy with your new v20230108, thank you again.

Thank you for this!

Not an issue, so of course feel free to close it.

I was a user of DVDProfiler, and active in the community during the 00's. I started using phpDVDProfiler when it was initially released.

I've been feeling nostalgic over the weekend and my mind got thinking of the joy of the whole DVD collecting scene back then, so I went searching and came across this :-)

I no longer have access to DVDProfiler, but I am happy to contribute to this if you're going to start active development; What are your plans?

DB Schema creation problems

I've received a report on the Invelos forums for some problems when creating the DB structure from scratch in MySQL version 5.7.28:

Ich hab übrigens versucht, die Datenbank von neu an aufzubauen und bin dabei bei dem Script auf folgende Probleme gestoßen (MySQL 5.7.28).

Er wollte nicht, dass die Id null ist, wenn sie Primary Key sein soll.

Hab es von
id char(20) default null,
auf
id char(20),
geändert

Außerdem mochte er das Keyword "signed" nicht ("unsigned" war OK) und ich hab es entfernt.

(Both problems have to do with the _DVD table.)

I think I'd tried the full schema installation with MariaDB 10.4.10 without any problem, but I'll have to take a deeper look into that.

Update the icons to higher quality versions

A lot of the graphics are of low quality, and really showing their age on high-resolution screens. We should aim to replace them with something of higher quality versions. All of the flags, ratings icons, and Format icons are available as SVGs.

  • Country Flags
  • Format icons ( DTS/Dolby/etc)
  • Ratings
  • Media type Icon in the sidebar listing (you will have to set $AddFormatIcons = 0; in your localsiteconfig.php to see these)

mysqli.php error on line 465 with release dates back in the 1960s

  • MySQL version = 10.8.3-MariaDB
  • PHP version = 8.0.10
  • phpDVDProfiler version = 20230102
  • Server = Abyss/2.16.4-X2-Win32 AbyssLib/2.16.4

Using your v_20230102 release... all works good with my 4 of my 5 installations.

I have 1 install, though, that has 3 profiles with release dates of 1965, 1966 and 1968 respectively. It seems that mysqli.php does not like dates that far back, and all imports fail. The next old release date that I have is 1972, and that one works fine.

I confirmed the 1965, 1966 & 1968 dates by temporarily moving them out of my Owned category, and then exporting only my Owned category. The import was then successful. But with those 3 old profiles moved back to my Owned category, I get the error again & the import fails.

The release dates for those problem profiles are:

  • 14-Sep-65 (F Troop)
  • 08-Sep-66 (Star Trek)
  • 20-Feb-68 (Columbo)

ERROR_LOG.txt

The strange thing is, I have another collection, with old release dates, and they import fine. Case in point is the following profile, with a release date of 16-May-47, and that collection imports fine, with no error.

Note that in this profile, phpDVDProfiler displays the date as 16 May 2047, instead of 16 May 1947, but at least that collection imports with no error:

https://www.fusionwings.com/movies/index.php?mediaid=202101080925&action=show

I realize that Release Dates are intended for when DVDs were released, but I use them for when the movies were released. And your previous releases from a few years ago did not have this issue with this particular collection.

Here's a link to that problem collection, as displayed following the import error (there should be at least 664 items in this collection, including child profiles):

https://www.fusionwings.com/tv/

Any thoughts?

As an aside, unrelated to the above issue, is that I was told a few years ago, that the reason why phpDVDProfiler cannot display dates prior to 1 January 1970, is that that is the Unix "epoch date", so a date in DVDProfiler prior to that, example of 11 August 1956, will display in phpDVDProfiler as 11 August 2056. However, what confuses me is, I have a genealogy PHP script (that uses MySQL) on my site that displays dates correctly, even back to years with only 3 digits (i.e. the year 743). So I'm unsure why phpDVDProfiler cannot display years correctly previous to 1 January 1970.

Sorry, no idea why the above 2 URLs are not working when clicked on.

Thank you in advance.

John
Toronto-ish, Canada

Overhaul of the mysqli interface

The mysqli interface (file mysqli.php) is riddled with bugs due to its old age. A complete rewrite might be a good idea.

Objectives:

  • Don't mask any error message with '@'.
  • Handle all potential exceptions correctly.
  • Still offer the same interface to the outer world.
  • Maybe use namespaces?

rss feed improvements.

With the advent of twitter, and other social media that RSS/Atom has gone out of fashion, and it's a great shame --I'll save the rant about why that is for elsewhere. However, I am still a big user and fan of them.

There are several improvements we can make to the current RSS feeds;

  • Generate a static rss.xml file on update to avoid having to dynamically generate it each time
  • Display more of the overview by default - we currently truncate.
  • Add purchase place (config variable)
  • Attach the notes (if a config variable is set)
  • ...

Add the possibility to always display the media banner on thumbnails

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?"

RSS Feeds are broken

Unfortunately with the addition of #2 (add 4K/UltraHD support) we broke the RSS feeds. As it can no longer find the correct $mediatype when trying to generate the tag for that given item.

@julmud I already have a fix for this ready to send, so you can assign it to me.

Add a Collection.xml fixture

As mentioned in #5 whilst doing development and testing MRs I have been using a Collection.xml file which contains Some Blu-ray's, we should expand on this to include more date, covering what phpDVDProfiler may come across in it's usage.

We should make sure it covers:

  • A blank profile with just a title
  • DVD
  • DVD Boxset
  • HD-DVD
  • Blu-Ray
  • Blu-Ray Boxset
  • 4K UHD Blu-Ray
  • Non-English versions of the above

Any other suggestions @julmud ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.