0
class Post extends Model {
0
+ # Boolean: $no_results
0
public $no_results = false;
0
- * SQL "where" text for which posts the current user can view.
0
+ # SQL "where" text for which posts the current user can view.
0
- * String: $enabled_feathers
0
- * SQL "where" text for each of the feathers. Prevents posts of a disabled Feather from showing.
0
+ # String: $enabled_feathers
0
+ # SQL "where" text for each of the feathers. Prevents posts of a disabled Feather from showing.
0
static $enabled_feathers;
0
+ $this->filtered = !isset($options["filter"]) or $options["filter"];
0
$this->slug =& $this->url;
0
- $this->parse(!isset($options["filter"]) or $options["filter"]);
0
* Generates an acceptable Title from the post's excerpt.
0
- *
$normalized - The post's excerpt. filtered -> tags stripped -> truncated to 75 characters -> normalized.
0
+ *
The post's excerpt. iltered -> first line -> ftags stripped -> truncated to 75 characters -> normalized.
0
public function title_from_excerpt() {
0
if ($this->no_results) return false;
0
- $excerpt = $this->excerpt();
0
+ # Excerpts are likely to have some sort of markup module applied to them;
0
+ # if the current instantiation is not filtered, make one that is.
0
+ $post = ($this->filtered) ? $this : new Post($this->id) ;
0
+ $excerpt = $post->excerpt();
0
Trigger::current()->filter($excerpt, "title_from_excerpt");
0
$split_lines = explode("\n", $excerpt);
0
public function title() {
0
if ($this->no_results) return false;
0
- $title = $feathers[$this->feather]->title($this);
0
- return Trigger::current()->filter($title, "title");
0
+ # Excerpts are likely to have some sort of markup module applied to them;
0
+ # if the current instantiation is not filtered, make one that is.
0
+ $post = ($this->filtered) ? $this : new Post($this->id) ;
0
+ $title = $feathers[$this->feather]->title($post);
0
+ return Trigger::current()->filter($title, "title", $post);
0
public function excerpt() {
0
if ($this->no_results) return false;
0
- $excerpt = $feathers[$this->feather]->excerpt($this);
0
- return Trigger::current()->filter($excerpt, "excerpt");
0
+ # Excerpts are likely to have some sort of markup module applied to them;
0
+ # if the current instantiation is not filtered, make one that is.
0
+ $post = ($this->filtered) ? $this : new Post($this->id) ;
0
+ $excerpt = $feathers[$this->feather]->excerpt($post);
0
+ return Trigger::current()->filter($excerpt, "excerpt", $post);
0
public function feed_content() {
0
if ($this->no_results) return false;
0
- return call_user_func(array($feathers[$this->feather], "feed_content"), $this);
0
+ # Excerpts are likely to have some sort of markup module applied to them;
0
+ # if the current instantiation is not filtered, make one that is.
0
+ $post = ($this->filtered) ? $this : new Post($this->id) ;
0
+ $feed_content = $feathers[$this->feather]->feed_content($post);
0
+ return Trigger::current()->filter($feed_content, "feed_content", $post);
0
* Parses the passed XML and loads the tags and values into <Post>.
0
- * $filter - Should the data be run through any triggers?
0
- private function parse(
$filter = false) {
0
+ private function parse(
) {
0
foreach (self::xml2arr(simplexml_load_string($this->xml)) as $key => $val)
0
$this->$key = codepoint2name($val);
0
$class = camelize($this->feather);
Comments
No one has commented yet.