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

32 lines
1.0KB

  1. <?php
  2. if (!defined('DEDEINC')) {
  3. exit("Request Error!");
  4. }
  5. /**
  6. * 投票标签
  7. *
  8. * @version $Id: vote.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. require_once(DEDEINC . '/dedevote.class.php');
  15. function lib_vote(&$ctag, &$refObj)
  16. {
  17. global $dsql;
  18. $attlist = "id|0,lineheight|24,tablewidth|100%,titlebgcolor|#EDEDE2,titlebackgroup|,tablebg|#FFFFFF";
  19. FillAttsDefault($ctag->CAttribute->Items, $attlist);
  20. extract($ctag->CAttribute->Items, EXTR_SKIP);
  21. if (empty($id)) $id = 0;
  22. if ($id == 0) {
  23. $row = $dsql->GetOne("SELECT aid FROM `#@__vote` ORDER BY aid DESC LIMIT 0,1");
  24. if (!isset($row['aid'])) return '';
  25. else $id = $row['aid'];
  26. }
  27. $vt = new DedeVote($id);
  28. return $vt->GetVoteForm($lineheight, $tablewidth, $titlebgcolor, $titlebackgroup, $tablebg);
  29. }