Location: PHPKode > projects > Uchome and Discuz > template/default/space_poll_view.htm
<!--{eval $_TPL['titles'] = array($poll['subject'], 'Poll');}-->
<!--{template header}-->

<!--{if $space[self]}-->
<h2 class="title"><img src="image/app/poll.gif" />Poll</h2>
<div class="tabs_header">
	<ul class="tabs">
		<li><a href="space.php?uid=$space[uid]&do=$do&view=new"><span>Latest Poll</span></a></li>
		<li><a href="space.php?uid=$space[uid]&do=$do&view=hot"><span>Hottest Poll</span></a></li>
		<li><a href="space.php?uid=$space[uid]&do=$do&view=reward"><span>Poll Points</span></a></li>
		<!--{if $space[friendnum]}--><li$actives[friend]><a href="space.php?uid=$space[uid]&do=$do&view=friend"><span>Friends Poll</span></a></li><!--{/if}-->
		<li class="active"><a href="space.php?uid=$space[uid]&do=$do&view=me"><span>My Poll</span></a></li>
		<li class="null"><a href="cp.php?ac=poll">Vote to new poll</a></li>
	</ul>
	<!--{if $_SGLOBAL[refer]}-->
	<div class="r_option">
		<a  href="$_SGLOBAL[refer]">&laquo; Prev Page</a>
	</div>
	<!--{/if}-->
</div>
<!--{else}-->
<!--{eval
	$_TPL['spacetitle'] = "Poll";
	$_TPL['spacemenus'][] = "<a href=\"space.php?uid=$space[uid]&do=$do&view=me\">Friends all Poll</a>";
	$_TPL['spacemenus'][] = "<a href=\"space.php?uid=$space[uid]&do=poll&pid=$pid\">View detials</a>";
}-->
<!--{template space_menu}-->
<!--{/if}-->

