Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: rating_img for rows.html

  1. #1
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default rating_img for rows.html

    HI can some one help me out on this i am a little stuck here i tried a bunch a different ways and just cant get the rating image to show up beside Google pr.
    I would like to have the rating image show up like Google pr when browsing.

    I tried <%$rating_img%> / <%$rating_image%> / i even tried ..

    Code:
    <%$hook_html_link_detail_after_link_detail%>  
    
    <div id="avg_rating">
      <form action="rating.php" method="post">
        <%$hook_html_link_detail_avg_rating_form_begin%> 
        <input type="hidden" name="id" value="<%$link_id%>" />
        <div style="float:left;"><b><%t%>Average Visitor Rating:<%/t%> </b></div>
          <%if $enable_rating_ajax%>
            <%$hook_html_link_detail_avg_rating_form_ajax%>
            <div style="float:left;">
              <ul class="ajax-rating-indexu" style="width:74px;">
                <li class="current" style="width:<%math equation="x * y" x=14.5 y=$rating%>px;"></li>
                <li><a href="javascript:;;" class="star1" title="1"></a></li>
                <li><a href="javascript:;;" class="star2" title="2"></a></li>
                <li><a href="javascript:;;" class="star3" title="3"></a></li>
                <li><a href="javascript:;;" class="star4" title="4"></a></li>
                <li><a href="javascript:;;" class="star5" title="5"></a></li>
              </ul>
              <span><%$rating%> (<%t%>out of 5<%/t%>)</span>
            </div>
          <%else%>
            <span><%$rating_img%></span>
            <span><%$rating%> (<%t%>out of 5<%/t%>)</span>
          <%/if%>
              
        <div><%t a=$votes%>Number of ratings: %1 Votes<%/t%></div>
        
        <%if $enable_rating_ajax neq 1%>
          <%$hook_html_link_detail_avg_rating_form_not_ajax%>
          <%t%>Visitor rating<%/t%>
          <select name="rating">
            <option value=""><%t%>Select Your Rating<%/t%></option>
            <option value="5"><%t%>Excellent!<%/t%></option>
            <option value="4"><%t%>Very Good<%/t%></option>
            <option value="3"><%t%>Good<%/t%></option>
            <option value="2"><%t%>Fair<%/t%></option>
            <option value="1"><%t%>Poor<%/t%></option>
          </select>
          <input type="submit" value="<%t%>Rate It!<%/t%>" />
        <%/if%>
        
        <%$hook_html_link_detail_avg_rating_form_end%>
    What is it i am missing

  2. #2
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    From what I see it should work just fine. $rating_img is a variable pulled from link.class.php which is available from application.php so it should be available to any page that pulls application.php (almost every page).

    I could be missing something of course, and if it's not working I probably am. But what it is, I just can't see it right now.

  3. #3
    FSGDAG's Avatar
    FSGDAG is offline Moderator
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Is AJAX rating turned on??? If so, wouldn't you want the rating_img to be BEFORE the <else> statement?? See below where I've added it in red
    Code:
    <%$hook_html_link_detail_after_link_detail%>  
    
    <div id="avg_rating">
      <form action="rating.php" method="post">
        <%$hook_html_link_detail_avg_rating_form_begin%> 
        <input type="hidden" name="id" value="<%$link_id%>" />
        <div style="float:left;"><b><%t%>Average Visitor Rating:<%/t%> </b></div>
          <%if $enable_rating_ajax%>
            <%$hook_html_link_detail_avg_rating_form_ajax%>
            <div style="float:left;">
              <ul class="ajax-rating-indexu" style="width:74px;">
                <li class="current" style="width:<%math equation="x * y" x=14.5 y=$rating%>px;"></li>
                <li><a href="javascript:;;" class="star1" title="1"></a></li>
                <li><a href="javascript:;;" class="star2" title="2"></a></li>
                <li><a href="javascript:;;" class="star3" title="3"></a></li>
                <li><a href="javascript:;;" class="star4" title="4"></a></li>
                <li><a href="javascript:;;" class="star5" title="5"></a></li>
              </ul>
                <span><%$rating_img%></span>
                 <span><%$rating%> (<%t%>out of 5<%/t%>)</span>
            </div>
          <%else%>
            <span><%$rating_img%></span>
            <span><%$rating%> (<%t%>out of 5<%/t%>)</span>
          <%/if%>
              
        <div><%t a=$votes%>Number of ratings: %1 Votes<%/t%></div>
        
        <%if $enable_rating_ajax neq 1%>
          <%$hook_html_link_detail_avg_rating_form_not_ajax%>
          <%t%>Visitor rating<%/t%>
          <select name="rating">
            <option value=""><%t%>Select Your Rating<%/t%></option>
            <option value="5"><%t%>Excellent!<%/t%></option>
            <option value="4"><%t%>Very Good<%/t%></option>
            <option value="3"><%t%>Good<%/t%></option>
            <option value="2"><%t%>Fair<%/t%></option>
            <option value="1"><%t%>Poor<%/t%></option>
          </select>
          <input type="submit" value="<%t%>Rate It!<%/t%>" />
        <%/if%>
        
        <%$hook_html_link_detail_avg_rating_form_end%>
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  4. #4
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default

    It does the same thing and yes ajax rating is enable, when i use the hole code for <%$hook_html_link_detail_after_link_detail%> all it will show is this...
    Average Visitor Rating 4.00 (out of 5) Number of ratings: 1 Votes
    No pictures. And this alone <%$rating_img%> does nothing.

    Thanks bruce, FSGDAG!!!

  5. #5
    mpdaddy is offline Active Member
    Join Date
    Nov 2007
    Posts
    227

    Default

    Did you get this working?

    Regards
    mp
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  6. #6
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default

    No!

  7. #7
    mpdaddy is offline Active Member
    Join Date
    Nov 2007
    Posts
    227

    Default

    I will check it out and the item you pm'd me about. I have to hang with the wife for a while, then I will work on it.

    Regards
    mp
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  8. #8
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Wink

    Thanks again MP.

  9. #9
    mpdaddy is offline Active Member
    Join Date
    Nov 2007
    Posts
    227

    Default

    What template are you using?
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  10. #10
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default

    Kosmos!

  11. #11
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default

    Quote Originally Posted by Bruceper View Post
    From what I see it should work just fine. $rating_img is a variable pulled from link.class.php which is available from application.php so it should be available to any page that pulls application.php (almost every page).

    I could be missing something of course, and if it's not working I probably am. But what it is, I just can't see it right now.
    Your missing something cause it ain't working

  12. #12
    mpdaddy is offline Active Member
    Join Date
    Nov 2007
    Posts
    227

    Default

    The problem lies in the browse.php file. When you put <%$rating_img%> in the rows.html file, it attempts to pull the image from

    Code:
    http://www.yoursite.com/category_name/themes/kosmos/images/rating/5.gif
    It should be:
    Code:
    http://www.yoursite.com/themes/kosmos/images/rating/5.gif
    It is a simple fix though. Open browse.php and find this code:

    Code:
        $links_obj->rating_image_path     = "themes/" . $theme_name . "/images/rating/";
    And change it to this:

    Code:
        $links_obj->rating_image_path     = $site_url . "/themes/" . $theme_name . "/images/rating/";
    Then insert <%$rating_img%> in your rows.html file wherever you want to display the image.

    Regards
    mp
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  13. #13
    DGTALGOODIES is offline Active Member
    Join Date
    Jun 2007
    Location
    Quebec
    Posts
    242

    Default

    Dam Talking about an eagle eye Thanks!

    Another fix by MPDADDY.

  14. #14
    mpdaddy is offline Active Member
    Join Date
    Nov 2007
    Posts
    227

    Default

    Bruce

    Would this classify as a bug?

    Regards
    mp
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  15. #15
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Would the issue have been easier if DGTALGOODIES showed me a URL and I could have just right clicked on the image and viewd the image path? Yes.

    Putting an image on a page that normally doesn't have that image can cause issues. Should all images use the proper image path including $site_url? Yes.

    Is it a bug? Maybe. The code works as designed, so no bug there. But when you try and use the code elsewhere an issues arises. It's a strange situation for sure. I'll post it on the project tools anyways.

Page 1 of 2 12 LastLast

Similar Threads

  1. how to display fields in rows.html
    By echo@ in forum Blocks and Modification
    Replies: 2
    Last Post: 01-31-2008, 03:28 PM
  2. Adding HTML between n rows
    By beto in forum v5.x
    Replies: 3
    Last Post: 01-17-2007, 06:19 AM
  3. Rows.html
    By gspinney in forum v5.x
    Replies: 2
    Last Post: 12-20-2006, 11:18 PM
  4. 2 rows.html templates
    By Rob Picken in forum v5.x
    Replies: 4
    Last Post: 12-28-2003, 09:30 AM
  5. rows.html v/s sp_cat_rows.html ??
    By ideavirus in forum v5.x
    Replies: 1
    Last Post: 06-22-2003, 08:12 AM

Posting Permissions

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