Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Pollbooth v2.0


Ian

Recommended Posts

  • Replies 356
  • Created
  • Last Reply

Top Posters In This Topic

Well,, still pulling hair out,, i got the results working in admin,, just altered some things and moved some things,, ,, now having trouble cleaning it all up,,

when viewing results,, it has the admin page look out of whack,, it takes it down to a text type only page,, not sure how to explain it,, but still working on that,, ill keep ya posted

Regards

Tom

Link to comment
Share on other sites

Maybe someone can offer me some advise,,,

 

I have this working,, by using the pollbooth.php code and making some alterations..

however,, When viewing poll results,,, it shows the results as desired,, in the graph form same as in catalog side,, however,, I can not seem to get the layout with admin panel to fit together,,,,

it changes the admin layout,, by means of turning the boxes and all into text links,, instead of the box style they apear as now

 

any clues where i am missing something to make this blend correctly?

 

Regards

Tom

Link to comment
Share on other sites

Ahh yes,, baby steps,,, lol

 

got it

 

I will go through and figure out what i had to alter and move,, and post it in the contrib as an addon to the excisting contrib,,,

 

I also have one tab or button i may want to create and make that change instead of using one from the catalog,,

 

Maybe later tonight or tomorrow,,, i will have it ready,,

 

Regards

Tom

Link to comment
Share on other sites

Ohh, Tayyy,,, !!

 

I think I got this.

 

Contribution

 

Hope someone files this helpful.

If I left anything out that it needs, just let me know

 

This will allow you to see Poll Results (excluding comments) from the Admin Control instead of going into the Catalog to view them.

 

Regards

Tom

Link to comment
Share on other sites

Just noticed this one, looks great! Wanted to know if the contribution saved results to a user's account???

 

I would like to survey customers with polls and feedback boxes and have the information stored with the customer's account info and viewable by the admin. We have a very strict Privacy Policy that we communicate to our customers, so collecting these "profiles" shouldn't be an ethical problem. What do you think?

Link to comment
Share on other sites

Jashua,

No,, this poll booth actually just saves the reults all in one file,,,

There is a comments section for it where they can leave feedback, but I dont use it,, however I would be sure it does not use the customers account as there were no sql changes to the customers table,, only added poll's tables,,,

Sorry, this one wont do what you want,, If you are good at php and sql ,, you may could alter this one to do what you want,, but I for one wouldnt know where to start with it,,

Sorry dude

 

Regards

Tom

Link to comment
Share on other sites

Thanks, all!

 

Jeff -- I'm sorry you were frustrated with this -- I would have helped, but really don't know how that other stuff works.

 

I needed this for just one poll at a time, possibly the most simple case for this contrib, and once I got that working, I submitted my results. I'm working around the clock trying to get my store (not live yet) running, and need all the cycles I can burn.

 

I hope it helped, sorry I couldn't help more.

 

-jared

Link to comment
Share on other sites

Jared.

 

We thank you for the work you put in to this,,

 

Just hope u dont mind me altering it for the results in the admin side.

 

and as with any mod,, there are times we pull our hair a little,, thats the life of a non programer,, lol

 

anyway,, thanks again for this mod

 

Regards

Tom

Link to comment
Share on other sites

hmm,

something i had not noticed

 

even with allow comments turned off in admin,,

There is still allowing customers to click on comments and add them

 

hmmm

anyone seen this?

 

 

Thanks in advance

 

Tom

Link to comment
Share on other sites

Tom,

 

I had the same problem and couldn't find a way around it, so I got rid of the "comment code" altogether (every instance of it). I decided that I didn't need the extra "feature" of allowing comments on votes made in our polls. We have forums set-up for that sort of thing (comments, etc.) :).

Link to comment
Share on other sites

Tom,

 

After installing the changes you gave for this contribution, here's what I now have in admin/polls.php, beginning around line 417 (changes are in bold type):

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=edit&cID=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=confirm&info=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_POLLBOOTH, 'op=results&pollid=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_results.gif', IMAGE_RESULTS) . '</a>');

 

Here's what I get in the address bar when I click on the results button (I just clicked on the first poll, which is number 3, but it's not taking me to the results for this poll):

 

...shop/admin/FILENAME_POLLBOOTH?op=results&pollid=

 

Any idea why this is happening? Maybe I'm too tired, but I don't see what's wrong here...

 

Oh yeah...If anyone wants it, feel free to steal this for your admin:

 

button_results.gif

 

(Save it in admin/includes/languages/english/images/buttons)

Edited by jwsfun
Link to comment
Share on other sites

RE: The results button (button_results.gif)...

 

Save it as I stated before, make the change in the code in your admin/polls.php(see my previous post) and add a define for it (the button) in your admin/includes/languages/english.php (with the rest of the buttons) as: define('IMAGE_RESULTS', 'Poll Results');

 

That's it...:)

Link to comment
Share on other sites

I am sorry Jeff,

I am not getting emails from any post updates today for some reason and just happened to come back by here,,

 

Are you still having the problem ,, and I would love to get ahold of the results button, but its not showing up on the forum there.

 

Anyway,, just let me know,, either here,, or by one of the instant messengers in the profile.

 

we will figure out what the deal is

Tom

Link to comment
Share on other sites

Tom,

 

After installing the changes you gave for this contribution, here's what I now have in admin/polls.php, beginning around line 417 (changes are in bold type):

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=edit&cID=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=confirm&info=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_POLLBOOTH, 'op=results&pollid=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_results.gif', IMAGE_RESULTS) . '</a>');

 

