Page 1 of 6 123 ... LastLast
Results 1 to 10 of 52

Thread: Ajax help

  1. #1
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax help

    Hello can someone run me through installing this http://www.masugadesign.com/the-lab/...tar-rating-bar please?






    Thanks!

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    After you download the file, unzip it. Inside are two folders, if you are using a MAC, open that folder, if you are not, open the other folder. Inside is a text file named README. read it and it has install instructions inside:

    Code:
    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.
    Just follow along until complete.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I don't understand this, "1. Make your table for the ratings in your db (you should be able to copy
    and paste the following SQL)"?

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You are creating an SQL database.

    Log into phpMyAdmin, open your database you created (or have) that will store this rating system. Click the "SQL" tab and there you will see a large input text box. copy and paste that code into the text box and click go.

    It will do the rest.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks!

  6. #6
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    For making the database do I select all priviliges for the user?





    Please and thank you!

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Only if you want that username to have access to your database it is a general usage that at least one user in each database has complete control, this way you can use scripts to make changes without having to log in to phpMyAdmin each time you want to run a back up or make a small change.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #8
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, I selected all privilages and I followed all the instructions. Then this is the page I put the rater on. http://www.athletes4excellence.com/liquidlayout1.php . However, I get this message "Parse error: syntax error, unexpected T_STRING in /home/athletes/public_html/rating/_config-rating.php on line 17"

  9. #9
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Well, this is where part 2 of the instructions comes in. You need to replace all the ### with your database name and user name and password, etc.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #10
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I did that, however, I did not fill out the following.

    " $rating_path_db = ''; // the path to your db.php file (not used yet!)
    $rating_path_rpc = ''; // the path to your rpc.php file (not used yet!)

    $rating_unitwidth = 30; // the width (in pixels) of each rating unit (star, etc.)
    // if you changed your graphic to be 50 pixels wide, you should change the value above"

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •