Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     $this->per_page = sets::pp('post_gouf');
     $sorter = new Database_Sorter('overall');
     $this->sorters[] = $sorter;
 }
Beispiel #2
0
 public function __construct()
 {
     parent::__construct();
     $cookie = new dynamic__cookie();
     $cookie->inner_set('visit.post', time(), false);
     $this->per_page = sets::pp('post');
 }
Beispiel #3
0
 public function __construct()
 {
     parent::__construct();
     if (sets::user('rights')) {
         $this->side_modules['top'][] = 'add_bar';
     }
     $this->per_page = sets::pp('news');
 }
Beispiel #4
0
?>
>5</option>
	<option value="7"<?php 
echo sets::pp('board_posts') == 7 ? ' selected="yes"' : '';
?>
>7</option>
	<option value="10"<?php 
echo sets::pp('board_posts') == 10 ? ' selected="yes"' : '';
?>
>10</option>
	<option value="15"<?php 
echo sets::pp('board_posts') == 15 ? ' selected="yes"' : '';
?>
>15</option>
	<option value="20"<?php 
echo sets::pp('board_posts') == 20 ? ' selected="yes"' : '';
?>
>20</option>
</select>
<br />
Все треды на главной: 
<input type="checkbox" class="settings" rel="board.allthreads" value="1"<?php 
echo sets::board('allthreads') ? ' checked' : '';
?>
>
<br />
Сразу показывать видео: 
<input type="checkbox" class="settings" rel="board.embedvideo" value="1"<?php 
echo sets::board('embedvideo') ? ' checked' : '';
?>
>
Beispiel #5
0
    function get_data()
    {
        if ($this->template != 'slideshow') {
            global $url;
            global $error;
            global $sets;
            global $def;
            if (is_numeric($url[2])) {
                $return['display'] = array('booru_single', 'comments');
                $return['art'] = $this->get_art(1, 'id=' . $url[2] . ' and area != "deleted"');
                $url['area'] = $return['art'][0]['area'];
                $return['comments'] = $this->get_comments($url[1], $url[2], is_numeric($url[5]) ? $url[5] : ($url[4] == 'all' ? false : 1));
                $return['navi']['curr'] = $url[4] == 'all' ? 'all' : max(1, $url[5]);
                $return['navi']['all'] = true;
                $return['navi']['name'] = "Страница комментариев";
                $return['navi']['meta'] = $url[2] . '/comments/';
                $return['navi']['start'] = max($return['navi']['curr'] - 5, 2);
                $return['navi']['last'] = ceil($return['comments']['number'] / $sets['pp']['comment_in_post']);
                $this->side_modules['top'] = array();
                $return['art'][0]['rating'] = $this->get_rating($url[2]);
                $return['art'][0]['packs'] = $this->get_packs($url[2]);
                $return['art'][0]['pool'] = $this->get_pools($url[2]);
            } elseif ($url[2] != 'pool' && $url[2] != 'cg_packs' && $url[2] != 'download') {
                $return['display'] = array('booru_page', 'navi');
                if ($url[2] == 'page' || !$url[2]) {
                    $area = 'area = "' . $url['area'] . '"';
                    $return['navi']['curr'] = max(1, $url[3]);
                    if ($sets['art']['sort'] == 'tag-desc') {
                        $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], $area, 'order by (length(tag) - length(replace(tag,\'|\',\'\'))) desc');
                    } elseif ($sets['art']['sort'] == 'tag-asc') {
                        $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], $area, 'order by (length(tag) - length(replace(tag,\'|\',\'\')))');
                    } else {
                        $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], $area);
                    }
                } elseif ($url[2] == 'date') {
                    $parts = explode('-', $url[3]);
                    if (is_numeric($parts[0] . $parts[1] . $parts[2]) && count($parts) == 3) {
                        $area = 'area = "' . $url['area'] . '" and pretty_date ="' . Transform_Time::ru_month($parts[1]) . ' ' . $parts[2] . ', ' . $parts[0] . '"';
                        $return['navi']['curr'] = max(1, $url[5]);
                        $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], $area);
                        $return['navi']['meta'] = $url[2] . '/' . $url[3] . '/';
                    } else {
                        $error = true;
                    }
                } elseif ($url[2] != 'mixed') {
                    $this->mixed_parse($url[2] . '=' . $url[3]);
                    $area = 'area = "' . $url['area'] . '" and locate("|' . ($url['tag'] ? $url['tag'] : mysql_real_escape_string($url[3])) . '|",art.' . $url[2] . ')';
                    $return['navi']['curr'] = max(1, $url[5]);
                    $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], $area);
                    $return['navi']['meta'] = $url[2] . '/' . $url[3] . '/';
                    $return['rss'] = $this->make_rss($url[1], $url[2], $url[3]);
                } else {
                    $area = $this->mixed_make_sql($this->mixed_parse($url[3]));
                    $return['navi']['curr'] = max(1, $url[5]);
                    $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], $area);
                    $return['navi']['meta'] = $url[2] . '/' . $url[3] . '/';
                }
                $return['navi']['start'] = max($return['navi']['curr'] - 5, 2);
                $return['navi']['last'] = ceil(obj::db()->sql('select count(id) from art where (' . $area . ')', 2) / $sets['pp']['art']);
            } else {
                if ($url[2] == 'pool') {
                    if (is_numeric($url[3])) {
                        if ($url[4] != 'sort') {
                            $return['display'] = array('booru_poolsingle', 'booru_page', 'navi');
                        } else {
                            $return['display'] = array('booru_poolsingle', 'booru_page');
                        }
                        $return['pool'] = Database::get_full_row('art_pool', $url[3]);
                        $query = Database::set_counter()->order('order', 'asc');
                        if ($url[4] != 'sort') {
                            $return['navi']['curr'] = max(1, $url[5]);
                            $return['navi']['meta'] = $url[2] . '/' . $url[3] . '/';
                            $return['navi']['start'] = max($return['navi']['curr'] - 5, 2);
                            $query->limit(sets::pp('art'), ($return['navi']['curr'] - 1) * sets::pp('art'));
                        }
                        $pool = $query->get_vector('art_in_pool', 'art_id', 'pool_id = ?', $url[3]);
                        $return['pool']['count'] = Database::get_counter();
                        if ($url[4] != 'sort') {
                            $return['navi']['last'] = ceil($return['pool']['count'] / $sets['pp']['art']);
                        }
                        $where = 'id=' . implode(' or id=', $pool);
                        $pool = array_flip($pool);
                        if ($art = $this->get_art(false, $where, '')) {
                            foreach ($art as $one) {
                                $return['art']['thumbs'][$pool[$one['id']]] = $one;
                            }
                            ksort($return['art']['thumbs']);
                        }
                        $return['rss'] = $this->make_rss($url[1], $url[2], $url[3]);
                    } else {
                        $return['display'] = array('booru_poolpage', 'navi');
                        $return['navi']['curr'] = max(1, $url[4]);
                        $return['navi']['meta'] = $url[2] . '/';
                        $return['navi']['start'] = max($return['navi']['curr'] - 5, 2);
                        $return['navi']['last'] = ceil(obj::db()->sql('select count(id) from art_pool', 2) / $sets['pp']['art_pool']);
                        $return['pools'] = obj::db()->sql('
							select p.id as id, p.name as name, count(*) as count
							from art_pool as p left join art_in_pool as a on p.id = a.pool_id
							group by p.id order by p.sortdate desc
							limit ' . ($return['navi']['curr'] - 1) * $sets['pp']['art_pool'] . ', ' . $sets['pp']['art_pool'], 'id');
                    }
                } elseif ($url[2] == 'cg_packs') {
                    $this->side_modules['top'] = array();
                    if (is_numeric($url[3])) {
                        $return['display'] = array('booru_pack_single', 'booru_page', 'navi');
                        $return['navi']['curr'] = max(1, $url[5]);
                        $return['navi']['meta'] = $url[2] . '/' . $url[3] . '/';
                        $return['navi']['start'] = max($return['navi']['curr'] - 5, 2);
                        $return['navi']['last'] = ceil(obj::db()->sql('select count(*) from art_in_pack where pack_id=' . $url[3], 2) / $sets['pp']['art']);
                        $return['pool'] = obj::db()->sql('select * from art_pack where id=' . $url[3], 1);
                        $return['art']['thumbs'] = $this->get_art(($return['navi']['curr'] - 1) * $sets['pp']['art'] . ', ' . $sets['pp']['art'], 'p.pack_id=' . $url[3], 'order by p.`order`', 'as a left join art_in_pack as p on a.id = p.art_id');
                    } else {
                        $return['display'] = array('booru_pack_list', 'navi');
                        $return['navi']['curr'] = max(1, $url[4]);
                        $return['navi']['meta'] = $url[2] . '/';
                        $return['navi']['start'] = max($return['navi']['curr'] - 5, 2);
                        $return['navi']['last'] = ceil(obj::db()->sql('select count(*) from art_pack where cover != ""', 2) / $sets['pp']['art_cg_pool']);
                        $return['pools'] = obj::db()->sql('select * from art_pack where cover != "" order by `date` desc limit ' . ($return['navi']['curr'] - 1) * $sets['pp']['art_cg_pool'] . ', ' . $sets['pp']['art_cg_pool'], 'id');
                    }
                } else {
                    if ($url[3] == 'pack') {
                        if (empty($url[4]) || !is_numeric($url[4])) {
                            $error = true;
                        } else {
                            if (empty($url[5]) || !is_numeric($url[5])) {
                                $pack = obj::db()->sql("select title, weight from art_pack where id = {$url['4']}", 1);
                                if ($pack['weight'] == 0) {
                                    $error = true;
                                } else {
                                    $this->template = 'download';
                                    $this->side_modules = array();
                                    $name = str_replace(array(' ', ';'), '_', $pack['title']);
                                    $file = ROOT_DIR . SL . 'files' . SL . 'pack_cache' . SL . 'pack_' . $url[4] . '.zip';
                                    return array('file' => $file, 'name' => $name . '.zip');
                                }
                            } else {
                                $this->template = 'download';
                                $this->side_modules = array();
                                $art = obj::db()->sql("\n\t\t\t\t\t\t\t\t\tselect a.md5, a.extension, p.filename\n\t\t\t\t\t\t\t\t\tfrom art as a left join art_in_pack as p on a.id = p.art_id\n\t\t\t\t\t\t\t\t\twhere a.id = {$url['5']} and p.pack_id = {$url['4']}", 1);
                                $file = ROOT_DIR . SL . 'images' . SL . 'booru' . SL . 'full' . SL . $art['md5'] . '.' . $art['extension'];
                                if (pathinfo($file, PATHINFO_EXTENSION) == 'jpg') {
                                    $type = 'jpeg';
                                } else {
                                    $type = pathinfo($file, PATHINFO_EXTENSION);
                                }
                                return array('file' => $file, 'name' => $art['filename'], 'type' => $type);
                            }
                        }
                    } else {
                        $this->template = 'download';
                        $this->side_modules = array();
                        if (pathinfo($url[3], PATHINFO_EXTENSION) == 'jpg') {
                            $type = 'jpeg';
                        } else {
                            $type = pathinfo($url[3], PATHINFO_EXTENSION);
                        }
                        return array('file' => ROOT_DIR . SL . 'images' . SL . 'booru' . SL . 'full' . SL . $url[3], 'name' => $url[3], 'type' => $type);
                    }
                }
            }
            $return['navi']['base'] = '/art' . ($url['area'] != $def['area'][0] ? '/' . $url['area'] : '') . '/';
            return $return;
        }
    }
