1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146:
<?php
if (!defined('SMF'))
die('No direct access...');
function BoardIndex()
{
global $txt, $user_info, $sourcedir, $modSettings, $context, $settings, $scripturl;
loadTemplate('BoardIndex');
$context['template_layers'][] = 'boardindex_outer';
$context['canonical_url'] = $scripturl;
if (!empty($_GET))
$context['robot_no_index'] = true;
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
$context['info_center'] = array();
if (!empty($settings['number_recent_posts']))
{
if ($settings['number_recent_posts'] > 1)
{
$latestPostOptions = array(
'number_posts' => $settings['number_recent_posts'],
);
$context['latest_posts'] = cache_quick_get('boardindex-latest_posts:' . md5($user_info['query_wanna_see_board'] . $user_info['language']), 'Subs-Recent.php', 'cache_getLastPosts', array($latestPostOptions));
}
if (!empty($context['latest_posts']) || !empty($context['latest_post']))
$context['info_center'][] = array(
'tpl' => 'recent',
'txt' => 'recent_posts',
);
}
if (!empty($modSettings['cal_enabled']) && allowedTo('calendar_view'))
{
$eventOptions = array(
'include_holidays' => $modSettings['cal_showholidays'] > 1,
'include_birthdays' => $modSettings['cal_showbdays'] > 1,
'include_events' => $modSettings['cal_showevents'] > 1,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$context += cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));
$context['calendar_only_today'] = $modSettings['cal_days_for_index'] == 1;
$context['calendar_can_edit'] = allowedTo('calendar_edit_any');
if (!empty($context['show_calendar']))
$context['info_center'][] = array(
'tpl' => 'calendar',
'txt' => $context['calendar_only_today'] ? 'calendar_today' : 'calendar_upcoming',
);
}
$context['show_stats'] = allowedTo('view_stats') && !empty($modSettings['trackStats']);
if ($settings['show_stats_index'])
$context['info_center'][] = array(
'tpl' => 'stats',
'txt' => 'forum_stats',
);
require_once($sourcedir . '/Subs-MembersOnline.php');
$membersOnlineOptions = array(
'show_hidden' => allowedTo('moderate_forum'),
'sort' => 'log_time',
'reverse_sort' => true,
);
$context += getMembersOnlineStats($membersOnlineOptions);
$context['show_buddies'] = !empty($user_info['buddies']);
$context['show_who'] = allowedTo('who_view') && !empty($modSettings['who_enabled']);
$context['info_center'][] = array(
'tpl' => 'online',
'txt' => 'online_users',
);
if (!empty($modSettings['trackStats']))
trackStatsUsersOnline($context['num_guests'] + $context['num_spiders'] + $context['num_users_online']);
if (!empty($settings['show_group_key']))
$context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array());
$context['page_title'] = sprintf($txt['forum_index'], $context['forum_name']);
$context['mark_read_button'] = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'custom' => 'data-confirm="' . $txt['are_sure_mark_read'] . '"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);
call_integration_hook('integrate_mark_read_button');
if (!empty($settings['show_newsfader']))
{
loadJavaScriptFile('slippry.min.js', array(), 'smf_jquery_slippry');
loadCSSFile('slider.min.css', array(), 'smf_jquery_slider');
}
}
?>