Jump to content
Sign in to follow this  
Ian

[Contribution] Pollbooth v2.0

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

Share this post


Link to post
Share on other sites

Hello again, just wondering if it is possible to vote on more than one option? Like a checkbox system instead of radio buttons...? The radio button option only seems to let you choose one option instead of a few...

Any ideas?

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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! :)

Share this post


Link to post
Share on other sites

Have just made a fix for the security flaw above, anyone else write something that works, mine might be classed as a 'bodge'?


Thanks for any help/comments.

 

Regards,

 

Lewis Hill

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
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);
   }
                 ?>

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

getting the same error...

 

Someone knows what's wrong?

Because i can't see where it asks for that function

Share this post


Link to post
Share on other sites
getting the same error...

 

Someone knows what's wrong?

Because i can't see where it asks for that function

 

Please explain the error you are getting if not the same

Edited by IceTheNet

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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?

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  

×