$forum) { if ( isset($forum['last_time']) && $forum['last_time'] > $exbb['last_visit'] ) { if ($forum['private'] && !$inuser['private'][$id]) continue; $newest[] = $id; } } if (count($newest)) { $to_show = array(); foreach ($newest as $inforum) { $filetoopen = $exbb['home_path'].'forum'.$inforum.'/list.php'; $topics = array(); $topics = get_file($filetoopen); $keys = array_keys($topics); foreach ($keys as $id=>$topicid) { if ($topics[$topicid]['postdate'] >= $exbb['last_visit'] && $topics[$topicid]['p_id'] != $exbb['mem_id']) { $date = $topics[$topicid]['postdate']; $to_show[$date] = $topics[$topicid]; //all info about topic $to_show[$date]['f_id'] = $inforum; $to_show[$date]['t_id'] = $topicid; } else { break 1;} } } unset($topics,$newest); if (!count($to_show)) error($lang['Main_msg'],$lang['No_newposts'],'',0); krsort($to_show,SORT_NUMERIC); $data = ''; $l_v = $exbb['last_visit']; $t_visits = (isset($_COOKIE['t_visits'])) ? unserialize($_COOKIE['t_visits']) : array(); $pinned = get_file($exbb['home_path'].'forum'.$inforum.'/_pinned.php'); foreach ($to_show as $date=>$topic){ $pinned = get_file($exbb['home_path'].'forum'.$inforum.'/_pinned.php'); if ($f_readed = (isset($_COOKIE['f'.$inforum])) ? $_COOKIE['f'.$inforum] : 0) { $exbb['last_visit'] = $f_readed > $exbb['last_visit'] ? $f_readed : $exbb['last_visit']; } if ( isset($pinned[$topic['t_id']]) ) $topic['state'] = 'pinned'; $top_id = $topic['f_id'].$topic['t_id']; $topicicon = topic_icon($topic,$t_visits[$top_id]); $m_id = isset($topic['a_id']) ? $topic['a_id'] : 0; $p_id = isset($topic['p_id']) ? $topic['p_id'] : 0; $t_name = ' '.sprintf('%s',$topic['f_id'],$topic['t_id'],$date,wordwrap($topic['name'], 32, ' ­ ', 1)).' '; $t_desc = wordwrap($topic['desc'], 32, ' ­ ', 1); $f_name = sprintf('%s',$topic['f_id'],$allforums[$topic['f_id']]['name']); $t_post = $topic['posts']; $poster = sprintf('',$topic['f_id'],$topic['t_id'],$date,wordwrap($topic['name'], 32, ' ­ ', 1)); $t_strt = $topic['author'] ? $topic['author'] : $lang['Unreg']; $poster .= $topic['poster'] ? $topic['poster'] : $lang['Unreg']; $p_date = longdate($date+$exbb['usertime']*3600); include('./templates/'.$exbb['default_style'].'newposts_data.tpl'); } $found = count($to_show); $icon_path = './templates/'.$exbb['default_style'].'im'; $title_page = $exbb['boardname'].' :: '.$lang['Search']; include('./templates/'.$exbb['default_style'].'all_header.tpl'); include('./templates/'.$exbb['default_style'].'logos.tpl'); include('./templates/'.$exbb['default_style'].'newposts.tpl'); echo ''; include('./templates/'.$exbb['default_style'].'footer.tpl'); } else { error($lang['Main_msg'],$lang['No_newposts'],'',0); } } function in_topic() { global $exbb,$vars,$lang; $title_page = $exbb['boardname'].' :: '.$lang['Search']; include('./templates/'.$exbb['default_style'].'all_header.tpl'); include('./templates/'.$exbb['default_style'].'logos.tpl'); include('./templates/'.$exbb['default_style'].'srch_intop.tpl'); include('./templates/'.$exbb['default_style'].'footer.tpl'); } function members() { global $exbb,$vars,$lang; include($exbb['home_path'].'language/'.$exbb['default_lang'].'/lang_reg.php'); $filetoopen = $exbb['home_path'].'data/users.php'; $users = get_file($filetoopen); $sort = $vars['s']; $pg = ($vars['pg']) ? $vars['pg'] : 25 ; if ($sort == 'n') { uasort($users, 'sort_by_name'); } else{ ksort($users,SORT_NUMERIC); } foreach ($users as $id=>$value) { $get = $exbb['home_path'].'members/'.$id.'.php'; if(!file_exists($get)){ continue; } $member[] = get_file($get); } $total = count($member); $pages = ($total) ? ceil($total/$pg) : 1; $pagestart = ( isset($vars['p']) ) ? intval($vars['p']) : 1; $order = ( $vars['order'] == 'DESC') ? 'DESC' : 'ASC'; $sort_arr = array('d'=>$lang['Sort_join'], 'p'=>'по количеству сообщений','n'=>$lang['Sort_name']); $sort_mode = ''; if($sort == 'p') { usort($member, 'sort_by_post'); } $ids = array_keys($member); $sort_order = ''; $sort_order .= ''; $p_order = '&s='.$sort.'&order='.$order; if ($pagestart < 1 or $pagestart > $pages) $pagestart = 1; if ($total > $pg) { $startarray = ($pagestart - 1) * $pg; $endarray = $pg; $page = ''; for($i=1;$i<=$pages;$i++){ if ($pagestart != $i) { $page .= ''.$i.' '; } else { $page .= '['.$i.'] '; } } $pages = ''.$lang['Pages'].' ('.$pages.'): '.$page; } else { $startarray = 0; $pages = ''.$lang['Pages'].' ('.$pages.')'; $endarray = $total; } $ids = array_slice($member,$startarray,$endarray); $idi = 0; foreach ($ids as $key=>$info) { if (!empty($member['title']) && $info['status'] != 'banned' ) { $title = $member['title']; $name = $member['name'];} else { switch ($info['status']) { case 'ad' : $title = $lang['Admin']; break; case 'moder' : $title = $lang['Moder']; break; case 'moder+' : $title = $lang['Moder']; break; case 'me' : $title = $lang['User']; break; case 'banned' : $title = $lang['User_banned']; break; }} switch ($info['status']) { case 'ad' : $title = ''.$title.''; $name = ''.$info['name'].''; break; case 'moder' : $title = ''.$title.''; $name = ''.$info['name'].''; break; case 'moder+' : $title = ''.$title.''; $name = ''.$info['name'].''; break; case 'me' : $title = $title; $name = $info['name']; break; case 'banned' : $title = ''.$title.''; $name = ''.$info['name'].''; break;} $posts = $info['posts']; $id = $info['id']; $location = $info['location']; $joined = date("d.m.Y", $info['joined']); if ($info['www'] != 'http://') { $info['www'] = str_replace('http://','',$info['www']); $www = (strlen($info['www']) > 4) ? ''.$lang['Look'].'' : ' '; } $email = ($info['showemail']) ? ''.$lang['Write'].'' : ''.$lang['Write'].''; $icq = ($info['icq']) ? '' : ' '; $idi++; $class = ( !($idi % 2) ) ? "row2" : "row1"; include('./templates/'.$exbb['default_style'].'memb_data.tpl'); } $icon_path = './templates/'.$exbb['default_style'].'im'; $title_page = $exbb['boardname'].' :: Пользователи'; include('./templates/'.$exbb['default_style'].'all_header.tpl'); include('./templates/'.$exbb['default_style'].'logos.tpl'); include('./templates/'.$exbb['default_style'].'memblist.tpl'); include('./templates/'.$exbb['default_style'].'footer.tpl'); } function sort_by_post($a, $b) { if ($a['posts'] == $b['posts']) { return 0; } return ($a['posts'] < $b['posts']) ? -1 : 1; } function sort_by_name($a, $b) { return strcmp($a['n'], $b['n']); } function search() { global $exbb,$vars,$lang; $allforums = get_file($exbb['home_path'].'data/allforums.php'); if ( !isset($vars['action']) ) { $forums = '