Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Pollbooth v2.0


Ian

Recommended Posts

I have mad the modifications on the last version of file from IceTheNet.

 

Enjoy,

 

Marc-Andr?

http://www.leroidelacapote.com

are you sure I just added beta 2.5 with some mods

I am not sure what people are looking at as far as to what you have fixed

but if you would be so kind to check out the new beta and make sure your mods are in the new one that would be fantastic. thanks for your work.

IceTheNet

Link to comment
Share on other sites

  • Replies 356
  • Created
  • Last Reply

Top Posters In This Topic

Hi, and thank you IceTheNet for the update.

 

And now have a look on this marvelous-without-no-layout-problem....

 

I have mad the modifications on the last version of file from IceTheNet.

 

Enjoy,

 

Marc-Andr?

The post I have made is for the V2.1.2 version of the Poll Booth Contributions.

 

But I have tried to put it with the 2.5 version and... everything is fine !

(I have made all the IceTheNet changes, but the modifications as in my precedent post, in the /includes/boxes/poll.php, all the others files are from the v2.5 version).

But let me check some more points today, and I will be back with the confirmation.

 

Sincerely yours,

Marc-Andr?

Edited by thedream

osCommerce 2.2 MS2 in 6 languages

TVA Intracomm

Numbers of visitors online

Who's online Enhancement

....

Link to comment
Share on other sites

Her are the modifications to perform a good space and a good layout in the /includes/boxes/poll.php file:

 

Replace on the original:
$content.= "<tr class=\"pollOptRow\"><td class=\"pollBoxRow\"><input type=\"radio\" name=\"voteid\" value=\"".$i."\"></td><td class=\"pollBoxRow\">".$result['optiontext']."</td></tr>";

by 
$content.= "<tr class=\"pollOptRow\"><td class=\"pollBoxRow\" align=\"center\" valign=\"middle\" width=\"15\"><input type=\"radio\" name=\"voteid\" value=\"".$i."\"></td><td class=\"pollBoxRow\">".$result['optiontext']."</td></tr>";

Replace on the original:
$content .= "<tr class=\"pollFooter\"><td colspan=\"2\" class=\"pollBoxText\"><center>[ <a href=\"" . tep_href_link('pollbooth.php', 'op=results&pollid=' .$pollid, 'NONSSL')."\">"._RESULTS."</a> | <a href=\"" .tep_href_link('pollbooth.php', 'op=list')."\">"._POLLS."</a> ]</td></tr>";
       $content .= "<tr class=\"pollFooter\"><td class=\"pollBoxText\"><center>" . $sum . " "._VOTES."</center>\n</td><td class=\"pollBoxText\"><center>" . $comments1  . " "._COMMENTS."</center>\n</td></tr>";

by:
$content .= "<tr class=\"pollFooter\"><td colspan=\"2\" align=\"center\" class=\"pollBoxText\">[ <a href=\"" . tep_href_link('pollbooth.php', 'op=results&pollid=' .$pollid, 'NONSSL')."\">"._RESULTS."</a> | <a href=\"" .tep_href_link('pollbooth.php', 'op=list')."\">"._POLLS."</a> ]</td></tr>";
       $content .= "<tr class=\"pollFooter\"><td align=\"center\" colspan=\"2\"><table><tr><td align=\"center\" class=\"pollBoxText\">" . $sum . " "._VOTES."\n</td><td class=\"pollBoxText\">" . $comments1  . " "._COMMENTS."\n</td></tr></table></td></tr>";
 $content .= "</table>";

