@@ -5,6 +5,9 @@ |
||
5 | 5 | final class IntroductionCollector extends Collector |
6 | 6 | { |
7 | 7 | |
8 | + /** |
|
9 | + * @param string $type |
|
10 | + */ |
|
8 | 11 | public static function getRow($type, $value = '') |
9 | 12 | { |
10 | 13 | $query = "SELECT `title`,`content`,`image` FROM `jpemeric_blog`.`introduction` WHERE `type` = '{$type}' && `value` = '{$value}' LIMIT 1"; |
@@ -17,6 +17,9 @@ discard block |
||
17 | 17 | return self::run_query($query); |
18 | 18 | } |
19 | 19 | |
20 | + /** |
|
21 | + * @param integer $total |
|
22 | + */ |
|
20 | 23 | public static function getMainList($total, $offset = 0) |
21 | 24 | { |
22 | 25 | $query = "SELECT `post`.`id` AS `id`, `title`, `path`, `date`, `body`, `category` FROM `jpemeric_blog`.`post` WHERE `display` = '1' ORDER BY `date` DESC LIMIT {$offset}, {$total}"; |
@@ -29,6 +32,9 @@ discard block |
||
29 | 32 | return self::get_count($query); |
30 | 33 | } |
31 | 34 | |
35 | + /** |
|
36 | + * @param integer $total |
|
37 | + */ |
|
32 | 38 | public static function getPostsForTag($tag_id, $total, $offset = 0) |
33 | 39 | { |
34 | 40 | $query = "SELECT `post`.`id` AS `id`, `title`, `path`, `date`, `body`, `category` FROM `jpemeric_blog`.`post`,`jpemeric_blog`.`ptlink` WHERE `display` = '1' && `post`.`id` = `ptlink`.`post_id` && `ptlink`.`tag_id` = '{$tag_id}' ORDER BY `date` DESC LIMIT {$offset}, {$total}"; |
@@ -41,6 +47,9 @@ discard block |
||
41 | 47 | return self::get_count($query); |
42 | 48 | } |
43 | 49 | |
50 | + /** |
|
51 | + * @param integer $total |
|
52 | + */ |
|
44 | 53 | public static function getPostsForCategory($category, $total, $offset = 0) |
45 | 54 | { |
46 | 55 | $category = self::escape($category); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $tag_clause = "'{$tag_clause}'"; |
81 | 81 | |
82 | 82 | $exclude_clause = ''; |
83 | - if(count($exclude_posts) > 0) |
|
83 | + if (count($exclude_posts) > 0) |
|
84 | 84 | { |
85 | 85 | $exclude_clause .= " && `ptlink`.`post_id` NOT IN ('"; |
86 | 86 | $exclude_clause .= implode("', '", $exclude_posts); |
@@ -83,6 +83,9 @@ |
||
83 | 83 | return self::run_query($query); |
84 | 84 | } |
85 | 85 | |
86 | + /** |
|
87 | + * @param integer $count |
|
88 | + */ |
|
86 | 89 | public static function getRecentBlogComments($count) |
87 | 90 | { |
88 | 91 | $query = " |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | return self::run_query($query); |
115 | 115 | } |
116 | 116 | |
117 | - public static function getRecentWaterfallComments($count = 5) |
|
118 | - { |
|
119 | - $query = " |
|
117 | + public static function getRecentWaterfallComments($count = 5) |
|
118 | + { |
|
119 | + $query = " |
|
120 | 120 | SELECT |
121 | 121 | `comment_meta`.`id`, |
122 | 122 | CONCAT('journal/', `log`.`alias`) AS `log_path`, |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | `comment_meta`.`date` DESC |
157 | 157 | LIMIT {$count}"; |
158 | 158 | |
159 | - return self::run_query($query); |
|
160 | - } |
|
159 | + return self::run_query($query); |
|
160 | + } |
|
161 | 161 | |
162 | 162 | public static function getCommentsForURL($site, $path, $commenter = 0) |
163 | 163 | { |
@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | $path = self::escape($path); |
165 | 165 | |
166 | - if($commenter != 0) |
|
166 | + if ($commenter != 0) |
|
167 | 167 | $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
168 | 168 | else |
169 | 169 | $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
@@ -163,10 +163,11 @@ |
||
163 | 163 | { |
164 | 164 | $path = self::escape($path); |
165 | 165 | |
166 | - if($commenter != 0) |
|
167 | - $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
|
168 | - else |
|
169 | - $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
|
166 | + if($commenter != 0) { |
|
167 | + $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
|
168 | + } else { |
|
169 | + $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
|
170 | + } |
|
170 | 171 | |
171 | 172 | $query = " |
172 | 173 | SELECT |
@@ -12,6 +12,9 @@ |
||
12 | 12 | return self::run_query($query); |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $date |
|
17 | + */ |
|
15 | 18 | public static function getDistanceByFields($date, $type, $distance) |
16 | 19 | { |
17 | 20 | $type = self::escape($type); |
@@ -12,6 +12,9 @@ |
||
12 | 12 | return self::run_query($query); |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param integer $action |
|
17 | + */ |
|
15 | 18 | public static function getHuluByFields($title, $action) |
16 | 19 | { |
17 | 20 | $title = self::escape($title); |
@@ -12,6 +12,9 @@ |
||
12 | 12 | return self::run_query($query); |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $date |
|
17 | + */ |
|
15 | 18 | public static function getTweetByFields($date, $text) |
16 | 19 | { |
17 | 20 | $date = self::escape($date); |
@@ -19,6 +19,9 @@ |
||
19 | 19 | return self::run_row_query($query); |
20 | 20 | } |
21 | 21 | |
22 | + /** |
|
23 | + * @param integer $type |
|
24 | + */ |
|
22 | 25 | public static function getImagesForPiece($piece_id, $type) |
23 | 26 | { |
24 | 27 | $piece_id = self::escape($piece_id); |
@@ -35,6 +35,9 @@ discard block |
||
35 | 35 | return self::get_count($query); |
36 | 36 | } |
37 | 37 | |
38 | + /** |
|
39 | + * @param integer $offset |
|
40 | + */ |
|
38 | 41 | public static function getInRange($offset, $start) |
39 | 42 | { |
40 | 43 | $query = "SELECT * FROM `jpemeric_stream`.`post` ORDER BY `date` DESC LIMIT {$start}, {$offset}"; |
@@ -48,6 +51,9 @@ discard block |
||
48 | 51 | return self::get_count($query); |
49 | 52 | } |
50 | 53 | |
54 | + /** |
|
55 | + * @param integer $offset |
|
56 | + */ |
|
51 | 57 | public static function getByTagInRange($tag, $offset, $start) |
52 | 58 | { |
53 | 59 | $tag = self::escape($tag); |
@@ -17,6 +17,9 @@ |
||
17 | 17 | return self::run_row_query($query); |
18 | 18 | } |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $date |
|
22 | + */ |
|
20 | 23 | public static function getDistanceByFields($date, $type, $distance) |
21 | 24 | { |
22 | 25 | $type = self::escape($type); |