Files
Testing/templates/poll.tpl
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

520 lines
11 KiB
Smarty

{include file='header.tpl'}
{* $Id: poll.tpl 162 2009-04-30 01:43:11Z john $ *}
<div class='page_header'>{lang_sprintf id=2500027 1=$owner->user_displayname 2=$url->url_create("profile", $owner->user_info.user_username) 3=$url->url_create("polls", $owner->user_info.user_username)}</div>
<br />
{* JAVASCRIPT FOR POLLS *}
{lang_javascript ids=2500028,2500034,2500114,2500115}
<script type='text/javascript' src="./include/js/poll.js"></script>
{literal}
<script type='text/javascript'>
<!--
jQuery(document).ready(function() {
loadXMLDoc(1);
{/literal}
{if $poll_object->poll_info.poll_viewonly}
getpolldata({$poll_object->poll_info.poll_id});
{/if}
{literal}
});
//-->
</script>
{/literal}
{* POLL RESULTS TEMPLATE *}
<div id="pollResultTemplate" >
<div class="pollResult">
<div class="pollResultLabel"></div>
<div class="pollResultBar"></div>
<span class="pollResultPercentage"></span>
<span class="pollResultVotes"></span>
</div>
</div>
{* SHOW THIS POLL *}
<div class='poll_view' id="sePoll{$poll_object->poll_info.poll_id}">
{* TITLE AND DESCRIPTION *}
<div class='poll_view_title'>
{$poll_object->poll_info.poll_title|truncate:75:"...":true}
</div>
<div class='poll_view_stats'>
{capture name=totalVotesCode}<span id='poll{$poll_object->poll_info.poll_id}_totalvotes'>{$poll_object->poll_info.poll_totalvotes}</span>{/capture}
{lang_sprintf id=2500029 1=$datetime->cdate("`$setting.setting_dateformat`", $datetime->timezone("`$poll_object->poll_info.poll_datecreated`", $global_timezone))}
{lang_sprintf id=2500028 1=$smarty.capture.totalVotesCode},
{lang_sprintf id=507 1=$total_comments},
{lang_sprintf id=2500122 1=$poll_object->poll_info.poll_views}
</div>
<div style='padding: 5px;'>
{$poll_object->poll_info.poll_desc|choptext:120:"<br>"}
</div>
{* RESULTS *}
<div style='padding: 5px; font-weight: bold; display: none; ' id='poll{$poll_object->poll_info.poll_id}_results'></div>
{* OPTIONS *}
<div style='padding: 5px;' id='poll{$poll_object->poll_info.poll_id}_vote'>
{counter start=-1 print=0}
{section name=options_loop loop=$poll_object->poll_info.poll_options}
<div style='padding: 3px 3px 3px 0px;'>
<table cellpadding='0' cellspacing='0'><tr>
<td>
<input type='radio' name="pollVoteSelect_{$poll_object->poll_info.poll_id}" onchange="change();" class="pollVoteOption" value='{counter}'>
</td>
<td style='font-weight: bold;'>
<label for='poll{$poll_object->poll_info.poll_id}_option{$smarty.section.options_loop.iteration}'>{$poll_object->poll_info.poll_options[options_loop]}</label>
</td>
</tr></table>
</div>
{/section}
</div>
{* VOTE OR VIEW *}
<div id="poll{$poll_object->poll_info.poll_id}_vote_actions" style='padding: 5px; margin-top: 10px;'>
{if $user->level_info.level_poll_allow & 2}<a href="javascript:void(0);" onclick="sendvotepoll();">{lang_print id=2500030}</a> |{/if}
<a href="javascript:void(0);" onclick="getpolldata({$poll_object->poll_info.poll_id});">{lang_print id=2500032}</a> | <span data-toggle='tooltip' title='Report a Problem' class="tiptool" ><a data-toggle="modal" data-target="#myModal" href="user_report.php?return_url={$url->url_current()|escape:url}&user={$owner->user_info.user_username}&item=poll&objectid={$poll_object->poll_info.poll_id}" style="font-size:15px;">&#9873;</a></span>
</div>
{* VOTE OR VIEW *}
<div id="poll{$poll_object->poll_info.poll_id}_results_actions" style='padding: 5px; margin-top: 10px; display:none;'>
<a href="javascript:void(0);" onclick="pollVoteMode({$poll_object->poll_info.poll_id});">{lang_print id=2500087}</a> | <span data-toggle='tooltip' title='Report a Problem' class="tiptool" ><a data-toggle="modal" data-target="#myModal" href="user_report.php?return_url={$url->url_current()|escape:url}&user={$owner->user_info.user_username}&item=poll&objectid={$poll_object->poll_info.poll_id}" style="font-size:15px;">&#9873;</a></span>
</div>
</div>
<br />
<div>
<a href='{$url->url_create("polls", $owner->user_info.user_username)}'>
<!--<img src='./images/icons/back16.gif' border='0' class='icon'>-->
{lang_sprintf id=2500033 1=$owner->user_displayname}
</a>
</div>
<br />
{* DISPLAY POST COMMENT BOX *}
<div style='margin-left: auto; margin-right: auto;'>
{if $poll_object->poll_info.commentsclosed==0}
{if $allowed_to_comment && $blocked!=1}
<div id="profile_{$media_info.media_id}_postcomment"><div class="comment_headline">Comments (<span class="tc" id="totalcomments">{$total_comments|default:0}</span>)</div>
{if $user->user_points > 3}
<form action="#" method="post" onsubmit="submitcommentform(); return updatecount();" id="commentform"><div class="profile_postcomment"><textarea name="comment_body" id="comment_body" cols="25" class="comment_area" style="overflow: hidden; height: 70px;" placeholder="Write Something..."></textarea><div style="margin-top: 5px;">Allowed HTML Tags: b, a, br</div><div style="text-align: right; margin-top: 5px;">
<input type="submit" id="comment_submit" class="button" value="Post Comment" />
<input type="hidden" name="task" id="task" value="comment_post"><input type="hidden" name="type" id="type" value="poll"><input type="hidden" name="iden" id="iden" value="poll_id"><input type="hidden" name="value" id="value" value="{$poll_object->poll_info.poll_id}" /><input type="hidden" name="tab"id="tab" value="polls"><input type="hidden" name="col" id="col" value="poll"><input type="hidden" name="user" id="user" value="{$owner->user_info.user_username}"></div><div id="comment_error" style="color: #FF0000; display: none;"></div></div></form>
{/if}
</div>{/if}
<div id="{$owner->user_info.user_username}_profile_comments" style='margin-left: auto; margin-right: auto;'></div>
{lang_javascript ids=39,155,175,182,183,184,185,187,784,787,829,830,831,832,833,834,835,854,856,891,1025,1026,1032,1034,1071}
{if $blocked!=1}
{literal}
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
<script>
jQuery(function() {
jQuery('#comment_body').autogrow();
});
</script>
<script type="text/javascript" src="/js/jquery.autogrow-textarea.js"></script>
{/literal}{/if}
{else}Comments are closed
{/if}{literal}
<script>
function loadXMLDoc(page)
{/*
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("{/literal}{$owner->user_info.user_username}_profile_comments{literal}").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","{/literal}grabprofilecomments.php?user={$owner->user_info.user_username}&url={$smarty.server.PHP_SELF}{if $smarty.server.QUERY_STRING!=""}?{$smarty.server.QUERY_STRING|urlencode}{/if}&p="+page+"&type=poll&tab=polls&col=poll&focus=poll_id&poll_id={$poll_object->poll_info.poll_id}{literal}",true);
xmlhttp.send();*/
jQuery("#{/literal}{$owner->user_info.user_username}_profile_comments{literal}").load("{/literal}grabprofilecomments.php?user={$owner->user_info.user_username}&url={$smarty.server.PHP_SELF}{if $smarty.server.QUERY_STRING!=""}?{$smarty.server.QUERY_STRING|urlencode}{/if}&p="+page+"&type=poll&tab=polls&col=poll&focus=poll_id&poll_id={$poll_object->poll_info.poll_id}{literal}", function(responseTxt, statusTxt, xhr){
if(xhr.state() == "resolved"){
// alert(statusTxt);
}
else
{
e.preventdefault();
return;
}
});
}
</script>
<script type="text/javascript">
var media_id = 0;
/* jQuery('#ajaxframe').load(function(){
loadXMLDoc(1);
document.getElementById('comment_body').value="";
});
*/
function editComment1(commentID)
{
//var commentContainerElement = $(this.options.type + '_' + this.options.typeID + '_comments');
//var commentElement = commentContainerElement.getElement('profile_comment_body_' + commentID);
var commentElement = document.getElementById('profile_comment_body_' + commentID);
var height = commentElement.offsetHeight + 10;
var commentText = commentElement.innerHTML.replace(/<br>/gi, '\r\n').replace(/>/gi, '&gt;');
var innerHTML = '';
innerHTML += "<form action='misc_js.php' method='post' name='editCommentForm' id='editCommentForm'>";
innerHTML += "<textarea name='comment_edit' id='comment_edit_" + commentID + "' style='height: " + height +" px; width: 100%;' onblur='doCommentEditNew("+commentID+")'>" + commentText + "</textarea>";
innerHTML += "<input type='hidden' name='task' value='comment_edit'>";
innerHTML += "<input type='hidden' name='comment_id' value='" + commentID + "'>";
innerHTML += "<input type='hidden' name='type' value='poll'>";
innerHTML += "<input type='hidden' name='iden' value='poll_id'>";
innerHTML += "<input type='hidden' name='value' value='{/literal}{$poll_object->poll_info.poll_id}{literal}'>";
innerHTML +=
'<input type="hidden" name="tab" value="users">';
innerHTML +=
'<input type="hidden" name="col" value="user">';
/* if( this.options.typeTabParent ) innerHTML +=
'<input type="hidden" name="tab_parent" value="' + this.options.typeTabParent + '">';
if( this.options.typeColParent ) innerHTML +=
'<input type="hidden" name="col_parent" value="' + this.options.typeColParent + '">';
if( this.options.typeChild ) innerHTML +=
'<input type="hidden" name="child" value="1">';
*/
innerHTML += "</form>";
// Inject
commentElement.innerHTML = innerHTML;
textarea_autogrow('comment_edit_' + commentID);
jQuery('#comment_edit_' + commentID).focus();
}
function sendvotepoll()
{
var pollvalue=jQuery('input[name="pollVoteSelect_{/literal}{$poll_object->poll_info.poll_id}{literal}"]:checked').val();
sendpollvote(pollvalue,{/literal}{$poll_object->poll_info.poll_id}{literal});
}
</script>{/literal}
</div>
{include file='footer.tpl'}