[geeklog-cvs] geeklog-1.3/public_html/admin trackback.php,1.7,1.8

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Tue Feb 1 03:21:00 EST 2005


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

Modified Files:
	trackback.php 
Log Message:
Added check for $_CONF['ping_enabled']


Index: trackback.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/trackback.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** trackback.php	30 Jan 2005 20:23:17 -0000	1.7
--- trackback.php	1 Feb 2005 08:20:57 -0000	1.8
***************
*** 7,11 ****
  // | trackback.php                                                             |
  // |                                                                           |
! // | Admin functions to send and delete trackback comments.                    |
  // +---------------------------------------------------------------------------+
  // | Copyright (C) 2005 by the following authors:                              |
--- 7,11 ----
  // | trackback.php                                                             |
  // |                                                                           |
! // | Admin functions handle Trackback, Pingback, and Ping                      |
  // +---------------------------------------------------------------------------+
  // | Copyright (C) 2005 by the following authors:                              |
***************
*** 39,43 ****
  require_once ('auth.inc.php');
  
! if (!$_CONF['trackback_enabled'] && !$_CONF['pingback_enabled']) {
      echo COM_refresh ($_CONF['site_admin_url'] . '/index.php');
      exit;
--- 39,44 ----
  require_once ('auth.inc.php');
  
! if (!$_CONF['trackback_enabled'] && !$_CONF['pingback_enabled'] &&
!         !$_CONF['ping_enabled']) {
      echo COM_refresh ($_CONF['site_admin_url'] . '/index.php');
      exit;
***************
*** 163,172 ****
      $result = DB_query ("SELECT sid,type FROM {$_TABLES['trackback']} WHERE cid = '$cid'");
      list ($sid, $type) = DB_fetchArray ($result);
! 
!     if ($type == 'article') {
!         $url = STORY_getItemInfo ($sid, 'url');
!     } else {
!         $url = PLG_getItemInfo ($type, $sid, 'url');
!     }
  
      if (TRB_allowDelete ($sid, $type)) {
--- 164,168 ----
      $result = DB_query ("SELECT sid,type FROM {$_TABLES['trackback']} WHERE cid = '$cid'");
      list ($sid, $type) = DB_fetchArray ($result);
!     $url = getItemInfo ($type, $sid, 'url');
  
      if (TRB_allowDelete ($sid, $type)) {
***************
*** 219,227 ****
      $retval = '';
  
!     if ($type == 'article') {
!         list ($url, $text) = STORY_getItemInfo ($id, 'url,description');
!     } else {
!         list ($url, $text) = PLG_getItemInfo ($type, $id, 'url,description');
!     }
  
      // extract all links from the text
--- 215,219 ----
      $retval = '';
  
!     list ($url, $text) = getItemInfo ($type, $id, 'url,description');
  
      // extract all links from the text
***************
*** 291,299 ****
      $retval = '';
  
!     if ($type == 'article') {
!         list ($itemurl,$feedurl) = STORY_getItemInfo ($id, 'url,feed');
!     } else {
!         list ($itemurl,$feedurl) = PLG_getItemInfo ($type, $id, 'url,feed');
!     }
  
      $template = new Template ($_CONF['path_layout'] . 'admin/trackback');
--- 283,287 ----
      $retval = '';
  
!     list ($itemurl,$feedurl) = getItemInfo ($type, $id, 'url,feed');
  
      $template = new Template ($_CONF['path_layout'] . 'admin/trackback');
***************
*** 401,404 ****
--- 389,410 ----
  }
  
+ /**
+ * Wrapper for STORY_getItemInfo / PLG_getItemInfo to keep things readable
+ *
+ * @param    string  $type   type of entry ('article' = story, else plugin)
+ * @param    string  $id     ID of that entry
+ * @param    string  $what   info requested
+ * @return   mixed           requested info, as a string or array of strings
+ *
+ */
+ function getItemInfo ($type, $id, $what)
+ {
+     if ($type == 'article') {
+         return STORY_getItemInfo ($id, 'title');
+     } else {
+         return PLG_getItemInfo ($type, $id, 'title');
+     }
+ }
+ 
  // MAIN
  $display = '';
***************
*** 472,482 ****
      $id = COM_applyFilter ($_REQUEST['id']);
      if (!empty ($id)) {
!         if ($type == 'article') {
!             list ($url, $title, $excerpt) = STORY_getItemInfo ($id,
!                                                 'url,title,excerpt');
!         } else {
!             list ($url, $title, $excerpt) = PLG_getItemInfo ($type, $id,
!                                                 'url,title,excerpt');
!         }
          $excerpt = trim (strip_tags ($excerpt));
          $blog = TRB_filterBlogname ($_CONF['site_name']);
--- 478,483 ----
      $id = COM_applyFilter ($_REQUEST['id']);
      if (!empty ($id)) {
!         list ($url, $title, $excerpt) = getItemInfo ($type, $id,
!                                                      'url,title,excerpt');
          $excerpt = trim (strip_tags ($excerpt));
          $blog = TRB_filterBlogname ($_CONF['site_name']);
***************
*** 538,546 ****
      }
  
!     if ($type == 'article') {
!         $title = STORY_getItemInfo ($id, 'title');
!     } else {
!         $title = PLG_getItemInfo ($type, $id, 'title');
!     }
  
      $display .= COM_siteHeader ('menu', $LANG_TRB['send_pings']);
--- 539,543 ----
      }
  
!     $title = getItemInfo ($type, $id, 'title');
  
      $display .= COM_siteHeader ('menu', $LANG_TRB['send_pings']);
***************
*** 628,636 ****
      }
  
!     if ($type == 'article') {
!         $fulltext = STORY_getItemInfo ($id, 'description');
!     } else {
!         $fulltext = PLG_getItemInfo ($type, $id, 'description');
!     }
  
      $display .= COM_siteHeader ('menu', $LANG_TRB['trackback'])
--- 625,629 ----
      }
  
!     $fulltext = getItemInfo ($type, $id, 'description');
  
      $display .= COM_siteHeader ('menu', $LANG_TRB['trackback'])
***************
*** 653,663 ****
      $trackbackUrl = TRB_detectTrackbackUrl ($url);
  
!     if ($type == 'article') {
!         list ($url, $title, $excerpt) = STORY_getItemInfo ($id,
!                                                            'url,title,excerpt');
!     } else {
!         list ($url, $title, $excerpt) = PLG_getItemInfo ($type, $id,
!                                                          'url,title,excerpt');
!     }
      $excerpt = trim (strip_tags ($excerpt));
      $blog = TRB_filterBlogname ($_CONF['site_name']);
--- 646,651 ----
      $trackbackUrl = TRB_detectTrackbackUrl ($url);
  
!     list ($url, $title, $excerpt) = getItemInfo ($type, $id,
!                                                  'url,title,excerpt');
      $excerpt = trim (strip_tags ($excerpt));
      $blog = TRB_filterBlogname ($_CONF['site_name']);
***************
*** 690,700 ****
          $type = COM_applyFilter ($_REQUEST['type']);
          if (!empty ($id) && !empty ($type)) {
!             if ($type == 'article') {
!                 list ($newurl, $newtitle, $newexcerpt) =
!                         STORY_getItemInfo ($id, 'url,title,excerpt');
!             } else {
!                 list ($newurl, $newtitle, $newexcerpt) =
!                         PLG_getItemInfo ($type, $id, 'url,title,excerpt');
!             }
              $newexcerpt = trim (strip_tags ($newexcerpt));
  
--- 678,683 ----
          $type = COM_applyFilter ($_REQUEST['type']);
          if (!empty ($id) && !empty ($type)) {
!             list ($newurl, $newtitle, $newexcerpt) =
!                                 getItemInfo ($type, $id, 'url,title,excerpt');
              $newexcerpt = trim (strip_tags ($newexcerpt));
  




More information about the geeklog-cvs mailing list