'; $exbb['icon_www'] = $exbb['text_menu'] ? 'WWW' : ''; $exbb['icon_aol'] = $exbb['text_menu'] ? 'AOL' : 'Skype'; $exbb['icon_pm'] = $exbb['text_menu'] ? $lang['Message'] : ''; $exbb['icon_prf'] = $exbb['text_menu'] ? $lang['Profile'] : ''; $exbb['icon_edit'] = $exbb['text_menu'] ? $lang['Editing'] : '.$lang['; $exbb['icon_del'] = $exbb['text_menu'] ? $lang['Delete'] : ''; $replygraphic = ($exbb['text_menu']) ? ''.$lang['Paste_qte'].'' : ''; $category = $forum[$inforum]['catname']; $forumname = stripslashes($forum[$inforum]['name']); $catid = $forum[$inforum]['catid']; $upload = ( isset($forum[$inforum]['upload']) && !empty($forum[$inforum]['upload']) && $exbb['file_upload'] ) ? $forum[$inforum]['upload'] : 0; if ((!$inuser['private'][$inforum]) && ($forum[$inforum]['private'])) { error($lang['Privat_topic'],$lang['Privat_denied']);} if ($exbb['reged']) { $top_id = $inforum.$intopic; $t_visits = (isset($_COOKIE['t_visits'])) ? unserialize($_COOKIE['t_visits']) : array(); $t_visits[$top_id] = time(); my_setcookie('t_visits',serialize($t_visits),86400); } $allof = false; switch ($forum[$inforum]['status']) { case 'reged': if (!$exbb['reged']) {$allof = true;} break; default: $allof = false; } $filetoopen = $exbb['home_path'].'forum'.$inforum.'/'.$intopic.'-thd.php'; if ( !file_exists($filetoopen) ) error($lang['Topic_open'],$lang['Topic_miss']); $filetoopen = $exbb['home_path'].'forum'.$inforum.'/list.php'; $list = get_file($filetoopen); #$list[$intopic]['views']++; #save_file($filetoopen,$list); $cur_topic = array(); $cur_topic[$intopic] = $list[$intopic]; unset($list); $topictitle = wordwrap($cur_topic[$intopic]['name'], 32, ' ­ ', 1); $topicdescr = $cur_topic[$intopic]['desc']; $threadstate = ( isset($cur_topic[$intopic]['state']) ) ? $cur_topic[$intopic]['state'] : 'closed'; $threadposts = $cur_topic[$intopic]['posts']; $is_poll = isset($cur_topic[$intopic]['poll']) ? true : false; #запрет ссылки цитирования if ($allof || $threadstate == 'closed') { $replygraphic = null; $lang['MS_paste'] = ''; } $movedto = null; if (isset($cur_topic[$intopic]['movedid'])) { list($in_f,$in_t) = explode(':',$cur_topic[$intopic]['movedid']); $movedto = '
moved'.$lang['Moved_to'].''; } $inmembmod = moderator($inforum,$forum); $newthreadbutton = ''; if ($forum[$inforum]['polls'] && $exbb['reged']) $newthreadbutton .= '   '; if (!$forum[$inforum]['private']) whosonline($lang['Topic_see'].' '.$topictitle.' - '.$forumname.''); if ($threadstate == 'open') { $replybutton = ''; } else { $replybutton = ''.$lang['Topic_closed'].''; } if ( isset($cur_topic[$intopic]['fls']) ) { $extmode = unserialize($cur_topic[$intopic]['ext']); $in_first = $extmode[0]; $in_end = $cur_topic[$intopic]['fls']; } else { $in_first = $cur_topic[$intopic]['posts'] + 1; $in_end = 0; } unset($extmode); $in_first_page = ceil($in_first/intval($exbb['posts_per_page'])); $numberofpages = $in_first_page + $in_end; $pagestart = (isset($vars['v'])) ? $numberofpages : intval($instart); if ($pagestart < 1 or $pagestart > $numberofpages) $pagestart = 1; $in_file = ($pagestart <= $in_first_page) ? '' : $pagestart - $in_first_page; if ($numberofpages > 1) { $showmore = true; $startarray = ($pagestart - 1) * $exbb['posts_per_page']; $endarray = intval($exbb['posts_per_page']); } else { $showmore = false; $startarray = 0; $pages = $lang['Pages'].' ('.$numberofpages.')'.$movedto; $endarray = $in_first; } unset($in_first,$in_end,$in_first_page); if ($showmore) { $pageshow = 4; 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'].' ' : ''; $pages = ''.$lang['Pages'].' ('.$numberofpages.'): '.$firspage.' '.$prevpage.' '.$pages.' '.$nextpage.' '.$lastpage.$movedto; } unset($numberofpages,$limitlower,$limitupper,$prevpage,$nextpage,$lastpage,$firspage); $filetoopen = $exbb['home_path'].'forum'.$inforum.'/'.$intopic.'-thd'.$in_file.'.php'; if (file_exists($filetoopen)) { $threads = get_file($filetoopen); if (!is_array($threads)) error($lang['Topic_open'],$lang['Topic_miss']); } else { error($lang['Topic_open'],$lang['Topic_miss']); } $keys = array_keys($threads); sort($keys,SORT_NUMERIC); if ( empty($in_file) ) $keys = array_slice($keys,$startarray,$endarray); elseif ( isset($vars['v']) ) { $keys = array_slice($keys,-$exbb['posts_per_page']); } $firstkey = reset($keys); $style = './templates/'.$exbb['default_style'].'topic_data.tpl'; $bot = is_search_bot() ? true : false; $names = array(); if ($exbb['ratings'] && !$bot) $ranks = get_file($exbb['home_path'].'data/membertitles.php'); $filetoopen = $exbb['home_path'].'forum'.$vars['forum'].'/attaches-'.$vars['topic'].'.php'; $t_attaches = ( file_exists($filetoopen) ) ? get_file($filetoopen) : array(); foreach ($keys as $id=>$key) { $member_id = isset($threads[$key]['p_id']) ? $threads[$key]['p_id'] : 0; $postipaddress = $threads[$key]['ip']; $showemoticons = $threads[$key]['smiles']; $post = $threads[$key]['post']; #Attach if ( isset($threads[$key]['attach_id']) ) { if ( isset($t_attaches[$threads[$key]['attach_id']]['size']) && $exbb['show_img']) { $post .= $lang['img_attach'].'
'.$threads[$key]['attach_file'].'

'; } else { $post .= '
'.$lang['Download_attach'].''.$threads[$key]['attach_file'].'
'.$lang['Downloads_attach'].$t_attaches[$threads[$key]['attach_id']]['hits'].'
'; } } if (isset($threads[$key]['edited'])) $post .= '

[s]('.$lang['Edited_by_own'].longDate($threads[$key]['edited']+$exbb['usertime']*3600).')[/s]'; if (isset($threads[$key]['mo_edited'])) { $post .= '


[s]'.$lang['Edited_by_mo'].$threads[$key]['mo_editor'].', '.longDate($threads[$key]['mo_edited']+$exbb['usertime']*3600).'[/s]'; if (isset($threads[$key]['mo_text']) && !isset($threads[$key]['ad_edited'])) $post .= '
'.$threads[$key]['mo_text']; } if (isset($threads[$key]['ad_edited'])) { $post .= '


[s]'.$lang['Edited_by_ad'].$threads[$key]['ad_editor'].', '.longDate($threads[$key]['ad_edited']+$exbb['usertime']*3600).'[/s]'; if (isset($threads[$key]['mo_text'])) $post .= '
'.$threads[$key]['mo_text']; } if ($bot) { $topic_data .= ''.$post.''; continue; } if (!array_key_exists($member_id,$names) ) { if (!checkuser($member_id)) { setup_guest($member_id);} else { setup_member($member_id); } } $username = $names[$member_id]['user']; $picon = $names[$member_id]['team']; $membertitle = $names[$member_id]['membertitle']; $signature = $threads[$key]['sig'] ? $names[$member_id]['signature'] : ''; $useravatar = $names[$member_id]['useravatar']; $membergraphic = $names[$member_id]['membergraphic']; $location = $names[$member_id]['location']; $karma = $names[$member_id]['karma']; $eml = $names[$member_id]['eml']; $www = $names[$member_id]['www']; $pm = $names[$member_id]['pm']; $prf = $names[$member_id]['prf']; $aim = $names[$member_id]['aim']; $edit = sprintf($names[$member_id]['edit'],$inforum,$intopic,$key,$in_file,$pagestart); $del = sprintf($names[$member_id]['del'],$inforum,$intopic,$key,$in_file,$pagestart); $posts = $names[$member_id]['posts']; $joined = $names[$member_id]['jnd']; $info = ''.$lang['Post_date'].' '.longDate($key+$exbb['usertime']*3600).''; $icq = $names[$member_id]['icq']; $uin = $names[$member_id]['uin']; if ($forum[$inforum]['codes']) $post = ikoncode($post); if (!empty($signature)) $post .= '

-----
'.$signature; $postbackcolor = ( !($id % 2) ) ? 'row1' : 'row2'; if (($exbb['emoticons']) && ($showemoticons)) $post = setsmiles($post); if (defined('IS_ADMIN')) { $info .= ' | '.$postipaddress; } include($style); } unset($names); if ($exbb['wordcensor']) $topic_data = bads_filter($topic_data); if ($is_poll) { $poll_html = poll(); } unset($firstkey); $options = array(); $options['print'] = ''.$lang['print_page'].''; if ( $exbb['reged'] ) { $filetoopen = $exbb['home_path'].'forum'.$inforum.'/'.$intopic.'-m.php'; $emailers = ( file_exists($filetoopen) ) ? get_file($filetoopen) : array(); $options['track'] = (isset($emailers[$exbb['mem_id']]) && $vars['action'] != 'untrack') ? ''.$lang['untrack_topic'].'' : ''.$lang['track_topic'].''; if ($vars['action'] == 'untrack') { unset($emailers[$exbb['mem_id']]); save_file($filetoopen,$emailers); unset($emailers); } } if ($forum[$inforum]['codes']) { $codemap = '
'; $smilesmap = '
'; $java = ''; } if ($threadstate != 'closed' && $threadstate != 'moved' && !$allof && !$bot){ if ($exbb['emoticons']) { $emoticonsbutton = ''.$lang['Do_smiles'].'
'; } if ($exbb['emailfunctions'] && $exbb['reged']) { $requestnotify = ''.$lang['Do_email'].'
'; } $sig_check = $inuser['sig_on'] ? 'checked' : ''; $showsig = ($exbb['reged']) ? "".$lang['Do_sig'] : ''; $reg = (!$exbb['reged']) ? '   '.$lang['You_reged'].'' : ''; if ($upload && $inuser['upload']) { $enctype = ' enctype="multipart/form-data"'; $hidden = ''; $filetoup = $lang['File_upload'].$upload.'
'; } include('./templates/'.$exbb['default_style'].'post_form.tpl'); if ($vars['action'] == 'track' and $exbb['reged']) { $options['track'] = ''.$lang['untrack_topic'].''; $emailers[$exbb['mem_id']] = 1; save_file($filetoopen,$emailers); @chmod($filetoopen,$exbb['ch_files']); unset($emailers); } } $options = implode ( ' :: ', $options); $mod_options = ''; if ($inmembmod) { $pinned = get_file($exbb['home_path'].'forum'.$inforum.'/_pinned.php'); $pin = isset($pinned[$intopic]) ? '' : ''; if ($threadstate == 'open') { $do = 'lock'; $lang['Unlock'] = $lang['Blocking']; } else { $do = 'unlock'; } include('./templates/'.$exbb['default_style'].'topic_options.tpl'); } $title_page = $topictitle .' :: '. $exbb['boardname']; if ($pagestart > 1) { $title_page .= ' ['.$pagestart.']'; } if ($inuser['new_pm']) include('./templates/'.$exbb['default_style'].'newmail.tpl'); $link = ''; include('./templates/'.$exbb['default_style'].'all_header.tpl'); include('./templates/'.$exbb['default_style'].'logos.tpl'); include('./templates/'.$exbb['default_style'].'topic_body.tpl'); include('./templates/'.$exbb['default_style'].'footer.tpl'); include('page_tail.php'); function setup_guest($u_id = 0) { global $names,$lang,$exbb,$inmembmod; $names[$u_id]['user'] = $lang['Unreg']; $names[$u_id]['membertitle'] = empty($u_id) ? $lang['No_reged'] : $lang['User_deleted']; $names[$u_id]['karma'] = 'Карма:
Поощрить/Наказать
'; if ($inmembmod) { $names[$u_id]['edit'] = ''.$exbb['icon_edit'].''.$exbb['delim_r']; $names[$u_id]['del'] = ''.$exbb['icon_del'].''; } } function setup_member($named) { global $exbb,$names,$lang,$vars,$ranks,$inmembmod,$modoutput,$threadstate; $user = getmember($named); if ( ($exbb['mem_id'] == $named && $threadstate != 'closed') || $inmembmod) { $names[$named]['edit'] = ''.$exbb['icon_edit'].''.$exbb['delim_r']; } if ($inmembmod) { $names[$named]['del'] = ''.$exbb['icon_del'].''; } $names[$named]['user'] = $user['name']; $names[$named]['id'] = $user['id']; $names[$named]['membertitle'] = $user['title']; $user['posts'] = (empty($user['posts'])) ? 0 : $user['posts']; $names[$named]['posts'] = $lang['User_total_posts'].' '.$user['posts'].' :'; if ($exbb['location']) { if ($user['location'] != '') { $names[$named]['location'] = (strlen($user['location']) > 20) ? '
'.$lang['From'].': '.substr($user['location'], 0, 20).' ...
' : '
'.$lang['From'].': '.$user['location']; } } $user['joined_'] = ($user['joined']) ? joindate($user['joined']) : $lang['NA']; $names[$named]['jnd'] = $lang['User_reg_date'].' '.$user['joined_'].' :
'; $names[$named]['jnd'] .= 'На форуме: '.floor((time()-$user['joined'])/86400).' дней :'; $names[$named]['signature'] = ''; if ( $user['sig'] != '' and $exbb['sig'] ) { $names[$named]['signature'] = ikoncode($user['sig']); } if (($exbb['avatars']) && ($user['avatar'] != 'noavatar.gif') && ($user['avatar'] != '')) { $names[$named]['useravatar'] = '
'; } $rang = reset($ranks); if ($exbb['ratings']) { $names[$named]['membertitle'] = key($ranks); $names[$named]['membergraphic'] = ''; foreach($ranks as $rang=>$info) { if ($user['posts'] >= $info['posts']) { $names[$named]['membertitle'] = $rang; $names[$named]['membergraphic'] = ''; } } } if ( !empty($user['title']) && $user['title'] != $lang['User'] ) $names[$named]['membertitle'] = $user['title']; if ( empty($names[$named]['membertitle']) ) $names[$named]['membertitle'] = $lang['User']; if ($user['status'] == 'ad') { $names[$named]['team'] = ' '; $names[$named]['membertitle'] = ( !empty($user['title']) ) ? $user['title'] : $lang['Admin']; } elseif (strpos($modoutput,$user['name'])) { $names[$named]['team'] = ' '; $names[$named]['membertitle'] = ( !empty($user['title']) ) ? $user['title'] : $lang['Moderator']; } elseif ($user['status'] == 'banned') { $names[$named]['membergraphic'] = ''; $names[$named]['membertitle'] = $lang['User_banned']; } $names[$named]['eml'] = null; if ( $user['showemail'] ) { $names[$named]['eml'] = ''.$exbb['icon_eml'].''.$exbb['delim_r']; } $names[$named]['www'] = null; if ( !empty($user['www']) && $user['www'] != 'http://') { $names[$named]['www'] = ''.$exbb['icon_www'].''.$exbb['delim_r']; } $names[$named]['aim'] = null; if ($user['aim'] != '') { $names[$named]['aim'] = ''.$exbb['icon_aol'].''.$exbb['delim_r']; } $names[$named]['icq'] = null; $names[$named]['uin'] = null; if ($user['icq'] !='') { $names[$named]['icq'] = ($exbb['text_menu']) ? 'ICQ' : 'ICQ'; $names[$named]['uin'] = $user['icq']; } $names[$named]['pm'] = null; if ( $exbb['pm'] ) { $names[$named]['pm'] = ''.$exbb['icon_pm'].''.$exbb['delim_r']; } $names[$named]['karma'] = (isset($user['karma'])) ? 'Карма: '.$user['karma'].'
Поощрить/Наказать
':'Карма: 0
Поощрить/Наказать
'; $names[$named]['prf'] = ''.$exbb['icon_prf'].''.$exbb['delim_r']; } function poll() { global $lang,$exbb,$inmembmod,$vars,$topictitle,$firstkey; $filtoopen = $exbb['home_path'].'forum'.$vars['forum'].'/'.$vars['topic'].'-poll.php'; if (!file_exists($filtoopen)) return ''; $poll_data = get_file($filtoopen); if ( !$poll_data['pollname'] ) $poll_data['pollname'] = $topictitle; $poll_title = $poll_data['pollname']; $poll_count = $poll_data['votes']; $poll_users = unserialize( $poll_data['ids']); $poll_chces = unserialize( $poll_data['choices']); $poll_users['0'] = true; if ($poll_users[$exbb['mem_id']]) { $style = './templates/'.$exbb['default_style'].'poll_data.tpl'; foreach ($poll_chces as $choice) { $pid = $choice[0]; $ptext = $choice[1]; $votes = $choice[2]; if (!$ptext) continue; $percent = ($votes == 0) ? 0 : $votes / $poll_count * 100; $percent = sprintf( '%.2f' , $percent ).'%'; $width = ($percent > 0) ? (int) $percent * 2 : 0; include($style); } $do = ''.$lang['Vote_count'].$poll_count.''; } else { $style = './templates/'.$exbb['default_style'].'poll_view.tpl'; foreach ($poll_chces as $choice) { $pid = $choice[0]; $ptext = $choice[1]; if (!$ptext) continue; include($style); } $do = ''; } $moderlinks = ($inmembmod) ? '
[ '.$lang['Editing'].' ] [ '.$lang['Delete'].' ]
' : null; include('./templates/'.$exbb['default_style'].'poll.tpl'); unset($poll_data,$pollch); return $poll_html; } ?>