News rating (ajax)

Download plugins, language packs and stuff.

News rating (ajax)

Postby FI-DD » Wed Mar 14, 2007 4:22 pm

You can check it out here:

http://english.cutenews.ru/cuteru/example/



Features:

- Ajax based

- Different stars in short and full story

- Prevent multiple votes by IP and/or cookie

- Select the number of stars via the template (2 - 10 stars)

- Select the size of the stars via the template



Installation:



1. Copy rating.ini to the inc/lang/en/plugins/ folder.

2. Copy rating.php and the rating/ folder to the plugins/ folder.

3. Activate the plugin and go to Options -> News ratings to create the new database table.



4. Put this between the <head> tags of your news page (head.php must be included before):

Code: Select all
<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" />




5. Put this in your template to show the rating:

Code: Select all
<div id="ratingform{id}">{rating:5:25}</div>


(5 is the number of stars (2-10), 25 is the size of the stars (10, 25, 30))



6. Put this in your template to show the average rating:

Code: Select all
<div id="rating_middle{id}">{rating-middle}</div>




7. Put this in your template to show the total votes:

Code: Select all
<div id="rating_total{id}">{rating-total}</div>
Attachments
rating_ajax.zip
News rating (ajax)
(11.09 KiB) Downloaded 628 times
Last edited by FI-DD on Wed Mar 14, 2007 11:43 pm, edited 2 times in total.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby asson » Wed Mar 14, 2007 9:56 pm

Very nice, thanks FI-DD
asson
 
Posts: 46
Joined: Fri Nov 24, 2006 2:15 am
Location: Karlstad, Sweden

Postby astrostart » Wed Mar 14, 2007 10:25 pm

It looks brilliant! But I just can't seem to get it to work.



I have made a screenshot. FI-DD, could you take a look at it? Thank you very much! :D
Attachments
avatar.jpg
(130.14 KiB) Downloaded 317 times
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Postby astrostart » Wed Mar 14, 2007 10:29 pm

Also, if I activate the Ratings (Ajax) script, it doesn't show {views} in my news.
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Postby FI-DD » Wed Mar 14, 2007 11:28 pm

astrostart wrote:It looks brilliant! But I just can't seem to get it to work.


Oh sorry, I forgot to let you include the css file.



Put this between the <head> tags of your news page:

Code: Select all
<link href="<?=$config_http_script_dir; ?>/plugins/rating/star.css" rel="stylesheet" type="text/css" media="screen" />




(I updated the instructions above.)
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby FI-DD » Wed Mar 14, 2007 11:30 pm

astrostart wrote:Also, if I activate the Ratings (Ajax) script, it doesn't show {views} in my news.


Fixed in the download above.
Last edited by FI-DD on Wed Mar 14, 2007 11:44 pm, edited 1 time in total.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby scottdallas » Wed Mar 14, 2007 11:40 pm

Now you're turning into the php and ajax guru FI-DD. This is one of the coolest additions to cutenews.ru it works sooo incredibly smoothly. Plus, I really like that it doesn't need to refresh the page (making {views} calculate again just for a rating).



You are the man.
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby astrostart » Thu Mar 15, 2007 12:14 am

Wow! Now it works!



But, I hope you don't mind, I found one little problem.



When I vote and I refresh, then it shows all this weird dots (see attachment)



How can I get rid of them?



Is there also a way to get rid of the horizontal line below it?



Thanks! :D



This is really the best plugin ever!
Attachments
astroforum.jpg
(177.37 KiB) Downloaded 303 times
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Postby FI-DD » Thu Mar 15, 2007 12:37 am

astrostart wrote:When I vote and I refresh, then it shows all this weird dots (see attachment)


I guess the star.css is clashing with your other css file.

Make sure you set list-style:none; for the <ul> and <li> tag in your css file.



Is there also a way to get rid of the horizontal line below it?


Remove border-bottom:1px solid #999; three times from star.css.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby WellWho » Thu Mar 15, 2007 1:49 am

I think that multiple votes is still possible. Try to rate one news on http://english.cutenews.ru/cuteru/example/ for 5 times
:: | www.funnyarena.net |:: thanks Scott
User avatar
WellWho
 
Posts: 62
Joined: Tue Jan 09, 2007 6:58 am

Postby astrostart » Thu Mar 15, 2007 3:01 am

Vielen Dank! It works! :D



I'm so happy!
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Postby astrostart » Thu Mar 15, 2007 3:02 am

WellWho wrote:I think that multiple votes is still possible. Try to rate one news on http://english.cutenews.ru/cuteru/example/ for 5 times




Try to refresh. You see that you cannot vote anymore. It may look like you can vote one, five or even ten times, but after one vote, the system already blocks you out. You just have to refresh to notice it.
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Postby scottdallas » Thu Mar 15, 2007 5:56 am

You just have to refresh to notice it.




Oh that's neat. I hadn't noticed that!
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby PJR » Thu Mar 15, 2007 9:38 am

I would like use it in only some posts (categories), concurrently with the standard rating, is it possible somehow?



(fe. I would like users could rate the record in music reviews with ajax version).
PJR
 
Posts: 165
Joined: Mon Oct 17, 2005 3:15 pm
Location: Czech republic

Postby astrostart » Thu Mar 15, 2007 10:03 am

HELP! I did something wrong, but I don't know what it is.



Users with Internet Explorer (7.0, i don't know about earlier versions) cannot vote lower than the average score on my site. The yellow stars seem to overlap the clickable stars.



For instance: http://www.astrostart.nl/index.php/2005 ... polls.html



This is weird, because it seems to work on FI-DD's example site. So it must have to do something with what I've done.



Does someone know which part must be altered? Thanks!



:cry:
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Next

Return to Additional Downloads



Who is online

Users browsing this forum: No registered users and 0 guests

cron