Changeset 762
- Timestamp:
- 07/28/06 10:29:57 (2 years ago)
- Location:
- sandbox
- Files:
-
- 2 removed
- 5 copied
- 1 moved
-
blog/api (moved) (moved from sandbox/plugins/BlogAPI)
-
blog/api/apicore.php (copied) (copied from sandbox/plugins/BlogAPI/apicore.php) (3 diffs)
-
blog/api/blogger.php (copied) (copied from sandbox/plugins/BlogAPI/blogger.php)
-
blog/api/index.php (copied) (copied from sandbox/plugins/BlogAPI/index.php) (5 diffs)
-
blog/api/metaweblog.php (copied) (copied from sandbox/plugins/BlogAPI/metaweblog.php) (2 diffs)
-
blog/api/template.main.tpl (copied) (copied from sandbox/plugins/BlogAPI/template.main.tpl)
-
plugins/BlogAPI/README.txt (deleted)
-
plugins/BlogAPI/index.xml (deleted)
Legend:
- Unmodified
- Added
- Removed
-
sandbox/blog/api/apicore.php
r740 r762 1 1 <?php 2 includeOnce( "Eolin.PHP.Core" );3 includeOnce( "Eolin.PHP.XMLStruct" );4 includeOnce( "Eolin.PHP.XMLTree" );5 includeOnce( "Eolin.PHP.XMLRPC" );6 includeOnce( "Tattertools.Control.RSS" );7 includeOnce( "Tattertools.Core" );8 includeOnce( "Tattertools.Control.Auth" );9 includeOnce( "Tattertools.Data.Post" );10 includeOnce( "Tattertools.Data.Category" );2 requireComponent( "Eolin.PHP.Core" ); 3 requireComponent( "Eolin.PHP.XMLStruct" ); 4 requireComponent( "Eolin.PHP.XMLTree" ); 5 requireComponent( "Eolin.PHP.XMLRPC" ); 6 requireComponent( "Tattertools.Control.RSS" ); 7 requireComponent( "Tattertools.Core" ); 8 requireComponent( "Tattertools.Control.Auth" ); 9 requireComponent( "Tattertools.Data.Post" ); 10 requireComponent( "Tattertools.Data.Category" ); 11 11 12 12 /*--------- Tatter tools Core component load -----------*/ … … 19 19 /*--------- Basic functions -----------*/ 20 20 21 function _get_request_id( $id ) 22 { 23 if( $_GET["id"] ) 24 { 25 DEBUG( "\nUse url request id: ". $_GET["id"] . "\n"); 26 return $_GET["id"]; 27 } 28 return $id; 29 } 30 21 31 function _get_canonical_id( $id ) 22 32 { 23 global $blogapi_dir; 24 $alias_file = $blogapi_dir . "/.htaliases"; 33 $alias_file = ROOT . "/.htaliases"; 34 $canon = _get_request_id( $id ); 35 25 36 if( !file_exists( $alias_file ) ) 26 37 { 27 return $id; 28 } 38 return $canon; 39 } 40 29 41 $fd = fopen( $alias_file, "r" ); 30 $canon = $id;31 42 while( !feof($fd) ) 32 43 { … … 428 439 function _deleteAttachment($owner,$parent,$name){ 429 440 global $database, $blogapi_dir; 430 @unlink( "$blogapi_dir/../../attach/$owner/$name");441 @unlink(ROOT . "/attach/$owner/$name"); 431 442 $name=mysql_escape_string($name); 432 443 $parent_clause = ""; -
sandbox/blog/api/index.php
r740 r762 1 1 <?php 2 define('ROOT', '../..'); 3 require ROOT . '/lib/include.php'; 4 2 5 /*--------- Debugging environment -----------*/ 3 6 global $debug, $debug_file, $blogapi_dir; 4 7 $debug = 0; /* DEBUGLOG */ 5 $debug_file = "../../plugins/BlogAPI/.htdebug.log";8 $debug_file = ROOT . "/.htdebug.log"; 6 9 $blogapi_dir = dirname( __FILE__ ); 7 10 … … 33 36 } 34 37 35 /*--------- Tatter tools Core component load -----------*/36 37 function includeOnce($name){38 global $blogapi_dir;39 if(!ereg('^[[:alnum:]]+[[:alnum:].]+$',$name))40 return ;41 if( TATTERTOOLS_VERSION < "1.0.6" && file_exists( $blogapi_dir . "/$name.php" ) )42 {43 DEBUG ( $blogapi_dir . "/$name.php\n");44 include_once( $blogapi_dir . "/$name.php");45 }46 else47 {48 $componet_file = $blogapi_dir . "/../../components/$name.php";49 if( file_exists( $componet_file ) )50 {51 include_once( $componet_file );52 }53 else54 {55 print( "File($componet_file) doesn't exist\n" );56 }57 }58 }59 60 38 /*--------- API main ---------------*/ 61 39 function BlogAPI() … … 70 48 { 71 49 global $hostURL, $blogURL; 72 $target .= '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$hostURL.$blogURL.'/ plugin/BlogAPI/rsd" />'.CRLF;50 $target .= '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$hostURL.$blogURL.'/api/rsd" />'.CRLF; 73 51 return $target; 74 52 } … … 77 55 { 78 56 global $hostURL, $blogURL; 79 global $service;80 57 global $owner; 81 58 $homeurl = $hostURL.$blogURL; 82 $apiurl = $homeurl . "/plugin/BlogAPI"; 83 $blogid = $service['domain'] . $blogURL; 59 $apiurl = $homeurl . "/api"; 84 60 $blogid = $owner; 85 61 … … 98 74 } 99 75 100 function BlogAPITest()76 if( substr( $_SERVER["REQUEST_URI"], -8 ) == "/api/rsd" ) 101 77 { 102 global $debug,$service, $blog; 103 if( !$debug ) 104 { 105 print( "<b>Set \"\$debug = 1;\" in " . __FILE__ ); 106 return; 107 } 108 print( "<pre>" ); 109 print( dirname(__FILE__) . "\n" ); 110 print( "Test page for checking.\n" ); 111 print( "Tatter tools version: " . TATTERTOOLS_VERSION . "\n"); 112 print( "Tatter tools root: " . ROOT . "\n"); 113 print( "Included " ); 114 print_r( get_included_files() ); 115 print( "</pre>" ); 78 SendRSD(); 116 79 } 117 118 function BlogAPIAtom() 80 else 119 81 { 120 includeOnce( "atom" ); 121 DoAtom(); 82 BlogAPI(); 122 83 } 123 84 ?> -
sandbox/blog/api/metaweblog.php
r740 r762 256 256 function metaWeblog_newMediaObject() 257 257 { 258 global $ blogapi_dir, $owner;258 global $owner; 259 259 DEBUG( "Enter: " . __FUNCTION__ . "\n" ); 260 260 $params = func_get_args(); … … 268 268 $mediaOjbect = $params[3]['bits']; 269 269 270 $tmp_dir = "$blogapi_dir/../../attach/temp";270 $tmp_dir = ROOT. "/attach/temp"; 271 271 if( !is_dir( $tmp_dir ) ) 272 272 {
