[geeklog-cvs] geeklog-1.3/public_html index.php,1.43,1.44

dhaun at geeklog.net dhaun at geeklog.net
Wed Mar 12 14:02:03 EST 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv4149/public_html

Modified Files:
	index.php 
Log Message:
Static Pages named topic:<topic-id> (e.g. topic:GeekLog) will be displayed on top of that topic (based on a hack by James Fryer).
Also made sure that any messages are displayed above anything else.


Index: index.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/index.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** index.php	11 Mar 2003 17:00:56 -0000	1.43
--- index.php	12 Mar 2003 19:02:01 -0000	1.44
***************
*** 76,143 ****
  $shownews = true;
  
! if (empty ($topic)) {
  
!     // check if static pages plugin is installed and enabled
!     if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) {
  
!         $perms = SP_getPerms ();
!         if (!empty ($perms)) {
!             $perms = ' AND ' . $perms;
!         }
!         $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage'" . $perms;
!         $result = DB_query ($spsql);
  
!         if (DB_numRows ($result) > 0) {
!             $spresult = DB_fetchArray ($result);
  
!             if ($spresult['sp_label'] == 'nonews') { // replace news entirely
!                 $shownews = false;
!                 switch ($spresult['sp_format']) {
!                     case 'noblocks':
!                         $display .= COM_siteHeader ('none');
!                         break;
!                     case 'allblocks':
!                     case 'leftblocks':
!                         $display .= COM_siteHeader ('menu');
!                         break;
!                 }
  
!                 // Check for type (ie html or php)
!                 if ($spresult['sp_php'] == 1) {
!                     $display .= eval (stripslashes ($spresult['sp_content']));
!                 } else {
!                     $display .= stripslashes ($spresult['sp_content']);
!                 }
  
!                 if ($spresult['sp_format'] == 'allblocks') {
!                     $display .= COM_siteFooter (true);
!                 } else if ($spresult['sp_format'] != 'blankpage') {
!                     $display .= COM_siteFooter ();
!                 }
!             } else { // display static page content before the news
!                 $display .= COM_siteHeader ();
!                 if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) {
!                     $display .= COM_startBlock ($spresult['sp_label']);
!                 }
  
!                 // Check for type (ie html or php)
!                 if ($spresult['sp_php'] == 1) {
!                     $display .= eval (stripslashes ($spresult['sp_content']));
!                 } else {
!                     $display .= stripslashes ($spresult['sp_content']);
!                 }
  
!                 if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) {
!                     $display .= COM_endBlock ();
!                 }
              }
-         } else {
-             $display .= COM_siteHeader();
          }
      } else {
!         $display .= COM_siteHeader();
      }
  } else {
!     $display .= COM_siteHeader();
  }
  
--- 76,147 ----
  $shownews = true;
  
! // check if static pages plugin is installed and enabled
! if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) {
  
!     if (empty ($topic)) {
!         $staticpage_title = 'frontpage';
!     } else {
!         $staticpage_title = 'topic:' . $topic;
!     }
  
!     $perms = SP_getPerms ();
!     if (!empty ($perms)) {
!         $perms = ' AND ' . $perms;
!     }
!     $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = '{$staticpage_title}'" . $perms;
!     $result = DB_query ($spsql);
  
!     if (DB_numRows ($result) > 0) {
!         $spresult = DB_fetchArray ($result);
  
!         if ($spresult['sp_label'] == 'nonews') { // replace news entirely
!             $shownews = false;
!             switch ($spresult['sp_format']) {
!                 case 'noblocks':
!                     $display .= COM_siteHeader ('none')
!                              . COM_showMessage ($HTTP_GET_VARS['msg']);
!                     break;
!                 case 'allblocks':
!                 case 'leftblocks':
!                     $display .= COM_siteHeader ('menu')
!                              . COM_showMessage ($HTTP_GET_VARS['msg']);
!                     break;
!             }
  
!             // Check for type (ie html or php)
!             if ($spresult['sp_php'] == 1) {
!                 $display .= eval (stripslashes ($spresult['sp_content']));
!             } else {
!                 $display .= stripslashes ($spresult['sp_content']);
!             }
  
!             if ($spresult['sp_format'] == 'allblocks') {
!                 $display .= COM_siteFooter (true);
!             } else if ($spresult['sp_format'] != 'blankpage') {
!                 $display .= COM_siteFooter ();
!             }
!         } else { // display static page content before the news
!             $display .= COM_siteHeader ()
!                      . COM_showMessage ($HTTP_GET_VARS['msg']);
!             if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) {
!                 $display .= COM_startBlock ($spresult['sp_label']);
!             }
  
!             // Check for type (ie html or php)
!             if ($spresult['sp_php'] == 1) {
!                 $display .= eval (stripslashes ($spresult['sp_content']));
!             } else {
!                 $display .= stripslashes ($spresult['sp_content']);
!             }
  
!             if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) {
!                 $display .= COM_endBlock ();
              }
          }
      } else {
!         $display .= COM_siteHeader() . COM_showMessage ($HTTP_GET_VARS['msg']);
      }
  } else {
!     $display .= COM_siteHeader() . COM_showMessage ($HTTP_GET_VARS['msg']);
  }
  
***************
*** 182,187 ****
  $limit = $U['maxstories'];
  
- $display .= COM_showMessage($HTTP_GET_VARS['msg']);
- 
  // Geeklog now allows for articles to be published in the future.  Because of
  // this, we need to check to see if we need to rebuild the RDF file in the case
--- 186,189 ----
***************
*** 306,311 ****
  $display .= COM_siteFooter(true); // The true value enables right hand blocks.
  
- } else {
-     $display = COM_showMessage ($HTTP_GET_VARS['msg']) . $display;
  }
  
--- 308,311 ----





More information about the geeklog-cvs mailing list