Query::SetLimit() 削除
@@ -351,11 +351,6 @@ | ||
351 | 351 | private $lock = false; |
352 | 352 | |
353 | 353 | //-- 直接生成型 --// |
354 | - //LIMIT 句生成 | |
355 | - public static function SetLimit($from, $to) { | |
356 | - return sprintf(' LIMIT %d, %d', $from, $to); | |
357 | - } | |
358 | - | |
359 | 354 | //LIKE 句生成 |
360 | 355 | public static function GetLike($str) { |
361 | 356 | return Text::Quote($str, '%', '%'); |
@@ -96,9 +96,11 @@ | ||
96 | 96 | $cache_flag = false; //キャッシュ取得判定 |
97 | 97 | if (JinrouCacheManager::Enable(JinrouCacheManager::LOG_LIST)) { |
98 | 98 | $cache_flag = self::IsCache(); |
99 | - if ($cache_flag) { | |
99 | + if (true === $cache_flag) { | |
100 | 100 | $str = JinrouCacheManager::Get(JinrouCacheManager::LOG_LIST); |
101 | - if (isset($str)) return $str; | |
101 | + if (true === isset($str)) { | |
102 | + return $str; | |
103 | + } | |
102 | 104 | } |
103 | 105 | } |
104 | 106 |
@@ -111,7 +113,9 @@ | ||
111 | 113 | |
112 | 114 | if (RQ::Get()->generate_index) { |
113 | 115 | $max = RQ::Get()->max_room_no; |
114 | - if (is_int($max) && $max > 0 && $room_count > $max) $room_count = $max; | |
116 | + if (is_int($max) && $max > 0 && $room_count > $max) { | |
117 | + $room_count = $max; | |
118 | + } | |
115 | 119 | $builder = new PageLinkBuilder('index', RQ::Get()->page, $room_count); |
116 | 120 | $builder->set_reverse = $is_reverse; |
117 | 121 | $builder->url = '<a href="index'; |
@@ -199,7 +203,7 @@ | ||
199 | 203 | } |
200 | 204 | |
201 | 205 | $str .= Text::LineFeed(self::GetListFooter()); |
202 | - if ($cache_flag) { | |
206 | + if (true === $cache_flag) { | |
203 | 207 | JinrouCacheManager::Store($str); |
204 | 208 | } |
205 | 209 | return $str; |
@@ -49,7 +49,7 @@ | ||
49 | 49 | } |
50 | 50 | |
51 | 51 | if ($this->file == 'old_log') { |
52 | - $this->AddOption('reverse', Switcher::Get(! $this->set_reverse)); | |
52 | + $this->AddOption('reverse', Switcher::Get(false === $this->set_reverse)); | |
53 | 53 | $url_stack[] = OldLogMessage::LINK_ORDER; |
54 | 54 | if ($this->set_reverse) { |
55 | 55 | $url_stack[] = OldLogMessage::ORDER_REVERSE; |
@@ -80,8 +80,11 @@ | ||
80 | 80 | |
81 | 81 | //ページ送り用のリンクタグを作成する |
82 | 82 | protected function GenerateTag($page, $title = null, $force = false) { |
83 | - if ($page == $this->page->set && ! $force) return Text::QuoteBracket($page); | |
84 | - if (is_null($title)) { | |
83 | + if ($page == $this->page->set && false === $force) { | |
84 | + return Text::QuoteBracket($page); | |
85 | + } | |
86 | + | |
87 | + if (true === is_null($title)) { | |
85 | 88 | $title = Text::QuoteBracket($page); |
86 | 89 | } |
87 | 90 | if ($this->file == 'index') { |
@@ -106,8 +109,7 @@ | ||
106 | 109 | } |
107 | 110 | $start = max(1, $start); |
108 | 111 | } |
109 | - $end = $start + $this->view_page - 1; | |
110 | - if ($end > $total) $end = $total; | |
112 | + $end = min($total, $start + $this->view_page - 1); | |
111 | 113 | |
112 | 114 | $this->page->set = $page; |
113 | 115 | $this->page->total = $total; |
@@ -114,7 +116,5 @@ | ||
114 | 116 | $this->page->start = $start; |
115 | 117 | $this->page->end = $end; |
116 | 118 | //Text::p($this->page, '◆page'); |
117 | - $this->limit = $page == 'all' ? '' : $this->view_count * ($page - 1); | |
118 | - $this->query = $page == 'all' ? '' : Query::SetLimit($this->limit, $this->view_count); | |
119 | 119 | } |
120 | 120 | } |