Results 1 to 13 of 13

Thread: How do I make reviews and ratings visible only by the author?

  1. #1
    Join Date
    Jul 2003
    Posts
    40

    Default How do I make reviews and ratings visible only by the author?

    Is it possible to display ratings and reviews only to its author?

    Lets say I reviewed and rated some links on my indexu site. After admin approval, they are public, anyone can see them.
    What I want to do, is to make them private so that they are only visible to me.

  2. #2
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Re: How do I make reviews and ratings visible only by the author?

    at first I was confused by what you were asking. I still have some questions.

    Generally, it is not a matter of can it be done but how can it be done.

    In this case, the review part is easy. well, it least in theory. In the detail.php check the cookie username against your username and run the DisplayReview function if equal. Otherwise review_rows is set to blank. if you want to display reviews from others, you will have to hack the DisplayReview function in the link.class.php file

    The ratings is different matter since it is part of the $link_detail variable. In that case you will have to hack the Display function in the link.class.php file. there is a whole section on ratings there.

    Are you planning on showing review/ratings from other users?

    While I'm sure this is valuable to you, I don't see this as hack/mod for many folks. But let's hear from other folks...!
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  3. #3
    Join Date
    Jul 2003
    Posts
    40

    Default Re: Re: How do I make reviews and ratings visible only by the author?

    Originally posted by esm
    Are you planning on showing review/ratings from other users?
    My idea is that each user sees only his reviews and ratings.
    To give you an example: lets say we are members of the same indexu site and I've reviewed and rated Link A and you have done the same.
    When I visit the detail page of Link A, I can't see your review and rating and you can't see mine.

  4. #4
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    well, the DisplayReview function displays all reviews so you would need to hack that.

    I don't have time right now but you will need to change the DisplayReview function.

    $uname = = $COOKIE_USERNAME;
    $review_rows = $links_obj->DisplayReview($id, $uname);

    and in link.class.php

    function DisplayReview($id,$uname, $query="",$show_link_detail=false) {

    then

    if(empty($query))
    $query = "select * from $this->review_table_name where link_id = $id and username=$uname and status = 1 order by date desc";

    done quickly but try it. Maybe dody has a different idea.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  5. #5
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Could you tell me what is its purpose? why only me can see my own review?

  6. #6
    Join Date
    Jul 2003
    Posts
    40

    Default

    Like I said before, I'm using indexu to manage a list of weblogs.

    Since most of them are personal weblogs, public reviews don't work very well because you are not reviewing (or criticizing) a consumer product but other people's feelings and words.

    Worst than that, some imature people seize any opportunity to bash others down and public reviews and ratings are the perfect place to do it.

    So, I want to turn them into a personal tool instead of a public weapon.
    I want people to use the review feature to write notes or whatever they want about other people's weblogs and use the rating feature as a tool to organize and mark their favorites.

    That's why. =)

  7. #7
    Join Date
    Jul 2003
    Posts
    40

    Default

    Thanks Esm but it's not working =(

    The rated and reviewed links output the dreaded Fatal error: Call to a member function on a non-object in /home/rbl/public_html/lib/link.class.php on line 2583 error.

    Line 2583 is: $num_rows = $result->RecordCount();

    Every detail page of unrated and unreviewed links show fine whether you are an anonimous visitor or a member.

  8. #8
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    try the following: instead

    in link.class.php

    function DisplayReview($id,$uname, $query="",$show_link_detail=false) {

    then

    if(empty($query))
    $query = "select * from $this->review_table_name where link_id = $id and username='$uname' and status = 1 order by date desc";

    Note the quote marks around '$uname'

    in detail.php

    change function ShowDetailPage();
    to
    function ShowDetailPage($uname);

    $review_rows = $links_obj->DisplayReview($id, $uname);

    Finally, in the "main program" area at the bottom of detail.php:

    DisplayTemplate($theme_path."header.html","\$title ,\$cat");
    ShowDetailPage($COOKIE_USERNAME);
    DisplayTemplate($theme_path."footer.html","\$cat,\ $ma");
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  9. #9
    Join Date
    Jul 2003
    Posts
    40

    Default

    Perfect! =)
    Thanks Esm!! =)

    You said before that ratings were a different matter. I'm looking through the code but so far I can only change the template and not the function.
    Do you have another bright suggestion? =)

  10. #10
    Join Date
    Jul 2003
    Posts
    40

    Default

    Oh! How stupid of me, it's already done! The only thing I need to do now, is disable visitor ratings and take the average rating values off the templates.

  11. #11
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    ratings come in two flavors for INDEXU.

    First, the rating that goes with the review. I looked at the code but didn't understand what I read.

    Same thing with the "public" rating submitted by visitors.

    Tell me a little more about what you see on your listings and what you want.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  12. #12
    Join Date
    Jul 2003
    Posts
    40

    Default

    I've taken all the rating links, stars and references from every page except the one that accompanies the member review in detail.php.

    You can see an exemple here:
    It's this:
    Review by teste24000 (date: 10-Jul-2003)
    Comment: this is a test review with a rating
    Rating: ****

    The only thing I have to do now is disable visitor rating, make that rating form (the grey box on the page above) visible to members only and disable the admin review validation.

  13. #13
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    The only thing I have to do now is disable visitor rating, make that rating form (the grey box on the page above) visible to members only and disable the admin review validation.
    - to disable visitor rating, just get rid a html form for rating. in detail_link.html
    PHP Code:
    <form action=rating.php method=post>
    <
    input type=hidden name=id value=<%link_id%>>
    ........ 
    Just work with template files to disable features. Please read the manual for detail template files.

Posting Permissions

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