Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#76 2006-09-11 15:54:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,422
Website GitHub

Re: [archived] pap_xpoll (multiple poll plugin)

Tranquillo, great plugin.

This post might be too specific for the forum so we can take the discussion offline if you prefer (can’t message you direct ‘cos your e-mail link is set private). Contact me if so.

What I’d like to do in essence is make polls country-specific. I have a dropdown on the front page that allows people to change their home country. It refreshes the page and sets a cookie to the two-letter code like en, fr, de etc [It doesn’t necessarily change the language of the page – though it could if I could figure out how to do it in TXP!]

The site is for a TV show, so a poll in one country might be “who should host next week’s show” and in another country at the same time, the poll might be “What did you think of last night’s show?”. I could do with some link between the country code list and the poll id so I can specify to which country a particular poll relates and then only show the latest poll that matches the country code (or none, if no country is selected). Does that make any sense?

I could add a column to one of your tables or create another many-to-many linking table, but I don’t really know how to hack your plugin to be country-aware. When a poll is created there would have to be a dropdown or text box for selection of the country code.

Do you think this is a reasonably easy mod for me to make? Any idea where I might look in your code to make a start? I can code PHP to a certain degree.

Alternatively, what if your new version of the plugin allowed polls to be grouped into categories and there was an attribute to specify the category to show a poll from? I could then make categories for each country code. Can I retrofit this idea into your existing plugin until the new version comes along?

Thanks in advance for any ideas.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#77 2006-12-05 16:34:11

saturnflyer
Member
Registered: 2006-01-22
Posts: 40

Re: [archived] pap_xpoll (multiple poll plugin)

I’m having trouble with the plugin where the results are not being shown. http://tinyurl.com/yz44q3

It works with one poll, but not with my latest. If I disabled the latest and show the previous one, I can click to view the results without voting. But I can’t view the results unless I vote for this latest poll.

Has anyone seen a problem like this?

(I should note that I’m using version 0.2)

Last edited by saturnflyer (2006-12-05 16:36:38)

Offline

#78 2007-01-15 22:34:47

gaza
Member
Registered: 2004-11-22
Posts: 29
Website

Re: [archived] pap_xpoll (multiple poll plugin)

I’ve installed v0.2 twice, and I get this in the extensions tab:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.manet/salchicha/canaldevideos.com/pap_xpoll_lib.php on line 32

No idea what to do, because I’ve deleted the tables in the database, deleted it… and then installed again, and it still won’t work.

Does anyone have the url to the very latest version?

Thanks,

G

Offline

#79 2007-01-16 16:27:36

tranquillo
Archived Plugin Author
Registered: 2005-03-07
Posts: 127
Website

Re: [archived] pap_xpoll (multiple poll plugin)

Did you define PFX in pap_xpoll_install.php correctly? It has to be the same as the Textpattern table prefix (incl. underscore!). If txp was installed without prefix, leave it empty in pap_xpoll_install.php

Last edited by tranquillo (2007-01-16 16:27:49)

Offline

#80 2007-01-16 17:23:54

gaza
Member
Registered: 2004-11-22
Posts: 29
Website

Re: [archived] pap_xpoll (multiple poll plugin)

Thanks! What happened was that since I knew textpattern had a prefix “txp_” I was simulating the same prefix. I just had to leave it blank!

Thanks,

G.

Offline

#81 2007-02-19 10:11:03

mearso
Member
From: Wales
Registered: 2004-03-25
Posts: 18
Website

Re: [archived] pap_xpoll (multiple poll plugin)

I seem to be having a problem with the cookie protection. Any tips on where I would start to diagnose what the problem might be?

I’ve created a new poll with the option to allow a user to vote once a year. But on the page a refresh adds an extra vote.

Offline

#82 2007-02-19 16:52:42

mearso
Member
From: Wales
Registered: 2004-03-25
Posts: 18
Website

Re: [archived] pap_xpoll (multiple poll plugin)

I’ve found the solution to my problem.

It was in the question of the poll. The user had put an apostrophe in the question whcich was being encoded, which in turn meant multiple voting was possible.

remove the apostrophe, and it was all fixed. In case someone else comes across thsi problem.

Offline

#83 2007-04-18 10:37:49

corra24
Member
Registered: 2006-08-19
Posts: 59

Re: [archived] pap_xpoll (multiple poll plugin)

There’s a way to increase the number (default: 10) of option choices for a poll?