<div id="content">
	<div class="poll_header">
		<div class="floatleft">
			<p>Created: <!--{date('d-m-Y H:i',$poll[dateline],1)}--></p>
			<p>Participant: <strong>$poll[voternum]</strong></p>
			<!--{if $space[self] && $poll[credit]}-->
			<p>Remaining Point: <strong>$poll[credit]</strong></p>
			<!--{/if}-->
			<!--{if $poll[expiration]}--><p>Last date: <!--{date('d-m-Y',$poll[expiration])}--></p><!--{/if}-->
		</div>
		<!--{if $space[self]}-->
		<div class="floatright">
			<script type="text/javascript" src="source/script_calendar.js"></script>
			<!--{if $poll[credit]}-->
			<p><a href="cp.php?ac=poll&op=endreward&pid=$poll[pid]" id="poll_reward_$poll[pid]" onclick="ajaxmenu(event, this.id)">Cancel Reward</a></p>
			<!--{/if}-->
			<p><a href="cp.php?ac=poll&op=addreward&pid=$poll[pid]" id="add_new_reward" onclick="ajaxmenu(event, this.id)">Add Reward</a></p>
			<p><a href="cp.php?ac=poll&op=addopt&pid=$poll[pid]" id="addnewoption" onclick="ajaxmenu(event, this.id, 1)">Add Options: </a></p>
			<p><a href="cp.php?ac=poll&pid=$poll[pid]&op=delete" id="poll_delete_$poll[pid]" onclick="ajaxmenu(event, this.id)">Delete Poll:</a></p>
			<p><a href="cp.php?ac=poll&pid=$poll[pid]&op=modify" id="poll_modify_$poll[pid]" onclick="ajaxmenu(event, this.id)">Change Time:</a></p>
			<p><a href="cp.php?ac=poll&pid=$poll[pid]&op=summary" id="poll_summary_$poll[pid]" onclick="ajaxmenu(event, this.id, 1)">Poll Summary:</a></p>
		</div>
		<!--{else}-->

		<!--{/if}-->
	</div>

	<div class="poll_title">
		<!--{if $expiration}-->
		<div class="print overtime">[expired]</div>
		<!--{elseif $poll[percredit]}-->
		<div class="print guerdon">[points]</div>
		<!--{/if}-->
		<!--{if $poll[hot]}--><span class="hot"><em>Popular </em>$poll[hot]</span><!--{/if}--><h3><img src="image/poll_icon.gif" /> $poll[subject]</h3><!--{if $poll['sex'] && $poll['sex'] != $_SGLOBAL['member']['sex'] || $poll[multiple]}--> (<!--{if $poll['sex'] && $poll['sex'] != $_SGLOBAL['member']['sex']}--> Only <strong><!--{if $poll['sex']==1}-->Male <!--{else}--> Female <!--{/if}--></strong>Participation <!--{/if}--><!--{if $poll[multiple]}-->optional {$poll[maxchoice]}<!--{/if}-->) <!--{/if}-->
		<!--{if $_GET[reward]}-->
		<p style="color: #F30">Congratulations! You got <strong>$_GET[reward]</strong> points.</p>
		<!--{elseif $poll[percredit]}-->
		<p style="color: #F30"><strong>$poll[percredit]</strong> point for each Vote</p>
		<!--{/if}-->
	</div>
	<!--{if $poll[message]}--><p class="poll_depiction">$poll[message]</p><!--{/if}-->

	<form name="poll" method="post" action="cp.php?ac=poll&pid=$poll[pid]&op=vote">

	<ol class="poll_item_list">
		<!--{eval $bcid = rand(0, 19);}-->
		<!--{loop $option $key $val}-->
		<li>
			<label class="poll_item">$val[option]:</label>
			<!--{if $bcid>19}-->
			<!--{eval $bcid=$bcid-19}-->
			<!--{/if}-->
			<div class="bar_bg bc_$bcid">
				<div class="bar_left"></div>
				<div class="bar_middle" id="bar_$key" len="{$val[width]}"></div>
				<div class="bar_right"></div>
			</div>
			<!--{eval $bcid++;}-->
			<div class="poll_percent">$val[votenum] ($val[percent]%)</div>
			<div class="floatleft">
				<!--{if $allowedvote && !$hasvoted}-->
				<input type="<!--{if $poll[multiple]}-->checkbox<!--{else}-->radio<!--{/if}-->" name="option[]" value="$val[oid]" <!--{if $poll[multiple]}-->onclick="checkSelect(this.checked)"<!--{/if}-->/>
				<!--{/if}-->
			</div>
		</li>
		<!--{/loop}-->
	</ol>
	<div class="poll_submit">
		<!--{if $allowedvote && !$hasvoted}-->
		<input type="hidden" name="votesubmit" value="true" />
		<input type="submit"  class="submit" id="votebutton" name="votebutton" value="Vote" /><br />
		<label><input type="checkbox" name="anonymous" value="1">Hide me</label>
		<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
		<!--{/if}-->
	</div>

	</form>

	<!--{if $poll[summary]}-->
	<div class="poll_summary">
	<h3 class="poll_sumuptitle">{$_SN[$poll[uid]]}Poll Summary</h3>
	<p class="poll_sumup">$poll[summary]</p>
	</div>
	<!--{/if}-->

	<div class="poll_htitle">

	<a href="cp.php?ac=share&type=poll&id=$poll[pid]" id="a_share" onclick="ajaxmenu(event, this.id, 1)" class="a_share">Share</a>
		<div class="r_option">
			<!--{if $_SGLOBAL[supe_uid] == $poll[uid] || checkperm('managepoll')}-->
			<a href="cp.php?ac=topic&op=join&id=$poll[pid]&idtype=pid" id="a_topicjoin_$poll[pid]" onclick="ajaxmenu(event, this.id)">Join Fun</a><span class="pipe">|</span>
			<a href="admincp.php?ac=poll&pid=$poll[pid]" target="_blank">Delete</a><span class="pipe">|</span>
			<!--{/if}-->
			<!--{if checkperm('managepoll')}-->
			<a href="cp.php?ac=poll&pid=$poll[pid]&op=edithot" id="a_hot_$poll[pid]" onclick="ajaxmenu(event, this.id)">Heat</a><span class="pipe">|</span>
			<!--{/if}-->
			<a href="cp.php?ac=common&op=report&idtype=pid&id=$poll[pid]" id="a_report" onclick="ajaxmenu(event, this.id, 1)">Abuse</a><span class="pipe">|</span>
			<a href="cp.php?uid=$poll[uid]&ac=poll&op=invite&pid=$poll[pid]"/>Invite Fiends</a><span class="pipe">|</span>
		</div>
		<div class="custom">
		<a id="newvoter" href="javascript:;" onclick="showVoter('new');">Latest Poll</a>
		<a id="wevoter" href="javascript:;" onclick="showVoter('we');">Voters</a>
		</div>
	</div>
	<div id="showvoter"></div>
	<script type="text/javascript">
		<!--{if !$hasvoted}-->
		var maxSelect = $poll[maxchoice];
		var alreadySelect = 0;
		function checkSelect(sel) {
			if(sel) {
				alreadySelect++;
				if(alreadySelect == maxSelect) {
					var oObj = document.getElementsByName("option[]");
					for(i=0; i < oObj.length; i++) {
						if(!oObj[i].checked) {
							oObj[i].disabled = true;
						}
					}
				}
			} else {
				alreadySelect--;
				if(alreadySelect < maxSelect) {
					var oObj = document.getElementsByName("option[]");
					for(i=0; i < oObj.length; i++) {
						if(oObj[i].disabled) {
							oObj[i].disabled = false;
						}
					}
				}
			}
		}
		<!--{/if}-->

		//Ч²é
		var optionNum = <!--{eval echo count($option)}-->;
		var maxLength = [0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,19];

		var timer;
		var length = 0;
		for(i = 0; i < optionNum; i++) {
			maxLength[i] = $("bar_" + i).getAttribute('len');
		}
		timer = setInterval(function(){
			setLength();
		}, 40);
		function setLength(){
			for (i = 0; i < optionNum; i++) {
				if (length - 1 >= maxLength[i]) {
					$('bar_' + i).style.width = maxLength[i] + "px";
				} else {
					$('bar_' + i).style.width = length + "px";
				}
				length = length + 1;
				if (length > 300) {
					clearInterval(timer);
				}
			}
		}
		function showVoter(filtrate) {
			$('newvoter').className = '';
			$('wevoter').className = '';
			$(filtrate+'voter').className = 'active';
			ajaxget('cp.php?ac=poll&op=get&pid=$poll[pid]&filtrate='+filtrate, 'showvoter');
		}
		showVoter('new')
	</script>
	<!--{if $isfriend}-->
	<div class="comments" id="div_main_content" style="padding: 0 0 20px;">

		<h3 class="feed_header"> <div class="r_option"><span id="comment_replynum">$poll[replynum]</span> Comments</div>comment</h3>
		<div class="page">$multi</div>
		<div class="comments_list" id="comment">
			<!--{if $cid}-->
			<div class="notice">
				Your comment<a href="space.php?uid=$poll[uid]&do=poll&pid=$poll[pid]">View all comments</a>
			</div>
			<!--{/if}-->
			<ul id="comment_ul">
			<!--{loop $list $value}-->
				<!--{template space_comment_li}-->
			<!--{/loop}-->
			</ul>
		</div>
		<div class="page">$multi</div>

		<form id="quickcommentform_{$pid}" name="quickcommentform_{$pid}" action="cp.php?ac=comment" method="post" class="quickpost">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<a href="###" id="face" title="Inser Mood" onclick="showFace(this.id, 'comment_message');return false;"><img src="image/facelist.gif" align="absmiddle" /></a>
						<!--{if $_SGLOBAL['magic']['doodle']}-->
						<a id="a_magic_doodle" href="magic.php?mid=doodle&showid=comment_doodle&target=comment_message" onclick="ajaxmenu(event, this.id, 1)"><img src="image/magic/doodle.small.gif" class="magicicon" />Graffiti Zone</a>
						<!--{/if}-->
						<br />
						<textarea id="comment_message" onkeydown="ctrlEnter(event, 'commentsubmit_btn');" name="message" rows="5" style="width:500px;"></textarea>
					</td>
				</tr>
				<tr>
					<td>
						<input type="hidden" name="refer" value="space.php?uid=$poll[uid]&do=$do&id=$pid" />
						<input type="hidden" name="id" value="$pid">
						<input type="hidden" name="idtype" value="pid">
						<input type="hidden" name="commentsubmit" value="true" />
						<input type="button" id="commentsubmit_btn" name="commentsubmit_btn" class="submit" value="ÆÀÂÛ" onclick="ajaxpost('quickcommentform_{$pid}', 'comment_add')" />
						<span id="__quickcommentform_{$pid}"></span>
					</td>
				</tr>
			</table>
			<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
		</form><br />
	</div>
	<!--{/if}-->

