Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Pollbooth v2.0


Ian

Recommended Posts

Hi Tom,

 

The error is at approximately line 227 in admin/polls.php

 

find:

 

 ? ?$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=list' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>');

replace with:

 

 ? ?$contents[] = array('align' => 'center', 'text' =>
? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('action', 'info', 'x', 'y')) . 'action=edit_config' . $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=list' . $poInfo->pollID, 'NONSSL') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>');

 

For those interested, the offending section is 'action=edit&cID=' and should be 'action=edit_config'

 

Cheers

Simon

 

 

I have made the above change and while I can now get the display poll config to appear any changes I make are not reflected - I want to change the display poll value to 0 but when I enter 0 and click update it stays at 2 and therefore only one poll is ever shown on the site - any ideas anyone??

 

Jay

Link to comment
Share on other sites

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

Top Posters In This Topic

Or is there an easy way to make the resultpage open in a popup window?

 

The resultbar is getting too large as it it now since im using centershop, so i would

like to decrease it's size or as i said make it open in a popupwindow, any tips?

Link to comment
Share on other sites

Does someone have Pollbooth works without erros on the catalog side?

 

If so, could you upload this contribution with valid files. There are too many<table> tags errors on the last update. I didn't succeed until now to clean the code. If I do I'll upload it.

 

Thanks in advance.

OSC2.2

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

I'm working on a site with many contributions and all is fine, except the Pollbooth.......Every category has a poll but only the latest I made is shown. When I go to another category than Kerstmis there is no poll shown...... :(

In admin there no errors and on catalog side also none..... Conclusion (?): it has to be something with the pollcollect.php???

laterssssssss,

Chris

 

P.S. The failure was mentioned a couple of times in the thread but still no solution?

Link to comment
Share on other sites

just played with the setting and a poll is only shown when you assign it to ALL categories.......that's one feature less.......... :-"

Link to comment
Share on other sites

I've tried to rewrite catalog/pollbooth.php file but didn't succeed. Here's what I've done... maybe it will be easier now for a php developper to solve the pb :

 

<?php 
 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/pollbooth.php');
 
 $location = ' : <a href="' . tep_href_link('pollbooth.php', 'op=results', 'NONSSL') . '" class="headerNavigation"> ' . NAVBAR_TITLE_1 . '</a>';
 DEFINE('MAX_DISPLAY_NEW_COMMENTS', '5');
