member_count.inc.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. function member_get_count()
  3. {
  4. global $element;
  5. global $s_uid;
  6. global $money_own;
  7. global $pm_total;
  8. foreach ($element as $k => $value) {
  9. if (empty($value[type])) {
  10. $and = $value[where] ? $value[where] : '';
  11. if ($value[style] == 'pm') {
  12. $mymps_member_count .= '<li class="' . $value[style] . '"><a href="' . $value[url] . '">' . $k . '(' . $pm_total . ')</a></li>';
  13. }
  14. else {
  15. $mymps_member_count .= '<li class="' . $value[style] . '"><a href="' . $value[url] . '">' . $k . '(' . mymps_count($value[table], 'WHERE userid = \'' . $s_uid . '\'' . $and) . ')</a></li>';
  16. }
  17. }
  18. else {
  19. $mymps_member_count .= '<li class="' . $value[style] . '"><a href="' . $value[url] . '">' . $k . '(' . $money_own . ')</a></li>';
  20. }
  21. }
  22. return $mymps_member_count;
  23. }
  24. $element = array(
  25. '信息' => array('style' => 'info', 'url' => 'info.php?part=all', 'table' => 'information', 'type' => ''),
  26. '点评' => array('style' => 'com', 'url' => 'comment.php', 'table' => 'member_comment', 'type' => '', 'where' => ' AND commentlevel = 1'),
  27. '短消息' => array('style' => 'pm', 'url' => 'pm.php', 'table' => 'member_pm', 'type' => '', 'where' => ' AND if_read = 0'),
  28. '账户' => array('style' => 'incomes', 'url' => 'bank.php', 'table' => 'member', 'type' => 'money')
  29. );
  30. if ($if_corp != 1) {
  31. unset($element['留言']);
  32. unset($element['点评']);
  33. }
  34. ?>