*

7ala

  • ****
  • 144 posts
Number of user reviews
« on: September 02, 2021, 08:44:45 AM »
welcome
Thank you for your great support
Is there a way to show the number of user ratings
or the number of item ratings
Total number per user or per item
In the user control panel

thank you
« Last Edit: September 02, 2021, 08:49:11 AM by 7ala »

*

MB Themes

Re: Number of user reviews
« Reply #1 on: September 02, 2021, 03:53:00 PM »
@7ala
I would recomment to check model of plugin for custom functions.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: Number of user reviews
« Reply #2 on: September 03, 2021, 12:23:03 PM »
Code: [Select]
// COUNT RATINGS ON USER ACCOUNT FROM SOME USER (to check if user already left rating)
public function countRatingsByUserId( $user_id, $user_email, $from_user_id ) {
  $this->dao->select('count(*) as i_count');
  $this->dao->from( $this->getTable_Rating() );

  if($user_id == 0 || $user_id == '') {
    $this->dao->where('s_user_email = "' . $user_email . '" AND fk_i_from_user_id = ' . $from_user_id );
  } else {
    $this->dao->where('fk_i_user_id = ' . $user_id . ' AND fk_i_from_user_id = ' . $from_user_id );
  }


  $result = $this->dao->get();
  if( !$result ) { return array(); }
  return $result->row();
}

I expect the code responsible for this
This function
but
What is the code to get the number of reviews?
Thanks