osDate Forum - osDate Dating Script

osDateEvo => osDateEvo Updated Files - Fixed Bugs => Topic started by: Pharg on March 30, 2018, 04:38:49 AM

Title: Profile Voting button and comments shows again after voting Fix.
Post by: Pharg on March 30, 2018, 04:38:49 AM
Hi Members,

In the showprofile.php find line 435 and get this:
Code: [Select]
        if ( isset($_SESSION['UserId']) && isset($_GET['id']) && $_SESSION['UserId'] != $_GET["id"] ) {

            $c = $osDB->getOne( 'SELECT count(*) as c  FROM !  WHERE userid = ? AND profileid = ? and ratingid = ? and rating > ?', array( USER_RATING_TABLE, $_SESSION['UserId'], $_REQUEST['id'], $item["id"], '0' ));


            if ( $c == 0 ) {

                $item["has_rated"] = '0';

            }else {

                $item["has_rated"] = '1';

            }

        }

        if ( isset($_SESSION['UserId']) && isset($_GET['id']) && $_SESSION['UserId'] != $_GET["id"] ) {

            $c = $osDB->getOne( 'SELECT count(*) as c  FROM !  WHERE userid = ? AND profileid = ? and ratingid = ? and comment <> ?', array( USER_RATING_TABLE, $_SESSION['UserId'], $_REQUEST['id'], $item["id"], '' ));


            if ( $c == 0 ) {

                $item["has_commented"] = '0';

            }else {

                $item["has_commented"] = '1';

            }

        }


Change to this:
Code: [Select]
        if ( isset($_SESSION['UserId']) || isset($_GET['id']) && $_SESSION['UserId'] != $_GET["id"] ) {

            $c = $osDB->getOne( 'SELECT count(*) as c  FROM !  WHERE userid = ? AND profileid = ? and ratingid = ? and rating > ?', array( USER_RATING_TABLE, $_SESSION['UserId'], $_REQUEST['id'], $item["id"], '0' ));


            if ( $c == 0 ) {

                $item["has_rated"] = '0';

            }else {

                $item["has_rated"] = '1';

            }

        }

        if ( isset($_SESSION['UserId']) || isset($_GET['id']) && $_SESSION['UserId'] != $_GET["id"] ) {

            $c = $osDB->getOne( 'SELECT count(*) as c  FROM !  WHERE userid = ? AND profileid = ? and ratingid = ? and comment <> ?', array( USER_RATING_TABLE, $_SESSION['UserId'], $_REQUEST['id'], $item["id"], '' ));


            if ( $c == 0 ) {

                $item["has_commented"] = '0';

            }else {

                $item["has_commented"] = '1';

            }

        }