国内流行的内容管理系统(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.

54 lines
1.8KB

  1. <?php
  2. if(!defined('DEDEINC'))
  3. {
  4. exit("Request Error!");
  5. }
  6. /**
  7. * 会员信息调用标签
  8. *
  9. * @version $Id: memberlist.lib.php 1 9:29 2010年7月6日Z tianya $
  10. * @package DedeCMS.Taglib
  11. * @copyright Copyright (c) 2020, DedeBIZ.COM
  12. * @license https://www.dedebiz.com/license
  13. * @link https://www.dedebiz.com
  14. */
  15. //orderby = logintime(login new) or mid(register new)
  16. function lib_memberlist(&$ctag, &$refObj)
  17. {
  18. global $dsql,$sqlCt;
  19. $attlist="row|6,iscommend|0,orderby|logintime,signlen|50";
  20. FillAttsDefault($ctag->CAttribute->Items,$attlist);
  21. extract($ctag->CAttribute->Items, EXTR_SKIP);
  22. $revalue = '';
  23. $innerText = trim($ctag->GetInnerText());
  24. if(empty($innerText)) $innerText = GetSysTemplets('memberlist.htm');
  25. $wheresql = ' WHERE mb.spacesta>-1 AND mb.matt<10 ';
  26. if($iscommend > 0) $wheresql .= " AND mb.matt='$iscommend' ";
  27. $sql = "SELECT mb.*,ms.spacename,ms.sign FROM `#@__member` mb
  28. LEFT JOIN `#@__member_space` ms ON ms.mid = mb.mid
  29. $wheresql order by mb.{$orderby} DESC LIMIT 0,$row ";
  30. $ctp = new DedeTagParse();
  31. $ctp->SetNameSpace('field','[',']');
  32. $ctp->LoadSource($innerText);
  33. $dsql->Execute('mb',$sql);
  34. while($row = $dsql->GetArray('mb'))
  35. {
  36. $row['spaceurl'] = $GLOBALS['cfg_basehost'].'/member/index.php?uid='.$row['userid'];
  37. if(empty($row['face'])){
  38. $row['face']=($row['sex']=='女')? $GLOBALS['cfg_memberurl'].'/templets/images/dfgirl.png' : $GLOBALS['cfg_memberurl'].'/templets/images/dfboy.png';
  39. }
  40. foreach($ctp->CTags as $tagid=>$ctag){
  41. if(isset($row[$ctag->GetName()])){ $ctp->Assign($tagid,$row[$ctag->GetName()]); }
  42. }
  43. $revalue .= $ctp->GetResult();
  44. }
  45. return $revalue;
  46. }