[geeklog-cvs] Geeklog-1.x/plugins/polls functions.inc,1.90,1.91

Dirk Haun dhaun at qs1489.pair.com
Sun Aug 17 04:42:01 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/polls
In directory qs1489.pair.com:/tmp/cvs-serv62447/plugins/polls

Modified Files:
	functions.inc 
Log Message:
For multi-question polls, make the "Vote" button read "Start Poll" in the polls block (bug #0000633)


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/polls/functions.inc,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** functions.inc	16 Aug 2008 19:43:58 -0000	1.90
--- functions.inc	17 Aug 2008 08:41:59 -0000	1.91
***************
*** 457,461 ****
  */
  
! function POLLS_pollVote($pid, $showall=true)
  {
      global $_CONF, $_TABLES, $LANG_POLLS, $LANG01, $_USER, $LANG25, $_IMAGE_TYPE;
--- 457,461 ----
  */
  
! function POLLS_pollVote($pid, $showall = true)
  {
      global $_CONF, $_TABLES, $LANG_POLLS, $LANG01, $_USER, $LANG25, $_IMAGE_TYPE;
***************
*** 467,473 ****
      $ntopics = DB_numRows($topic);
  
!     if($ntopics == 0 ) {
          return $retval;
      }
      $P = DB_fetchArray($topic);
      if ((!isset($_COOKIE[$pid]) && !POLLS_ipAlreadyVoted($pid)) or ($P['is_open'] == 1)) {
--- 467,474 ----
      $ntopics = DB_numRows($topic);
  
!     if ($ntopics == 0) {
          return $retval;
      }
+ 
      $P = DB_fetchArray($topic);
      if ((!isset($_COOKIE[$pid]) && !POLLS_ipAlreadyVoted($pid)) or ($P['is_open'] == 1)) {
***************
*** 480,489 ****
              $nquestions = DB_numRows($questions );
  
!             if($nquestions > 0 ) {
!                 $poll = new Template($_CONF['path'] . 'plugins/polls/templates/');
!                 $poll->set_file(array('panswer' => 'pollanswer.thtml',
!                                         'block' => 'pollblock.thtml',
!                                         'pquestions' => 'pollquestions.thtml',
!                                         'comments' => 'pollcomments.thtml'));
                  $poll->set_var('xhtml', XHTML);
                  $poll->set_var('site_url', $_CONF['site_url']);
--- 481,491 ----
              $nquestions = DB_numRows($questions );
  
!             if ($nquestions > 0) {
!                 $poll = new Template($_CONF['path']
!                                      . 'plugins/polls/templates/');
!                 $poll->set_file(array('panswer'    => 'pollanswer.thtml',
!                                       'block'      => 'pollblock.thtml',
!                                       'pquestions' => 'pollquestions.thtml',
!                                       'comments'   => 'pollcomments.thtml'));
                  $poll->set_var('xhtml', XHTML);
                  $poll->set_var('site_url', $_CONF['site_url']);
***************
*** 494,499 ****
                  $poll->set_var('num_votes', COM_numberFormat($P['voters']));
                  $poll->set_var('poll_vote_url', $_CONF['site_url']
!                         . '/polls/index.php');
!                 $poll->set_var('lang_vote', $LANG_POLLS['vote']);
                  $poll->set_var('lang_votes', $LANG_POLLS['votes']);
  
--- 496,505 ----
                  $poll->set_var('num_votes', COM_numberFormat($P['voters']));
                  $poll->set_var('poll_vote_url', $_CONF['site_url']
!                                                 . '/polls/index.php');
!                 if (($nquestions == 1) || $showall) {
!                     $poll->set_var('lang_vote', $LANG_POLLS['vote']);
!                 } else {
!                     $poll->set_var('lang_vote', $LANG_POLLS['start_poll']);
!                 }
                  $poll->set_var('lang_votes', $LANG_POLLS['votes']);
  
***************
*** 512,520 ****
                  $poll->set_var('poll_results', $results);
  
!                 $access = SEC_hasAccess($topic['owner_id'],$topic['group_id'],$topic['perm_owner'],
!                     $topic['perm_group'],$topic['perm_members'],$topic['perm_anon']);
                  if ($access == 3) {
                      $editlink = COM_createLink($LANG25[27], $_CONF['site_admin_url']
!                         . '/plugins/polls/index.php?mode=edit&pid=' . $pid );
                      $poll->set_var('edit_link', $editlink);
                      $editicon = $_CONF['layout_url'] . '/images/edit.' . $_IMAGE_TYPE;
--- 518,527 ----
                  $poll->set_var('poll_results', $results);
  
!                 $access = SEC_hasAccess($topic['owner_id'], $topic['group_id'],
!                                 $topic['perm_owner'], $topic['perm_group'],
!                                 $topic['perm_members'], $topic['perm_anon']);
                  if ($access == 3) {
                      $editlink = COM_createLink($LANG25[27], $_CONF['site_admin_url']
!                         . '/plugins/polls/index.php?mode=edit&pid=' . $pid);
                      $poll->set_var('edit_link', $editlink);
                      $editicon = $_CONF['layout_url'] . '/images/edit.' . $_IMAGE_TYPE;
***************
*** 522,526 ****
                      $editiconhtml = COM_createImage($editicon, $LANG25[27], $icon_attr);
                      $editlink = COM_createLink($editiconhtml, $_CONF['site_admin_url']
!                         . '/plugins/polls/index.php?mode=edit&pid=' . $pid );
                      $poll->set_var('edit_icon', $editlink);
                  }
--- 529,533 ----
                      $editiconhtml = COM_createImage($editicon, $LANG25[27], $icon_attr);
                      $editlink = COM_createLink($editiconhtml, $_CONF['site_admin_url']
!                         . '/plugins/polls/index.php?mode=edit&pid=' . $pid);
                      $poll->set_var('edit_icon', $editlink);
                  }
***************
*** 532,543 ****
                  }
  
!                 for($j=0; $j<$nquestions; $j++) {
                      $Q = DB_fetchArray($questions);
!                     $poll->set_var('poll_question', " ".$Q['question']);
                      $poll->set_var('question_id', $j);
  
!                     $notification = "";
!                     $filter = "";
!                     if ($showall == false) {
                          $nquestions--;
                          $notification = $LANG25[35] . " $nquestions " . $LANG25[36];
--- 539,550 ----
                  }
  
!                 for ($j = 0; $j < $nquestions; $j++) {
                      $Q = DB_fetchArray($questions);
!                     $poll->set_var('poll_question', $Q['question']);
                      $poll->set_var('question_id', $j);
  
!                     $notification = '';
!                     $filter = '';
!                     if (!$showall) {
                          $nquestions--;
                          $notification = $LANG25[35] . " $nquestions " . $LANG25[36];
***************
*** 587,591 ****
                  $retval =  $poll->finish($poll->parse('output', 'block')) . LB;
  
!                 if($showall == true && $P['commentcode'] >= 0 ) {
                      $delete_option = (SEC_hasRights('polls.edit') &&
                          SEC_hasAccess($P['owner_id'], $P['group_id'],
--- 594,598 ----
                  $retval =  $poll->finish($poll->parse('output', 'block')) . LB;
  
!                 if ($showall && ($P['commentcode'] >= 0)) {
                      $delete_option = (SEC_hasRights('polls.edit') &&
                          SEC_hasAccess($P['owner_id'], $P['group_id'],
***************
*** 624,630 ****
  */
  
! function POLLS_showPoll($size, $pid='', $showall=false )
  {
      global $_CONF, $_PO_CONF, $_TABLES;
      $retval = '';
  
--- 631,638 ----
  */
  
! function POLLS_showPoll($size, $pid='', $showall = false )
  {
      global $_CONF, $_PO_CONF, $_TABLES;
+ 
      $retval = '';
  
***************
*** 647,651 ****
                  $Q = DB_fetchArray($result);
                  $pid = $Q['pid'];
!                 if ($size < 120) {// assume we're in the poll block
                      $showall = false;
                  } else { // assume we're in polls/index.php
--- 655,659 ----
                  $Q = DB_fetchArray($result);
                  $pid = $Q['pid'];
!                 if ($size < 120) { // assume we're in the poll block
                      $showall = false;
                  } else { // assume we're in polls/index.php




More information about the geeklog-cvs mailing list