当前位置: 首页>>代码示例>>PHP>>正文


PHP professions::GetCatalogPosition方法代码示例

本文整理汇总了PHP中professions::GetCatalogPosition方法的典型用法代码示例。如果您正苦于以下问题:PHP professions::GetCatalogPosition方法的具体用法?PHP professions::GetCatalogPosition怎么用?PHP professions::GetCatalogPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在professions的用法示例。


在下文中一共展示了professions::GetCatalogPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$results = array();
if (count($argv) > 1) {
    parse_str(implode('&', array_slice($argv, 1)), $_GET);
}
//------------------------------------------------------------------------------
$login = @$_GET['login'];
isAllowProfi();
$user = new users();
$user->GetUser($login);
if ($user->uid > 0) {
    $rating = new rating($user->uid, $user->is_pro, $user->is_verify, $user->is_profi);
    $r_data = $rating->data;
    $user_profs = professions::GetProfessionsByUser($user->uid);
    if ($user_profs) {
        foreach ($user_profs as $up) {
            $rating_pos[] = professions::GetCatalogPosition($user->uid, $user->spec_orig, $r_data['total'], $up, $user->is_pro == 't');
        }
        if ($rating_pos) {
            $results['rating_total'] = $r_data['total'];
            foreach ($rating_pos as $pos) {
                $results[iconv('CP1251', 'UTF-8', $pos['prof_name'])] = $pos['pos'];
            }
        }
    }
}
//------------------------------------------------------------------------------
array_walk($results, function (&$value, $key) {
    $value = sprintf('%s = %s' . PHP_EOL, $key, $value);
});
print_r(implode('', $results));
exit;
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:pos.php

示例2: foreach

            $u_last_prm_width += ($lp_to_d - $lp_d + 1) * 2;
        }
    }
}
$u_has_ps = $u_has_ps_fp || $u_has_ps_ctg;
$u_has_prm = $prm_is_FP ? $u_has_ps_fp : ($prm_is_CTG ? $u_has_ps_ctg : $u_is_pro);
if (!$u_is_pro) {
    $u_pro_rating = rating::GetByFormula($u_rating + (int) rating::GetWorkFactorPlusIfPro($uid), 't', $u_is_verify);
}
// Определяем места в каталоге.
if ($u_profs = professions::GetProfessionsByUser($uid, false)) {
    foreach ($u_profs as $prof_id) {
        if (!$u_is_pro) {
            $pro_pos = professions::GetCatalogPosition($uid, $u_spec, $u_pro_rating, $prof_id, TRUE, TRUE);
        }
        $cur_pos = professions::GetCatalogPosition($uid, $u_spec, $u_rating, $prof_id, $u_is_pro);
        $u_ctlg_pos[] = array('prof_name' => $cur_pos['prof_name'], 'prof_id' => $prof_id, 'pos' => $cur_pos['pos'], 'propos' => $pro_pos['pos'], 'link' => $cur_pos['link']);
    }
}
// Получаем статистику юзера для графика за месяц и за год.
if ($mdays = promotion::GetFromDaily($uid, $MONTHDAY, $TODAY)) {
    foreach ($mdays as $d) {
        if (($mc = $d['by_e'] + $d['by_f'] + $d['by_u']) > $cur_month_max_h) {
            $cur_month_max_h = $mc;
        }
        if ($mc > $cur_year_max_h) {
            $cur_year_max_h = $mc;
        }
        $u_month_sum['by_a'] += $mc;
        $u_month_sum['by_e'] += $d['by_e'];
        $u_month_sum['by_f'] += $d['by_f'];
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:content.php


注:本文中的professions::GetCatalogPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。