国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 line
1.7KB

  1. <?php
  2. if (!defined('DEDEINC')) exit ('dedebiz');
  3. /**
  4. * 会员信息标签
  5. *
  6. * @version $id:userinfo.lib.php tianya $
  7. * @package DedeBIZ.Taglib
  8. * @copyright Copyright (c) 2023 DedeBIZ.COM
  9. * @license GNU GPL v2 (https://www.dedebiz.com/license)
  10. * @link https://www.dedebiz.com
  11. */
  12. function lib_userinfo(&$ctag, &$refObj)
  13. {
  14. global $dsql;
  15. $attlist="mid|0";
  16. FillAttsDefault($ctag->CAttribute->Items,$attlist);
  17. extract($ctag->CAttribute->Items, EXTR_SKIP);
  18. $rmid = !empty($refObj->Fields['mid'])? intval($refObj->Fields['mid']) : 0;
  19. $mid = $mid > 0 ? $mid : $rmid;
  20. if ($mid == 0) return "";
  21. $revalue = '';
  22. $innerText = trim($ctag->GetInnerText());
  23. if(empty($innerText)) $innerText = GetSysTemplets('userinfo.htm');
  24. $sql = "SELECT U.*,US.spacename,US.sign,AR.membername as rankname FROM `#@__member` U
  25. LEFT JOIN `#@__member_space` US ON US.mid = U.mid
  26. LEFT JOIN `#@__arcrank` AR ON AR.`rank` = U.`rank`
  27. WHERE U.mid='{$mid}' LIMIT 0,1 ";
  28. $ctp = new DedeTagParse();
  29. $ctp->SetNameSpace('field','[',']');
  30. $ctp->LoadSource($innerText);
  31. $dsql->Execute('user',$sql);
  32. while($row = $dsql->GetArray('user'))
  33. {
  34. if($row['matt']==10) return ''; //不显示管理员信息
  35. $row['userurl'] = $GLOBALS['cfg_memberurl'].'/index.php?uid='.$row['userid'];
  36. $row['face'] = empty($row['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $row['face'];
  37. foreach($ctp->CTags as $tagid=>$ctag)
  38. {
  39. if(isset($row[$ctag->GetName()])){ $ctp->Assign($tagid,$row[$ctag->GetName()]); }
  40. }
  41. $revalue .= $ctp->GetResult();
  42. }
  43. return $revalue;
  44. }
  45. ?>