[geeklog-cvs] Geeklog-1.x/public_html article.php,1.92,1.93

Dirk Haun dhaun at qs1489.pair.com
Sun Aug 19 12:28:04 EDT 2007


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

Modified Files:
	article.php 
Log Message:
Integrated Ramnath's changes to make stories available through the webservice API


Index: article.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/article.php,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -d -r1.92 -r1.93
*** article.php	28 Feb 2007 02:43:02 -0000	1.92
--- article.php	19 Aug 2007 16:28:02 -0000	1.93
***************
*** 105,109 ****
  
      $story = new Story();
!     $result = $story->loadFromDatabase($sid, 'view');
  
      /*$access = SEC_hasAccess ($A['owner_id'], $A['group_id'],
--- 105,129 ----
  
      $story = new Story();
! 
!     $args = array (
!                     'sid' => $sid,
!                     'mode' => 'view'
!                   );
! 
!     $output = STORY_LOADED_OK;
!     $result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
! 
!     if($result == PLG_RET_OK) {
!         /* loadFromArray cannot be used, since it overwrites the timestamp */
!         reset($story->_dbFields);
! 
!         while (list($fieldname,$save) = each($story->_dbFields)) {
!             $varname = '_' . $fieldname;
! 
!             if (array_key_exists($fieldname, $output)) {
!                 $story->{$varname} = $output[$fieldname];
!             }
!         }
!     }
  
      /*$access = SEC_hasAccess ($A['owner_id'], $A['group_id'],
***************
*** 112,116 ****
      if (($access == 0) OR !SEC_hasTopicAccess ($A['tid']) OR
          (($A['draft_flag'] == 1) AND !SEC_hasRights ('story.edit'))) {*/
!     if( $result == STORY_PERMISSION_DENIED ) {
          $display .= COM_siteHeader ('menu', $LANG_ACCESS['accessdenied'])
                   . COM_startBlock ($LANG_ACCESS['accessdenied'], '',
--- 132,136 ----
      if (($access == 0) OR !SEC_hasTopicAccess ($A['tid']) OR
          (($A['draft_flag'] == 1) AND !SEC_hasRights ('story.edit'))) {*/
!     if ($output == STORY_PERMISSION_DENIED) {
          $display .= COM_siteHeader ('menu', $LANG_ACCESS['accessdenied'])
                   . COM_startBlock ($LANG_ACCESS['accessdenied'], '',
***************
*** 119,123 ****
                   . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'))
                   . COM_siteFooter ();
!     } elseif ( $result == STORY_INVALID_SID ) {
          $display .= COM_refresh($_CONF['site_url'] . '/index.php');
      } elseif (($mode == 'print') && ($_CONF['hideprintericon'] == 0)) {
--- 139,143 ----
                   . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'))
                   . COM_siteFooter ();
!     } elseif ( $output == STORY_INVALID_SID ) {
          $display .= COM_refresh($_CONF['site_url'] . '/index.php');
      } elseif (($mode == 'print') && ($_CONF['hideprintericon'] == 0)) {
***************
*** 322,324 ****
  echo $display;
  
! ?>
--- 342,344 ----
  echo $display;
  
! ?>
\ No newline at end of file




More information about the geeklog-cvs mailing list