请问这段代码是什么意思

2016-07-07 15:05 来源:www.chinab4c.com 作者:ecshop专家


  1. switch ($rule_key)
  2. {
  3. case TO_P :
  4. $result_points = floor($num * $to / $from);
  5. $user->set_points($row['user_name'], array($bbs_key=>0 - $num)); //调整论坛
  6. log_account_change($row['user_id'], 0, 0, 0, $result_points, $_LANG['transform_points'], ACT_OTHER);
  7. show_message(sprintf($_LANG['to_pay_points'],$num, $points_name[$bbs_key]['title'], $result_points), $_LANG['transform_points'], 'user.php?act=transform_points');
  8. case TO_R :
  9. $result_points = floor($num * $to / $from);
  10. $user->set_points($row['user_name'], array($bbs_key=>0 - $num)); //调整论坛积分
  11. log_account_change($row['user_id'], 0, 0, $result_points, 0, $_LANG['transform_points'], ACT_OTHER);
  12. show_message(sprintf($_LANG['to_rank_points'], $num, $points_name[$bbs_key]['title'], $result_points), $_LANG['transform_points'], 'user.php?act=transform_points');
  13. case FROM_P :
  14. $result_points = floor($num * $to / $from);
  15. log_account_change($row['user_id'], 0, 0, 0, 0-$num, $_LANG['transform_points'], ACT_OTHER); //调整商城积分
  16. $user->set_points($row['user_name'], array($bbs_key=>$result_points)); //调整论坛积分
  17. show_message(sprintf($_LANG['from_pay_points'], $num, $result_points,$points_name[$bbs_key]['title']), $_LANG['transform_points'], 'user.php?act=transform_points');
  18. case FROM_R :
  19. $result_points = floor($num * $to / $from);
  20. log_account_change($row['user_id'], 0, 0, 0-$num, 0, $_LANG['transform_points'], ACT_OTHER); //调整商城积分
  21. $user->set_points($row['user_name'], array($bbs_key=>$result_points)); //调整论坛积分
  22. show_message(sprintf($_LANG['from_rank_points'], $num, $result_points, $points_name[$bbs_key]['title']), $_LANG['transform_points'], 'user.php?act=transform_points');
  23. }
复制代码

回答:
$user->set_points($row['user_name'], array($bbs_key=>$result_points)); //调整论坛积分

特别是调整论坛积分的那几句是什么意思啊,有人可以分析一下吗,谢谢

以上代码是整合后用的 set_points是一个函数 你ctrl+f一下 就知道 他都需要那些参数