Esempio n. 1
0
        $paid_advice = new paid_advices();
        $new_advices = $paid_advice->getAdvices($_SESSION['uid'], $author);
    }
    $exrates = new exrates();
    $EXR = $exrates->GetAll();
    // если в фильтре отзывов у фрилансера задано "от фрилансеров", и также с работодателем - то рекомендаций и платных рекомендаций не будет
    $sameRole = is_emp($user->role) && $author == 2 || !is_emp($user->role) && $author == 1;
    if (!$sameRole) {
        $msgs = sbr::getUserFeedbacks($to_id, is_emp($user->role), $sort > 0 ? $sort : false, $period, true, false);
        // рекомендации
    }
    $msgs2 = opinions::GetMsgs($to_id, $msg_cntr, $ppage, $num_msgs, $error, $tbl_type, $sort > 0 ? $sort : false, $period, $author);
    // мнения
    $opCount = ($msgs ? count($msgs) : 0) + ($msgs2 ? count($msgs2) : 0);
} elseif ($ops_type != 'norisk') {
    $msgs = opinions::GetMsgs($to_id, $msg_cntr, $ppage, $num_msgs, $error, $tbl_type, $sort > 0 ? $sort : false, $period, $author);
    $opCount = $msgs ? count($msgs) : 0;
}
$filterCounts = opinions::getFilterCounts($to_id, is_emp($user->role), $sort, $author, $period);
/**
 * @deprecated #0015627
if ($uid) {
    $can_post = opinions::CheckUserCanPost($uid, $to_id);
}
*/
$_SESSION['page_user_id'] = $user->uid;
if ($ops_type == 'norisk') {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/paid_advices.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/sbr.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/exrates.php";
    $sbr = new sbr(get_uid(false));
Esempio n. 2
0
 /**
  * Возвращает часть ответа с отзывами о пользователе
  * 
  * @param  array $aData информация о отзывами о пользователе
  * @return array
  */
 private function _getUserOpinionsData($aData)
 {
     require_once ABS_PATH . '/classes/paid_advices.php';
     require_once ABS_PATH . '/classes/opinions.php';
     require_once ABS_PATH . '/classes/sbr_meta.php';
     require_once ABS_PATH . '/classes/sbr.php';
     $aReturn = array();
     $msgs = sbr::getUserFeedbacks($aData['uid'], is_emp($aData['role']), false, 0, false, false);
     // рекомендации
     $msgs2 = opinions::GetMsgs($aData['uid'], null, null, null, $error, 'users', false, 0, 0);
     // мнения
     if (is_array($msgs) && $msgs) {
         foreach ($msgs as $theme) {
             $oUser = new users();
             $oUser->GetUserByUID($theme['fromuser_id']);
             $taData = array();
             $taClassVars = array_keys(get_class_vars('users'));
             foreach ($taClassVars as $sVar) {
                 $taData[$sVar] = $oUser->{$sVar};
             }
             if (!is_emp($taData['role'])) {
                 require_once ABS_PATH . '/classes/freelancer.php';
                 $aTmp = freelancer::getFreelancerByLogin(array($taData['login']));
                 $taData['spec'] = $aTmp[0]['spec'];
             }
             $aReturn[] = array("id" => $theme['id'], 'type' => $theme['is_payed'] ? 2 : 1, "from_user_id" => $theme['fromuser_id'], "to_user_id" => $theme['touser_id'], "rate" => $theme['sbr_rating'], "text" => $theme['descr'] ? iconv('cp1251', 'utf-8', $theme['descr']) : '', "status" => 1, "create_time" => strtotime($theme['posted_time']), "update_time" => $theme[''], "user" => $this->_getUserData($taData));
         }
     }
     if (is_array($msgs2) && $msgs2) {
         foreach ($msgs2 as $opinion) {
             $oUser = new users();
             $oUser->GetUserByUID($opinion['fromuser_id']);
             $taData = array();
             $taClassVars = array_keys(get_class_vars('users'));
             foreach ($taClassVars as $sVar) {
                 $taData[$sVar] = $oUser->{$sVar};
             }
             if (!is_emp($taData['role'])) {
                 require_once ABS_PATH . '/classes/freelancer.php';
                 $aTmp = freelancer::getFreelancerByLogin(array($taData['login']));
                 $taData['spec'] = $aTmp[0]['spec'];
             }
             $aReturn[] = array("id" => $opinion['id'], 'type' => 2, "from_user_id" => $opinion['fromuser_id'], "to_user_id" => $opinion['touser_id'], "rate" => $opinion['rating'], "text" => $opinion['msgtext'] ? iconv('cp1251', 'utf-8', $opinion['msgtext']) : '', "status" => 1, "create_time" => strtotime($opinion['post_time']), "update_time" => $opinion['modified'] ? strtotime($opinion['modified']) : 0, "user" => $this->_getUserData($taData));
         }
     }
     return $aReturn;
 }