Thanks.

Corrado

Last edited by corra24 (2007-04-18 10:38:34)

Offline

#84 2007-05-01 13:06:52

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Re: [archived] pap_xpoll (multiple poll plugin)

does this still exist i can’t seem to download it anywhere


Grrr RRR nnndth grrr Skeek!

Offline

#85 2007-05-25 10:34:26

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: [archived] pap_xpoll (multiple poll plugin)

Seems tranquillo is not caring for the plugin anymore, maybe someone else likes to take it over? anyway her you can download v0.2:
pap_xpoll_v02.zip

Offline

#86 2007-06-04 18:52:52

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [archived] pap_xpoll (multiple poll plugin)

A new maintainer would be quite nice, yes.

Offline

#87 2007-08-14 08:28:26

Anton
Plugin Author
From: Alingsås, Sweden
Registered: 2004-11-16
Posts: 138
Website

Re: [archived] pap_xpoll (multiple poll plugin)

I get an error that wasn’t there just days ago: “tag_error <txp:pap_xpoll_options class=”“ /> -> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 153”. Anyone had this one before?

Offline

#88 2007-08-23 13:43:31

sisushka
Member
Registered: 2007-07-30
Posts: 14

Re: [archived] pap_xpoll (multiple poll plugin)

Yay, great plugin! It works like a charm :) I’m just wondering how to use it for a multi-lingual site without editing the pages. I simply want to eliminate the posibility of ruining a site by my client. Any ideas? :)

Offline

#89 2007-09-23 18:27:13

sisushka
Member
Registered: 2007-07-30
Posts: 14

Re: [archived] pap_xpoll (multiple poll plugin)

I’ve got it finally :) There probably would be a more impressive to make it multi-lingual than the system of mine, but I’m not a programmer :) So, if anybody needs a multilingual poll, just wrap the options into spans and use CSS to display either first language or the second one.

I did it like this:
CSS for Slovak lang.

@/* gal2 */

#gal2 input {
width: auto;
height: auto;
margin: 0 10px 0 0;
}

#gal2 span.en {
display: none;
visibility: hidden;
}

#gal2 span.sk {
display: block;
visibility: none;
}

#gal2 strong span.sk, #gal2 strong {
color: #d7a800;
font-weight: 900;
}

#gal2 span.en strong {
display: none;
visibility: hidden;
}

#gal2 span.clsPerc {
width: auto;
height: 15px;
margin: 0 5px 0 5px;
padding: 0 2px 0 2px;
}@

CSS for English lang.

@/* gal1 */

#gal1 input {
width: auto;
height: auto;
margin: 0 10px 0 0;
}

#gal1 span.sk {
display: none;
visibility: hidden;
}

#gal1 strong span.en, #gal2 strong {
color: #d7a800;
font-weight: 900;
}

#gal1 span.sk strong {
display: none;
visibility: hidden;
}

#gal1 span.clsPerc {
width: auto;
height: 15px;
margin: 0 5px 0 5px;
padding: 0 2px 0 2px;
}
@

(or you could use two separate styles, so the id of #gal1 may remain…)

Text in your poll goes like this:
@
<strong><span class=“sk”>Páči sa Vám naša nová webstránka?</span> <span class=“en”>Do you like our website?</span></strong>

<span class=“sk”>Áno, je veľmi pekná.</span><span class=“en”>Yes, it’s very nice.</span>

<span class=“sk”>Môže byť.</span><span class=“en”>Quite good one.</span>

<span class=“sk”>Nie, nepáči sa mi.</span><span class=“en”>No, I don’t like it.</span>
@

It works fine so far, but I still hope that somebody will code the proper PHP some time :))
Use it only if you don’t mind that both languages will be visible while switching the CSS of.

- S.

Offline

#90 2007-09-23 18:29:55

sisushka
Member
Registered: 2007-07-30
Posts: 14

Re: [archived] pap_xpoll (multiple poll plugin)

I’ve got it finally :) There probably would be a more impressive to make multi-lingual pap_xpoll than the system of mine, but I’m not a programmer :) So, if anybody needs a multilingual poll, just wrap the options into spans with classes and use CSS to display either first language or the second one.

It works fine so far, but I still hope that somebody will code the proper PHP some time :))
Use it only if you don’t mind that both languages will be visible while switching the CSS of.

- S.

Last edited by sisushka (2007-09-23 18:34:26)

Offline

Board footer

Powered by FluxBB