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

52 lines
1.8KB

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