Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of the rating #164

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

MrMusic
Copy link
Member

@MrMusic MrMusic commented Oct 26, 2023

This PR adds the functionality to calculate and display the rating of an image.
The calculate code was taken from JomGallery 3.6.
The rating is displayed in the backend and frontend at the respective image.
Please note: There is no functionality yet to rate images in the frontend. For testing, the number of ratings (imgvotes) and the rating sum (imgvotesum) must be entered manually into the database table.

@MrMusic MrMusic added the needs testing This issue or pull request needs further testing label Oct 26, 2023
@rowi68
Copy link

rowi68 commented Oct 28, 2023

I have tested this item ✅ successfully.

@AlexanderSupp
Copy link

Testing with Joomla 4.3.4, PHP 8.1.13, mysql 8.0.31.
The rating is limited to 5.
If I enter 1 / 6 the result is 1 / 5 and not 1 / 6.
If I enter 50 / 500 the result is 50 / 5 and not 50 / 10.
From my point of view, the rating must be limited by entering the data.
But not within the calculation process.

@rowi68
Copy link

rowi68 commented Nov 2, 2023

The rating is limited to 5. If I enter 1 / 6 the result is 1 / 5 and not 1 / 6.

I don't think this is relevant, as the evaluation will be done later on the website and not directly in the database. So it will not be possible to award a 6.
In my opinion, everything is fine...

@AlexanderSupp
Copy link

Keep in mind that JG 3 allows a rating up to 10.
In the config data, you can decide the limit for each installation.
More about this you find here: http://joomgallery4.fotofreunde-much.de/en/requirements/the-photo-club

@rowi68
Copy link

rowi68 commented Nov 3, 2023

Sorry, I didn't have that in mind. I assumed that 5 is the maximum rate.

@MrMusic
Copy link
Member Author

MrMusic commented Nov 4, 2023

If I enter 50 / 500 the result is 50 / 5 and not 50 / 10.

You are right. The value in the configuration is assumed to be the 'limit' for the display. However, this was already the case with JoomGallery 3.6.

From my point of view, the rating must be limited by entering the data.

This is correct.
When submitting a rating, the maximum value specified in the configuration must not be exceeded.

...as the evaluation will be done later on the website and not directly in the database. So it will not be possible to award a 6.

That is also correct too.
Therefore, there should be no a wrong rating calculation.

@Elfangor93
Copy link
Member

Can we merge this PR?
It has still a "needs testing" label...

@AlexanderSupp
Copy link

This PR can merged. The max vote will be add later in the system.

@Elfangor93
Copy link
Member

@MrMusic Can you please resolve the remaining confict?
Then I guess we can merge...

@MrMusic
Copy link
Member Author

MrMusic commented Dec 13, 2023

Can we merge this PR?

Yes, or is there something against this?

It has still a "needs testing" label...

Actually, every PR should be tested before it is merged.
The label is always removed after it has been merged, isn't it?

@MrMusic Can you please resolve the remaining confict?

Should now be done.

@Elfangor93 Elfangor93 removed the needs testing This issue or pull request needs further testing label Dec 13, 2023
@Elfangor93
Copy link
Member

Thank you very much ✅

@Elfangor93 Elfangor93 merged commit fab2577 into JoomGalleryfriends:main Dec 13, 2023
@MrMusic MrMusic deleted the Calculation-of-the-rating branch January 4, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants