Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
News rating (ajax)
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
News rating (ajax)
Author Message
rats



Joined: 29 May 2006
Posts: 44

Post Reply with quote
with "{rating-middle}", can I get a full number?

Ex: not 4.3, but 43



I want to make a small hack, so people can't vote in the short-story, only in full-story, so I wanna make a cute bar with dynamic width, witch will look like the voting bar Wink
Sat Apr 07, 2007 4:18 pm View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2736
Location: Germany

Post Reply with quote
In plugins/rating.php the following line calculates the value for {rating-middle}:

Code:
$middle = @round(($row['rating'] / $row['votes']), 1);




Change it for example to this:

Code:
$middle = ($row['rating'] / $row['votes'] * 10);

Tue Apr 10, 2007 6:46 pm View user's profile Send private message
PJR



Joined: 17 Oct 2005
Posts: 161
Location: Czech republic

Post Reply with quote
The is a colllision with this anf "Today" plugin. If today plugin is on, the ajax rating doesn't work...
Sat May 05, 2007 9:42 pm View user's profile Send private message
marcusmagalhaes



Joined: 24 Apr 2007
Posts: 70

Post rating problem Reply with quote
I've put rating in my template and it show in my page like this....



http://www.fessergs.com.br/index.php



Picture 2.png
 Description:
????
 Filesize:  5.79 KB
 Viewed:  602 Time(s)

Picture 2.png


Sat May 05, 2007 11:56 pm View user's profile Send private message
Ramon



Joined: 12 Oct 2005
Posts: 462
Location: Hoogeveen, NL

Post Reply with quote
hehe that's because it doesn't round anymore. I dont know why FI-DD deleted that, but you should try something like this.



Code:
$middle = @round(($row['rating'] / $row['votes'] * 10), 2);


_________________
Sun May 06, 2007 2:04 am View user's profile Send private message Visit poster's website
marcusmagalhaes



Joined: 24 Apr 2007
Posts: 70

Post Reply with quote
where I put this code?



Ramon wrote:
hehe that's because it doesn't round anymore. I dont know why FI-DD deleted that, but you should try something like this.



Code:
$middle = @round(($row['rating'] / $row['votes'] * 10), 2);

Sun May 06, 2007 2:36 am View user's profile Send private message
marcusmagalhaes



Joined: 24 Apr 2007
Posts: 70

Post Reply with quote
{rating:5:25}

not middle



Ramon wrote:
hehe that's because it doesn't round anymore. I dont know why FI-DD deleted that, but you should try something like this.



Code:
$middle = @round(($row['rating'] / $row['votes'] * 10), 2);

Sun May 06, 2007 2:42 am View user's profile Send private message
Ramon



Joined: 12 Oct 2005
Posts: 462
Location: Hoogeveen, NL

Post Reply with quote
My bad, i'm sorry.. What does line 49 of your rating.php file says?

_________________
Sun May 06, 2007 4:00 pm View user's profile Send private message Visit poster's website
marcusmagalhaes



Joined: 24 Apr 2007
Posts: 70

Post Reply with quote
before .... $middle = @round(($row['rating'] / $row['votes']), 1);

now... $middle = @round(($row['rating'] / $row['votes'] * 10), 2);





and line 48 ... $rating = $row['votes'] > 0 ? $row['rating'] / $row['votes'] : 0;

Ramon wrote:
My bad, i'm sorry.. What does line 49 of your rating.php file says?

Sun May 06, 2007 11:16 pm View user's profile Send private message
marcusmagalhaes



Joined: 24 Apr 2007
Posts: 70

Post Re: rating problem Reply with quote
any suggestion???



marcusmagalhaes wrote:
I've put rating in my template and it show in my page like this....



http://www.fessergs.com.br/index.php

Mon May 07, 2007 1:47 pm View user's profile Send private message
Ramon



Joined: 12 Oct 2005
Posts: 462
Location: Hoogeveen, NL

Post Reply with quote
I don't get it, it doesnt seem to round. And when you changed it to
Code:
$middle = @round(($row['rating'] / $row['votes'] * 10), 2);
It should have multiplied by 10, making the rating 40.08..



Try this



Code:
$middle = round(($row['rating'] / $row['votes']), 2);




And be sure to delete the cache Smile

_________________
Mon May 07, 2007 9:59 pm View user's profile Send private message Visit poster's website
marcusmagalhaes



Joined: 24 Apr 2007
Posts: 70

Post Re: News rating (ajax) Reply with quote
I put this in my template <div id="ratingform{id}">{rating:5:10}</div>



and shows in my page this////









please help-me!!!





in my page i put this:

<script type="text/javascript" src="<?=$config_http_script_dir; ?>/plugins/rating/star.js"></script>

<link href="<?=$config_http_script_dir; ?>/plugins/rating/star.css" rel="stylesheet" type="text/css" media="screen" />
Wed May 09, 2007 1:57 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2736
Location: Germany

Post Reply with quote
1. Open plugins/rating.php and remove this:

Code:
'Currently '.$current_rating.'/'.$stars.'</li>'.




2. Open plugins/rating/rating.php and remove this:

Code:
'Currently '.$current_rating.'/'.$stars.'</li>'.

Wed May 09, 2007 6:22 pm View user's profile Send private message
supafly



Joined: 24 May 2007
Posts: 2

Post Reply with quote
Just added this and I'm having some issues. The stars are there and you can hover over them but once they're clicked the "please wait" flashes quickly and no vote is recorded.



Any one have any ideas?
Thu May 24, 2007 12:30 am View user's profile Send private message
Ramon



Joined: 12 Oct 2005
Posts: 462
Location: Hoogeveen, NL

Post Reply with quote
I've got exactly the same problems. It also doesnt seem to work on the cnr example page :S

_________________
Mon Jul 02, 2007 6:55 pm View user's profile Send private message Visit poster's website
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.