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 !
* Page viewing logic is much smarter.
* Fixed comment edit/delete links in Firefox
* Touched up comment pagination links
vito (author)
Thu Jul 24 18:53:43 -0700 2008
commit  582e492959ca0bef40d6e02be1654fd31185c1e5
tree    abbf9850842ec4eeda2f51362e89d8337847e36d
parent  efce460d9879a9583175573a6936b5b9060714bf
...
228
229
230
231
232
 
233
234
235
236
 
 
 
 
 
 
 
237
238
239
...
228
229
230
 
 
231
232
 
 
 
233
234
235
236
237
238
239
240
241
242
0
@@ -228,12 +228,15 @@
0
       if (count($this->arg) == 1 and method_exists(MainController::current(), $this->arg[0]))
0
         return $this->action = $this->arg[0];
0
 
0
- $page = new Page(null, array("where" => "url = :url",
0
- "params" => array(":url" => end($this->arg))));
0
+ $valids = Page::find(array("where" => "url IN ('".implode("', '", $this->arg)."')"));
0
 
0
- if (!$page->no_results)
0
- return list($_GET['url'], $this->action) = array(end($this->arg), "page");
0
- elseif ($i_have_the_power)
0
+ if (count($valids) == count($this->arg)) {
0
+ foreach ($valids as $valid)
0
+ if ($valid->url == end($this->arg)) {
0
+ $page = $valid;
0
+ return list($_GET['url'], $this->action) = array($valid->url, "page");
0
+ }
0
+ } elseif ($i_have_the_power)
0
         return $this->action = fallback($this->arg[0], "index");
0
     }
0
 
...
116
117
118
 
 
 
 
 
 
 
 
 
 
 
119
120
121
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
0
@@ -116,6 +116,17 @@
0
     }
0
 
0
     /**
0
+ * Function: page
0
+ * Handles page viewing.
0
+ */
0
+ public function page() {
0
+ global $page;
0
+
0
+ if (!isset($page))
0
+ $page = new Page(null, array("where" => "url = :url", "params" => array(":url" => $_GET['url'])));
0
+ }
0
+
0
+ /**
0
      * Function: feed
0
      * Grabs posts for the feed.
0
      */
...
34
35
36
37
38
39
40
41
...
34
35
36
 
 
37
38
39
0
@@ -34,8 +34,6 @@
0
       $theme->load(array("pages/view", "pages/index"), array("post" => $post, "posts" => array($post)));
0
       break;
0
     case "page":
0
- fallback($page, new Page(null, array("where" => "url = :url", "params" => array(":url" => $_GET['url']))));
0
-
0
       if (!$page->no_results) {
0
         $theme->title = $page->title;
0
 
...
6
7
8
9
10
11
 
12
13
...
6
7
8
 
9
10
11
12
13
0
@@ -6,8 +6,8 @@
0
         $comment.body
0
       </blockquote>
0
       <cite>
0
- ${ "<strong>%s</strong> on <a href=\"%s\" class=\"permalink\">%s</a>" | translate | format(comment.author_link, comment.post.url ~ "#comment_"~comment.id, comment.created_at | strftime("%B %e, %Y, at %I:%M %p" | translate)) }
0
         ${ comment.delete_link("Delete" | translate, "") }
0
         ${ comment.edit_link("Edit" | translate, "") }
0
+ ${ "<strong>%s</strong> on <a href=\"%s\" class=\"permalink\">%s</a>" | translate | format(comment.author_link, comment.post.url ~ "#comment_"~comment.id, comment.created_at | strftime("%B %e, %Y, at %I:%M %p" | translate)) }
0
       </cite>
0
     </li>
...
13
14
15
16
17
 
 
 
 
 
18
19
20
...
13
14
15
 
 
16
17
18
19
20
21
22
23
0
@@ -13,8 +13,11 @@
0
         </ol>
0
         {% endif %}
0
         <input type="hidden" name="last_comment" value="$post.latest_comment" id="last_comment" />
0
- ${ post.comments.next_link("Next &rarr;" | translate, "next_page") }
0
- ${ post.comments.prev_link("&larr; Previous" | translate, "prev_page") }
0
+ $post.comments.prev_link
0
+ $post.comments.next_link
0
+ {% if post.comments.paginated and post.comments.pages > 1 %}
0
+ <span class="pages">Page $post.comments.page of $post.comments.pages</span>
0
+ {% endif %}
0
 {% if post.commentable %}
0
 {% include "forms/comment/new.twig" %}
0
 {% endif %}

Comments

    No one has commented yet.