[geeklog-cvs] geeklog-1.3/public_html article.php,1.37,1.38 lib-common.php,1.267,1.268 usersettings.php,1.76,1.77

dhaun at geeklog.net dhaun at geeklog.net
Sun Nov 23 04:57:24 EST 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv20445/public_html

Modified Files:
	article.php lib-common.php usersettings.php 
Log Message:
Restored old behaviour of 'comment.php?mode=display', e.g. when linking to a user's comments from their profile.


Index: article.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/article.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** article.php	16 Nov 2003 18:22:33 -0000	1.37
--- article.php	23 Nov 2003 09:57:22 -0000	1.38
***************
*** 203,207 ****
                  $story_template->set_var ('commentbar',
                          COM_userComments ($story, $A['title'], 'article',
!                                           $order, $mode, $delete_option));
              }
              $display .= $story_template->finish ($story_template->parse ('output', 'article'));
--- 203,207 ----
                  $story_template->set_var ('commentbar',
                          COM_userComments ($story, $A['title'], 'article',
!                                           $order, $mode, 0, $delete_option));
              }
              $display .= $story_template->finish ($story_template->parse ('output', 'article'));

Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.267
retrieving revision 1.268
diff -C2 -d -r1.267 -r1.268
*** lib-common.php	16 Nov 2003 21:44:18 -0000	1.267
--- lib-common.php	23 Nov 2003 09:57:22 -0000	1.268
***************
*** 1789,1793 ****
                      $Q['perm_anon'] ) == 3 ? true : false );
                  $retval .= COM_userComments( $qid, $Q['question'], 'poll',
!                                              $order, $mode, $delete_option ); 
              }
          }
--- 1789,1793 ----
                      $Q['perm_anon'] ) == 3 ? true : false );
                  $retval .= COM_userComments( $qid, $Q['question'], 'poll',
!                                              $order, $mode, 0, $delete_option ); 
              }
          }
***************
*** 2710,2713 ****
--- 2710,2714 ----
  * @param        string      $order     How to order the comments 'ASC' or 'DESC'
  * @param        string      $mode      comment mode (nested, flat, etc.)
+ * @param        int         $pid       id of parent comment
  * @param        boolean     $delete_option   if current user can delete comments
  * @see function COM_commentBar
***************
*** 2716,2720 ****
  *
  */