Here's what I get in the address bar when I click on the results button (I just clicked on the first poll, which is number 3, but it's not taking me to the results for this poll):

 

...shop/admin/FILENAME_POLLBOOTH?op=results&pollid=

 

Any idea why this is happening? Maybe I'm too tired, but I don't see what's wrong here...

 

Oh yeah...If anyone wants it, feel free to steal this for your admin:

 

button_results.gif

 

(Save it in admin/includes/languages/english/images/buttons)

Jeff

 

As far as the line on 417,, 418 in my file,,, though,,, it looks right,, only thing i see that is any different,, is,, the results button that you made.. and i dont see as it should cause the problem,,

 

did you make any other changes,, there is a line number difference from the one i have that i posted.

 

what is on line above,, 416?

 

let me know,,

 

Regards

Tom

Link to comment
Share on other sites

Tom,

 

Here's the whole bit o' code, from lines 405-429:

 

<?php
 $heading=array();
 $contents=array();
 
 $heading[] = array('align' => 'left', 'text' => ' <b>' . $poInfo->pollTitle . '</b> ');

 if ($HTTP_GET_VARS['action'] == 'confirm') {
   $form = '<form action="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action')) . 'action=deleteconfirm', 'NONSSL') . '" method="post"><input type="hidden" name="cID" value="' . $poInfo->pollID . '">'  ."\n";
   $contents[] = array('text' => $form);
   $contents[] = array('align' => 'left', 'text' => TEXT_DELETE_INTRO . '<br> <b>' . $poInfo->name . '</b><br> ');
   $contents[] = array('align' => 'center', 'text' => tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action')), 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 } else {
   $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=edit&cID=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=confirm&info=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_POLLBOOTH, 'op=results&pollid=' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_results.gif', IMAGE_RESULTS) . '</a>');
}
if ($poll_query_numrows==0){
$contents[] = array('align' => 'center', 'text' => 'No polls defined');
}
if ($form) $contents[] = array('text' => '</form>');

   echo '            <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
   echo '            </td>' . "\n";
}
?>

 

I still can't find the rpoblem...:(

Link to comment
Share on other sites

  • 1 month later...

Found a bug, the "Votes" and "_COMMENTS" problem.

 

Find line 85 in polls.php and change it to look like this. You're going to change the _COMMENTS part so the line looks like this:

 

$content .= "<tr class=\"pollFooter\"><td class=\"pollBoxText\"><center>" . $sum . " "._VOTES."</center>\n</td><td class=\"pollBoxText\"><center>" . $comments . " " . "Comments" . "</center>\n</td></tr>";

 

Thats it all one big line FYI.. =)

Link to comment
Share on other sites

Here's how to get rid of the "Comments" function all together.. =)

 

First, in pollbooth.php around line 164 change it to look like this:

 

//$post_details = _COMMENTS_BY . $comment_name . '['. $comments['host_name'] . ']' . _COMMENTS_ON . $comments['date'];
 $post_details = "";

 

Then, in pollbooth.php around 193 change it to look like this:

 

<tr><td colspan="2" align="center" class="main">[ <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>

 

I think that's it =)

Link to comment
Share on other sites

Hi! I have a problem with pollboth 2.1 on Ms2 2.2.

When a custumer votes without select an item (he just click the "vote" button) he has this error message:

 

1062 - Valore duplicato 'ab05dc945a4fea1d3840afa4137ea001' per la chiave 1

 

insert into sessions values ('ab05dc945a4fea1d3840afa4137ea001/warn/_NO_VOTE_SELECTED', '1075458897', 'cart|O:12:\"shoppingcart\":4:{s:8:\"contents\";a:0:{}s:5:\"total\";i:0;s:6:\"weight\";i:0;s:12:\"content_type\";b:0;}language|s:7:\"italian\";languages_id|s:1:\"1\";currency|s:3:\"EUR\";navigation|O:17:\"navigationhistory\":2:{s:4:\"path\";a:1:{i:0;a:4:{s:4:\"page\";s:9:\"index.php\";s:4:\"mode\";s:6:\"NONSSL\";s:3:\"get\";a:1:{s:6:\"osCsid\";s:55:\"ab05dc945a4fea1d3840afa4137ea001/warn/_NO_VOTE_SELECTED\";}s:4:\"post\";a:0:{}}}s:8:\"snapshot\";a:0:{}}')

 

[TEP STOP]

 

 

Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown in line 0

 

I' m looking for help...please...

Link to comment
Share on other sites

I made the error traslation

 

 

1062 - duplicate entry 'ab05dc945a4fea1d3840afa4137ea001' for the key 1

 

insert into sessions values ('ab05dc945a4fea1d3840afa4137ea001/warn/_NO_VOTE_SELECTED', '1075458897', 'cart|O:12:\"shoppingcart\":4:{s:8:\"contents\";a:0:{}s:5:\"total\";i:0;s:6:\"weight\";i:0;s:12:\"content_type\";b:0;}language|s:7:\"italian\";languages_id|s:1:\"1\";currency|s:3:\"EUR\";navigation|O:17:\"navigationhistory\":2:{s:4:\"path\";a:1:{i:0;a:4:{s:4:\"page\";s:9:\"index.php\";s:4:\"mode\";s:6:\"NONSSL\";s:3:\"get\";a:1:{s:6:\"osCsid\";s:55:\"ab05dc945a4fea1d3840afa4137ea001/warn/_NO_VOTE_SELECTED\";}s:4:\"post\";a:0:{}}}s:8:\"snapshot\";a:0:{}}')

 

[TEP STOP]

Link to comment
Share on other sites

  • 2 weeks later...

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...