[geeklog-cvs] Geeklog-1.x/plugins/polls functions.inc,1.80,1.81

Dirk Haun dhaun at qs1489.pair.com
Sat Dec 29 15:03:11 EST 2007


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

Modified Files:
	functions.inc 
Log Message:
Fixed warnings, voting, etc. Some source code cosmetics.


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/polls/functions.inc,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** functions.inc	25 Nov 2007 06:56:05 -0000	1.80
--- functions.inc	29 Dec 2007 20:03:09 -0000	1.81
***************
*** 3,7 ****
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Polls Plugin 1.1                                                          |
  // +---------------------------------------------------------------------------+
  // | functions.inc                                                             |
--- 3,7 ----
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Polls Plugin 2.0                                                          |
  // +---------------------------------------------------------------------------+
  // | functions.inc                                                             |
***************
*** 579,583 ****
--- 579,587 ----
                          $P['perm_owner'], $P['perm_group'], $P['perm_members'],
                          $P['perm_anon']) == 3 ? true : false);
+ 
                      require_once $_CONF['path_system'] . 'lib-comment.php';
+ 
+                     $order = '';
+                     $mode  = '';
                      $retval .= CMT_userComments($pid, $P['topic'], 'polls',
                                                  $order, $mode, 0, 1, false,
***************
*** 587,591 ****
          }
      } else {
!         $retval .= POLLS_pollResults($pid );
      }
  
--- 591,595 ----
          }
      } else {
!         $retval .= POLLS_pollResults($pid);
      }
  
***************
*** 663,672 ****
  *
  * @param    string   $pid   poll id
- * @param    array    $pid   question ids
  * @param    array    $aid   selected answers
  * @return   string   HTML for poll results
  *
  */
! function POLLS_pollsave($pid, $qid, $aid)
  {
      global $_TABLES, $LANG_POLLS;
--- 667,675 ----
  *
  * @param    string   $pid   poll id
  * @param    array    $aid   selected answers
  * @return   string   HTML for poll results
  *
  */
! function POLLS_pollsave($pid, $aid)
  {
      global $_TABLES, $LANG_POLLS;
***************
*** 679,690 ****
  
      DB_change($_TABLES['polltopics'],'voters',"voters + 1",'pid',$pid,'',true);
!     // This call to DB-change will properly supress the insertion of quoes around $value in the sql
!     for ($i=0; $i<count($aid); $i++) {
          DB_change(
              $_TABLES['pollanswers'],
              'votes',
              "votes + 1",
!             array('pid','qid','aid'),
!             array($pid,$i,COM_applyFilter($aid[$i], true)),
              '',
              true
--- 682,694 ----
  
      DB_change($_TABLES['polltopics'],'voters',"voters + 1",'pid',$pid,'',true);
!     // This call to DB-change will properly supress the insertion of quotes around $value in the sql
!     $answers = count($aid);
!     for ($i = 0; $i < $answers; $i++) {
          DB_change(
              $_TABLES['pollanswers'],
              'votes',
              "votes + 1",
!             array('pid', 'qid', 'aid'),
!             array($pid,  $i,    COM_applyFilter($aid[$i], true)),
              '',
              true
***************
*** 939,943 ****
  * @param   int     $cid    Comment id to display (possibly including sub-comments)
  * @param   string  $title  Page/comment title
! * @param   string  $order  'ASC' or 'DSC' or blank
  * @param   string  $format 'threaded', 'nested', or 'flat'
  * @param   int     $page   Page number of comments to display
--- 943,947 ----
  * @param   int     $cid    Comment id to display (possibly including sub-comments)
  * @param   string  $title  Page/comment title
! * @param   string  $order  'ASC' or 'DESC' or blank
  * @param   string  $format 'threaded', 'nested', or 'flat'
  * @param   int     $page   Page number of comments to display
***************
*** 999,1006 ****
                  break;
              case 'topic':
!                 if (($Q['open'] == 0) || (
!                         ($Q['hideresults'] == 1) && ($_USER['uid'] == $Q['owner_id'])
                      ) || (
!                         ($Q['hideresults'] == 1) && (SEC_inGroup('Root'))
                      )
                  ) {
--- 1003,1010 ----
                  break;
              case 'topic':
!                 if (($A['open'] == 0) || (
!                         ($A['hideresults'] == 1) && ($_USER['uid'] == $A['owner_id'])
                      ) || (
!                         ($A['hideresults'] == 1) && (SEC_inGroup('Root'))
                      )
                  ) {




More information about the geeklog-cvs mailing list