Jump to content
Sign in to follow this  
Ian

[Contribution] Pollbooth v2.0

Recommended Posts

I've upgraded the pollbooth code in a number of areas.

 

First pollbooths are now multilingual, in that you can define title and options in the languages your site uses.

 

Second, you can now define polls which are tied to a catalog category. So you could say have a poll which only showed when the customer was in the DVD category.

 

Finally, it is now possible to post comments against a forum. This is pretty alpha code, and the layout could do with some tidying. But it works.

 

http://www.oscommerce.com/community/contributions,20

 

also see the test site at

 

www.zenwarehouse.com/new_cc_gv/catalog/

 

a category poll can be seen by clicking on the DVD category


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

Hi Ian

 

thanks for a great contribution, i've just installed it and have found the following was missing...

 

from your poll.SQL file needed the following line

 

INSERT INTO phesis_poll_config VALUES (6, 'Number of Comments', 'MAX_DISPLAY_NEW_COMMENTS', '10', 'Maximum number of comments to display on the pollbooth page', '2001-12-07 20:20:26', '2001-12-07 20:20:26');

 

I also needed to add the following to cataloglanguagesenglishpollbooth.php

 

define('TEXT_DISPLAY_NUMBER_OF_COMMENTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> comments)');

 

In the polls.php box comments was showing as _COMMENTS which was defined in cataloglanguagesenglishpollbooth.php so i added the following to the top of catalogincludesboxespoll.php

 

  require(DIR_WS_LANGUAGES . $language . '/pollbooth.php');

 

Finally i saw in catalogpollbooth.php that _COMMENT was showing in the 'other polls' listing so i changed on line 249 _COMMENT to _COMMENTS

 

Also i was wondering if you'd got some code to display the poll box on all pages

 

tia :)

Share this post


Link to post
Share on other sites

Elliot

 

Cheers for the heads up on those bugs. I'll update my cvs, although I'll probably wait another day or so before updating the contribution incase anything else turns up.

 

Not sure what you mean by display poll on all pages?

 

If you have added the line to includes/column_right.php

 

include(DIR_WS_BOXES . 'polls.php')

 

this should show the poll on all pages.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

Hi Ian

 

sorry about that, please ignore me i wasn't looking. another thing i did notice was that if you choose not to display comments nothing happens i.e. you still can add comments, comments is still displayed in the pollbooth listing. i did a search for 'SHOW_POLL_COMMENTS' and it doesn't appear in your code

 

hth

Share this post


Link to post
Share on other sites

Elliot,

 

Your right regarding the comments, at the moment they don't consider the configuration settings. Comments should also follow the public/private settings as well. Only they don't :(

 

I'll fix this later tonight.

 

I think it the future I should aslo add some form of moderation in admin to remove bad comments.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

Hi Ian, having moderation in admin is defintely important. for your information i found it better to change the max length of the title field through the adminpolls.php file to 255 on lines 135 and 288

 

maxlength="255"

 

I also added the following to catalogincludeslanguagespollbooth.php

 

define('_ADD_COMMENTS', 'Add Comment');

 

and changed line 192 in catalogpollbooth.php from

 

<tr><td colspan="2" align="center" class="main">[ <a href="<?php echo tep_href_link('pollbooth.php','pollid='.$pollid.'&op=comment','NONSSL')?>"><? echo _COMMENT?></a> | <a href="<?php echo tep_href_link('pollbooth.php','pollid='.$pollid.'&op=vote','NONSSL')?>"><? echo _VOTING?></a> | <a href="<? echo tep_href_link('pollbooth.php','op=list','NONSSL')?>"><?echo _OTHERPOLLS?></a> ]</td></tr>

 

to

 

<tr><td colspan="2" align="center" class="main">[ <a href="<?php echo tep_href_link('pollbooth.php','pollid='.$pollid.'&op=comment','NONSSL')?>"><? echo _ADD_COMMENTS?></a> | <a href="<?php echo tep_href_link('pollbooth.php','pollid='.$pollid.'&op=vote','NONSSL')?>"><? echo _VOTING?></a> | <a href="<? echo tep_href_link('pollbooth.php','op=list','NONSSL')?>"><?echo _OTHERPOLLS?></a> ]</td></tr>

 

that way in whichever language i'm using i can have 'Add comment' instead of comment

 

:)

Share this post


Link to post
Share on other sites

Also - This is a top contribution!!!

 

Just need the admin comments regulation :wink: :wink:

 

Warren

Share this post


Link to post
Share on other sites

Warren,

 

Dead as a doornail. I run the site off my home computer. The hard disk died yesterday (may it rest in peace).

 

Using a backup laptop at the moment. Fortunately everything was nicely backed up, so I should have it up again soon.

 

Tis why I'm still up at 2:40 a.m.

 

 

Also if any one has emailed me today/yesterday I will get back to you as soon as things are fixed.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

What is TEXT_DISPLAY_NUMBER_OF_COMMENTS supposed to be/say (i.e. Number of Comments or something else)?

 

Also, where is it supposed to be defined?