</div>

<div id="sidebar">


	<!--{if $topic}-->
	<div class="affiche">
		<img src="image/app/topic.gif" align="absmiddle">
		<strong>Intereted</strong>£º<a href="space.php?do=topic&topicid=$topic[topicid]">$topic[subject]</a>
	</div>
	<!--{/if}-->

	<div class="sidebox">
		<h2 class="title">Latest Poll</h2>
		<ul class="news_list poll_new">
			<!--{if $newpoll}-->
			<!--{loop $newpoll $key $value}-->
			<li style="height:auto;"><a href="space.php?uid=$value[uid]&do=$do&pid=$value[pid]">$value[subject]</a></li>
			<!--{/loop}-->
			<!--{else}-->
				<li style="height:auto;">No new Poll</li>
			<!--{/if}-->
		</ul>
	</div>

	<div class="sidebox">
		<h2 class="title">Hottest Poll</h2>
		<ul class="news_list poll_new">
			<!--{if $hotpoll}-->
				<!--{loop $hotpoll $key $value}-->
				<li style="height:auto;"><a href="space.php?uid=$value[uid]&do=$do&pid=$value[pid]">$value[subject]</a></li>
				<!--{/loop}-->
			<!--{else}-->
				<li style="height:auto;">There is no popular vote this month</li>
			<!--{/if}-->
		</ul>
	</div>

</div>

<script type="text/javascript">
//²ÊºçìÅ
var elems = selector('div[class~=magicflicker]'); 
for(var i=0; i<elems.length; i++){
	magicColor(elems[i]);
}
</script>

<!--{template footer}-->
Return current item: Uchome and Discuz