style_config))
{
$config = $template->style_config;
if(!isset($config['grad']))
{
$template->refresh_config();
}
}
else
{
$config = array(
'home' => 0,
'click' => 1,
'top' => 0,
'switch' => '',
);
}
// get color
$colors = array(
'sblue',
'darkblue',
'red',
'pink',
'green',
'purple',
'gray',
'blue',
);
$color = $row['body_background'];
if(!in_array($color, $colors))
{
$color = $colors[0];
}
$current_template_images = $current_template_path . "/images";
$template_dir = $current_template_path;
if((strlen($phpbb_root_path) > 0) && (substr($template_dir, 0, strlen($phpbb_root_path)) !== $phpbb_root_path))
{
$template_dir = $phpbb_root_path . $template_dir;
}
$imageset_dir = $template_dir . '/images/' . $color;
$imageset_lang_dir = $template_dir . '/images/{LANG}';
$imageset_lang_dir_color = $template_dir . '/images/{LANG}/' . $color;
//
// headers/footers
//
$tpl_hdr1 = '
| ';
$tpl_hdr2 = ' | |
';
if(empty($template->style_config['top']))
{
$tpl_ftr = '';
}
else
{
$tpl_ftr = '';
}
$tpl_hdr_small1 = ' | ';
$tpl_hdr_small2 = ' | |
';
//
// testing if image exists
//
$test_file = $template_dir . '/images/lang_{LANG}/' . $color . '/quick_reply.gif';
$tpl_lang = 'english';
if(@file_exists(str_replace('{LANG}', $board_config['default_lang'], $test_file)))
{
// image exists, setting language variable to correct url
$tpl_lang = $board_config['default_lang'];
}
elseif($board_config['default_lang'] !== 'english')
{
// image doesn't exist, testing if there is english version
if(!@file_exists(str_replace('{LANG}', 'english', $test_file)))
{
// nothing found. setting to default language
$tpl_lang = $board_config['default_lang'];
}
}
//
// adding custom template variables
//
$template->assign_vars(array(
'T_TEMPLATE_PATH' => $template_dir,
'T_IMAGESET_PATH' => $imageset_dir,
'T_COLOR' => $color,
'T_LANG' => $tpl_lang,
'XS_VERSION' => isset($template->xs_version) ? intval($template->xs_version) : 0,
// switches
'S_LOGGED_IN' => $userdata['session_logged_in'] ? 1 : 0,
'S_ADMIN' => $userdata['user_level'] == ADMIN ? 1 : 0,
'S_MOD' => $userdata['user_level'] == MOD ? 1 : 0,
// private messages
'C_PM' => $userdata['session_logged_in'] && $userdata['user_new_privmsg'] ? ' (' . $userdata['user_new_privmsg'] . ')' : '',
// login form
'S_LOGIN_ACTION2' => htmlspecialchars(append_sid('login.'.$phpEx)),
'S_LOGIN_ACTION3' => urlencode('login.'.$phpEx.'?sid='.$userdata['session_id']),
'S_SID' => $userdata['session_id'],
// strings
'CA_L_NO_MSG' => $lang['No_new_pm'],
'CA_L_ANNOUNCE' => $lang['Topic_Announcement'] . ' ',
'CA_L_STICKY' => $lang['Topic_Sticky'] . ' ',
// search forms
'CA_SEARCH_INDEX' => append_sid('search.php?mode=results'),
'CA_SEARCH_FORUM' => isset($forum_id) ? $forum_id : '0',
// quick reply
'CA_QR_BUTTON' => $lang['Post_a_reply'],
// content headers/footers
'TPL_CONTENT_TOP' => ' | | |
| ',
'TPL_CONTENT_TOP_NOPADDING' => ' |
| | |
| ',
'TPL_CONTENT_BOTTOM' => ' | |
| | |
',
'TPL_CONTENT_TOPNAV1' => ' | ',
'TPL_CONTENT_TOPNAV2' => ' | |
| ',
'TPL_CONTENT_TOPNAV2_PM' => ' | |
| ',
'TPL_CONTENT_BOTTOMNAV1' => ' | |
| ',
'TPL_CONTENT_BOTTOMNAV2' => ' | |
',
// headers 1
'TPL_HDR1' => str_replace('{IMG}', 'house', $tpl_hdr1),
'TPL_HDR1_NEW' => str_replace('{IMG}', 'post_new', $tpl_hdr1),
'TPL_HDR1_POST' => str_replace('{IMG}', 'post', $tpl_hdr1),
'TPL_HDR1_BLUE' => str_replace('{IMG}', 'blue', $tpl_hdr1),
'TPL_HDR1_ORANGE' => str_replace('{IMG}', 'orange', $tpl_hdr1),
// headers 2
'TPL_HDR2' => str_replace('{IMG}', 'blue', $tpl_hdr2),
'TPL_HDR2_NEW' => str_replace('{IMG}', 'orange', $tpl_hdr2),
// headers for portal
'TPL_HDR1_SMALL' => str_replace(array('{NEW}', '{NEW2}'), array('',''), $tpl_hdr_small1),
'TPL_HDR2_SMALL' => str_replace(array('{NEW}', '{NEW2}'), array('',''), $tpl_hdr_small2),
'TPL_HDR1_SMALL_NEW' => str_replace(array('{NEW}', '{NEW2}'), array('_new','-new'), $tpl_hdr_small1),
'TPL_HDR2_SMALL_NEW' => str_replace(array('{NEW}', '{NEW2}'), array('_new','-new'), $tpl_hdr_small2),
// footer
'TPL_FTR' => str_replace(array('{NEW}', '{NEW2}'), array('',''), $tpl_ftr),
'TPL_FTR_NEW' => str_replace(array('{NEW}', '{NEW2}'), array('_new','-new'), $tpl_ftr),
// onclick
'T_ONCLICK' => empty($config['click']) ? 'ca_onclick' : 'onclick',
));
if(defined('IN_ADMIN') && (empty($HTTP_GET_VARS['pane']) || $HTTP_GET_VARS['pane'] !== 'left' ))
{
$template->assign_block_vars('ca_admin', array());
}
else
{
$template->assign_block_vars('ca_noadmin', array());
}
if ( $userdata['session_logged_in'] )
{
$template->assign_vars(array(
'CA_L_LOGIN_LOGOUT' => $lang['Logout'] . ' (' . $userdata['username'] . ')',
'CA_NEW_MSGS' => $userdata['user_new_privmsg'],
));
if($userdata['user_new_privmsg'])
{
$template->assign_block_vars('ca_new_privmsgs', array(
'TEXT' => sprintf($userdata['user_new_privmsg'] > 1 ? $lang['New_pms'] : $lang['New_pm'], $userdata['user_new_privmsg'])
));
}
}
else
{
$template->assign_vars(array(
'CA_L_LOGIN_LOGOUT' => $lang['Login'],
));
}
// check xs mod
if(!empty($template->xs_version))
{
$template->assign_vars(array(
'CA_XS_COMMENT_START' => '',
'CA_XS_COMMENT_JS_START' => ' /* ',
'CA_XS_COMMENT_JS_END' => ' */ ',
));
}
// check 2.0.11
global $lang, $board_config, $template;
if(defined('IN_ADMIN') && isset($lang['Visual_confirm']))
{
$version = explode('.', $board_config['version']);
if(isset($version[2]) && intval($version[2]) > 10)
{
$template->assign_block_vars('admin_visual_confirm', array());
}
}
$current_template_images = $imageset_dir;
$images['icon_quote'] = "$imageset_lang_dir/icon_quote.gif";
$images['icon_edit'] = "$imageset_lang_dir/icon_edit.gif";
$images['icon_search'] = "$imageset_lang_dir/icon_search.gif";
$images['icon_profile'] = "$imageset_lang_dir/icon_profile.gif";
$images['icon_pm'] = "$imageset_lang_dir/icon_pm.gif";
$images['icon_email'] = "$imageset_lang_dir/icon_email.gif";
$images['icon_delpost'] = "$imageset_lang_dir/icon_delete.gif";
$images['icon_ip'] = "$imageset_lang_dir/icon_ip.gif";
$images['icon_www'] = "$imageset_lang_dir/icon_www.gif";
$images['icon_icq'] = "$imageset_lang_dir/icon_icq.gif";
$images['icon_aim'] = "$imageset_lang_dir/icon_aim.gif";
$images['icon_yim'] = "$imageset_lang_dir/icon_yim.gif";
$images['icon_msnm'] = "$imageset_lang_dir/icon_msn.gif";
$images['icon_minipost'] = "$imageset_dir/icon_latest_reply.gif";
$images['icon_gotopost'] = "$imageset_dir/icon_latest_reply.gif";
$images['icon_minipost_new'] = "$imageset_dir/icon_newest_reply.gif";
$images['icon_latest_reply'] = "$imageset_dir/icon_latest_reply.gif";
$images['icon_newest_reply'] = "$imageset_dir/icon_newest_reply.gif";
$images['forum'] = "$imageset_dir/folder_big.gif";
$images['forum_new'] = "$imageset_dir/folder_new_big.gif";
$images['forum_locked'] = "$imageset_dir/folder_locked_big.gif";
$images['folder'] = "$imageset_dir/folder.gif";
$images['folder_new'] = "$imageset_dir/folder_new.gif";
$images['folder_hot'] = "$imageset_dir/folder_hot.gif";
$images['folder_hot_new'] = "$imageset_dir/folder_new_hot.gif";
$images['folder_locked'] = "$imageset_dir/folder_lock.gif";
$images['folder_locked_new'] = "$imageset_dir/folder_lock_new.gif";
$images['folder_sticky'] = "$imageset_dir/folder_sticky.gif";
$images['folder_sticky_new'] = "$imageset_dir/folder_sticky_new.gif";
$images['folder_announce'] = "$imageset_dir/folder_announce.gif";
$images['folder_announce_new'] = "$imageset_dir/folder_announce_new.gif";
$images['post_new'] = "$imageset_lang_dir_color/post.gif";
$images['post_locked'] = "$imageset_lang_dir_color/reply-locked.gif";
$images['reply_new'] = "$imageset_lang_dir_color/reply.gif";
$images['reply_locked'] = "$imageset_lang_dir_color/reply-locked.gif";
$images['pm_inbox'] = "$imageset_dir/msg_inbox.gif";
$images['pm_outbox'] = "$imageset_dir/msg_outbox.gif";
$images['pm_savebox'] = "$imageset_dir/msg_savebox.gif";
$images['pm_sentbox'] = "$imageset_dir/msg_sentbox.gif";
$images['pm_readmsg'] = "$imageset_dir/folder.gif";
$images['pm_unreadmsg'] = "$imageset_dir/folder_new.gif";
$images['pm_replymsg'] = "$imageset_lang_dir_color/reply.gif";
$images['pm_postmsg'] = "$imageset_lang_dir_color/msg_newpost.gif";
$images['pm_quotemsg'] = "$imageset_lang_dir/icon_quote.gif";
$images['pm_editmsg'] = "$imageset_lang_dir/icon_edit.gif";
$images['pm_new_msg'] = "";
$images['pm_no_new_msg'] = "";
$images['topic_watch'] = "";
$images['topic_un_watch'] = "";
$images['topic_mod_lock'] = "$imageset_lang_dir_color/topic_lock.gif";
$images['topic_mod_unlock'] = "$imageset_lang_dir_color/topic_unlock.gif";
$images['topic_mod_split'] = "$imageset_lang_dir_color/topic_split.gif";
$images['topic_mod_move'] = "$imageset_lang_dir_color/topic_move.gif";
$images['topic_mod_delete'] = "$imageset_lang_dir_color/topic_delete.gif";
$images['voting_graphic'][0] = "$imageset_dir/voting_bar.gif";
$images['voting_graphic'][1] = "$imageset_dir/voting_bar.gif";
$images['voting_graphic'][2] = "$imageset_dir/voting_bar.gif";
$images['voting_graphic'][3] = "$imageset_dir/voting_bar.gif";
$images['voting_graphic'][4] = "$imageset_dir/voting_bar.gif";
//
// Vote graphic length defines the maximum length of a vote result
// graphic, ie. 100% = this length
//
$board_config['vote_graphic_length'] = 205;
$board_config['privmsg_graphic_length'] = 175;
?>