! function COM_userComments( $sid, $title, $type='article', $order='', $mode='', $delete_option = false )
  {
      global $_CONF, $_TABLES, $_USER, $LANG01;
--- 2717,2721 ----
  *
  */
! function COM_userComments( $sid, $title, $type='article', $order='', $mode='', $pid = 0, $delete_option = false )
  {
      global $_CONF, $_TABLES, $_USER, $LANG01;
***************
*** 2768,2772 ****
                  $q = "SELECT c.*,u.username,u.fullname,u.photo,unix_timestamp(date) AS nice_date "
                     . "FROM {$_TABLES['comments']} as c, {$_TABLES['users']} as u "
!                    . "WHERE c.uid = u.uid AND sid = '$sid' AND pid = 0 AND type = '$type' "
                     . "ORDER BY date $order LIMIT $limit";
                  break;
--- 2769,2773 ----
                  $q = "SELECT c.*,u.username,u.fullname,u.photo,unix_timestamp(date) AS nice_date "
                     . "FROM {$_TABLES['comments']} as c, {$_TABLES['users']} as u "
!                    . "WHERE c.uid = u.uid AND sid = '$sid' AND pid = $pid AND type = '$type' "
                     . "ORDER BY date $order LIMIT $limit";
                  break;

Index: usersettings.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** usersettings.php	20 Sep 2003 16:50:35 -0000	1.76
--- usersettings.php	23 Nov 2003 09:57:22 -0000	1.77
***************
*** 185,189 ****
      global $_CONF, $_USER, $LANG04;
  
!     if ($account_id != $_USER['uid']) {
          // now that doesn't look right - abort ...
          return COM_refresh ($_CONF['site_url'] . '/index.php');
--- 185,190 ----
      global $_CONF, $_USER, $LANG04;
  
!     if (($_CONF['allow_account_delete'] != 1) || ($account_id <= 0) ||
!             ($account_id != $_USER['uid'])) {
          // now that doesn't look right - abort ...
          return COM_refresh ($_CONF['site_url'] . '/index.php');
***************
*** 227,231 ****
      global $_CONF, $_TABLES, $_USER;
  
!     if ($uid != $_USER['uid']) {
          // now that doesn't look right - abort ...
          return COM_refresh ($_CONF['site_url'] . '/index.php');
--- 228,233 ----
      global $_CONF, $_TABLES, $_USER;
  
!     if (($_CONF['allow_account_delete'] != 1) || ($uid <= 0) ||
!             ($uid != $_USER['uid'])) {
          // now that doesn't look right - abort ...
          return COM_refresh ($_CONF['site_url'] . '/index.php');
***************
*** 636,640 ****
  
      if ($_CONF['allow_username_change'] == 1) {
!         $A['new_username'] = strip_tags (COM_stripslashes ($A['new_username']));
          if (!empty ($A['new_username']) &&
                  ($A['new_username'] != $_USER['username'])) {
--- 638,642 ----
  
      if ($_CONF['allow_username_change'] == 1) {
!         $A['new_username'] = COM_applyFilter ($A['new_username']);
          if (!empty ($A['new_username']) &&
                  ($A['new_username'] != $_USER['username'])) {
***************
*** 650,664 ****
      }
  
!     if (!empty($A["passwd"])) {
!         $passwd = md5($A["passwd"]);
!         DB_change($_TABLES['users'],'passwd',"$passwd","uid",$_USER['uid']);
      }
  
!     $A['fullname'] = strip_tags (COM_stripslashes ($A['fullname']));
!     $A['email'] = strip_tags (COM_stripslashes ($A['email']));
!     $A['homepage'] = COM_killJS(strip_tags (COM_stripslashes ($A['homepage'])));
!     $A['sig'] = strip_tags (COM_stripslashes ($A['sig']));
!     $A['about'] = strip_tags (COM_stripslashes ($A['about']));
!     $A['pgpkey'] = strip_tags (COM_stripslashes ($A['pgpkey']));
  
      if (!COM_isEmail ($A['email'])) {
--- 652,669 ----
      }
  
!     $A['passwd'] = COM_applyFilter ($A['passwd']);
!     if (!empty($A['passwd'])) {
!         $passwd = md5($A['passwd']);
!         DB_change($_TABLES['users'],'passwd',"$passwd",'uid',$_USER['uid']);
      }
  
!     $A['fullname']     = COM_applyFilter ($A['fullname']);
!     $A['email']        = COM_applyFilter ($A['email']);
!     $A['homepage']     = COM_applyFilter ($A['homepage']);
!     $A['sig']          = COM_applyFilter ($A['sig']);
!     $A['about']        = COM_applyFilter ($A['about']);
!     $A['pgpkey']       = COM_applyFilter ($A['pgpkey']);
!     $A['cooktime']     = COM_applyFilter ($A['cooktime'], true);
!     $A['delete_photo'] = COM_applyFilter ($A['delete_photo']);
  
      if (!COM_isEmail ($A['email'])) {
***************
*** 686,694 ****
  
       	// Call custom account registration and save function if enabled and exists
! 	    if ($_CONF['custom_registration'] AND (function_exists(custom_usersave))) {
! 		    custom_usersave($_USER['uid']);
! 	        return COM_refresh("{$_CONF['site_url']}/usersettings.php?mode=edit&msg=5");
! 		}
! 			
          if ($_CONF['allow_user_photo'] == 1) {
              include_once($_CONF['path_system'] . 'classes/upload.class.php');
--- 691,700 ----
  
       	// Call custom account registration and save function if enabled and exists
!         if ($_CONF['custom_registration'] AND (function_exists('custom_usersave'))) {
!             custom_usersave($_USER['uid']);
!             return COM_refresh ($_CONF['site_url']
!                                 . '/usersettings.php?mode=edit&msg=5');
!         }
! 
          if ($_CONF['allow_user_photo'] == 1) {
              include_once($_CONF['path_system'] . 'classes/upload.class.php');
***************
*** 713,717 ****
              $upload->setAllowedMimeTypes(array('image/gif'=>'.gif','image/jpeg'=>'.jpg,.jpeg','image/pjpeg'=>'.jpg,.jpeg','image/x-png'=>'.png','image/png'=>'.png'));
              if (!$upload->setPath($_CONF['path_html'] . 'images/userphotos')) {
!                 print 'File Upload Errors:<BR>' . $upload->printErrors();
                  exit;
              }
--- 719,723 ----
              $upload->setAllowedMimeTypes(array('image/gif'=>'.gif','image/jpeg'=>'.jpg,.jpeg','image/pjpeg'=>'.jpg,.jpeg','image/x-png'=>'.png','image/png'=>'.png'));
              if (!$upload->setPath($_CONF['path_html'] . 'images/userphotos')) {
!                 print 'File Upload Errors:<br>' . $upload->printErrors();
                  exit;
              }
***************
*** 740,744 ****
                      $upload->uploadFiles();
                      if ($upload->areErrors()) {
!                        print "ERRORS<BR>";
                         $upload->printErrors();
                         exit; 
--- 746,750 ----
                      $upload->uploadFiles();
                      if ($upload->areErrors()) {
!                        print "ERRORS<br>";
                         $upload->printErrors();
                         exit; 
***************
*** 835,838 ****
--- 841,845 ----
      }
  
+     $A['maxstories'] = COM_applyFilter ($A['maxstories'], true);
      if ($A['maxstories'] < $_CONF['minnews']) {
          $A['maxstories'] = $_CONF['minnews'];
***************
*** 852,856 ****
      if (sizeof($TIDS) > 0) {
          for ($i = 0; $i < sizeof($TIDS); $i++) {
!             $tids .= $TIDS[$i] . ' ';
          }
      }
--- 859,863 ----
      if (sizeof($TIDS) > 0) {
          for ($i = 0; $i < sizeof($TIDS); $i++) {
!             $tids .= COM_applyFilter ($TIDS[$i]) . ' ';
          }
      }
***************
*** 858,862 ****
      if (sizeof($AIDS) > 0) {
          for ($i = 0; $i < sizeof($AIDS); $i++) {
!             $aids .= $AIDS[$i] . ' ';
          }
      }
--- 865,869 ----
      if (sizeof($AIDS) > 0) {
          for ($i = 0; $i < sizeof($AIDS); $i++) {
!             $aids .= COM_applyFilter ($AIDS[$i], true) . ' ';
          }
      }
***************
*** 865,869 ****
      if (count($BOXES) > 0) {
          for ($i = 1; $i <= count($BOXES); $i++) {
!             $boxes .= current($BOXES); 
              if ($i <> count($BOXES)) {
                  $boxes .= ',';
--- 872,876 ----
      if (count($BOXES) > 0) {
          for ($i = 1; $i <= count($BOXES); $i++) {
!             $boxes .= COM_applyFilter (current($BOXES), true);
              if ($i <> count($BOXES)) {
                  $boxes .= ',';
***************
*** 888,897 ****
          }
      }
-     if (!isset ($A['tzid'])) {
-         $A['tzid'] = '';
-     }
  
!     // Save theme, when doing so, put in cookie so we can set the user's theme even when they aren't logged in
!     DB_query("UPDATE {$_TABLES['users']} SET theme='{$A["theme"]}',language='{$A["language"]}' WHERE uid = {$_USER['uid']}");
      setcookie ($_CONF['cookie_theme'], $A['theme'], time() + 31536000,
                 $_CONF['cookie_path'], $_CONF['cookiedomain'],
--- 895,904 ----
          }
      }
  
!     // Save theme, when doing so, put in cookie so we can set the user's theme
!     // even when they aren't logged in
!     $A['theme'] = COM_applyFilter ($A['theme']);
!     $A['language'] = COM_applyFilter ($A['language']);
! 
      setcookie ($_CONF['cookie_theme'], $A['theme'], time() + 31536000,
                 $_CONF['cookie_path'], $_CONF['cookiedomain'],
***************
*** 901,911 ****
                 $_CONF['cookiesecure']);
  
!     DB_query("UPDATE {$_TABLES['userprefs']} SET noicons='{$A['noicons']}', willing='{$A["willing"]}', dfid='{$A["dfid"]}', tzid='{$A["tzid"]}', emailfromadmin='{$A['emailfromadmin']}', emailfromuser='{$A['emailfromuser']}', showonline='{$A['showonline']}' WHERE uid='{$_USER['uid']}'");
  
      if (empty ($etids)) {
          $etids = '-';
      }
      DB_save($_TABLES['userindex'],"uid,tids,aids,boxes,noboxes,maxstories,etids","'{$_USER['uid']}','$tids','$aids','$selectedblocks','{$A['noboxes']}',{$A['maxstories']},'$etids'");
  
      DB_save($_TABLES['usercomment'],'uid,commentmode,commentorder,commentlimit',"'{$_USER['uid']}','{$A['commentmode']}','{$A['commentorder']}','{$A['commentlimit']}'");
  }
--- 908,931 ----
                 $_CONF['cookiesecure']);
  
!     $A['theme'] = addslashes ($A['theme']);
!     $A['language'] = addslashes ($A['language']);
!     DB_query("UPDATE {$_TABLES['users']} SET theme='{$A['theme']}',language='{$A['language']}' WHERE uid = {$_USER['uid']}");
! 
!     $A['dfid'] = COM_applyFilter ($A['dfid'], true);
!     $A['tzid'] = addslashes (COM_applyFilter ($A['tzid']));
!     DB_query("UPDATE {$_TABLES['userprefs']} SET noicons='{$A['noicons']}', willing='{$A['willing']}', dfid='{$A['dfid']}', tzid='{$A['tzid']}', emailfromadmin='{$A['emailfromadmin']}', emailfromuser='{$A['emailfromuser']}', showonline='{$A['showonline']}' WHERE uid='{$_USER['uid']}'");
  
      if (empty ($etids)) {
          $etids = '-';
      }
+     $tids = addslashes ($tids);
+     $etids = addslashes ($etids);
+     $aids = addslashes ($aids);
+     $selectedblocks = addslashes ($selectedblocks);
      DB_save($_TABLES['userindex'],"uid,tids,aids,boxes,noboxes,maxstories,etids","'{$_USER['uid']}','$tids','$aids','$selectedblocks','{$A['noboxes']}',{$A['maxstories']},'$etids'");
  
+     $A['commentmode'] = addslashes (COM_applyFilter ($A['commentmode']));
+     $A['commentorder'] = addslashes (COM_applyFilter ($A['commentorder']));
+     $A['commentlimit'] = COM_applyFilter ($A['commentlimit'], true);
      DB_save($_TABLES['usercomment'],'uid,commentmode,commentorder,commentlimit',"'{$_USER['uid']}','{$A['commentmode']}','{$A['commentorder']}','{$A['commentlimit']}'");
  }
***************
*** 913,920 ****
  // MAIN
  if (isset ($HTTP_POST_VARS['mode'])) {
!     $mode = $HTTP_POST_VARS['mode'];
  }
  else if (isset ($HTTP_GET_VARS['mode'])) {
!     $mode = $HTTP_GET_VARS['mode'];
  }
  $display = '';
--- 933,940 ----
  // MAIN
  if (isset ($HTTP_POST_VARS['mode'])) {
!     $mode = COM_applyFilter ($HTTP_POST_VARS['mode']);
  }
  else if (isset ($HTTP_GET_VARS['mode'])) {
!     $mode = COM_applyFilter ($HTTP_GET_VARS['mode']);
  }
  $display = '';
***************
*** 926,930 ****
          $display .= COM_siteHeader('menu');
          if (isset ($HTTP_GET_VARS['msg'])) {
!             $display .= COM_showMessage($HTTP_GET_VARS['msg']);
          }
          $display .= editpreferences();
--- 946,950 ----
          $display .= COM_siteHeader('menu');
          if (isset ($HTTP_GET_VARS['msg'])) {
!             $display .= COM_showMessage (COM_applyFilter ($HTTP_GET_VARS['msg'], true));
          }
          $display .= editpreferences();
***************
*** 934,938 ****
          $display .= COM_siteHeader('menu');
          if (isset ($HTTP_GET_VARS['msg'])) {
!             $display .= COM_showMessage($HTTP_GET_VARS['msg']);
          }
          $display .= edituser();
--- 954,958 ----
          $display .= COM_siteHeader('menu');
          if (isset ($HTTP_GET_VARS['msg'])) {
!             $display .= COM_showMessage (COM_applyFilter ($HTTP_GET_VARS['msg'], true));
          }
          $display .= edituser();
***************
*** 949,956 ****
          break;
      case 'confirmdelete':
!         $display .= confirmAccountDelete ($HTTP_POST_VARS['account_id']);
          break;
      case 'deleteconfirmed':
!         $display .= deleteUserAccount ($HTTP_POST_VARS['account_id']);
          break;
      }
--- 969,976 ----
          break;
      case 'confirmdelete':
!         $display .= confirmAccountDelete (COM_applyFilter ($HTTP_POST_VARS['account_id'], true));
          break;
      case 'deleteconfirmed':
!         $display .= deleteUserAccount (COM_applyFilter ($HTTP_POST_VARS['account_id'], true));
          break;
      }





More information about the geeklog-cvs mailing list