add a certain number of votes when noone already voted yet

1 year 7 months ago #10411 by boucdur
Hi Viktor,

I just installed JVE.

_____________________________
here is my first and most important question out of three :

I "don't really need" a rating system
What I want though is the stars underneath my pages in the result of google when they appear in the search result.
At the moment I have them because I inserted the rich snippets in my pages.
I attribuated myself a note of 5/5 and number of 100 votes.

However in order to be a bit more honnest and make the ratting be different on each page I will probably put your rating system visible in the page.

My probleme is :
If I don't get no votes by the visitors I won't get the stars in the google results neither.
I thought that it would be nice to put the value I want for example 5/5 and 5 votes where the vote plugin appear even if noone voted yet.
The votes of my visitors could be added to these inital values.

Do you think that would be possible to change a few lines in a file to get that ?

I tried to change these lines in /plugins/content/joomlavoteextended/joomlavoteextended.php
private function getVoteOutput($row)
	{
		$rating = 5;/*instead of 0*/
		$best_rating = 5;
		$rating_count = 98;/*instead of 0*/
		$statistics = $this->params->get('statistics', 0);
		$intro_text = $this->params->get('introtext', '');
Unfortunatly it didn't work and didn't do nothing actually.

_____________________________
An other question for a detail.
the results are shown like this :
4 of 5 - 1 votes
it's in english
I could find how to translate that to french
It should be :
4 sur 5 - 1 vote

_____________________________
Last question :
It seems that I can only vote once.
Or more accuratatly...I can vote multiple times but the result does'nt change. Even if I reload the page it says 4 of 5 - 1 votes
It seems to me it's not a matter of cache as I believe I emptied my cache with care
You can check that in this page :
www.tourdumondiste.com/argentine/carnet-...ge-argentine-mendoza

_____________________________


Thank you. I hope you can help me with that.
regards,

François

1 year 7 months ago #10415 by Vitja
Hello François,

thank you for activating a support subscription!

To your questions:

1. You did it almost right. The problem is the value for $rating_count. Set this to 1 and it should be fine!

2. Create a language override (Extensions - Language(s) - Overrides) for the constant PLG_JOOMLAVOTEEXTENDED_STATISTICS_FRONTEND. Select on the left side your language for Administrator and on the edit page activate the checkbox For both locations.

3. Yes, you are not allowed to vote more than once (with the same IP address), I use the core functionality for the ratings. If you change your IP address, then you can vote again.

Regards

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10419 by boucdur
Hello,

Thank you for your answers.
I changed line 117 to get artificially an addition of votes and it's even better :
if(!empty($row->rating_count))
		{
			$rating_count = (int)$row->rating_count+156;
		}

Just a last remaining little something.
It's fine to me one ip adress can only vote once but the message on the second voting is "thank you for your voting" wheareas it wold be better an other message like "you already voted"
It's really not a big deal but if it was possible to change that it would be slightly better.
1 year 7 months ago #10420 by boucdur
Sorry It seems I found a real issue :

I believe the rating is not pushed into the meta :
<p class="unseen jve-invisible">
PLG_VOTE_USER_RATING
<meta itemprop="ratingCount" content="157">
<meta itemprop="worstRating" content="0">
</p>
Should there be the average rating in a meta tag insted of "PLG_VOTE_USER_RATING" ?
I was extenting the line :
<meta itemprop="ratingValue" content="5">
and in content the average rating instead of the 5

Is something wrong ?
1 year 7 months ago #10421 by boucdur
At this line :
$html .= '<p class="unseen jve-invisible">'.JText::sprintf('PLG_VOTE_USER_RATING', '<span itemprop="ratingValue">'.$rating.'</span>', '<span itemprop="bestRating">'.$best_rating.'</span>').'<meta itemprop="ratingCount" content="'.$rating_count.'" />'.'<meta itemprop="worstRating" content="0" />'.'</p>';

The spans don't seems to appear in the generated code on the page.
1 year 7 months ago #10424 by Vitja
Hi!

Why do you increase just the $rating_count? If you want to increase the rating count, then you should also increase the overall rating too.

In your website the language constant PLG_VOTE_USER_RATING is not translated. Usually the string is loaded from the language file of the original vote plugin:

PLG_VOTE_USER_RATING="User Rating:&#160;%1$s&#160;/&#160;%2$s"

Add this constant into the Language Manager. But I should change this and add this string into the language file of the plugin.

Greetings

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10426 by Vitja
Hello Boucdur,

please update to version 3.2.0 which solves the not translated language constant.

Cheers

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10427 by boucdur
I'm not sure I undertand what you are saying about the translation.
Looking at you php file it seems to me there should be a call to this constant :
COM_CONTENT_ARTICLE_VOTE_FAILURE in case the voter tries to vote a second time
In that case $response_message would be equal to COM_CONTENT_ARTICLE_VOTE_FAILURE
But as I said this a minor issue and I can live with it.

What about the other matter about. This line of code
html .= '<p class="unseen jve-invisible">'.JText::sprintf('PLG_VOTE_USER_RATING', '<span itemprop="ratingValue">'.$rating.'</span>', '<span itemprop="bestRating">'.$best_rating.'</span>').'<meta itemprop="ratingCount" content="'.$rating_count.'" />'.'<meta itemprop="worstRating" content="0" />'.'</p>';

This two lines with the spans should be in the generated page shouln't hey ? But they are not.
<span itemprop="ratingValue">'.$rating.'</span>

Instead when I inspect the code of my page I see that :
[code]<p class="unseen jve-invisible">
PLG_VOTE_USER_RATING
<meta itemprop="ratingCount" content="157">
<meta itemprop="worstRating" content="0">
</p>
The spans are missing indeed and there is this "PLG_VOTE_USER_RATING" in text

Am I wrong to think something is a bit weird ?

Ah As I was wrinting this message I read your answer telling me to upgrade the plugin.
I will do it immédiatly thanks
1 year 7 months ago #10436 by Vitja

boucdur wrote: Ah As I was wrinting this message I read your answer telling me to upgrade the plugin.
I will do it immédiatly thanks


So, is this issue solved? :-)

Cheers

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10438 by boucdur
yes yes all solved.
Thank you again.
Time to create page: 0.220 seconds