Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Pollbooth v2.0


Ian

Recommended Posts

  • 3 weeks later...
  • Replies 356
  • Created
  • Last Reply

Top Posters In This Topic

Don't know if anyone knows this but here....very easy to fix!!!!!

 

Find this snippet of code in pollbooth.php...........

-------------------------------------------------------------------------------

}

while ($comments = tep_db_fetch_array($comments_query)) {

if ($comments['customer_id'] != '0') {

$name_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '". $comments['customer_id'] . "'");

$name = tep_db_fetch_array($name_query);

$comment_name = $name['customers_firstname'] . " " . $name['customers_lastname'];

} else {

$comment_name = $comments['name'];

}

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

?>

 

<tr><td class="main" colspan="2"><b><?php echo $post_details; ?></b></td></tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>

<tr><td class="main" colspan="2"><?php echo htmlspecialchars($comments['comment']); ?></td></tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>

 

 

 

 

<?php

}

---------------------------------------------------------

and change this line

<?php echo htmlspecialchars($comments['comment']); ?>

 

to:

 

<?php echo htmlspecialchars($comments['COMMENT']); ?>

 

and it works....this fix worked great for me!

 

DJ :twisted:

I think it works now!!!!..oh! no it don't !

Link to comment
Share on other sites

i got a problem too. i get a error on the "Polls Configuration" link in my admin menue:

Fatal error: Call to undefined function: tep_array_merge() in /usr/local/apache/www/web3/html/catalog/admin/polls.php on line 185

dont now what this error means, but i checked my files more than 1 time and it looks ok. the error seems to be in my poll.php or somewhere else...

someone got a solution for my bug ?

tx

and regards

slicks

Link to comment
Share on other sites

sorry forgot to post wich version i`m using: oscommercems2

also ich post thist time the line where te bug is going out:

      $cfgInfo_array = tep_array_merge($configuration, $cfg_extra);

maybe this can help to fix my problem :/

i installed this poll now 5 times, every time now the same error.

regards

slicks

Link to comment
Share on other sites

When I go to the Polls Configuration the page doen not do anythin it stops half way through the process and does not display a error but the body section of the page looks like the following

 

<!-- body_text //-->

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"> Poll Manager </td>

           <td align="right"> <img src="images/pixel_trans.gif" border="0" alt="" width="57" height="40"> </td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

             <tr class="dataTableHeadingRow">

               <td class="dataTableHeadingContent"> Title </td>

               <td class="dataTableHeadingContent"> Value </td>

               <td class="dataTableHeadingContent" align="center"> Action </td>

             </tr>

 

and it just stop the page code at that point.

 

can anyone tell me how to fix this I am on 2.2 MS2

Link to comment
Share on other sites

hy olby and greetings to denmark :wink: can you be a little more specific ? u mean i need to put all tep_ away from any messages in all .php files from the poll ? and whats with the statments i edit in my other files like aplication_top and any other to edit files ?

tx for help and regards

slicks

Link to comment
Share on other sites

Hi Slicks.

 

and greetings to Norway ?

 

The name of that function has changed from:

tep_array_merge()

to

array_merge()

So older contributions might use the outdated name, and you have to rename the calls where ever they are.

Best Regards

olby

Link to comment
Share on other sites

this hack is a disaster...

i take all the tep_ away from the .php`s and now there are more bugs than before :roll:

Fatal error: Call to undefined function: hide_session_id() in /usr/local/apache/www/web3/html/catalog/includes/boxes/polls.php on line 3

this error in catalog

Fatal error: Call to undefined function: href_link() in /usr/local/apache/www/web3/html/catalog/admin/includes/boxes/polls.php on line 10

this one in admin

i think i poll that poll out :twisted:

slicks

Link to comment
Share on other sites

Hi Slicks.

 

Hold on a sec

 

Theres many functions included in the osCommerce and one - only one - of these is now called array_merge instead of tep_array_merge.

 

Theres still many functions left, that starts with tep_

 