"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Share this post


Link to post
Share on other sites
What is TEXT_DISPLAY_NUMBER_OF_COMMENTS supposed to be/say (i.e. Number of Comments or something else)?

 

Also, where is it supposed to be defined?

 

^^^^^^^^^^ LOOK UP ^^^^^^^^^^

Share this post


Link to post
Share on other sites
What is TEXT_DISPLAY_NUMBER_OF_COMMENTS supposed to be/say (i.e. Number of Comments or something else)?

 

Also, where is it supposed to be defined?

 

^^^^^^^^^^ LOOK UP ^^^^^^^^^^

 

Damn, gone onto a new page, lol!!

Share this post


Link to post
Share on other sites

OK - I have a problem....

 

Whenever I press the ligts in admin for public etc...

 

They dont change or work :S

 

Warren

Share this post


Link to post
Share on other sites
OK - I have a problem....

 

Whenever I press the ligts in admin for public etc...

 

They dont change or work :S

 

Warren

 

Me Too. Is there a patch for this contribution? I find the last post on this to be 5/12/03 from Waza04.

 

Thank you for the help.

Share this post


Link to post
Share on other sites

Ive just installed this version onto a new snapshot and all seems to be ok apart from when you view the results on pollbooth.php i get the error:

 

1064 - You have an error in your SQL syntax near ') as total ' at line 1

 

select count() as total

 

[TEP STOP]

 

any ideas?

Share this post


Link to post
Share on other sites

Yes,

 

The cvs updates after 18/5 included a complete re-write of the split_page_results class. Because of this any contribution using this class will be broken :cry:

 

I haven't had a chance to go thru everything to work out the changes yet.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

just to let you know that in catalog/includes/box/poll.php you have to change $comments to $comment or something else otherwise it is gonna bugger up your comments text field in checkout_process as it also has $comments in its code

 

regards

huw

Share this post


Link to post
Share on other sites

hi ian

 

you wrote:

 

The cvs updates after 18/5 included a complete re-write of the split_page_results class. Because of this any contribution using this class will be broken

 

i am sure you are very busy, but the thing is i like your contribution very much and would like to keep it in my updated shop version which i can't because of the rewrite of the split_page_results class.

 

so i would like to ask you when you might have a look at this class and change your contribution so it also works with the latest 2.2 ms1 snapshot.

 

regards

 

huw

Share this post


Link to post
Share on other sites

it does work fine for me i run 2.2, the only thing i find it the total vote result does not show properly in multi-language, so if you have 3 vote in french and 4 vote in english, it show the right total of 7 but in each language it show only the vote related to that language, i mean has the graphics result, it's very strange, is it supposed to be that way? also yes the comment out still doesn't work, I just install it today, so this info is real fresh, but overall it's pretty good stuff,

 

thanks

Share this post


Link to post
Share on other sites

one more thing, Eliot's fixes work great.

Share this post


Link to post
Share on other sites

So far I really like this contrib and hope it continues to advance (please remember us still using MS1 !!! :-) )

 

I installed the WYSIWYG Editor 1.6 so I edit catalog/includes/languages/english/mainpage.php in order to make updates. I'd like to have the poll in a box in the "body" of the default/mainpage instead of in the column. Anyone able to show me how to do this? I've been trying this all morning and cant get it to work.

 

Many thanks!

Share this post


Link to post
Share on other sites

Hi!!

First: GREAT CONTRIBUTION!!!

 

I?m using MS1 and have a little big problem.

 

When I setup a poll in many languages, I vote in the different languages and the results page doesn?t show the votes done in other language (example: i?m in "spanish" and vote YES . I turn to "english" vote NO and go to the results page and get 2 votes, but the graphic shows only 1 vote, the vote donde in english)

 

Could you help me???


Juan Pablo V?zquez

juan@qodiga.com

Argentina

Share this post


Link to post
Share on other sites

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 'select * from phesis_comments where pollid = '1' and language



select count(select * from phesis_comments where pollid = '1' and language_id = '1') as total

 

Iam getting this error. I have been looking everywhere for the fix but can't find it.

 

Thanks

Share this post


Link to post
Share on other sites

Use this at your own risk

 

For all the peoples with the

 

1064 - You have an error in your SQL syntax near 'select * from phesis_comments where pollid = '2' and language_id = '4') as t' at line 1



select count(select * from phesis_comments where pollid = '2' and language_id = '4') as total 



[TEP STOP]

problem

 

I came up with a solution:

 

Open pollbooth.php in your php-editor, find around line 134

 

$comments_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_NEW_COMMENTS, $comments_query_raw, $comments_numrows);

 

Put // in front of this line of code so it looks like this

//                      $comments_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_NEW_COMMENTS, $comments_query_raw, $comments_numrows);

 

save and upload the file to your website.

 

It works for my site..........................

Share this post


Link to post
Share on other sites

Thanks for the tip, but when I try it, I get this error

 

 

Parse error: parse error in /home/mesztekc/public_html/pollbooth.php on line 135

 

 

Any ideas?

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×