コード例 #1
0
ファイル: board.php プロジェクト: 4otaku/4otaku
	public function move () {
		$id = query::$post['id'];
		$to = query::$post['to'];

		if (!is_numeric($id) || !is_numeric($to)) {
			return;
		}

		if (query::$cookie != def::get('board', 'moderator')) {
			return;
		}

		Database::update('board', array(
			'thread' => $to,
			'sortdate' => ceil(microtime(true)*1000)
		), $id);

		$mail = new mail(def::notify('mail'));
		$mail->text("Moved board №$id, to " . $to)->send();
	}
コード例 #2
0
ファイル: thread_message.php プロジェクト: 4otaku/4otaku
						<? } ?>
					</span>
				</div>
			</span>
		<? } ?>
		<? if ($thread['images_count'] > 0) { ?>
			<span class="link_right">
				<a href="#" rel="Свернуть все" class="board_unfold_all">
					Развернуть все
				</a>
			</span>
		<? } ?>
	<? } ?>
	<? if (
        $thread['cookie'] && query::$cookie === $thread['cookie'] ||
        query::$cookie === def::get('board', 'moderator')
    ) { ?>
		<span class="link_delete">
			 <img src="<?php 
echo $def['site']['dir'];
?>
/images/comment_delete.png" alt="удалить" rel="<?php 
echo $id;
?>
" class="delete_from_board">
		</span>
	<? } ?>
	<span class="author">
		<?php 
echo $thread['name'];
?>
コード例 #3
0
ファイル: top.php プロジェクト: 4otaku/4otaku
<? if ($url['area'] == def::get('area',3) && $url[1] == def::get('type',2)) { ?>
	<div class="mini-shell margin10">
		Графические ресурсы для создания любительских ВН. 
		<a href="http://wiki.4otaku.org/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5_%D0%BB%D1%8E%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D1%81%D0%BA%D0%BE%D0%B9_%D0%92%D0%9D">
			Статья про создание
		</a> 
		(в процессе написания).
	</div>
<? } ?>
<?
	$lang['add'] = array(
		$def['type'][0] => 'Добавить материал',
		$def['type'][1] => 'Добавить видео',
		$def['type'][2] => 'Загрузить картинки',
		'order' => 'Оставить заказ (не забудьте прочитать правила)',
		'pool' => 'Добавить новую группу',
		'board' => 'Открыть новый тред',
		'thread' => 'Ответить в тред',
		'soku' => 'Загрузить реплей',
	);
	
	if (is_array($data['top']['board_list'])) {
		$board_list = $data['top']['board_list'];
		include_once(TEMPLATE_DIR.SL.'main'.SL.'board'.SL.'menu.php');
	}
	if ($data['top']['add_bar']) {
		if (!$data['top']['add_bar']['name']) $data['top']['add_bar']['name'] = $data['top']['add_bar']['type'];
		?>
			<div class="addborder">
				<div id="downscroller" rel="<?php 
コード例 #4
0
ファイル: sidebar.php プロジェクト: 4otaku/4otaku
	function art_tags() {
		global $data; global $url;

		if (in_array($url['area'], def::get('area')) && $url['area'] != 'workshop') {
			$area = $url['area'];
		} else {
			$area = def::get('area',0);
		}
		$prefix = $url['area'].'/';

		$tags = array();
		$page_flag = false;
		if (is_array($data['main']['art']['thumbs'])) {
			$page_flag = true;
			foreach ($data['main']['art']['thumbs'] as $art) {
				if (is_array($art['meta']['tag'])) {
					foreach ($art['meta']['tag'] as $alias => $tag) {
						if (isset($tags[$alias])) {
							$tags[$alias]['count']++;
						} else {
							$tags[$alias] = array('name' => $tag['name'], 'color' => $tag['color'], 'count' => 1, 'description' => $tag['have_description']);
						}
					}
				}
			}
		} elseif (is_array($data['main']['art'][0]['meta']['tag'])) {
			foreach ($data['main']['art'][0]['meta']['tag'] as $alias => $tag) {
				if (isset($tags[$alias])) {
					$tags[$alias]['count']++;
				} else {
					$tags[$alias] = array('name' => $tag['name'], 'color' => $tag['color'], 'count' => 1, 'description' => $tag['have_description']);
				}
			}
		}
		unset($tags['prostavte_tegi'],$tags['tagme'],$tags['deletion_request']);

		if (!empty($tags)) {
			$where = 'where alias="'.implode('" or alias="',array_keys($tags)).'"';
			$global = obj::db()->sql('select alias, art_'.$area.' from tag '.$where,'alias');
			if ($page_flag) {
				foreach ($global as $alias => $global_count) {
					$ret_key = ((int) $tags[$alias]['count'] * (int) $global_count).'.'.rand(0,10000);
					$return[$ret_key] = array('alias' => $alias, 'num' => $global_count) + $tags[$alias];
				}

				krsort($return);
				$return = array_slice($return,0,25);
				shuffle($return);
			} else {
				foreach ($global as $alias => $global_count) {
					$return[$alias] = array('alias' => $alias, 'num' => $global_count) + $tags[$alias];
				}
			}

			foreach ($return as $key => $tag) {
				$return[$key]['alias'] = $prefix.'tag/'.$tag['alias'];
			}

			uasort($return, 'transform__array::meta_sort');
			return $return;
		}
	}