How can change the Poll Widget Code like this?
5 posters
Page 1 of 2
Page 1 of 2 • 1, 2
How can change the Poll Widget Code like this?
Hello,
How can I change the Poll widget like this http://prntscr.com/4lf50p ?
How can I change the Poll widget like this http://prntscr.com/4lf50p ?
Last edited by Black-Shadow on October 11th 2014, 1:33 pm; edited 3 times in total
Re: How can change the Poll Widget Code like this?
Do a search for poll codes for widgets and create a customized widget.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: How can change the Poll Widget Code like this?
Hi SLGray,
I have search for it but I didn't find something similar, I have a similar code in templates for the poll posts but and I have try to adapt it on widget but its not working correctly. I must modify the portal templates poll_ballot and poll_result but I don't know how can I do this.
I have search for it but I didn't find something similar, I have a similar code in templates for the poll posts but and I have try to adapt it on widget but its not working correctly. I must modify the portal templates poll_ballot and poll_result but I don't know how can I do this.
Re: How can change the Poll Widget Code like this?
I don't know about that widget, but I know you can show the results by the title attribute. Some CSS for phpbb3 :
- Code:
.module td[title*="%"]:after { content:attr(title) }
Re: How can change the Poll Widget Code like this?
Hello Ange,
I need to modify the portal templates for the widget to be the same with poll posts. My forum version is PunBB.
I need to modify the portal templates for the widget to be the same with poll posts. My forum version is PunBB.
Re: How can change the Poll Widget Code like this?
ok so after seeing a 1000 bumps "lol" i figured i would give this a try
and this is what i came up with only prob is you cant make the options to long or it will mess up
just replace everything in the
Admin panel- Display - Templates - general - viewtopic_poll_result
with
and this is what i came up with only prob is you cant make the options to long or it will mess up
just replace everything in the
Admin panel- Display - Templates - general - viewtopic_poll_result
with
- Code:
<!----Created by: TheTwistedKilla---->
<table style="width: 30%;" align="center" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td>
<div class="mainhead clearfix">
<p class="options">{CLOSE_POLL}</p>
<p class="h2"><img src="http://i884.photobucket.com/albums/ac50/TwistedKilla/Stuff/bargraph_zps7e3a1416.png" alt="Smiley face" height="42" width="42"> <strong>{POLL_QUESTION}</strong></p>
<p class="total" align="right"><strong>Votes : {TOTAL_VOTES}</strong>
</div>
</td></tr><td>
<table>
<tr>
<th> </th>
<th> </th>
<th> </th>
</tr>
<tr>
<td>{poll_option.POLL_OPTION_CAPTION}</td>
<td>{poll_option.POLL_OPTION_PERCENT}</td>
<td>[ {poll_option.POLL_OPTION_RESULT} ]</td>
</tr>
</table>
<dl>
<dt> </dt>
<dd>{L_POLL_HIDE_RESULT}</dd>
</dl>
<div class="frm-buttons">
<!-- BEGIN cancel_vote -->
<em><a href="{U_CANCEL_VOTE}">{L_CANCEL_VOTE}</a></em><br /><br />
<!-- END cancel_vote -->
</div>
</td>
</tbody>
</table>
Re: How can change the Poll Widget Code like this?
Hello,
Is this code for poll widget? I am asking that because you are modifing the template viewtopic_poll result. If this code is for the poll topics I have it, furthermore it has changes on the template viewtopic_poll_ballot. I need to adapt this code for the widget too.
Is this code for poll widget? I am asking that because you are modifing the template viewtopic_poll result. If this code is for the poll topics I have it, furthermore it has changes on the template viewtopic_poll_ballot. I need to adapt this code for the widget too.
Re: How can change the Poll Widget Code like this?
do you have code for a vote widget so i can modify it
Re: How can change the Poll Widget Code like this?
Hello,
Here are the codes of templates:
Template: viewtopic_poll_ballot
Template: viewtopic_poll_result
I think the modifications must be done in portal templates poll_ballot, mod_poll and poll_result.
Here are the codes of templates:
Template: viewtopic_poll_ballot
- Spoiler:
- Code:
<form id="poll_ballot" class="zzPoll" method="post" action="{S_POLL_ACTION}">
<h3>
{POLL_QUESTION} {CLOSE_POLL}
<span class="totalvote">
</span>
</h3>
<ul>
<!-- BEGIN poll_option -->
<li>
<p class="poll-c">
<input id="poll{poll_option.POLL_OPTION_ID}" type="{poll_option.POLL_TYPE_BUTTON}" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}" />
<label for="poll{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label>
</p>
</li>
<!-- END poll_option -->
</ul>
<div class="frm-buttons">
<input type="submit" name="submit" value="Vote" />
<a href="{U_VIEW_RESULTS}" class="view_vote">Δείτε τα αποτελέσματα</a>
{S_HIDDEN_FIELDS}
</div>
</form>
<script type="text/javascript">
//<![CDATA[
function zzPoll(a) {
$("#poll_ballot .totalvote").empty();
$("#poll_ballot").hide().after(a.children().hide().fadeIn());
$("#poll_result .poll_w").attr("data-width", function() {
return $(this).outerWidth()
}).width(0);
$("#poll_result .poll_w").each(function() {
$(this).animate({
width: $(this).data("width")
}, 1500)
})
}
function fixClick() {
$("#poll_ballot .frm-buttons *").hide();
$("#poll_ballot .frm-buttons").css("background", "url(http://i57.servimg.com/u/f57/17/05/17/70/preloa10.gif) no-repeat center transparent")
}
$("#poll_ballot .view_vote").click(function(a) {
a.preventDefault();
fixClick();
history.replaceState(null, null, "?vote=viewresult");
$("#poll_ballot .totalvote").html('[ <span style="color:#0056D8">Ενημέρωση...</span> ]');
$("<div />").load(this.href + " #poll_result", function() {
zzPoll($(this));
$("#poll_result .frm-buttons").html('<a class="pClose" href="javascript:;">Πίσω στην ψηφοφορία</a>');
$("#poll_result .pClose").click(function() {
history.replaceState(null, null, location.pathname);
$("#poll_result").remove();
$("#poll_ballot").fadeIn();
$("#poll_ballot .frm-buttons *").show();
$("#poll_ballot .frm-buttons").removeAttr("style")
})
})
});
$("#poll_ballot").submit(function(a) {
var b = $(this).serializeArray(),
c = $(this).attr("action");
$.ajax({
url: c,
type: "POST",
data: b,
success: function(a, d, b) {
$("<div />").load(location.origin + location.pathname + " #poll_result", function() {
zzPoll($(this))
})
},
error: function(a, b, c) {
console.error(b)
}
});
a.preventDefault();
a.off()
});
$("#poll_ballot input[name='submit']").click(function(a) {
a.preventDefault();
history.replaceState(null, null, location.pathname);
$("#poll_ballot .poll-c input:checked").length ? (fixClick(), $("#poll_ballot .totalvote").html('[ <span style="color:#0056D8">Ενημέρωση...</span> ]'), $("#poll_ballot").submit()) : $("#poll_ballot .totalvote").html('[ <span style="color:red">Δεν έχετε επιλέξει τίποτα!</span> ]')
});
$(window).one("resize", function() {
$(".zzPoll .poll_w").css("width", function() {
return $(this).next().next().text()
})
});
//]]>
</script>
Template: viewtopic_poll_result
- Spoiler:
- Code:
<div id="poll_result" class="zzPoll">
<h3>
{POLL_QUESTION} {CLOSE_POLL}
<span class="totalvote">
[
<strong>{TOTAL_VOTES}</strong> Σύνολο Ψήφων ]
</span>
</h3>
<ul>
<!-- BEGIN poll_option -->
<li>
<p class="poll_t" title="{poll_option.POLL_OPTION_CAPTION}">{poll_option.POLL_OPTION_CAPTION}</p>
<div class="poll_m">
<p class="poll_w" style="width:{poll_option.POLL_OPTION_PERCENT}"></p>
<span class="result">{poll_option.POLL_OPTION_RESULT}</span>
<span class="percent">{poll_option.POLL_OPTION_PERCENT}</span>
</div>
</li>
<!-- END poll_option -->
</ul>
<!-- BEGIN switch_hide_result -->
<dl>
<dt> </dt>
<dd>{L_POLL_HIDE_RESULT}</dd>
</dl>
<!-- END switch_hide_result -->
<div class="frm-buttons">
<!-- BEGIN cancel_vote -->
<a class="c_vote" href="{U_CANCEL_VOTE}">Skip to vote</a>
<!-- END cancel_vote -->
<!-- BEGIN switch_user_logged_out -->
<p>{L_NOT_CONNECTED} {L_LOGIN_REGISTER}</p>
<!-- END switch_user_logged_out -->
</div>
</div>
<script type="text/javascript">
//<![CDATA[
$("#poll_result .poll_w").attr("data-width", function() {
return $(this).outerWidth()
}).width(0);
$(window).on("load scroll", function() {
$("#poll_result").height() + $("#poll_result").offset().top < $(window).scrollTop() + $(window).height() && ($("#poll_result:not(.displayed) .poll_w").each(function() {
$(this).animate({
"width": $(this).data("width")
}, 1500)
}), $("#poll_result").addClass("displayed"))
});
$("#poll_result .frm-buttons:empty").remove();
$(window).one("resize", function() {
$(".zzPoll .poll_w").css("width", function() {
return $(this).next().next().text()
})
});
//]]>
</script>
I think the modifications must be done in portal templates poll_ballot, mod_poll and poll_result.
Last edited by Black-Shadow on October 5th 2014, 1:18 pm; edited 1 time in total
Re: How can change the Poll Widget Code like this?
where are you planning on putting the poll ?? need know about what size its gonna be
Re: How can change the Poll Widget Code like this?
Hello,
I am planning to change the the format of the poll widget http://prntscr.com/4t74pk and make it the same like the poll posts like this http://prntscr.com/4t7523
I am planning to change the the format of the poll widget http://prntscr.com/4t74pk and make it the same like the poll posts like this http://prntscr.com/4t7523
Re: How can change the Poll Widget Code like this?
i know that but are you gonna put it on side of the forum or in middle of portal or what
Re: How can change the Poll Widget Code like this?
ok man this is about as close as i can get hope works for you
just replace everything in "poll_result" template
with
just replace everything in "poll_result" template
with
- Code:
<style type="text/css">
<!--
td { vertical-align: top; }
.leftcolumn { max-width: 20%;}
.centercolumn { width: 50px; }
.rightcolumn { min-width:30%;}
.leftcolumnb { width: 40%;}
.centercolumnb { min-width:70px;}
.rightcolumnb { min-width:30%;}
.tabletoo { width:74%;}
-->
</style>
<div class="mainheadclearfix">
<p class="h2"><img src="http://i884.photobucket.com/albums/ac50/TwistedKilla/Stuff/bargraph_zps7e3a1416.png" width="40" height="40"> <strong>{POLL_QUESTION}</strong></p>
</div>
<table class="tabletoo">
<td class="tabletoo"><p class="total" align="right">[<strong>{TOTAL_VOTES} Vote</strong>]</p></td>
</table>
<div class="maincontent frm">
<fieldset class="frmset">
<!-- BEGIN poll_option -->
<dl>
<table>
<tr>
<th class="leftcolumnb"> </th>
<th class="centercolumnb"> <th>
<th class="rightcolumnb"> <th>
</tr>
<tr>
<td class="leftcolumn">{poll_option.POLL_OPTION_CAPTION}</td>
<td class="centercolumn"><p align="right">{poll_option.POLL_OPTION_PERCENT}</p></td>
<td class="rightcolumn"><p align="right">[{poll_option.POLL_OPTION_RESULT}]</p></td>
</tr>
</table>
</dl>
<!-- END poll_option -->
<!-- BEGIN switch_hide_result -->
<dl>
<dt> </dt>
<dd>{L_POLL_HIDE_RESULT}</dd>
</dl>
<!-- END switch_hide_result -->
</fieldset>
<div class="frm-buttons">
<!-- BEGIN cancel_vote -->
<em><a href="{U_CANCEL_VOTE}">{L_CANCEL_VOTE}</a></em><br /><br />
<!-- END cancel_vote -->
</div>
</div>
Re: How can change the Poll Widget Code like this?
Hello,
What other changes must be done in the mod_poll and and poll_ballot templates?
Its too close to the request poll widget but the buttons etc "Cancel Vote" is missing and there is a strange line in the widget http://prntscr.com/4tc6ul .
What other changes must be done in the mod_poll and and poll_ballot templates?
Its too close to the request poll widget but the buttons etc "Cancel Vote" is missing and there is a strange line in the widget http://prntscr.com/4tc6ul .
Re: How can change the Poll Widget Code like this?
the img isnt working for me but ill prob end up needing a test acct for your site to login to to mod it for ur theme
Re: How can change the Poll Widget Code like this?
Ok I will pm you the testing account details.
Furthermore the poll choice displayed with the old style of voting not with the black bullets http://prntscr.com/4tdltc . I am thinking and the other templates need modification.
Here are the templates if they can help you.
mod_poll template:
poll_ballot template:
poll_result template:
Furthermore the poll choice displayed with the old style of voting not with the black bullets http://prntscr.com/4tdltc . I am thinking and the other templates need modification.
Here are the templates if they can help you.
mod_poll template:
- Spoiler:
- Code:
<div class="module main">
<div class="main-head">
<a name="sondage"></a>
<div class="h3">{L_POLL}</div>
</div>
<div class="main-content">
{POLL_DISPLAY}
</div>
</div>
poll_ballot template:
- Spoiler:
- Code:
<div class="ballot">
<form method="POST" action="{S_POLL_ACTION}">
<h4>{POLL_QUESTION}</h4>
<fieldset class="clearfix">
<!-- BEGIN poll_option -->
<dl>
<dd><input type="{poll_option.POLL_TYPE_BUTTON}" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}" /> </dd>
<dt><label>{poll_option.POLL_OPTION_CAPTION}</label></dt>
</dl>
<div class="clear"></div>
<!-- END poll_option -->
</fieldset>
<fieldset class="center">
<input type="submit" name="submit" value="{L_SUBMIT_VOTE}" class="button1" />
</fieldset>
<p class="center"><b><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></p>
{S_HIDDEN_FIELDS}
</form>
</div>
poll_result template:
- Spoiler:
- Code:
<style type="text/css">
<!--
td { vertical-align: top; }
.leftcolumn { max-width: 20%;}
.centercolumn { width: 50px; }
.rightcolumn { min-width:30%;}
.leftcolumnb { width: 40%;}
.centercolumnb { min-width:70px;}
.rightcolumnb { min-width:30%;}
.tabletoo { width:100%;}
-->
</style>
<div class="mainheadclearfix">
<p class="h2"><img src="http://i83.servimg.com/u/f83/16/58/89/73/combo10.png" width="26" height="26"> <strong>{POLL_QUESTION}</strong></p>
</div>
<table class="tabletoo">
<td class="tabletoo"><p class="total" align="right">[<strong>{TOTAL_VOTES} Ψήφοι</strong>]</p></td>
</table>
<div class="maincontent frm">
<fieldset class="frmset">
<!-- BEGIN poll_option -->
<dl>
<table>
<tr>
<th class="leftcolumnb"> </th>
<th class="centercolumnb"> <th>
<th class="rightcolumnb"> <th>
</tr>
<tr>
<td class="leftcolumn">{poll_option.POLL_OPTION_CAPTION}</td>
<td class="centercolumn"><p align="right">{poll_option.POLL_OPTION_PERCENT}</p></td>
<td class="rightcolumn"><p align="right">[{poll_option.POLL_OPTION_RESULT}]</p></td>
</tr>
</table>
</dl>
<!-- END poll_option -->
<!-- BEGIN switch_hide_result -->
<dl>
<dt> </dt>
<dd>{L_POLL_HIDE_RESULT}</dd>
</dl>
<!-- END switch_hide_result -->
</fieldset>
<div class="frm-buttons">
<!-- BEGIN cancel_vote -->
<em><a href="{U_CANCEL_VOTE}">{L_CANCEL_VOTE}</a></em><br /><br />
<!-- END cancel_vote -->
</div>
</div>
Re: How can change the Poll Widget Code like this?
Hello,
I have been adapt the codes and made the widget.
The problem is solved.
I have been adapt the codes and made the widget.
The problem is solved.
Re: How can change the Poll Widget Code like this?
sorry shadow i got caught up in stuff and forgot about helping you with the other half... glad you got it all figured out tho
Page 1 of 2 • 1, 2
Similar topics
» How to do this Advanced Hiding Widget Code as well as the Recent Topic's Widget Modification
» Shortcuts Widget Code
» How to change a poll font color? (Invision)
» Widget code help please.
» New Widget Code
» Shortcuts Widget Code
» How to change a poll font color? (Invision)
» Widget code help please.
» New Widget Code
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum