[pLog-svn] r2866 - in plugins/branches/lifetype-1.0/atom: class/net templates

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Jan 29 17:12:02 GMT 2006


Author: oscar
Date: 2006-01-29 17:12:01 +0000 (Sun, 29 Jan 2006)
New Revision: 2866

Modified:
   plugins/branches/lifetype-1.0/atom/class/net/atomrequestgenerator.class.php
   plugins/branches/lifetype-1.0/atom/templates/basic.template
Log:
fixed an issue as reported here (http://forums.lifetype.net/viewtopic.php?t=4077&postdays=0&postorder=asc&start=15), where the atom plugin would fail to report the right url when subdomains are in use.


Modified: plugins/branches/lifetype-1.0/atom/class/net/atomrequestgenerator.class.php
===================================================================
--- plugins/branches/lifetype-1.0/atom/class/net/atomrequestgenerator.class.php	2006-01-29 01:41:32 UTC (rev 2865)
+++ plugins/branches/lifetype-1.0/atom/class/net/atomrequestgenerator.class.php	2006-01-29 17:12:01 UTC (rev 2866)
@@ -12,12 +12,22 @@
 	
 		function AtomRequestGenerator( $blogInfo = null, $mode = CHECK_CONFIG_REQUEST_MODE )
 		{
+			$this->_blogInfo = $blogInfo;		
 			$this->RawRequestGenerator( $blogInfo, $mode );
-			
-			$this->_blogInfo = $blogInfo;
 		}
 		
 		/**
+		 * this is a slight trick that we had to pull if we wanted to have support for subdomains in
+		 * Atom uris, or else calling things like atomBaseUrl or servicePostUrl would result in URLs
+		 * that did not have {blogname} and {username} already replaced in them
+		 */
+		function setBlog( $blogInfo )
+		{
+		  $this->_blogInfo = $blogInfo;
+		  $this->RawRequestGenerator( $blogInfo );
+		}
+		
+		/**
 		 * returns the entry point to the atom interface
 		 */		
 		function atomBaseUrl()

Modified: plugins/branches/lifetype-1.0/atom/templates/basic.template
===================================================================
--- plugins/branches/lifetype-1.0/atom/templates/basic.template	2006-01-29 01:41:32 UTC (rev 2865)
+++ plugins/branches/lifetype-1.0/atom/templates/basic.template	2006-01-29 17:12:01 UTC (rev 2866)
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
  <feed xmlns="http://purl.org/atom/ns#">
   {foreach from=$blogs item=blog}
+  {$url->setBlog($blog)}
+  <link xmlns="http://purl.org/atom/ns#" type="application/x.atom+xml" rel="service.feed" href="{$url->serviceFeedUrl($blog)}" title="{$blog->getBlog()}"/>
   <link xmlns="http://purl.org/atom/ns#" type="application/x.atom+xml" rel="service.post" href="{$url->servicePostUrl($blog)}" title="{$blog->getBlog()}"/>
-  <link xmlns="http://purl.org/atom/ns#" type="application/x.atom+xml" rel="service.feed" href="{$url->serviceFeedUrl($blog)}" title="{$blog->getBlog()}"/>
   <link xmlns="http://purl.org/atom/ns#" type="application/x.atom+xml" rel="service.upload" href="{$url->serviceUploadUrl($blog)}" title="{$blog->getBlog()}"/>
   <link xmlns="http://purl.org/atom/ns#" type="application/x.atom+xml" rel="service.categories" href="{$url->serviceCategoriesUrl($blog)}" title="{$blog->getBlog()|escape}"/>
   <link xmlns="http://purl.org/atom/ns#" type="text/html" rel="alternate" href="{$url->blogLink($blog)}" title="{$blog->getBlog()}"/>



More information about the pLog-svn mailing list