Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Pollbooth v2.0


Ian

Recommended Posts

Ok, just came across another post about the "Cannot redeclare pollnewest()" error and discovered that i had the code:

 

require('includes/boxes/polls.php');

 

in column_left.php and column_right.php so i just removed it from one of them and everthing is now fine.

 

Although im still getting my left hand admin menu displaying everything like so i said in the last post:

 

BOX_HEADING_CONFIGURATION etc. and

BOX_TOOLS_BACKUP etc.

 

 

Anyone got any ideas why that would be happening but yet the "poll" option on the menu seems fine...??

 

One more thing... in the actual poll infobox on the site, the comments string is appearing as _COMMENTS. How would i alter that?

 

Thanks! :rolleyes:

Edited by sonictrip.net
Link to comment
Share on other sites

  • Replies 356
  • Created
  • Last Reply

Top Posters In This Topic

I just noticed that changing "radio_button" to "checkbox" on line 72 of the polls.php file changes the buttons to checkboxes.

Is this the proper way to do it though or is there a way of doing it so that you can choose in each poll whether you want to use radio buttons or checkboxes?

Link to comment
Share on other sites

  • 2 weeks later...

A guy im doing some work for wants to have the poll coming up after the new account setup page, or even better would be to have the poll coming up on the same page that it asks for all your account details. Is there a way to do this? Coz if u stick the "include" code on the account details page for the poll, it has 2 submit buttons, how would you go about updating both the account details page and the poll page with the one submit button? Would it be easier just to have the poll code on the following page after the account_details.php page, on the account_details_process.php page? If i went this way, how would i call the polls.php page after the submit button is pressed on the acount_details.php page?

Thanks for any help at all, much appreciated! :)

Link to comment
Share on other sites

  • 2 weeks later...

Im still trying to find a way to gather multiple checkbox data from a poll instead of single option data. There was a bit of code somewhere that when changed from "option" to "checkbox", it displays all the options in a poll as checkboxes but it only takes the info from the first box you tick and discards the rest??? Can anyone help me here please? :unsure:

Link to comment
Share on other sites

The Poll Booth Contribution did not have the standard osCommerce on/off toggle (red light - green light) for two columns in Admin where there should be a toggle. There is a column for Public (Private or Public) and another column for Open (Open or Closed). I have modified the code so that the columns now show the Active / Inactive images, and clicking the images correctly modifies the database. The only problem is that the status images displayed on screen do not change to correctly display the status of the poll. Below is the code from the page for one of the columns. Any help?

 

<?php 
	 if ($polls['poll_type'] == '0') {
	 echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Active', 10, 10) . '  <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_light.gif', 'Set Inactive', 10, 10) . '</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_light.gif', 'Set Active', 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10);
   }
                 ?>

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

IceTheNet this section has not been used for along time I am reactivating it for the community. There seems to be a growing want for this contribution so I am here and ready to help. I cant garantee an answer to all question but I will do my best. if you find a bug. or a solution let me know. :thumbsup:

Link to comment
Share on other sites

QUOTE 

Fatal error: Cannot redeclare pollnewest() (previously declared in C:\home\markettown\www\irishtimes\catalog\includes\boxes\polls.php:6) in C:\home\markettown\www\irishtimes\catalog\includes\boxes\polls.php on line 5

 

this is due to a double entry of the function pollnewest()

you will have to find the second entry and delete it. It cannot be declaired twice

 

my new version fixes this problem:

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

 

this also has a fix for the security problem if any one find's other bug's would be interested in hearing about it.

Link to comment
Share on other sites

  • 2 weeks later...

Hi;

 

While voting for a poll on main page i get the error shown below.What did i made wrong.

 

Please help!

 

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

Link to comment
Share on other sites

Hi;

 

While voting for a poll on main page i get the error shown below.What did i made wrong.

 

Please help!

 

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

 

I to have recieved this error from time to time and I am stumped because there is no physical call to tep_db_connect() twice. I find if go back and comeback it will go away sometime but I am working on this one. I have tested it on windows it works without error but in some version of linux it does show up. When I figgure out what causes this I will post a new version of polls and send you a pm.

Link to comment
Share on other sites

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

 

Hi, I have the same problem, have u found the solution ?

 

Another, I don't want display the numers of votes and I don't want display numers of comment, can you help me guys ?

 

Thank you

Edited by luca75
Link to comment
Share on other sites

Hi, I have the same problem, have u found the solution ?

 

Another, I don't want display the numers of votes and I don't want display numers of comment, can you help me guys ?

 

Thank you

 

 

The solution for who don't want display the numbers of comment and votes in the box is delete or comment this line

 

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

 

in catalog/includes/boxes

Link to comment
Share on other sites

Hi, I have the same problem, have u found the solution ?

 

Another, I don't want display the numers of votes and I don't want display numers of comment, can you help me guys ?

 

Thank you

 

I just installed and am getting the same redeclare error. A search on the forum found

http://www.oscommerce.info/kb/osCommerce/Common_Problems/198

 

Though I double checked and I don't think I have this problem.

Link to comment
Share on other sites

I was getting the same error and I went thru the whole zip file and uploaded all the polls.php pollbooth.php and other files included to the appropriate folder and it worked. Just some steps that were not added to make sure you upload those as well.

Link to comment
Share on other sites

I was getting the same error and I went thru the whole zip file and uploaded all the polls.php pollbooth.php and other files included to the appropriate folder and it worked. Just some steps that were not added to make sure you upload those as well.

 

 

I went through the installation again, loaded all the files again, no joy. When I select a poll option, then "Vote", I get a error screen:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /www/i/islandwest/htdocs/includes/functions/database.php:13) in /www/i/islandwest/htdocs/includes/functions/database.php on line 13

 

which is this snippet:

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

if ($$link) mysql_select_db($database);

 

return $$link;

}

 

The routine being run is /catalog/pollcollect.php. This requires '/includes/application_top.php', which (on my version) on line 61 has:

// make a connection to the database... now

tep_db_connect() or die('Unable to connect to database server!');

 

 

I only have tep_db_connect() declared in two places, one admin, one catalog:

/admin/includes/functions/database.php

/includes/functions/database.php

 

Any tips for solving this would be appreciated.

Link to comment
Share on other sites

very strange .. two things

 

1. When i vote i get blank page on pollcollect.php

2. when i add second language to poll and submit it .. poll is still not shown in second language .. when i check back for these words they are not there .. looks like poll is not allowing to enter second language !?

 

tenx

Link to comment
Share on other sites

Hi;

 

While voting for a poll on main page i get the error shown below.What did i made wrong.

 

Please help!

 

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

 

 

Can anyone found the solution?

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