[geeklog-cvs] geeklog-1.3/public_html index.php,1.57,1.58 lib-common.php,1.328,1.329

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Sun May 30 19:27:31 EDT 2004


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

Modified Files:
	index.php lib-common.php 
Log Message:
Added capability for Plugins to call index.php with a msg ID to be shown by COM_showMessage.
Plugin Developers would add the referrenced Messages in their Language Files
The Message variables need to follow a defined standard.
$PLG_pluginname_MESSAGE1 = 'Error Message';
Example: $PLG_newsletter_MESSAGE1 = 'Invalid email address';

Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.328
retrieving revision 1.329
diff -C2 -d -r1.328 -r1.329
*** lib-common.php	30 May 2004 16:33:02 -0000	1.328
--- lib-common.php	30 May 2004 23:27:28 -0000	1.329
***************
*** 4737,4745 ****
  * it for display on the calling page
  *
! * @param        int     $msg        ID of message to show
  * @return     string  HTML block with message
  */
  
! function COM_showMessage( $msg )
  {
      global $MESSAGE, $_CONF;
--- 4737,4746 ----
  * it for display on the calling page
  *
! * @param      int     $msg        ID of message to show
! * @param      string  $plugin     Optional Name of plugin to lookup plugin defined message
  * @return     string  HTML block with message
  */
  
! function COM_showMessage( $msg, $plugin='' )
  {
      global $MESSAGE, $_CONF;
***************
*** 4750,4758 ****
      {
          $timestamp = strftime( $_CONF['daytime'] );
          $retval .= COM_startBlock( $MESSAGE[40] . ' - ' . $timestamp, '',
                             COM_getBlockTemplate( '_msg_block', 'header' ))
!             . '<img src="' . $_CONF['layout_url']
!             . '/images/sysmessage.gif" border="0" align="top" alt="">'
!             . $MESSAGE[$msg] . '<br><br>'
              . COM_endBlock( COM_getBlockTemplate( '_msg_block', 'footer' ));
      }
--- 4751,4766 ----
      {
          $timestamp = strftime( $_CONF['daytime'] );
+         if ($plugin != '') {
+             $var = 'PLG_'.$plugin.'_MESSAGE'.$msg;
+             global $$var;
+             $message = $$var;
+         } else {
+             $message = $MESSAGE[$msg];
+         }
          $retval .= COM_startBlock( $MESSAGE[40] . ' - ' . $timestamp, '',
                             COM_getBlockTemplate( '_msg_block', 'header' ))
!             . '<table><tr><td><img src="' . $_CONF['layout_url']
!             . '/images/sysmessage.gif" border="0" align="top" alt=""></td>'
!             . '<td style="padding:5px;">'. $message . '</td></tr></table>'
              . COM_endBlock( COM_getBlockTemplate( '_msg_block', 'footer' ));
      }
***************
*** 4761,4764 ****
--- 4769,4773 ----
  }
  
+ 
  /**
  * Prints Google(tm)-like paging navigation

Index: index.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/index.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** index.php	1 May 2004 17:57:04 -0000	1.57
--- index.php	30 May 2004 23:27:28 -0000	1.58
***************
*** 68,72 ****
  $display .= COM_siteHeader();
  if (isset ($HTTP_GET_VARS['msg'])) {
!     $display .= COM_showMessage (COM_applyFilter ($HTTP_GET_VARS['msg'], true));
  }
  
--- 68,72 ----
  $display .= COM_siteHeader();
  if (isset ($HTTP_GET_VARS['msg'])) {
!     $display .= COM_showMessage (COM_applyFilter ($HTTP_GET_VARS['msg'], true),COM_applyFilter ($HTTP_GET_VARS['plugin']));
  }
  




More information about the geeklog-cvs mailing list