$exbb['last_visit'] ? $f_readed : $exbb['last_visit']; } $markforum = ''.$lang['Forum_mark'].''; } $forum = get_file($exbb['home_path'].'data/allforums.php'); $allowed = false; if ( ($exbb['reged']) && ($inuser['private'][$inforum]) ) { $allowed = true; } forumjump($forum); if ($jumpto != '') { Header("Location: $jumpto"); exit; } if (!isset($forum[$inforum])) error($lang['Main_msg'],$lang['Dont_chg_url']); $category = $forum[$inforum]['catname']; $forumname = stripslashes($forum[$inforum]['name']); $catid = $forum[$inforum]['catid']; # Check if it's a private forum, and is the member cleared? if (defined('IS_ADMIN')) $allowed = true; if (($forum[$inforum]['private']) && (!$allowed)) error($lang['Privat_enter'],$lang['Privat_login'].$lang['Privat_rule']); if (!$forum[$inforum]['private']) { whosonline($lang['View_forum']." ".$forum[$inforum]['name'].''); } if (isset($forum[$inforum]['moderator'])) { moderator($inforum,$forum); } # Open up the forum threads list $filetoopen = $exbb['home_path'].'forum'.$inforum.'/list.php'; if (file_exists($filetoopen)) { $topics = get_file($filetoopen); } else {$topics = array();} $to_page = ''; if (isset($vars['filterby']) and $vars['word'] != '') { $word = $vars['word']; $topics = filtered($word); $resetfiltr = ''.$lang['Reset_filter'].''; $to_page = '&filterby='.$vars['filterby'].'&word='.$vars['word']; } # Limit the total topics to a span $pagestart = isset($vars['show']) ? intval($vars['show']) : 1; $numberofitems = count($topics); $numberofpages = ceil($numberofitems/$exbb['topics_per_page']); if (!isset($pagestart) || $pagestart < 1 || $pagestart > $numberofpages) $pagestart = 1; if ($numberofitems > $exbb['topics_per_page']) { $showmore = true; $startarray = ($pagestart - 1) * $exbb['topics_per_page']; $endarray = $exbb['topics_per_page']; } else { $showmore = false; $startarray = 0; $topicpages = $lang['Pages'].' ('.$numberofpages.')'; $endarray = $numberofitems; } # if we have multiple pages, print them $pageshow = 8; if ($showmore) { #1 if ($pagestart > 1) $prevpage = $pagestart - 1; if ($pagestart < $numberofpages) $nextpage = $pagestart + 1; $limitlower = $pagestart - $pageshow + 1; $limitupper = $pagestart + $pageshow - 1; if ($limitupper > $numberofpages) { $limitupper = $numberofpages; if ($limitlower > $numberofpages) $limitlower = $numberofpages - $pageshow; } if ($limitlower <= 0) $limitlower = 1; for($i=$limitlower;$i<=$limitupper;$i++){ if ($pagestart != $i) {$pages .= '$i ";} else {$pages .= '['.$i.'] ';} } $prevpage = ($prevpage) ? '« ' : ''; $nextpage = ($pagestart < $numberofpages) ? '» ' : ''; $lastpage = ($limitupper < $numberofpages) ? ''.$lang['page_last'].' ' : ''; $firspage = ($limitlower > 1) ? ''.$lang['page_first'].' ' : ''; $topicpages = $lang['Pages'].' ('.$numberofpages.'): '.$firspage.' '.$prevpage.' '.$pages.' '.$nextpage.' '.$lastpage; } #1 switch ($forum[$inforum]['status']) { case 'all': $who = $lang['All_users_can']; break; case 'reged': $who = $lang['Reg_users_can']; break; default: $who = $lang['Admins_only']; } $keys = array_keys($topics); $keys = array_slice($keys,$startarray,$endarray); $pinned = isset($vars['filterby']) ? array() : get_file($exbb['home_path'].'forum'.$inforum.'/_pinned.php'); if ( count($pinned) ) { foreach ($pinned as $pin=>$id) array_unshift($keys,$pin); $keys = array_unique($keys); } foreach ($keys as $id=>$topicid) { if (!isset( $topics[$topicid]['name'] ) || empty($topics[$topicid]['name']) ) $topics[$topicid]['name'] = $topics[$topicid]['author'].date(" d.m.Y H:i",$topics[$topicid]['date']); $topictitle = wordwrap($topics[$topicid]['name'], 32, ' ­ ', 1); $topicdescription = wordwrap($topics[$topicid]['desc'], 32, ' ­ ', 1); $threadposts = $topics[$topicid]['posts']; $startedby = $topics[$topicid]['author'] ? $topics[$topicid]['author'] : $lang['Unreg']; $startedpostdate = $topics[$topicid]['date']; $lastposter = $topics[$topicid]['poster'] ? $topics[$topicid]['poster'] : $lang['Unreg']; $lastpostdate = $topics[$topicid]['postdate']; $startedby = $topics[$topicid]['a_id'] ? ''.$startedby.'' : $startedby; if ( isset($topics[$topicid]['fls']) ) { $extmode = unserialize($topics[$topicid]['ext']); $in_first = $extmode[0]; $in_end = $topics[$topicid]['fls']; unset($extmode); } else { $in_first = $topics[$topicid]['posts'] + 1; $in_end = 0; } $numberofpages = ceil($in_first/intval($exbb['posts_per_page'])) + $in_end; $threadpages = ''; $pagestoshow = ' [ #'; if ($numberofpages > 1) { $limitupper = ($numberofpages < $pageshow) ? $numberofpages : $pageshow; for ($p=2;$p<=$limitupper;$p++){ $threadpages .= ''.$p.' '; } $middlepage = ($numberofpages > $pageshow * 2) ? ceil($numberofpages/2) : 0; $lastpage = ($numberofpages > $pageshow) ? $numberofpages : 0; $middlepage = ($middlepage) ? '... ' : ''; $lastpage = ($lastpage) ? ''.$lang['page_last'].'' : ''; $pagestoshow .= ' '.$lang['Page'].' '.$threadpages.' '.$middlepage.' '.$lastpage; } $pagestoshow .= ' ]'; if ($exbb['reged']) { if ( isset($pinned[$topicid]) ) $topics[$topicid]['state'] = 'pinned'; $top_id = $inforum.$topicid; $topicicon = topic_icon($topics[$topicid],$t_visits[$top_id]); } $lastpostdate = ( !empty($lastpostdate) ) ? longdate($lastpostdate + $exbb['usertime'] * 3600) : $lang['NA']; $startedpostdate = $startedpostdate + ($exbb['usertime'] * 3600); $startedlongdate = date("d.m.Y",$startedpostdate); $topictitle = ''.$topictitle.''; if ( isset($topics[$topicid]['poll']) ) $topictitle .= ' '.$lang['Poll'].''; $lastposter = $topics[$topicid]['p_id'] ? ''.$lastposter.'' : $lastposter; $topicdescription = (!empty($topicdescription)) ? '
  »'.$topicdescription : ''; include('./templates/'.$exbb['default_style'].'forum_data.tpl'); } # end topic foreach if ($exbb['wordcensor']) $forum_data = bads_filter($forum_data); if ( $exbb['reged'] ) { $filetoopen = $exbb['home_path'].'forum'.$inforum.'/_f_track.php'; $emailers = ( file_exists($filetoopen) ) ? get_file($filetoopen) : array(); $options = (isset($emailers[$exbb['mem_id']]) && $vars['action'] != 'untrack') ? ''.$lang['untrack_forum'].'' : ''.$lang['track_forum'].''; if ($vars['action'] == 'untrack') { unset($emailers[$exbb['mem_id']]); save_file($filetoopen,$emailers); } if ($vars['action'] == 'track') { $options = ''.$lang['untrack_forum'].''; $emailers[$exbb['mem_id']] = 1; save_file($filetoopen,$emailers); } unset($emailers,$filetoopen); } $newthreadbutton = ''; if ($forum[$inforum]['polls'] && $exbb['reged']) $newthreadbutton .= ' '; if ($inuser['new_pm']) include('./templates/'.$exbb['default_style'].'newmail.tpl'); $icon_path = './templates/'.$exbb['default_style'].'im'; $title_page = strip_tags($forumname).' :: '.$exbb['boardname']; include('./templates/'.$exbb['default_style'].'all_header.tpl'); include('./templates/'.$exbb['default_style'].'logos.tpl'); include('./templates/'.$exbb['default_style'].'forum_body.tpl'); include('./templates/'.$exbb['default_style'].'footer.tpl'); include('page_tail.php'); function filtered($word) { global $lang,$vars,$topics; $res = array(); switch ($vars['filterby']) { case 'topdesc': $field = 'desc'; break; case 'author': $field = 'author'; break; default: $field = 'name'; break; } if (preg_match("/\b$word\b/i",$lang['Unreg'])) { foreach ($topics as $id=>$info) { if (!$info['author']) $res[$id] = $info; } } else { foreach ($topics as $id=>$info) { if (preg_match("/$word/i",$info[$field])) $res[$id] = $info; } } #myprint($res); return $res; } ?>