Beispiel #6
0
								?>
									<td class="imageholder">
										<div class="image-0">
											<img src="<?php 
echo $block['image'];
?>
" />
										</div>
									</td>
								<?
							}
						?>						
						<td valign="top">
							<?php 
echo $block['comment_count'] > $sets['pp']['comment_in_post'] ? '<p class="help">
									Показываются только ' . $sets['pp']['comment_in_post'] . ' последних ' . obj::transform('text')->wcase(sets::pp('comment_in_post'), 'комментарий', 'комментария', 'комментариев') . '. 
									<a href="' . $def['site']['dir'] . '/' . $block['place'] . '/' . $block['id'] . '/comments/all">
										Читать все
									</a>.
								</p>' : '';
?>
							<?	
								$i = $block['comment_count'];
								foreach ($block['comments'] as $comment) { 
									$i--; 
									if ($i < $sets['pp']['comment_in_post']) {
										?>
											<div class="comment" id="comment-<?php 
echo $comment['id'];
?>
"<?php 
Beispiel #7
0
	function get_threads($condition = '', $limit = '') {
		$return = $this->get_thread_records($condition, $limit);

		if (is_array($return)) {
			$keys = 'thread='.implode(' or thread=', array_keys($return));
			$posts = obj::db()->sql('select * from board where `type`="post" and ('.$keys.')');

			if (is_array($posts)) {
				foreach ($posts as $post) {
					$return[$post['thread']]['posts'][$post['id']] = $post;
				}

				foreach ($return as $key => $thread) {

					if (!empty($thread['posts'])) {
						list($total_images, $total_flash, $total_video) = $this->process_content($thread['posts']);
						$total = count($thread['posts']);
						krsort($thread['posts']);
						$thread['posts'] = array_slice($thread['posts'],0,sets::pp('board_posts'));
						list($images, $flash, $video) = $this->count_content($thread['posts']);
						$return[$key]['posts'] = array_reverse($thread['posts']);
						$return[$key]['skipped'] = array(
							'images' => ($total_images - $images),
							'flash' => ($total_flash - $flash),
							'video' => ($total_video - $video),
							'posts' => ($total - count($thread['posts'])),
						);
					}
				}
			}
		} else {
			return false;
		}
		$this->build_inner_links($this->inner_links, $return);
		return $return;
	}