Changeset 539475
- Timestamp:
- 05/03/2012 03:07:16 PM (14 years ago)
- Location:
- create-a-league
- Files:
-
- 2 edited
- 3 copied
-
tags/1.0 (copied) (copied from create-a-league/trunk)
-
tags/1.0/create-your-league.php (copied) (copied from create-a-league/trunk/create-your-league.php) (5 diffs)
-
tags/1.0/readme.txt (copied) (copied from create-a-league/trunk/readme.txt) (2 diffs)
-
trunk/create-your-league.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
create-a-league/tags/1.0/create-your-league.php
r483272 r539475 3 3 Plugin Name: Create Your League 4 4 Plugin URI: http://www.createyourleague.com/ 5 Version: 0.55 Version: 1.0 6 6 Author: createyourleague, http://www.risultatieclassifiche.net/ 7 7 Author URI: http://www.risultatieclassifiche.net/ … … 24 24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 25 25 */ 26 27 function createyourleague_get_remote_file($url) 28 { 29 // get the host name and url path 30 $parsedUrl = parse_url($url); 31 $host = $parsedUrl['host']; 32 if (isset($parsedUrl['path'])) { 33 $path = $parsedUrl['path']; 34 } else { 35 // the url is pointing to the host like http://www.mysite.com 36 $path = '/'; 37 } 38 39 if (isset($parsedUrl['query'])) { 40 $path .= '?' . $parsedUrl['query']; 41 } 42 43 if (isset($parsedUrl['port'])) { 44 $port = $parsedUrl['port']; 45 } else { 46 // most sites use port 80 47 $port = '80'; 48 } 49 50 $timeout = 20; 51 $response = ''; 52 53 $referer = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; 54 55 // connect to the remote server 56 $fp = fsockopen($host, $port, $errno, $errstr, $timeout); 57 58 if( !$fp ) { 59 echo "Cannot retrieve $url"; 60 } else { 61 // send the necessary headers to get the file 62 fputs($fp, "GET $path HTTP/1.0\r\n" . 63 "Host: $host\r\n" . 64 "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3\r\n" . 65 "Referer: $referer\r\n\r\n"); 66 67 // retrieve the response from the remote server 68 while ($line = fread($fp, 4096)) { 69 $response .= $line; 70 } 71 72 fclose($fp); 73 74 // strip the headers 75 $pos = strpos($response, "\r\n\r\n"); 76 $response = substr($response, $pos + 4); 77 } 78 79 // return the file content 80 return $response; 81 } 26 82 27 83 function createyourleague_context() { … … 48 104 $host = createyourleague_host($lang); 49 105 50 return file_get_contents('http://' . $host . '/api/php/' . $id, false, createyourleague_context());106 return createyourleague_get_remote_file('http://' . $host . '/api/php/' . $id); 51 107 } 52 108 … … 61 117 $host = createyourleague_host($lang); 62 118 63 return file_get_contents('http://' . $host . '/api/php-days/' . $id . '?order=' . urlencode($order) . '&limit=' . urlencode($limit) . '&day=' . urlencode($day) . '&two_columns=' . urlencode($two_columns), false, createyourleague_context());119 return createyourleague_get_remote_file('http://' . $host . '/api/php-days/' . $id . '?order=' . urlencode($order) . '&limit=' . urlencode($limit) . '&day=' . urlencode($day) . '&two_columns=' . urlencode($two_columns)); 64 120 } 65 121 … … 69 125 $host = createyourleague_host($lang); 70 126 71 return file_get_contents('http://' . $host . '/api/php-topscorers/' . $id, false, createyourleague_context());127 return createyourleague_get_remote_file('http://' . $host . '/api/php-topscorers/'); 72 128 } 73 129 -
create-a-league/tags/1.0/readme.txt
r483272 r539475 5 5 Requires at least: 2.5 6 6 Tested up to: 3.3 7 Stable tag: 0.57 Stable tag: 1.0 8 8 9 9 Create Your League is a completely FREE service that allows you to publish the ranking table of your league directly to your WordPress web site. … … 65 65 == Changelog == 66 66 67 = 1.0 = 68 * fixed error when php setting allow_fopen_url is off 69 67 70 = 0.4 = 68 71 * added new parameters to createyourleague_days -
create-a-league/trunk/create-your-league.php
r483272 r539475 3 3 Plugin Name: Create Your League 4 4 Plugin URI: http://www.createyourleague.com/ 5 Version: 0.55 Version: 1.0 6 6 Author: createyourleague, http://www.risultatieclassifiche.net/ 7 7 Author URI: http://www.risultatieclassifiche.net/ … … 24 24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 25 25 */ 26 27 function createyourleague_get_remote_file($url) 28 { 29 // get the host name and url path 30 $parsedUrl = parse_url($url); 31 $host = $parsedUrl['host']; 32 if (isset($parsedUrl['path'])) { 33 $path = $parsedUrl['path']; 34 } else { 35 // the url is pointing to the host like http://www.mysite.com 36 $path = '/'; 37 } 38 39 if (isset($parsedUrl['query'])) { 40 $path .= '?' . $parsedUrl['query']; 41 } 42 43 if (isset($parsedUrl['port'])) { 44 $port = $parsedUrl['port']; 45 } else { 46 // most sites use port 80 47 $port = '80'; 48 } 49 50 $timeout = 20; 51 $response = ''; 52 53 $referer = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; 54 55 // connect to the remote server 56 $fp = fsockopen($host, $port, $errno, $errstr, $timeout); 57 58 if( !$fp ) { 59 echo "Cannot retrieve $url"; 60 } else { 61 // send the necessary headers to get the file 62 fputs($fp, "GET $path HTTP/1.0\r\n" . 63 "Host: $host\r\n" . 64 "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3\r\n" . 65 "Referer: $referer\r\n\r\n"); 66 67 // retrieve the response from the remote server 68 while ($line = fread($fp, 4096)) { 69 $response .= $line; 70 } 71 72 fclose($fp); 73 74 // strip the headers 75 $pos = strpos($response, "\r\n\r\n"); 76 $response = substr($response, $pos + 4); 77 } 78 79 // return the file content 80 return $response; 81 } 26 82 27 83 function createyourleague_context() { … … 48 104 $host = createyourleague_host($lang); 49 105 50 return file_get_contents('http://' . $host . '/api/php/' . $id, false, createyourleague_context());106 return createyourleague_get_remote_file('http://' . $host . '/api/php/' . $id); 51 107 } 52 108 … … 61 117 $host = createyourleague_host($lang); 62 118 63 return file_get_contents('http://' . $host . '/api/php-days/' . $id . '?order=' . urlencode($order) . '&limit=' . urlencode($limit) . '&day=' . urlencode($day) . '&two_columns=' . urlencode($two_columns), false, createyourleague_context());119 return createyourleague_get_remote_file('http://' . $host . '/api/php-days/' . $id . '?order=' . urlencode($order) . '&limit=' . urlencode($limit) . '&day=' . urlencode($day) . '&two_columns=' . urlencode($two_columns)); 64 120 } 65 121 … … 69 125 $host = createyourleague_host($lang); 70 126 71 return file_get_contents('http://' . $host . '/api/php-topscorers/' . $id, false, createyourleague_context());127 return createyourleague_get_remote_file('http://' . $host . '/api/php-topscorers/'); 72 128 } 73 129 -
create-a-league/trunk/readme.txt
r483272 r539475 5 5 Requires at least: 2.5 6 6 Tested up to: 3.3 7 Stable tag: 0.57 Stable tag: 1.0 8 8 9 9 Create Your League is a completely FREE service that allows you to publish the ranking table of your league directly to your WordPress web site. … … 65 65 == Changelog == 66 66 67 = 1.0 = 68 * fixed error when php setting allow_fopen_url is off 69 67 70 = 0.4 = 68 71 * added new parameters to createyourleague_days
Note: See TracChangeset
for help on using the changeset viewer.