[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.114,1.115

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Tue May 11 14:00:42 EDT 2004


Update of /var/cvs/geeklog-1.3/public_html/admin
In directory www:/tmp/cvs-serv29180/public_html/admin

Modified Files:
	story.php 
Log Message:
It's now possible to change the author of a story (feature request #204).


Index: story.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.114
retrieving revision 1.115
diff -C2 -d -r1.114 -r1.115
*** story.php	1 May 2004 17:57:05 -0000	1.114
--- story.php	11 May 2004 18:00:38 -0000	1.115
***************
*** 75,78 ****
--- 75,105 ----
  // debug($HTTP_POST_VARS);
  
+ 
+ /**
+ * Returns a list of all users and their user ids, wrapped in <option> tags.
+ *
+ * @param    int     uid     current user (to be displayed as selected)
+ * @return   string          string with <option> tags, to be wrapped in <select>
+ *
+ */
+ function userlist ($uid = 0)
+ {
+     global $_TABLES;
+ 
+     $retval = '';
+ 
+     $result = DB_query ("SELECT uid,username FROM {$_TABLES['users']} WHERE uid > 1 ORDER BY username");
+ 
+     while ($A = DB_fetchArray ($result)) {
+         $retval .= '<option value="' . $A['uid'] . '"';
+         if ($uid == $A['uid']) {
+             $retval .= ' selected="selected"';
+         }
+         $retval .= '>' . $A['username'] . '</option>' . LB;
+     }
+ 
+     return $retval;
+ }
+ 
  /**
  * Shows story editor
***************
*** 81,85 ****
  *
  * @param    string      $sid    ID of story to edit
! * @param    string      $mode   ??
  * @return   string      HTML for story editor
  *
--- 108,112 ----
  *
  * @param    string      $sid    ID of story to edit
! * @param    string      $mode   mode: preview, 'edit', 'editsubmission'
  * @return   string      HTML for story editor
  *
***************
*** 171,175 ****
              $A['show_topic_icon'] = 0;
          }
!         
          // Convert array values to numeric permission values
          list($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) = SEC_getPermissionValues($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
--- 198,202 ----
              $A['show_topic_icon'] = 0;
          }
! 
          // Convert array values to numeric permission values
          list($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) = SEC_getPermissionValues($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
***************
*** 236,239 ****
--- 263,267 ----
                                 'username', "uid = {$A['uid']}"));
      $story_templates->set_var('story_uid', $A['uid']);
+     $story_templates->set_var ('user_list', userlist ($A['uid']));
  
      // user access info
***************
*** 1103,1106 ****
--- 1131,1137 ----
      }
      $unixdate = strtotime("$publish_month/$publish_day/$publish_year $publish_hour:$publish_minute:$publish_second");
+     if (isset ($HTTP_POST_VARS['author_from_list'])) {
+         $uid = $HTTP_POST_VARS['author_from_list'];
+     }
      submitstory($type,$sid,$uid,$tid,$title,$introtext,$bodytext,$hits,$unixdate,$comments,$featured,$commentcode,$statuscode,$postmode,$frontpage, $draft_flag,$numemails,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,$delete,$show_topic_icon);
  } else { // 'cancel' or no mode at all




More information about the geeklog-cvs mailing list