[geeklog-cvs] geeklog-1.3/public_html users.php,1.71,1.72 usersettings.php,1.77,1.78

blaine at geeklog.net blaine at geeklog.net
Fri Jan 2 15:58:29 EST 2004


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

Modified Files:
	users.php usersettings.php 
Log Message:
Re-vamped Custom Registration to improve integration. Now using {customfields} variable in templates so admin and user can edit their profiles and use the custom fields if required

Index: users.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/users.php,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** users.php	2 Jan 2004 03:17:46 -0000	1.71
--- users.php	2 Jan 2004 20:58:26 -0000	1.72
***************
*** 238,241 ****
--- 238,245 ----
      $user_templates->set_var ('lang_all_postings_by', $LANG04[86] . ' ' . $A['username']);
  
+     // Call custom registration function if enabled and exists
+     if ($_CONF['custom_registration'] AND (function_exists(custom_displayuser)) ) {
+         $user_templates->set_var ('customfields', custom_displayuser($user) );
+     }
      PLG_profileVariablesDisplay ($user, $user_templates);
  
***************
*** 490,494 ****
              $retval .= COM_siteHeader ('Menu');
              if ($_CONF['custom_registration'] AND (function_exists(custom_userform))) {
!                 $retval .= custom_userform ('new', '', $LANG04[19]);
              } else {
                  $retval .= newuserform ($LANG04[19]);
--- 494,498 ----
              $retval .= COM_siteHeader ('Menu');
              if ($_CONF['custom_registration'] AND (function_exists(custom_userform))) {
!                 $retval .= custom_userform ($LANG04[19]);
              } else {
                  $retval .= newuserform ($LANG04[19]);
***************
*** 504,508 ****
          $retval .= COM_siteHeader ('menu');
          if ($_CONF['custom_registration'] && function_exists(custom_userform)) {
!             $retval .= custom_userform ('new', '', $msg);
          } else {
              $retval .= newuserform ($msg);
--- 508,512 ----
          $retval .= COM_siteHeader ('menu');
          if ($_CONF['custom_registration'] && function_exists(custom_userform)) {
!             $retval .= custom_userform ($msg);
          } else {
              $retval .= newuserform ($msg);
***************
*** 668,679 ****
      if (is_numeric ($uid) && ($uid > 0)) {
          $display .= COM_siteHeader('menu');
!         // Call custom registration and account record create function if
!         // enabled and exists
!         if ($_CONF['custom_registration'] AND (function_exists(custom_userform))
!                  AND SEC_hasRights('user.edit')) {
!             $display .= custom_userform ('moderate', $uid);
!         } else {
!             $display .= userprofile ($uid);
!         }
          $display .= COM_siteFooter ();
      } else {
--- 672,676 ----
      if (is_numeric ($uid) && ($uid > 0)) {
          $display .= COM_siteHeader('menu');
!         $display .= userprofile ($uid);
          $display .= COM_siteFooter ();
      } else {

Index: usersettings.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** usersettings.php	21 Dec 2003 10:53:06 -0000	1.77
--- usersettings.php	2 Jan 2004 20:58:26 -0000	1.78
***************
*** 54,62 ****
      global $_TABLES, $_CONF, $LANG04, $_USER;
  
-     // Call custom account form and edit function if enabled and exists
-     if ($_CONF['custom_registration'] AND (function_exists(custom_userform))) {
-         return custom_userform('edit',$_USER['uid']);
-     } 
- 
      $result = DB_query("SELECT fullname,cookietimeout,email,homepage,sig,emailstories,about,pgpkey,photo FROM {$_TABLES['users']},{$_TABLES['userprefs']},{$_TABLES['userinfo']} WHERE {$_TABLES['users']}.uid = {$_USER['uid']} && {$_TABLES['userprefs']}.uid = {$_USER['uid']} && {$_TABLES['userinfo']}.uid = {$_USER['uid']}");
      $A = DB_fetchArray($result);
--- 54,57 ----
***************
*** 166,169 ****
--- 161,169 ----
      }
  
+     // Call custom account form and edit function if enabled and exists
+     if ($_CONF['custom_registration'] AND (function_exists(custom_edituser))) {
+         $preferences->set_var ('customfields', custom_edituser($_USER['uid']) );
+     } 
+ 
      PLG_profileVariablesEdit ($_USER['uid'], $preferences);
  
***************
*** 685,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');
--- 685,688 ----
***************
*** 784,787 ****
--- 778,786 ----
          DB_query("UPDATE {$_TABLES['users']} SET fullname='{$A["fullname"]}',email='{$A["email"]}',homepage='{$A["homepage"]}',sig='{$A["sig"]}',cookietimeout={$A["cooktime"]},photo='$filename' WHERE uid={$_USER['uid']}");
          DB_query("UPDATE {$_TABLES['userinfo']} SET pgpkey='" . $A["pgpkey"] . "',about='{$A["about"]}' WHERE uid={$_USER['uid']}");
+ 
+         // Call custom registration save function if enabled and exists
+         if ($_CONF['custom_registration'] AND (function_exists(custom_saveuser))) {
+             custom_saveuser($_USER['uid']);
+         }
  
          if ($_US_VERBOSE) {





More information about the geeklog-cvs mailing list