The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How can change the Poll Widget Code like this?

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Solved How can change the Poll Widget Code like this?

Post by Van-Helsing on September 10th 2014, 9:26 am

Hello,
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

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by SLGray on September 10th 2014, 9:31 am

Do a search for poll codes for widgets and create a customized widget.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35641
Reputation : 2374
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 10th 2014, 9:51 am

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.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Ange Tuteur on September 10th 2014, 5:44 pm

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) }

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 11th 2014, 1:38 am

Hello Ange,
I need to modify the portal templates for the widget to be the same with poll posts. My forum version is PunBB.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 14th 2014, 12:22 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 15th 2014, 12:23 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 16th 2014, 12:36 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 17th 2014, 12:40 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 18th 2014, 10:37 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 19th 2014, 5:33 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 21st 2014, 11:43 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 27th 2014, 11:09 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 29th 2014, 12:41 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on September 30th 2014, 1:46 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 3rd 2014, 12:00 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 4th 2014, 12:13 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 4th 2014, 8:51 am

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
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
  <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
  <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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>&nbsp;</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>

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 4th 2014, 8:59 am

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.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 4th 2014, 9:08 am

do you have code for a vote widget so i can modify it

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 4th 2014, 7:26 pm

Hello,
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

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 5th 2014, 3:11 am

where are you planning on putting the poll ?? need know about what size its gonna be

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 5th 2014, 9:45 am

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

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 5th 2014, 2:35 pm

i know that but are you gonna put it on side of the forum or in middle of portal or what

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 5th 2014, 4:20 pm

ok man this is about as close as i can get hope works for you

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>&nbsp;</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>

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 5th 2014, 8:09 pm

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 .

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 5th 2014, 8:31 pm

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

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 5th 2014, 8:45 pm

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:
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}" />&nbsp;</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>&nbsp;</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>

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by Van-Helsing on October 11th 2014, 1:24 pm

Hello,
I have been adapt the codes and made the widget.
The problem is solved.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can change the Poll Widget Code like this?

Post by _Twisted_Mods_ on October 11th 2014, 1:44 pm

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

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum