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

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sat Jan 29 12:52:57 EST 2005


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

Modified Files:
	trackback.php 
Log Message:
Changed plugin API for Trackback / Pingback functions


Index: trackback.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/trackback.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** trackback.php	29 Jan 2005 09:02:11 -0000	1.3
--- trackback.php	29 Jan 2005 17:52:55 -0000	1.4
***************
*** 39,43 ****
  require_once ('auth.inc.php');
  
! if (!$_CONF['trackback_enabled']) {
      echo COM_refresh ($_CONF['site_admin_url'] . '/index.php');
      exit;
--- 39,43 ----
  require_once ('auth.inc.php');
  
! if (!$_CONF['trackback_enabled'] && !$_CONF['pingback_enabled']) {
      echo COM_refresh ($_CONF['site_admin_url'] . '/index.php');
      exit;
***************
*** 59,62 ****
--- 59,64 ----
  
  require_once ($_CONF['path_system'] . 'lib-trackback.php');
+ require_once ($_CONF['path_system'] . 'lib-pingback.php');
+ require_once ($_CONF['path_system'] . 'lib-story.php');
  
  /**
***************
*** 145,182 ****
  
  /**
- * Get information for an entry
- *
- * Retrieves the information (URL, title, excerpt) for an entry, so that we
- * can populate the input fields in the trackback comment editor.
- *
- * @param    string  $sid    ID of the entry
- * @param    string  $type   type of the entry ('article' = story)
- * @retrun   array           array (URL, title, excerpt)
- *
- */
- function getinfo ($sid, $type = 'article')
- {
-     global $_CONF, $_TABLES;
- 
-     if ($type == 'article') {
-         $story = addslashes ($sid);
-         $result = DB_query ("SELECT title, introtext FROM {$_TABLES['stories']} WHERE (sid = '$story') AND (draft_flag = 0) AND (date <= NOW())" . COM_getPermSql ('AND') . COM_getTopicSql ('AND'));
-         list ($title, $excerpt) = DB_fetchArray ($result);
- 
-         if (!empty ($title) && !empty ($excerpt)) {
-             $url = COM_buildUrl ($_CONF['site_url'] . '/article.php?story='
-                                  . $sid);
-             return array ($url,
-                           stripslashes ($title),
-                           TRB_filterExcerpt ($excerpt));
-         }
-     } else {
-         return PLG_handleTrackbackComment ($type, $sid, 'info');
-     }
- 
-     return array ('', '', '');
- }
- 
- /**
  * Deletes a trackback comment. Checks if the current user has proper
  * permissions first.
--- 147,150 ----
***************
*** 301,305 ****
      $id = COM_applyFilter ($_REQUEST['id']);
      if (!empty ($id)) {
!         list ($url, $title, $excerpt) = getinfo ($id, $type);
          $blog = TRB_filterBlogname ($_CONF['site_name']);
  
--- 269,280 ----
      $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']);
  
***************
*** 330,334 ****
          $type = COM_applyFilter ($_REQUEST['type']);
          if (!empty ($id) && !empty ($type)) {
!             list ($newurl, $newtitle, $newexcerpt) = getinfo ($id, $type);
  
              if (empty ($url) && !empty ($newurl)) {
--- 305,316 ----
          $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));
  
              if (empty ($url) && !empty ($newurl)) {




More information about the geeklog-cvs mailing list