$polloptions[] = array('polloptionid' => $options['polloptionid'], 'polloption' => preg_replace("/\\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\\/\\/([^\\[\"']+?)\\](.+?)\\[\\/url\\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $options['polloption']), 'votes' => $options['votes'], 'width' => @round($options['votes'] * 300 / $count['max']) + 2, 'percent' => @sprintf("%01.2f", $options['votes'] * 100 / $count['total'])); } $voterids = explode("\t", $voterids); $voters = array_unique($voterids); $voterscount = count($voters) - 1; array_shift($voters); if (!$expiration) { $expirations = $timestamp + 86400; } else { $expirations = $expiration; if ($expirations > $timestamp) { $thread['remaintime'] = remaintime($expirations - $timestamp); } } $allowvote = $allowvote && (empty($thread['closed']) || $alloweditpoll) && !in_array($discuz_uid ? $discuz_uid : $onlineip, $voters) && $timestamp < $expirations && $expirations > 0; $optiontype = $multiple ? 'checkbox' : 'radio'; $visiblepoll = $visible || $forum['ismoderator'] || $discuz_uid && $discuz_uid == $thread['authorid'] || $expirations >= $timestamp && in_array($discuz_uid ? $discuz_uid : $onlineip, $voters) ? 0 : 1; } else { $db->query("UPDATE {$tablepre}threads SET special='0' WHERE tid='{$tid}'", 'UNBUFFERED'); } $post = $db->fetch_first("SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,\r\n\tm.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,\r\n\tm.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, m.xspacestatus, mf.nickname, mf.site,\r\n\tmf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals, mf.avatar, mf.avatarwidth,\r\n\tmf.avatarheight, mf.customstatus, mf.spacename {$fieldsadd}\r\n\tFROM {$tablepre}posts p\r\n\tLEFT JOIN {$tablepre}members m ON m.uid=p.authorid\r\n\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\tWHERE p.tid='{$tid}' AND first=1 LIMIT 1"); $pid = $post['pid']; $postlist[$post['pid']] = viewthread_procpost($post); if ($attachpids) { require_once DISCUZ_ROOT . './include/attachment.func.php'; parseattach($attachpids, $attachtags, $postlist, $showimages); } viewthread_parsetags(); $post = $postlist[$post['pid']]; include template('viewthread_poll'); exit;
$cic = 0; $totalcomment[$comment['pid']] = preg_replace('/<i>([\\.\\d]+)<\\/i>/e', "'<i class=\"cmstarv\" style=\"background-position:20px -'.(intval(\\1) * 16).'px\">'.sprintf('%1.1f', \\1).'</i>'.(\$cic++ % 2 ? '<br />' : '');", $comment['comment']); } } } if ($_G['forum_attachpids'] != '-1') { require_once libfile('function/attachment'); parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, $skipaids); } if (empty($postlist)) { showmessage('undefined_action', NULL); } else { $_G['setting']['seodescription'] = current($postlist); $_G['setting']['seodescription'] = !$_G['forum_thread']['price'] ? str_replace(array("\r", "\n"), '', cutstr(htmlspecialchars(strip_tags($_G['setting']['seodescription']['message'])), 150)) : ''; } viewthread_parsetags($postlist); if (empty($_G['gp_viewpid'])) { $sufix = ''; if ($_G['gp_from'] == 'home') { $space['uid'] = $_G['forum_thread']['authorid']; $space['username'] = $_G['forum_thread']['author']; $sufix = '_home'; $post =& $postlist[$_G['forum_firstpid']]; } elseif ($_G['gp_from'] == 'portal') { $sufix = '_portal'; $post =& $postlist[$_G['forum_firstpid']]; } if ($_G['inajax']) { include template('common/header_ajax'); $sufix = '_from_node'; }