Replace on the original:
$info_box_contents[] = array('form' => '<form name="poll" method="post" action="'. tep_href_link('pollcollect.php') .'">',

by:
$info_box_contents[] = array('form' => '<form name="poll" method="post" action="'. tep_href_link('pollcollect.php') .'"><table width="100%"  border="0" cellspacing="0" cellpadding="0">',

 

That's it !

 

What I have corrected is a table - row on 2 colums problems.

I have add a <table> mark and made some pure code correction as the alignement, etc..

 

Enjoy.

 

Marc-Andr?

Edited by thedream

osCommerce 2.2 MS2 in 6 languages

TVA Intracomm

Numbers of visitors online

Who's online Enhancement

....

Link to comment
Share on other sites

Im running this mod on my site, its great and I really like seeing the response from the visitors... but I can't seem to get rid of the _comments at the bottom of the poll. I see there fixes for various versions of the mod, but Im not sure which one applies to version 2.0? How can I get rid of the _comments so it displays properly?

 

Thanks in advance for the help and thanks for an awesome contrib!

Link to comment
Share on other sites

Im running this mod on my site, its great and I really like seeing the response from the visitors... but I can't seem to get rid of the _comments at the bottom of the poll.  I see there fixes for various versions of the mod, but Im not sure which one applies to version 2.0?  How can I get rid of the _comments so it displays properly?

 

Thanks in advance for the help and thanks for an awesome contrib!

 

Try looking back in the install.txt, the step for defining that text was apparently skipped or left our, not uploaded with defined statement.

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

Hi there,

 

you have to make changes in the following file (for each language!):

 

/catalogue/includes/languages/french or whatever you have/pollbooth.php

 

and translate the folowing:

 

....

define('_COMMENT', 'your translation');

define('_COMMENTS', 'your translation...');

....

 

 

Enjoy

 

Marc-Andr?

osCommerce 2.2 MS2 in 6 languages

TVA Intracomm

Numbers of visitors online

Who's online Enhancement

....

Link to comment
Share on other sites

Hi there,

 

you have to make changes in the following file (for each language!):

 

/catalogue/includes/languages/french or whatever you have/pollbooth.php

 

and translate the folowing:

 

....

define('_COMMENT', 'your translation');

define('_COMMENTS', 'your translation...');

....

Enjoy

 

Marc-Andr?

 

 

Just to follow up.. you are absolutely right, in my case I had to go to

/catalogue/includes/languages/english and add the line

 

define('_COMMENTS','Comments');

 

as the line was not a part of the installation for the version of the contribution I downloaded. (which is what Marc Andr? and other posters are saying, but I wanted to clarify for future users of this cool contrib!)

 

Thanks to all for the help !

Link to comment
Share on other sites

Hi... sorry for my bad english...

 

I just installed "pollbooth_v2.5_beta" and made a couple of test polls. Them, when i make the vote, only gets the following message (under pollcollect.php, i think)

 

1064 - You have an error in your SQL syntax near '.20.92, 1117065162 , 2)' at line 1

INSERT INTO phesis_poll_check (ip, time, pollid) VALUES (201.242.20.92, 1117065162 , 2)

[TEP STOP]

 

I know that there is my ip address (don't know if i should cover it), but... my priority is another one: make that this usuful contribution works...

 

Thanks in advance,

 

Jos? G.

Link to comment
Share on other sites

thank's I will look into that

 

I tried something different. I was testing the contribution on a shop that i had on localhost and i noticed that the Session ID appeared on the URL on all pages i visited, but when i clicked on "VOTE" the session ID was not on the URL of pollbooth.php.

 

Then i tried uploading the contribution to my online version of the shop, where none of the URL's show the Session ID and it worked, after hitting "VOTE" it loads pollbooth.php and i'm still logged in. Perfect :D Still i would like to know why it doesn't work on localhost, or maybe there's something i need to change on my local configuration, any ideas?

 

So, since that was working i decided to change the poll configuration on the admin to not allow more than one vote per customer but then after hitting "VOTE" i get the same error that E-nercia reports

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.###.##, 1117126319 , 1)' at line 1

INSERT INTO phesis_poll_check (ip, time, pollid) VALUES (###.##.###.##, 1117126319 , 1)

[TEP STOP]

 

I have another question, shouldn't the restriction of 1 vote per customer be validated per customer_id and not per ip? Cause that's what i understand this is doing. But if that person connects with another IP, then they can vote again, am i right?

 

Ok then, thanks for any help

Link to comment
Share on other sites

I tried something different. I was testing the contribution on a shop that i had on localhost and i noticed that the Session ID appeared on the URL on all pages i visited, but when i clicked on "VOTE" the session ID was not on the URL of pollbooth.php.

 

Then i tried uploading the contribution to my online version of the shop, where none of the URL's show the Session ID and it worked, after hitting "VOTE" it loads pollbooth.php and i'm still logged in. Perfect :D Still i would like to know why it doesn't work on localhost, or maybe there's something i need to change on my local configuration, any ideas?

 

So, since that was working i decided to change the poll configuration on the admin to not allow more than one vote per customer but then after hitting "VOTE" i get the same error that E-nercia reports

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.###.##, 1117126319 , 1)' at line 1

INSERT INTO phesis_poll_check (ip, time, pollid) VALUES (###.##.###.##, 1117126319 , 1)

[TEP STOP]

 

I have another question, shouldn't the restriction of 1 vote per customer be validated per customer_id and not per ip? Cause that's what i understand this is doing. But if that person connects with another IP, then they can vote again, am i right?

 

Ok then, thanks for any help

 

 

Yes that sounds like a solution I think the problem is with the IP the peroids may cause some databases to bark. I will attempt to change that to user instead of IP in future versions in the mean time you can experiment by using quotes or find a way to remove the periods from the IP maybe use preg replace. I will work on it if I find a solution I will post the changes thank you for your input

Link to comment
Share on other sites

  • 2 weeks later...

New error:

 

Parse error: parse error, unexpected T_STRING in /home/telecom/public_html/V5/includes/languages/espanol/pollbooth.php on line 33

Link to comment
Share on other sites

Hello,

 

I just download and installed pollbooth_v2.1_1 security fix. Thanks for this contribution which sound very usefull except that it doesn' t work on my website.

 

After voting, I've got the message on pollcollect.php:

 

1064 - You have an error in your SQL syntax near '.152.88, 1118152117 , 2)' at line 1

 

INSERT INTO phesis_poll_check (ip, time, pollID) VALUES (83.202.152.88, 1118152117 , 2)

 

[TEP STOP]

 

Many thanks for help...

 

Valerie

Link to comment
Share on other sites

Hi! I've installed this contrib a while ago and usually it works ok. But it happens sometimes, when you first tr to vote to get this error:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/muccelmi/public_html/muccelmic/includes/functions/database.php:13) in /home/muccelmi/public_html/muccelmic/includes/functions/database.php on line 13

 

Although this doesn't always appear, it may discourage clients to vote (they don't know they should try again). So, I need an advice on what to do. Thanks!

Link to comment
Share on other sites

Hello,

 

I just download and installed pollbooth_v2.1_1 security fix. Thanks for this contribution which sound very usefull except that it doesn' t work on my website.

 

After voting, I've got the message on pollcollect.php:

 

1064 - You have an error in your SQL syntax near '.152.88, 1118152117 , 2)' at line 1

 

INSERT INTO phesis_poll_check (ip, time, pollID) VALUES (83.202.152.88, 1118152117 , 2)

 

[TEP STOP]

 

Many thanks for help...

 

Valerie

your problem would be with value time a space at the end of your time value is not accepted. I will look into this one what is the os of the server and mysql version and php version. this may help.

Link to comment
Share on other sites

Hello,

 

I just download and installed pollbooth_v2.1_1 security fix. Thanks for this contribution which sound very usefull except that it doesn' t work on my website.

 

After voting, I've got the message on pollcollect.php:

 

1064 - You have an error in your SQL syntax near '.152.88, 1118152117 , 2)' at line 1

 

INSERT INTO phesis_poll_check (ip, time, pollID) VALUES (83.202.152.88, 1118152117 , 2)

 

[TEP STOP]

 

Many thanks for help...

 

Valerie

 

Think I found it

try this

in pollcollect.php line 30 replace with this line:

tep_db_query("INSERT INTO phesis_poll_check (ip, time, pollid) VALUES (".$ip.", ".$ctime.", ".$pollid.")");

Link to comment
Share on other sites

Hi! I've installed this contrib a while ago and usually it works ok. But it happens sometimes, when you first tr to vote to get this error:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/muccelmi/public_html/muccelmic/includes/functions/database.php:13) in /home/muccelmi/public_html/muccelmic/includes/functions/database.php on line 13

 

Although this doesn't always appear, it may discourage clients to vote (they don't know they should try again). So, I need an advice on what to do. Thanks!

get the newer one I believe I have found and fixed this in the newset version

Link to comment
Share on other sites

Think I found it

try this

in pollcollect.php line 30 replace with this line:

tep_db_query("INSERT INTO phesis_poll_check (ip, time, pollid) VALUES (".$ip.", ".$ctime.", ".$pollid.")");

 

 

 

This work for me!!Now the last error has gone, but I have this another:

 

 

Parse error: parse error, unexpected T_STRING in /home/telecom/public_html/V5/includes/languages/espanol/pollbooth.php on line 33

 

 

Anybody knows what's the matter?

 

 

Thanks :)

Link to comment
Share on other sites

This work for me!!Now the last error has gone, but I have this another:

Parse error: parse error, unexpected T_STRING in /home/telecom/public_html/V5/includes/languages/espanol/pollbooth.php on line 33

Anybody knows what's the matter?

Thanks  :)

 

 

Sorry, it didn't work for me..I have to turn Allow multiple votes option ON

Link to comment
Share on other sites

I tried something and it works now !

 

in poolcollect.php, line 34,

 

you find

tep_db_query("INSERT INTO phesis_poll_check (ip, time, pollID) VALUES (".$ip"', ".$ctime." , ".$pollid.")");

 

replace by

tep_db_query("INSERT INTO phesis_poll_check (ip, time, pollID) VALUES ('".$ip."', '".$ctime."' , '".$pollid."')");

 

 

Valerie

Link to comment
Share on other sites

This work for me!!Now the last error has gone, but I have this another:

Parse error: parse error, unexpected T_STRING in /home/telecom/public_html/V5/includes/languages/espanol/pollbooth.php on line 33

Anybody knows what's the matter?

Thanks  :)

I see you are using spanish language I would say check and make sure the files are complete for spanish language probably missing a file. I don't know how this thing operates under different languages. try switching to english and see if it works. if it dose take the english language files put them in spanish language files and translate. be carefull about using odd charachters such as ' or , these can make a mess of the code. if you need to use don't forget to escape the characters IE: '\s

Link to comment
Share on other sites

I tried something and it works now !

 

in poolcollect.php,  line 34,

 

you find

                      tep_db_query("INSERT INTO phesis_poll_check (ip, time, pollID) VALUES (".$ip"', ".$ctime." , ".$pollid.")");

 

replace by

                      tep_db_query("INSERT INTO phesis_poll_check (ip, time, pollID) VALUES ('".$ip."', '".$ctime."' , '".$pollid."')");

Valerie

 

This worked for me, thanks a lot. Still i think that the check should be done by customer_id in the case of private polls. In the case of public polls, i don't think a check is needed, but i'm not sure.

 

But thanks a lot for the solution, i don't know php/MySQL, so i depend a lot on the experts on this great community :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...