[geeklog-cvs] Geeklog-1.x/system lib-story.php,1.117,1.118

Dirk Haun dhaun at qs1489.pair.com
Thu Jan 3 09:41:35 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv96505/system

Modified Files:
	lib-story.php 
Log Message:
Try the default topic first if no topic is given in a WS submit


Index: lib-story.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-story.php,v
retrieving revision 1.117
retrieving revision 1.118
diff -C2 -d -r1.117 -r1.118
*** lib-story.php	29 Dec 2007 15:05:50 -0000	1.117
--- lib-story.php	3 Jan 2008 14:41:33 -0000	1.118
***************
*** 9,13 ****
  // | Story-related functions needed in more than one place.                    |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2007 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
--- 9,13 ----
  // | Story-related functions needed in more than one place.                    |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2008 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
***************
*** 1074,1086 ****
      /* - START: Set all the defaults - */
  
-     /* Default topic is the first one */
      if (empty($args['tid'])) {
!         $o = array();
!         $s = array();
!         if (service_getTopicList_story(array('gl_svc' => true), $o, $s) == PLG_RET_OK) {
!             $args['tid'] = $o[0];
          } else {
!             $svc_msg['error_desc'] = 'No topics available';
!             return PLG_RET_ERROR;
          }
      }
--- 1074,1093 ----
      /* - START: Set all the defaults - */
  
      if (empty($args['tid'])) {
!         // see if we have a default topic
!         $topic = DB_getItem($_TABLES['topics'], 'tid',
!                             'is_default = 1' . COM_getPermSQL('AND'));
!         if (!empty($topic)) {
!             $args['tid'] = $topic;
          } else {
!             // otherwise, just use the first one
!             $o = array();
!             $s = array();
!             if (service_getTopicList_story(array('gl_svc' => true), $o, $s) == PLG_RET_OK) {
!                 $args['tid'] = $o[0];
!             } else {
!                 $svc_msg['error_desc'] = 'No topics available';
!                 return PLG_RET_ERROR;
!             }
          }
      }




More information about the geeklog-cvs mailing list