if ($HTTP_GET_VARS['action']=='do_comment') {
 $comment_query_raw = "insert into phesis_comments (pollid, customer_id, name, date, host_name, comment,language_id) values ('" . $HTTP_GET_VARS['pollid'] . "', '" . $customer_id . "', '" . addslashes($HTTP_POST_VARS['comment_name']) . "', now(),'" . $REMOTE_ADDR . "','" . addslashes($HTTP_POST_VARS['comment']) . "','" . $languages_id . "')";
 $comment_query = tep_db_query($comment_query_raw);
 $HTTP_GET_VARS['action'] = '';
 $HTTP_GET_VARS['op'] = 'results';
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- 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"><?php echo HEADING_TITLE; ?></td>
           <td align="right"></td>
         </tr>
       </table></td>
     </tr>
     <tr>
    	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr><?php
if (!isset($HTTP_GET_VARS['op'])) {
       $HTTP_GET_VARS['op']="list";
       }
switch ($HTTP_GET_VARS['op']) {
       case "results":
if (isset($HTTP_GET_VARS['pollid'])) {
$pollid=$HTTP_GET_VARS['pollid'];

} else {
$pollid=1;
 }
$poll_query = tep_db_query("SELECT pollid, timeStamp FROM phesis_poll_desc WHERE pollid='".$pollid."'");
$polls = tep_db_fetch_array($poll_query);
$title_query = tep_db_query("SELECT optionText from phesis_poll_data where pollid='".$pollid."' and voteid='0' and language_id = '" . $languages_id . "'");
$title = tep_db_fetch_array($title_query);
?>

<tr>
    	 <td colspan="2" align="center"><b><?php echo $title['optionText']?></b></td>
     </tr>
<tr>
    	 <td> </td>
     </tr>
<?php
$query="SELECT SUM(optionCount) AS sum FROM phesis_poll_data WHERE pollid='".$pollid."'";
$result=tep_db_query($query);
$polls=tep_db_fetch_array($result);
$sum=$polls['sum'];
for($i = 1; $i <= 12; $i++) {
$query = "SELECT pollid, optiontext, optioncount, voteid FROM phesis_poll_data WHERE (language_id = '" . $languages_id . "') and (pollid='".$pollid."') AND (voteid='".$i."')";
$result=tep_db_query($query);$polls=tep_db_fetch_array($result);
$optiontext=$polls['optiontext'];
$optioncount=$polls['optioncount'];
if ($optiontext) {
?>
<tr><td align="right">
<?php echo $optiontext?></td>
<?php
if ($sum) {
$percent = 100 * $optioncount / $sum;
} else {
$percent = 0;
}
?>
    	 <td align="left">
<?php
$percentInt = (int)$percent * 4 * 1;
$percent2 = (int)$percent;
if ($percent > 0) {
?>
<img src="images/leftbar.gif" height="15" width="1" Alt="<?echo $percent2?> %"><img src="images/mainbar.gif" height="15" width="<?echo $percentInt?>" Alt="<?echo $percent2?> %"><img src="images/rightbar.gif" height="15" width="7" Alt="<?echo $percent2?> %">

<?php
 } else {
?>
<img src="images/leftbar.gif" height="15" width="7" Alt="<? echo $percent2?> %"><img src="images/mainbar.gif" height="15" width="3" Alt="<? echo $percent2?> %"><img src="images/rightbar.gif" height="15" width="7" Alt="<? echo $percent2?> %">

<?php
}


printf(" %.2f%% (%d)", $percent, $optioncount);
?>

<?php
}
}
?>
     
    	 
     <tr><td> </td>
    	 <td> </td>
     </tr><?php
$comments_query_raw = "select * from phesis_comments where pollid = '" . $pollid . "' and language_id = '" . $languages_id . "'";
// $comments_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_NEW_COMMENTS, $comments_query_raw, $comments_numrows);
$comments_query = tep_db_query($comments_query_raw);
if ($comments_numrows > 0) {
?>
<tr>
    	 <td colspan="2"> </td>
     </tr>

<tr>
    	 <td class="pageheading" colspan="2"><?php echo _COMMENTS_POSTED; ?></td>
     </tr>

<?php
}
if (($comments_numrows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<tr>
    	 <td colspan="2"><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
<td class="smallText"><?php echo $comments_split->display_count($comments_numrows, MAX_DISPLAY_NEW_COMMENTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_COMMENTS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE; ?> <?php echo $comments_split->display_links($comments_numrows, MAX_DISPLAY_NEW_COMMENTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
         </table></td>
     </tr>
<?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 . "<u>" . $comment_name . "</u>" . _COMMENTS_ON . $comments['date'] . '<br>';
?>

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

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

      

<?php
}
if (($comments_numrows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<tr>
    	 <td colspan="2"><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $comments_split->display_count($comments_numrows, MAX_DISPLAY_NEW_COMMENTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_COMMENTS); ?></td>

<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE; ?> <?php echo $comments_split->display_links($comments_numrows, MAX_DISPLAY_NEW_COMMENTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
  </tr>
</table></td>
     </tr>
<?php
 }
?>
<tr>
    	 <td colspan="2" align="center"> </td>
     </tr>
<tr>
    	 <td colspan="2" align="center" class="main"><? echo _TOTALVOTES?> = <? echo $sum?></td>
     </tr>
<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>
<?php
break;
case 'comment':
if (isset($HTTP_GET_VARS['pollid'])) {
$pollid=$HTTP_GET_VARS['pollid'];
} else {
$pollid=1;
}
$poll_query = tep_db_query("SELECT pollid, timeStamp FROM phesis_poll_desc WHERE pollid='".$pollid."'");
$polls = tep_db_fetch_array($poll_query);
$title_query = tep_db_query("select optionText from phesis_poll_data where pollid='".$pollid."' and voteid='0' and language_id = '" . $languages_id . "'");
$title = tep_db_fetch_array($title_query);
?>
<?php echo tep_draw_form('poll_comment', tep_href_link('pollbooth.php', 'action=do_comment&pollid=' . $pollid), 'post'); ?>

<tr>
    	 <td colspan="2" align="center"><?echo $title['optionText']?></td>
    	 <?php
if (!$customer_id) {
?>

<tr>
    	 <td><?php echo tep_draw_input_field('comment_name',''); ?> <?php echo _YOURNAME; ?></td>
     </tr>
<?php
}
?>
<tr>
    	 <td><?php echo tep_draw_textarea_field('comment', 'soft', '30', '4', ''); ?></td>
     </tr>
<tr>
    	 <td><?php echo tep_image_submit('button_continue0.gif','TEXT_CONTINUE0'); ?></td>
     </tr>

<?php
$nolink = true;
break;
case 'list':
?>

<tr><td colspan="3"> </td></tr>
<?php
$result=tep_db_query("SELECT pollid, timestamp, voters, poll_type, poll_open FROM phesis_poll_desc ORDER BY timestamp desc");
$row=0;
while ($polls=tep_db_fetch_array($result)) {
 $row++;
 $id=$polls['pollid'];
if (($row / 2) == floor($row / 2)) {
?>
<tr class="Payment-even"><?php
} else {
?>
<tr class="Payment-odd"><?php
}
$title_query = tep_db_query("SELECT optionText from phesis_poll_data where pollid='".$id."' and voteid='0' and language_id = '" . $languages_id . "'");
$title = tep_db_fetch_array($title_query);
$fullresults="<a href=\"".tep_href_link('pollbooth.php','op=results&pollid='.$id,'NONSSL')."\">"._POLLRESULTS."</a>";
$result1 = tep_db_query("SELECT sum(optioncount) AS sum FROM phesis_poll_data WHERE pollid='".$id."'");
$poll_sum=tep_db_fetch_array($result1);
$sum=$poll_sum['sum'];
$query1=tep_db_query("select count(pollid) as comments from phesis_comments where pollid='".$id."' and language_id='".$languages_id."'");

$result1 = tep_db_fetch_array($query1);
$comments = $result1['comments'];
echo("<tr><td align='center' class=\"main\">".$title['optionText']."</td><td align='center' class=\"main\">".$sum." "._VOTES."</td><td align='center' class=\"main\">".$comments." "._COMMENTS."</td><td align='center' class=\"main\">".$fullresults."</td>");
if ($polls['poll_type']=='0') {
echo ("<td align='center' class=\"main\">"._PUBLIC."</td>");
} else {
echo ("<td align='center' class=\"main\">"._PRIVATE."</td>");
}
if ($polls['poll_open']=='0') {
echo ("<td align='center' class=\"main\">"._POLLOPEN."</td>");
} else {
echo ("<td align='center' class=\"main\">"._POLLCLOSED."</td>");
}

echo("</tr>\n");
       }
       break;
       case "vote":
if (isset($HTTP_GET_VARS['pollid'])) {
$pollid=$HTTP_GET_VARS['pollid'];
} else {
$pollid=1;
}
$poll_query=tep_db_query("select voters from phesis_poll_desc where pollid='".$pollid."'");
$poll_details=tep_db_fetch_array($poll_query);
$title_query = tep_db_query("Select optionText from phesis_poll_data where pollid='".$pollid."' and voteid='0' and language_id = '" . $languages_id . "'");
$title = tep_db_fetch_array($title_query);
?><b><center><?php echo $title['optionText']; ?></b><br></center>

<?php
$url = tep_href_link('pollbooth.php','op=results&pollid='.$pollid,'NONSSL');
$content =  "<input type=\"hidden\" name=\"pollid\" value=\"".$pollid."\">\n";
$content .=  "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">\n";
for ($i=1;$i<=12;$i++) {
$query=tep_db_query("select pollid, optiontext, optioncount, voteid from phesis_poll_data where (pollid='".$pollid."') and (voteid=$i) and (language_id='".$languages_id."')");
if ($result=tep_db_fetch_array($query)) {
if ($result['optiontext']) {
$content .= "<center><input type=\"radio\" name=\"voteid\" value=\"" . $i . "\">" . $result['optiontext'] . "<br></center>\n";
  }
 }
}
$content .= "<br><center><input type=\"submit\" value=\""._VOTE."\"></center><br>\n";
$query=tep_db_query("select sum(optioncount) as sum from phesis_poll_data where pollid='".$pollid."'");
               if ($result=tep_db_fetch_array($query)) {
                       $sum=$result['sum'];
               }

$content .= "<center>[ <a href=\"".tep_href_link('pollbooth.php','op=results&pollid=' . $pollid,'NONSSL') . "\">" . _RESULTS . "</a> | <a href=\"".tep_href_link('pollbooth.php','op=list','NONSSL') . "\">" . _OTHERPOLLS . "</a>" . "]" . "</center>";

$content .= "</br><center>" . $sum . " "._VOTES."</center>\n";
?>
<form name="poll" method="post" action="pollcollect.php">
<?php echo $content; ?>
</form>
</tr>

<?php
break;
}
if (!$nolink) {
?>
<tr><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue1.gif', IMAGE_BUTTON_CONTINUE1) . '</a>' . "</center>"; ?>
<?php
}
?>
  </tr> </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I'm really too bad in php coding but I wanted to make things go ahead...Hope this will help some of us to build a correct file.

 

Cheers!

Edited by mujina

OSC2.2

Link to comment
Share on other sites

  • 3 weeks later...

Great Contrib, just needs some bugs worked out as mentioned.

 

To add... Anybody have the problem of after a vote they don't go to the results? Mine seems to stay on the same page (but the vote was counted). And of course pollbooth.php has major probs with the tables and spacing.

 

My Website with poll

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

Forgot to mention (oops!)

 

I fixed the images/rightbar.gif so the bar gets both edges (corners) finished off in the poll meter. The easiest way if your rightbar (corner) is not showing up is to copy mine (right click and lift the image) and place it in your /images (overwrite the corrupt gif). I don't want to pollute the (Contrib) more than already is just for this and I'm sure it will be corrected in the next download version.

 

--KJ

Edited by Top_Speed

define('PROJECTS', 'Something that goes on forever!');

Link to comment
Share on other sites

  • 3 weeks later...

Does this step have to be performed?

I have installed this and get an error if this code is in.

 

The error is undefined function.

 

application_top.php in /catalog/includes

add

 

// set the pollbooth parameters (can be modified through the administration tool)
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from phesis_poll_config');

while ($configuration = tep_db_fetch_array($configuration_query)) {     
    define($configuration['cfgKey'], $configuration['cfgValue']);   
} 
// set the pollbooth parameters (can be modified through the administration tool)

 

Thanks for any feedback.

Link to comment
Share on other sites

  • 2 weeks later...

Hi ! I've installed the Contribution and everything works on the customer side.

 

But in my Admin when I press the Button "Preview" i get this error

 

Warning: main(includes/form_check.js.php): failed to open stream: No such file or directory in /is/htdocs/catalog/admin/pollbooth.php on line 15

 

Warning: main(includes/form_check.js.php): failed to open stream: No such file or directory in /is/htdocs//is/htdocs/catalog/admin/pollbooth.php on line 15

 

Fatal error: main(): Failed opening required 'includes/form_check.js.php' (include_path='./:/usr/share/pear/') in /is/htdocs/catalog/admin/pollbooth.php on line 15

 

well, the line 15 in the admin/pollbooth.php is

 

<?php require('includes/form_check.js.php'); ?>

 

and the form_check.js.php' is at his place in catalog/includes !

 

Anybody knows how to fix this ?

 

Any help appreciate

 

Thank you

 

Roberto

Edited by busonero
Link to comment
Share on other sites

Hi !

 

I've got it. Just copied the form_check.js.php from catalog/includes to

catalog/admin/includes and it works !

 

Sincerely

Roberto

 

 

Hi ! I've installed the Contribution and everything works on the customer side.

 

But in my Admin when I press the Button "Preview" i get this error

well, the line 15 in the  admin/pollbooth.php is

 

<?php require('includes/form_check.js.php'); ?>

 

and the form_check.js.php' is at his place in catalog/includes !

 

Anybody knows how to fix this ?

 

Any help appreciate

 

Thank you

 

Roberto

Link to comment
Share on other sites

Hi, hier I'm again :-)

 

The Contribution works fine.

 

I fixed the problem I had with the catalog/pollboth.php

included in the Update from 19. Oct. 2004 Pollboth

after several tryes, replacing with the catalog/poolboth.php included in the 14 Oct 2004 - pollbooth_v2.1 KorrekturenPoolboth 14.10.04. (Thank you George). I also replaced teh files provided from Lloyd in the 8 Mar 2005 - Fixed!! (Thank you Lloyd)

 

Now the central table doesn't cause any moved colomns, but as can you can see in the Picture:

 

pool1.gif

 

i do not have any margins or better any background to separate the different rows as I wish . You can see here how it should be :

 

pool2.gif

 

Anybody has already fix it or maybe knows how to get the rows lightly marked ?

 

Thank you for your help

 

Sincerely

Roberto

Edited by busonero
Link to comment
Share on other sites

  • 2 weeks later...

Hi, I've installed PollBooth v 2.1.1 and everything seems to be ok except for one thing. When I click vote the page that opens looks like this. Same thin g with results and polls. I've read this topic but coudn't see the solution...I may have missed it. Could you help me? Thanks!

Link to comment
Share on other sites

Hi, I've installed PollBooth v 2.1.1  and everything seems to be ok except for one thing. When I click vote the page that opens looks like this. Same thin g with results and polls. I've read this topic but coudn't see the solution...I may have missed it. Could you help me? Thanks!

http://muccelmic.comdir_ws_admin/images/leftbar.gif

this is a link to one of your images I imagin the site is muccelmic.com

and that somehow you have swaped your files as it is looking for admin. you dont have dir_ws_admin declared in configuration file this could be if your link was intended to go to admin. I think most likely you have swaped pollbooth php and need to upload the right one to the right spot.

Link to comment
Share on other sites

I have installed this contribution and have read the forum, but Im wondering a couple of things... what do I need to add to get the contribution to work with BTS (Basic Template System) ? If anyone has this installed and is using BTS, please let me know what changes you have made to the pollbooth.php or other files!

 

The second question is the multi-language support... The total shows the number of people who have responded to the Poll, but the actual number reported when you view the results is based on the number that have responded in the language that you are using to view the site. Is this by design or is there a way to aggregate the results so that total number of votes and the results match regardless of the language you are using to view the site?

 

Its a great contribution and thanks to Icethenet and the rest of you for all of your hard work in making it better!

Link to comment
Share on other sites

I have installed this contribution and  have read the forum, but Im wondering a couple of things... what do I need to add to get the contribution to work with BTS (Basic Template System) ?  If  anyone has this installed and is using BTS, please let me know what changes you have made to the pollbooth.php or other files!

 

The second question is the multi-language support... The total shows the number of people who have responded to the Poll, but the actual number reported when you view the results is based on the number that have responded in the language that you are using to view the site.  Is this by design or is there a way to aggregate the results so that total number of votes and the results match regardless of the language you are using to view the site?

 

Its a great contribution and thanks to Icethenet and the rest of you for all of your hard work in making it better!

I have not attemted bts yet after the next revision we may see this coming. as far as muliti-lingual I will see if I can find this answer before next release. but no garrentees.

Link to comment
Share on other sites

Hi there,

 

I have worked on it and I think I have solved the space problem, with column and layout and the last things the redirection when you have voted. It had to be tested by you; here are the modifications:

 

First of all in the /catalog/pollcollect.php,

replace:
header("Location: index.php");
by
header("Location: " . tep_href_link('pollbooth.php', 'op=results&pollid=' .$pollid, 'NONSSL') . "");

and replace the complete file /catalog/includes/boxes/poll.php by:

<!-- polls //-->
<?php
 $hide = tep_hide_session_id();

function pollnewest() {
       global $customer_id, $HTTP_GET_VARS;
       if (DISPLAY_POLL_HOW==3) {
               $extra_query=" and pollID='" . DISPLAY_POLL_ID . "'";
               }
       if (!isset($customer_id)) {
               $extra_query.=" and poll_type='0' ";
               }
       if (DISPLAY_POLL_HOW==2) {
               $order = 'voters DESC';
                } else {
               $order = 'timestamp DESC';
               }
       $query= tep_db_query("select pollid, catID FROM phesis_poll_desc where poll_open='0'".$extra_query."and catID != 0 order by ".$order);
       $count=tep_db_num_rows($query);
       $result = tep_db_fetch_array($query);
       $pollid = false;
       if ($count>0) {
          if ($HTTP_GET_VARS['cPath']) $mypath = $HTTP_GET_VARS['cPath'];
          if ($HTTP_GET_VARS['products_id'])$mypath = tep_get_product_path($HTTP_GET_VARS['products_id']);
          if ($mypath) {
            $sub_cat_ids = split("[_]", $mypath);
            for ($i = 0; $i < count($sub_cat_ids); $i++) {
              if ($sub_cat_ids[$i] == $result['catID']) $pollid = $result['pollid'];
            }
          }
       }
       $query= tep_db_query("select pollid, catID FROM phesis_poll_desc where poll_open='0'".$extra_query." and catID = 0 order by ".$order);
       $count=tep_db_num_rows($query);
              if ((!DISPLAY_POLL_HOW==0 || $count==1) && !$pollid) {
               if ($result=tep_db_fetch_array($query)) {
                       $pollid = $result['pollid'];
               }
       } elseif (!$pollid) {
               mt_srand((double) microtime() * 1000000);
               $rand = mt_rand(1,$count);
               for($i=0;$i<$rand;$i++) {
                       $result=tep_db_fetch_array($query);
                       $pollid = $result['pollid'];
                       }
       }
       return $pollid;
}
if (basename($PHP_SELF) !='pollbooth.php') {
$pollid=pollnewest();
if ($pollid) {
?>
 <tr>
       <td>
<?php
       $poll_query=tep_db_query("select voters from phesis_poll_desc where pollid=$pollid and poll_open='0'");
       $poll_details=tep_db_fetch_array($poll_query);
       $title_query = tep_db_query("select optionText from phesis_poll_data where pollid=$pollid and voteid='0' and language_id = '" . $languages_id . "'");
       $title = tep_db_fetch_array($title_query);
       $info_box_contents = array();
         $info_box_contents[] = array('align' => 'center',
                              'text'  => _POLLS
                             );
         new infoBoxHeading($info_box_contents, false, false);
         $url = tep_href_link('pollbooth.php', 'op=results&pollid='.$pollid);
       $content = "<tr><td colspan=\"2\" class=\"main\">" . $title['optionText'] . "</td></tr>";
        $content .=  "<input type=\"hidden\" name=\"pollid\" value=\"".$pollid."\">\n";
         $content .=  "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">\n";
       for ($i=1;$i<=8;$i++) {
             $query=tep_db_query("select pollid, optiontext, optioncount, voteid from phesis_poll_data where (pollid=$pollid) and (voteid=$i) and (language_id=$languages_id)");
             if ($result=tep_db_fetch_array($query)) {
                             if ($result['optiontext']) {
                      $content.= "<tr class=\"pollOptRow\"><td class=\"pollBoxRow\" align=\"center\" valign=\"middle\" width=\"15\"><input type=\"radio\" name=\"voteid\" value=\"".$i."\"></td><td class=\"pollBoxRow\">".$result['optiontext']."</td></tr>";
                      }
                   }
       }
       $content .= "<tr class=\"pollFooter\"><td colspan=\"2\"><center><input type=\"submit\" value=\""._VOTE."\"></center>\n</td></tr>";
       $query=tep_db_query("select sum(optioncount) as sum from phesis_poll_data where pollid=$pollid");
       $query1=tep_db_query("select count(pollid) as comments from phesis_comments where pollid=$pollid and language_id=$languages_id");
       $result1 = tep_db_fetch_array($query1);
       $comments1  = $result1['comments'];
       if ($result=tep_db_fetch_array($query)) {
               $sum=$result['sum'];
       }
       $content .= "<tr class=\"pollFooter\"><td colspan=\"2\" align=\"center\" class=\"pollBoxText\">[ <a href=\"" . tep_href_link('pollbooth.php', 'op=results&pollid=' .$pollid, 'NONSSL')."\">"._RESULTS."</a> | <a href=\"" .tep_href_link('pollbooth.php', 'op=list')."\">"._POLLS."</a> ]</td></tr>";
       $content .= "<tr class=\"pollFooter\"><td align=\"center\" colspan=\"2\"><table><tr><td align=\"center\" class=\"pollBoxText\">" . $sum . " "._VOTES."\n</td><td class=\"pollBoxText\">" . $comments1  . " "._COMMENTS."\n</td></tr></table></td></tr>";
 $content .= "</table>";
$info_box_contents = array();
$info_box_contents[] = array('form' => '<form name="poll" method="post" action="'. tep_href_link('pollcollect.php') .'"><table width="100%"  border="0" cellspacing="0" cellpadding="0">',
                              'align' => 'left',
                              'text'  =>   $content
                             );
new infoBox($info_box_contents);
?>
       </td>
 </tr>
<?php
} elseif (SHOW_NOPOLL==1) {
?>
 <tr>
       <td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
                              'text'  => _NOPOLLS
                           );
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
                             'text'  => _NOPOLLSCONTENT
                            );
new infoBox($info_box_contents);
?>
       </td>
 </tr>
<?php
}
}
?>
<!-- polls-eof //-->

 

And now have a look on this marvelous-without-no-layout-problem....

 

I have mad the modifications on the last version of file from IceTheNet.

 

Enjoy,

 

Marc-Andr?

http://www.leroidelacapote.com

Edited by thedream

osCommerce 2.2 MS2 in 6 languages

TVA Intracomm

Numbers of visitors online

Who's online Enhancement

....

Link to comment
Share on other sites

Hello, i have just installed the latest version of the contrib (2.5 beta) and i found the following problem:

 

when i vote, pollbooth.php loads fine, but it logs me out of the shop. I have tried with public and private polls, same thing on both cases.

 

Everything i have tried works fine, thanks a lot for the great contribution :D

Link to comment
Share on other sites

Hello, i have just installed the latest version of the contrib (2.5 beta) and i found the following problem:

 

when i vote, pollbooth.php loads fine, but it logs me out of the shop. I have tried with public and private polls, same thing on both cases.

 

Everything i have tried works fine, thanks a lot for the great contribution :D

 

thank's I will look into that

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