So removing all tep_ will leave you with something that cannot work.

Best Regards

olby

Link to comment
Share on other sites

Hi Slicks.

 

Hold on a sec

 

Theres many functions included in the osCommerce and one - only one - of these is now called array_merge instead of tep_array_merge.

 

Theres still many functions left, that starts with tep_

 

So removing all tep_ will leave you with something that cannot work.

to late to hold on :wink: i take all tep_ away from my .php`s ..

 

later i checked in other php files from catalog that they using tep_ too and they working fine.

so i take the zip from the poll end take a new search for tep_array_merge, but i cant find any file thats include tep_array_merge. did you know wich file contains that string ? or can you mail me your working files ?

got to say much tx again for helping me with my nooby work here :/

regards

slicks

Link to comment
Share on other sites

ok, i found that file. it is the poll.php in admin that contains the wrong string. ich changed it and most things seems to be ok.

but i get some errors if i give a vote in poll:

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



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



[TEP STOP]

maybe some wrong in my language setup. ? use only german language (if you read my english here, you know why ;)

 

i get some other errors too if i make a second vote:

 

1054 - Unknown column 'warn' in 'where clause'



select optionText from phesis_poll_data where pollid=2&warn=_ALREADY_VOTED and voteid='0' and language_id = '2'



[TEP STOP]

maybe someone knows this bug and know how to fix it. this is a really hard hack... 4 days to make it work ... and it doesent work :roll:

anyway mucho gracias that i bored you so long time :D

regards

slicks

Link to comment
Share on other sites

  • 2 weeks later...

With all the help form this thread i managed to get the poll thing working on my MS2 install.

 

Why do people post these things as if they were 4 MS2 and have so many bugs?

 

Also it would be of great help (4 all of us) if someone posted the updated language files. If someone needs i can post the updated pollbooth.php and admin/polls.php that are now (many thanks to the posters) MS2 compliant and the whole thing seems to b working.

 

Otherwise a great contrib. :D

 

Saluti

Link to comment
Share on other sites

I have a problem with admin/polls on the bouton private/public and open /closed (red and green)

 

When i click on the bouton, he stay always green but the script is correct. We can open or close a sondage for example but the button are always green.

 

line 367

// ############## pb couleur #########################
	 if ($polls['poll_type']==1) {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_type&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', _ALT_PUBLIC) . '</a>';
   } else {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_type&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', _ALT_PRIVATE) . '</a>';
   }
                 ?>
                </td>
               <td class="dataTableContent" align="center"> 
	 <?php
   if ($polls['poll_open']==1) {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_open&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', _ALT_REOPEN) . '</a>';
   } else {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_open&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', _ALT_CLOSE) . '</a>';
   }

// ################### fin ########################

 

if you change :

 if ($polls['poll_type']==1){

by

if ($polls['poll_type']==0) {

you have a red button.

 

i think they have bug on variable but i don't know where !!!!!


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

I have installed the Polls contributiona(Nice mod Ian) and I have been able to tweak it pretty good to do what I want, but one thing I cant do (probably cause I have no idea what I am doing) is get it so when you vote, it just submits the vote but does not go to a new page (the comments page).

 

Can anyone help me?

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

  • 4 weeks later...

I just installed this contrib and it looks good but it's buggy as hell. I am using MS2.2 and when I select a poll option I get this:

 

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

 

[TEP STOP]

 

Is there a final version of this contrib I can download and it works... ?

Dan

Link to comment
Share on other sites

I am using 2.2 and integrated this today, nicely done, I am hopeful that someone may have an idea why the comments won't display. I am also curious if anyone could give me an idea how I can get more than 8 option fields?

 

Thanks

romanus

Link to comment
Share on other sites

There is a fix to the comments it is in this thread somthing about changing case in pollbooth.php

 

htmlspecialchars($comments['comment'])

 

should be

 

htmlspecialchars($comments['COMMENT'])

 

That fixedd the comment thing

romanus

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