public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
Moved the Route->feed changing stuff to the "view" action altogether.
vito (author)
Sat Nov 01 17:24:42 -0700 2008
commit  08bfcbbd0492940b546a39dbb67bd8ecd3185c70
tree    f4b8a17bf0286c476c86bc734abdda98f7f69b4e
parent  8227e88f9aca7b2a8ae48013cd344baf2c54fdae
...
196
197
198
199
200
201
202
203
204
205
206
207
208
209
 
210
211
212
...
373
374
375
376
 
377
378
379
380
381
382
383
 
384
385
 
 
 
 
 
386
387
388
...
736
737
738
 
...
196
197
198
 
 
 
 
 
 
 
199
200
201
 
202
203
204
205
...
366
367
368
 
369
370
371
372
373
374
 
 
375
376
 
377
378
379
380
381
382
383
384
...
732
733
734
735
0
@@ -196,17 +196,10 @@
0
                     if ($parameter[0] == "(")
0
                         $post_url_attrs[rtrim(ltrim($parameter, "("), ")")] = $args[$index];
0
 
0
-                $original_feed = $this->feed;
0
-
0
-                if ((oneof(@$post_url_attrs["url"], @$post_url_attrs["clean"]) == "feed") and # do some checking to see if they're trying
0
-                    (count(explode("/", trim($post_url, "/"))) > count($args) or              # to view the post or the post's feed.
0
-                     end($args) != "feed"))
0
-                    $this->feed = false;
0
-
0
                 if ($return_post)
0
                     return Post::from_url($post_url_attrs);
0
                 else
0
-                    $route->try["view"] = array($post_url_attrs, $original_feed);
0
+                    $route->try["view"] = array($post_url_attrs, $args);
0
             }
0
         }
0
 
0
@@ -373,16 +366,19 @@
0
          * Function: view
0
          * Views a post.
0
          */
0
-        public function view($attrs = null, $original_feed = false) {
0
+        public function view($attrs = null, $args = array()) {
0
             if (isset($attrs))
0
                 $post = Post::from_url($attrs, array("drafts" => true));
0
             else
0
                 $post = new Post(array("url" => @$_GET['url']));
0
 
0
-            if ($post->no_results) {
0
-                Route::current()->feed = $original_feed;
0
+            if ($post->no_results)
0
                 return false;
0
-            }
0
+
0
+            if ((oneof(@$attrs["url"], @$attrs["clean"]) == "feed") and # do some checking to see if they're trying
0
+                (count(explode("/", trim($post_url, "/"))) > count($args) or              # to view the post or the post's feed.
0
+                 end($args) != "feed"))
0
+                $this->feed = false;
0
 
0
             if (!$post->theme_exists())
0
                 error(__("Error"), __("The feather theme file for this post does not exist. The post cannot be displayed."));
0
@@ -736,3 +732,4 @@
0
             return $instance = (empty($instance)) ? new self() : $instance ;
0
         }
0
     }
0
+

Comments