Jump to content

Close

Free AJAX rating Script (EXCELLENT!)


  • Please log in to reply

#1
Guest_aku_*

Posted 17 February 2007 - 07:55 PM

Guest_aku_*
  • Guests
Click to view battle stats
This is just too good to be missed!

excellent stuff and totally free
http://www.masugades...tar-rating-bar/

avail while its still free!

#2
Polymath

Posted 09 September 2008 - 08:10 AM

Polymath

    Member

  • Downloader
  • PipPip
  • 29 posts
  • Gender:Male
  • Location:New Zealand
Click to view battle stats
I would so love to get something like this into my SMF arcade under each game on play screen. I read the instructions but what a mess they are. Anybody know SMF knowwhat I am supposed to do. In dumb mode please.


-----------------

INSTALLATION:

=============================================================================
1. Make your table for the ratings in your db (you should be able to copy
and paste the following SQL)
=============================================================================
CREATE TABLE `ratings` (
`id` varchar(11) NOT NULL,
`total_votes` int(11) NOT NULL default 0,
`total_value` int(11) NOT NULL default 0,
`used_ips` longtext,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=3;


=============================================================================
2. Enter your specific info into _config-rating.php
=============================================================================
$dbhost = 'localhost';
$dbuser = '###';
$dbpass = '###';
$dbname = '###';
$tableName = 'ratings';
$rating_unitwidth = 30;


=============================================================================
3. Enter this line at the top of any page where you want
to have rating bars.
=============================================================================
<?php require('_drawrating.php'); ?>


=============================================================================
4. Point to the right Javascript and CSS files (you need
behavior.js, rating.js, and rating.css)
=============================================================================
<script type="text/javascript" language="javascript" src="js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="css/rating.css" />

Remember to make sure to fix paths for the images as well. I kept behavior.js separate
from rating.js, because you can use it for other things!


=============================================================================
5. Drop the function wherever you want a rating bar to appear
=============================================================================
NOTE: As of version 1.2.1, use the echo statement! Also, if you use the static
parameter, you should always specify the 2nd parameter (number of units), even if
it is blank (which will default to 10 units)

<?php echo rating_bar('8'); ?> - 10 stars (default), ID of 8
<?php echo rating_bar('8xxa','5'); ?> - 5 stars, ID of 8xxa
<?php echo rating_bar('9a','5','static'); ?> - 5 stars, ID of 9a, static (non votable)
<?php echo rating_bar('9b',''); ?> - 10 stars, ID of 9b
<?php echo rating_bar('9c','8','static'); ?> - 8 stars, ID of 9c, static (non votable)


If you want to change how the rating bar is rendered, you will need to edit
the _drawrating.php file. Also, you might need to edit the bottom of the rpc.php
file at about line 52, where the $newback variable is.

#3
Polymath

Posted 09 September 2008 - 08:11 AM

Polymath

    Member

  • Downloader
  • PipPip
  • 29 posts
  • Gender:Male
  • Location:New Zealand
Click to view battle stats
Wow Posting it in here has made the instructions way better. :lol: :p

#4
Polymath

Posted 10 September 2008 - 03:50 AM

Polymath

    Member

  • Downloader
  • PipPip
  • 29 posts
  • Gender:Male
  • Location:New Zealand
Click to view battle stats
Ok. Anybody.

I have made the rating database and table within.
I have entered my specific info into _config-rating.php

I have also placed everything in a folder called rating. all I need now is to edit files for the path to rating/****. Which of these do i need to do.

I also am a little lost with the rest.

<?php require('_drawrating.php'); ?>

Where would i put this?

<script type="text/javascript" language="javascript" src="rating/js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="rating/js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="rating/css/rating.css" />


and how would I get this in:
<?php echo rating_bar('9b',''); ?>
here:
<tr class="windowbg">

		<td>

		 <div style="text-align: center;">

		  ', $context['arcade']['game']['html'], '

		  ', !$context['arcade']['can_submit'] ? '<br /><b>' . $txt['arcade_cannot_save'] . '</b>' : '', '
<br />
<<<<<<<<<<<<<<<<<<<<<<<<I WANT IT IN  HERE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<!-- START ADTOLL.COM CODE V1.0 -->
<STYLE>
/* Style of "Your link" text link */
A.at_adv_here_15282, A.at_pow_by_15282 {font-family: Arial,Sans-Serif; font-size: 10px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; color: #000099; text-decoration: none; }
/* Style of "Your link" text hover link */
A.at_adv_here_15282:hover, A.at_pow_by_15282:hover { color: #0000FF; text-decoration: underline; }
</STYLE>
<script type="text/javascript">
/* Show "Your link"   [1]-Visible [0]-Not visible */
adtoll_see_your_ad_here = 1;
/* "Your link" text */
adtoll_your_text = "Game Sponser";
/* Show "Powered by" link   [1]-Visible [0]-Not visible */
adtoll_show_powered_by = 0;
</SCRIPT>
<script src="[url="http://adserve.adtoll.com/js/at_ag_15282.js"]http://adserve.adtoll.com/js/at_ag_15282.js[/url]" type="text/javascript"></SCRIPT>
<!-- END ADTOLL.COM CODE V1.0 -->

Thanks for anybody that can help. I am off to SMF Arcade to ask too.

#5
Polymath

Posted 16 September 2008 - 03:53 AM

Polymath

    Member

  • Downloader
  • PipPip
  • 29 posts
  • Gender:Male
  • Location:New Zealand
Click to view battle stats
[SMF Arcade]

Ok. I have the rating installed with images but it is not submitting the rating at the moment. I'm not too sure what i have to do with it but I am getting there.

Index.template:
<script type="text/javascript" language="javascript" src="rating/js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="rating/js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="rating/css/rating.css" />

Arcade.template:
// Play screen

function template_arcade_game_play()

{

 global $scripturl, $txt, $context, $settings;
 

 
 require('rating/_drawrating.php'); 
 echo '	

	 <div class="tborder">
Blah...blah...blah...

and under the game, below adtoll
<!-- END ADTOLL.COM CODE V1.0 -->
', rating_bar('9b',''), '

		  <br /><br />', $context['arcade']['game']['help'], '

		 </div>

So.. the rating bar is there but when you click it, it does nothing but that spinning I'm doing something thingy..

Anybody have any idea what that problem could be to fix the submit hang?

see it there>>
http://www.gamesocke...=play;game=1052

#6
Polymath

Posted 16 September 2008 - 08:32 AM

Polymath

    Member

  • Downloader
  • PipPip
  • 29 posts
  • Gender:Male
  • Location:New Zealand
Click to view battle stats
Ok I have it now working. But it is not much good is it? It is the same rating for every game. Vote once and all pages/ games are the same. All that database and installation for something is for one page only. I don't get it ^o) one vote for 1000 games. Pffttt

As posted SMFarcade:
OK. I have this Ajax rating system installed fine. It is working..ish.

But if someone votes it is for a vote for all games, not just that one game..so I guess it is not all that it is cracked up to be.

I'm going to leave it up because I have posted elswhere about it. But it really needs to have a ID for every game so that one vote don't count for all games. These things are stupid when it is only for one page. Anyway it can be done but it just needs to be done for SMF Arcade.

Here is what I installed: hxxp://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/

if someone with a test site or just wishes to instal it,can you find out what I need to do to give each an ID so that each games vote is for that game and not all.

can be seen on any game here>> http://www.gamesocke...p?action=arcade


#7
nikosb

Posted 20 August 2011 - 07:04 PM

nikosb

    Newbie

  • Subscriber - Gold
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Greece
Click to view battle stats
I try but do not manage
I have vbulletin 4.x.x and ibproarcade 270
can help you doing?
Thanks
Nikos

#8
clifton11221

Posted 04 November 2011 - 03:09 AM

clifton11221

    Member

  • Downloader
  • PipPip
  • 13 posts
Click to view battle stats
Thanks for sharing!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users