Esempio n. 1
0
 public function prasePost($val, $num, $last)
 {
     $val["post_content"] = $this->getArgs["striptags"] ? mgStripTags($val["post_content"]) : $val["post_content"];
     if (!$this->getArgs["content"]) {
         $post = explode("<!--more-->", $val["post_content"]);
         $val["post_content"] = $this->getArgs["sub"] == 0 ? $post[0] : mgSubStr($post[0], 0, $this->getArgs["sub"]);
     }
     $val["post_alt"] = $num % 2;
     $val["post_tags"] = $val["post_tags"] ? explode(",", $val["post_tags"]) : array();
     $val["post_utc"] = $this->stack['static_var']['time_zone'] + $val["post_time"];
     $val["post_time"] = date($this->getArgs["time_format"], $val["post_utc"]);
     $val["post_year"] = date("Y", $val["post_utc"]);
     $val["post_month"] = date("n", $val["post_utc"]);
     $val["post_day"] = date("j", $val["post_utc"]);
     $val["post_is_last"] = $last;
     if ($val['post_is_page']) {
         $val["permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['pages']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['pages']['value']));
     } else {
         $val["permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['archives']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['archives']['value']));
     }
     $val["category_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['category']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['category']['value']));
     $val["trackback_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['trackbacks']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['trackbacks']['value']));
     $val["rss_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['archives_rss']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['archives_rss']['value']));
     $val["post_comment_url"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['post_comment']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['post_comment']['value']));
     return $val;
 }
Esempio n. 2
0
 public function praseFile($val)
 {
     $trim = array('png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff');
     $match = eregi("^([_@0-9a-zA-Z€-ÿ\\^\\.\\%-]{0,})[\\.]([0-9a-zA-Z]{1,})\$", $val['file_name'], $file_name);
     $val['is_image'] = in_array(strtolower($file_name[2]), $trim);
     $val['file_id'] = $val['id'];
     $val["permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['file_output']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['file_output']['value']));
     $val["thumbnail_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['thumbnail']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['thumbnail']['value']));
     $val["view_thumbnail_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['view_thumbnail']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['view_thumbnail']['value']));
     return $val;
 }
Esempio n. 3
0
 private function prasePost($val)
 {
     $val["post_alt"] = $num % 2;
     $val["post_tags"] = $val["post_tags"] ? explode(",", $val["post_tags"]) : array();
     $val["post_utc"] = $this->stack['static_var']['time_zone'] + $val["post_time"];
     $val["post_time"] = date($this->stack['static_var']['post_date_format'], $val["post_utc"]);
     $val["post_year"] = date("Y", $val["post_utc"]);
     $val["post_month"] = date("n", $val["post_utc"]);
     $val["post_day"] = date("j", $val["post_utc"]);
     $val["post_is_last"] = $last;
     if ($val['post_is_page']) {
         $val["permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['pages']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['pages']['value']));
     } else {
         $val["permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['archives']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['archives']['value']));
     }
     $val["category_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['category']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['category']['value']));
     $val["trackback_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['trackbacks']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['trackbacks']['value']));
     $val["rss_permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['archives_rss']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['archives_rss']['value']));
     return $val;
 }
Esempio n. 4
0
 public function praseCategory($val)
 {
     $val["permalink"] = $this->stack['static_var']['index'] . vsprintf($this->stack['permalink']['category']['path'], mgArrayIntersectKey($val, $this->stack['permalink']['category']['value']));
     return $val;
 }