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

55 lines
1.9KB

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