Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#31 2018-03-20 12:32:41
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
Thx Bloke for the Idea to look in my php-Version. My php-Version is “5.6.19” –
If I you correct understand, can this plugin only installing on php-version maximum “4.1.2”? Or should it install, because my php-Version is bigger than “4.1.2.”?
How (and where) can set the Plugin for newer php-Versions? Or have I you don’t understand…? (my english is not the best, sorry…)
Offline
#32 2018-03-20 12:50:09
- Bloke
- Developer
- From: Leeds, UK
- Registered: 2006-01-29
- Posts: 8,812
- Website
Re: geo_vote
lythande wrote #310157:
My php-Version is “5.6.19”
Okay, then your installation woes are unlikely to be caused by the plugin’s use of mysql_*
functions. Not sure why it wouldn’t install. When I treid, it did take a few enable/disable cycles before I saw the Vote tab on the menu. No idea why.
can this plugin only installing on php-version maximum “4.1.2”?
Nope, that value refers to the minimum supported MySQL version.
The patch I made just fixes the use of mysqli_*
(with an ‘i’) calls so anyone running newer versions of PHP can play.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#33 2018-03-20 13:02:37
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
Okay, I try out your patch in my one textpatter-plugin.
Edit:
Many many thanks, your Patch works great!!! :-)
I have set my new Lines for vote_subtitles inside the Plugin-PHP and your patch too. Then I go to “Expanses” – “Vote” and there is very quick to install the Tables and was finish in 2 seconds. With my “vote_subtitles”! :-)
Edit 2:
wowww, I have look in my php-database and there is now the right collation utf8_general_ci
! Much thanks for that too!!!
Last edited by lythande (2018-03-20 13:24:21)
Offline
#34 2019-01-19 18:08:20
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
Hi,
now I wish to using the vote-plugin. But each of the option-bars of a question has the same color (Option 1, Option 2 …).
How I can make the class for the option-bar do different for each bar?
Under "function geo_vote_show_results($rs, $message){
:
if (${‘option_title_’.$i} != ‘’) { … //hard coded css for alpha release $out[] = ‘<div class=”’.$option_title_class.’” style=“width:’.$total_votes_percent[$i].’%;height:16px;”></div>’;
doesn’t work it with:
$out[]= ‘<div class=”’.$option_title_class-$1.’”…>
its outputting in the source without '<div class="'.$option_title_class-$1.'">
and only -1">
and then the follow code doesnt work. Its erased <div class="'.$option_title_class
.
Has someone an idea how I can make it for this final:
<span class=“option_title_class”>Ja (100%, 4 Teilnahme)</span><br /><div class=“option_title_class-1” style=“width:100%;height:16px;”>(bar is green)</div>
so e.g. for the bars:
<div class=“option_title_class-1” >(the bar is green with class)</div>
<div class=“option_title_class-2” >(the bar is red with class)</div>
<div class=“option_title_class-3” >(the bar is grey with class)</div>
Last edited by lythande (2019-01-19 18:09:56)
Offline
#35 2019-01-19 20:10:08
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
A second question:
in the vote_title-field I wish to use the questionmarks "title"
. But it outputting with \"title\"
How I can use the "title"
without the backslash \
?
Offline
#36 2019-02-25 22:44:42
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
Hmm, nobody has an idea to help me?
Offline
#37 2019-02-25 23:18:10
- jakob
- Admin
- From: Germany
- Registered: 2005-01-20
- Posts: 3,578
- Website
Re: geo_vote
lythande wrote #316181:
doesn’t work it with:
$out[]= '<div class="'.$option_title_class-$1.'" … >
I’m not familiar with the plugin or its code but you want to alter -
slightly to be .'-'.
between the two variables if you want the classes to be linked via a hyphen:
if (${'option_title_'.$i} != '') {
…
// hard coded css for alpha release
$out[] = '<div class="' . $option_title_class . '-' . $1 . '" style="width: ' . $total_votes_percent[$i] . '%; height: 16px;"></div>';
The second thing with the title sounds like the title is being escaped twice in the code somewhere. Without finding the code, I can’t say for sure.
A way of getting around the problem in the meantime is to use curly quotes in your text, e.g. “title”
or „titel“
. As escaping will only affect the straight quote and straight apostrophe (along with a few other key letters and punctuation symbols), those will be unaffected.
TXP Builders – finely-crafted code, design and txp
Offline
#38 2019-02-27 09:04:00
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
Thanx you lot, Jacob!
I will try out it today evening.
After the last survey I have see another problem. The bars for “yes/no/maybe” are not really correct in the length.
e.g. a question has results:
yes: 62,5%
no: 25%
maybe: 12,5%
But the bars are not correct in the length. Normally the bar for 12,5 should be very short, but is same length how the bar for 62,5% (full wide length from page in the browser). The bar for 25% is the shortest.
Why? I think, the code cant work with the comma-separated %-length?
You can see the survey-results here
Offline
#39 2019-02-27 09:57:50
- jakob
- Admin
- From: Germany
- Registered: 2005-01-20
- Posts: 3,578
- Website
Re: geo_vote
lythande wrote #316772:
The bars for “yes/no/maybe” are not really correct in the length … I think, the code cant work with the comma-separated %-length?
It’s because you have a German ,
instead of a decimal point in the value for width. You need it to output width:22.22%;
and then it works.
TXP Builders – finely-crafted code, design and txp
Offline
#40 2019-03-02 00:32:33
- lythande
- Member
- Registered: 2009-09-08
- Posts: 197
- Website
Re: geo_vote
Okay, I understand this now, thx. But the ,
its from the plugin-code.
How I can changing the ,
to .
in the code?
function geo_vote_show_results($rs, $message){
$total_votes_percent = array_fill(1, 10, 0);
if ($total_votes > 0){
for ($i = 1; $i <= 10; $i++) {
$total_votes_percent[$i] = round((${'option_'.$i}/$total_votes)*100, 2);
}
}
...
for ($i = 1; $i <= 10; $i++){
if (${'option_title_'.$i} != '') {
$out[] = '<span class="'.$option_title_class.'">'.doSpecial(${"option_title_".$i}).' ('.$total_votes_percent[$i].'%, '.${"option_".$i}.' '.geo_vote_gTxt('votes').')</span><br />';
//hard coded css for alpha release
$out[] = '<div style="background:'.$vote_bar_colour.';width:'.$total_votes_percent[$i].'%;height:16px;"></div>';
}
Last edited by lythande (2019-03-02 00:45:37)
Offline