<?php
error_reporting(E_ALL & ~E_NOTICE);
//ini_set('display_errors', 1);

global $vbulletin, $stylevar, $db, $template_hook, $vbphrase, $foruminfo, $userinfo;
if ($vbulletin->options['ackapa_tabfilmseriti'] AND is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['uyegrubu_tabfilmseriti'])) AND (THIS_SCRIPT == 'index') OR array_intersect(explode(',', $foruminfo['parentlist']), explode(',', $vbulletin->options['only_forum_id_tabfilmseriti'])))
{	
	$template_hook['wfserit'] = $vbulletin->options['width_tabfilmseriti'] - 20;
	$template_hook['hfserit'] = $vbulletin->options['height_tabfilmseriti'] - 30;
	$template_hook['wfserit7'] = $vbulletin->options['width_tabfilmseriti'] - 7;
	$template_hook['hfserit10'] = $vbulletin->options['height_tabfilmseriti'] + 10;
	$template_hook['wfserit30'] = $vbulletin->options['width_tabfilmseriti'] - 30;
	$template_hook['wfserit37'] = $vbulletin->options['width_tabfilmseriti'] - 37;
	$template_hook['hfserit46'] = $vbulletin->options['height_tabfilmseriti'] - 46;
	$template_hook['hfserit66'] = $vbulletin->options['height_tabfilmseriti'] - 66;
	$template_hook['hfserit86'] = $vbulletin->options['height_tabfilmseriti'] - 86;
	
        $templatercss = vB_Template::create('forumhome_tabfilmseriti_css');
        $headinclude .= $templatercss->render();
		
		$id_tabfilmseriti_tab1_baslik = ($vbulletin->options['id_tabfilmseriti_tab1_baslik']);
        $id_tabfilmseriti_tab2_baslik = ($vbulletin->options['id_tabfilmseriti_tab2_baslik']);
        $id_tabfilmseriti_tab3_baslik = ($vbulletin->options['id_tabfilmseriti_tab3_baslik']);
        $id_tabfilmseriti_tab4_baslik = ($vbulletin->options['id_tabfilmseriti_tab4_baslik']);
        $id_tabfilmseriti_tab5_baslik = ($vbulletin->options['id_tabfilmseriti_tab5_baslik']);
        $id_tabfilmseriti_tab6_baslik = ($vbulletin->options['id_tabfilmseriti_tab6_baslik']);
        $id_tabfilmseriti_tab7_baslik = ($vbulletin->options['id_tabfilmseriti_tab7_baslik']);
        $id_tabfilmseriti_tab8_baslik = ($vbulletin->options['id_tabfilmseriti_tab8_baslik']);
        $height_tabfilmserititab1 = ($vbulletin->options['height_tabfilmseriti'] + 40);
		$height_tabfilmserititab2 = ($vbulletin->options['height_tabfilmseriti'] + 12);
		$height_tabfilmserititab = ($vbulletin->options['height_tabfilmseriti'] + 10);
        $ismi_tabfilmseriti = ($vbulletin->options['ismi_tabfilmseriti']);
        $hizi_tabfilmseriti = ($vbulletin->options['hizi_tabfilmseriti']);
        $rengi_tabfilmseriti = ($vbulletin->options['rengi_tabfilmseriti']);
        $resmi_tabfilmseriti = ($vbulletin->options['resmi_tabfilmseriti']);
        $templater = vB_Template::create('forumhome_tabfilmseriti');
        $templater->register('ismi_tabfilmseriti', $ismi_tabfilmseriti);
        $templater->register('hizi_tabfilmseriti', $hizi_tabfilmseriti);
        $templater->register('rengi_tabfilmseriti', $rengi_tabfilmseriti);
        $templater->register('resmi_tabfilmseriti', $resmi_tabfilmseriti);
        $templater->register('id_tabfilmseriti_tab1_baslik', $id_tabfilmseriti_tab1_baslik);
        $templater->register('id_tabfilmseriti_tab2_baslik', $id_tabfilmseriti_tab2_baslik);
        $templater->register('id_tabfilmseriti_tab3_baslik', $id_tabfilmseriti_tab3_baslik);
        $templater->register('id_tabfilmseriti_tab4_baslik', $id_tabfilmseriti_tab4_baslik);
        $templater->register('id_tabfilmseriti_tab5_baslik', $id_tabfilmseriti_tab5_baslik);
        $templater->register('id_tabfilmseriti_tab6_baslik', $id_tabfilmseriti_tab6_baslik);
        $templater->register('id_tabfilmseriti_tab7_baslik', $id_tabfilmseriti_tab7_baslik);
        $templater->register('id_tabfilmseriti_tab8_baslik', $id_tabfilmseriti_tab8_baslik);
        $templater->register('height_tabfilmserititab', $height_tabfilmserititab);
		$templater->register('height_tabfilmserititab1', $height_tabfilmserititab1);
		$templater->register('height_tabfilmserititab2', $height_tabfilmserititab2);
		
		
		
if (THIS_SCRIPT == 'index')
{
	require_once(DIR . '/includes/adminfunctions_template.php');
	$filmseriti_bul3 = trim(preg_replace('#^\$final_rendered = \'(.*)\';$#s', '\\1', compile_template('{vb:raw sidebar}')));			
	$filmseriti_degistir3 = trim(preg_replace('#^\$final_rendered = \'(.*)\';$#s', '\\1', compile_template('{vb:raw template_hook.yilmazfilmseriti3}
	{vb:raw sidebar}')));
	$vbulletin->templatecache['FORUMHOME'] = str_replace($filmseriti_bul3, $filmseriti_degistir3, $vbulletin->templatecache['FORUMHOME']);		
	
        switch ($vbulletin->options['yeri_tabfilmseriti'])
		{	
			case 0: break;		
			case 1: $header = $templater->render().$header; break;
			case 2: $header = $header.$templater->render(); break;
			case 3: $vbulletin->templatecache['navbar'] = str_replace('<!-- closing div for above_body -->', '<!-- closing div for above_body -->'.$templater->render(), $vbulletin->templatecache['navbar']); break;
			case 4: $template_hook['forumhome_above_forums'] .= $templater->render(); break;
			case 5: $template_hook['forumhome_below_forums'] .= $templater->render(); break;
			case 6: $template_hook['forumhome_wgo_pos4'] .= $templater->render(); break;
			case 7: $footer = $templater->render().$footer; break;
			case 13: $template_hook['yilmazfilmseriti3'] = $templater->render().$template_hook['yilmazfilmseriti3']; break;
		}
}
		if (THIS_SCRIPT == 'forumdisplay')
{
require_once(DIR . '/includes/adminfunctions_template.php');	
	$filmseriti_bul1 = trim(preg_replace('#^\$final_rendered = \'(.*)\';$#s', '\\1', compile_template('<div id="above_threadlist" class="above_threadlist">')));			
	$filmseriti_degistir1 = trim(preg_replace('#^\$final_rendered = \'(.*)\';$#s', '\\1', compile_template('{vb:raw template_hook.yilmazfilmseriti1}
	<div id="above_threadlist" class="above_threadlist">')));
	$vbulletin->templatecache['FORUMDISPLAY'] = str_replace($filmseriti_bul1, $filmseriti_degistir1, $vbulletin->templatecache['FORUMDISPLAY']);
	
	$filmseriti_bul2 = trim(preg_replace('#^\$final_rendered = \'(.*)\';$#s', '\\1', compile_template('<div id="pagetitle" class="pagetitle">')));			
	$filmseriti_degistir2 = trim(preg_replace('#^\$final_rendered = \'(.*)\';$#s', '\\1', compile_template('{vb:raw template_hook.yilmazfilmseriti2}
	<div id="pagetitle" class="pagetitle">')));
	$vbulletin->templatecache['FORUMDISPLAY'] = str_replace($filmseriti_bul2, $filmseriti_degistir2, $vbulletin->templatecache['FORUMDISPLAY']);
	
	
       switch ($vbulletin->options['forumdisplayde_yeri_tabfilmseriti'])	
		{	
			case 8: break;		
			case 9: $vbulletin->templatecache['navbar'] = str_replace('<!-- closing div for above_body -->', '<!-- closing div for above_body -->'.$templater->render(), $vbulletin->templatecache['navbar']); break;
			case 10: $template_hook['yilmazfilmseriti1'] = $templater->render().$template_hook['yilmazfilmseriti1']; break;
			case 11: $template_hook['yilmazfilmseriti2'] = $templater->render().$template_hook['yilmazfilmseriti1']; break;
			case 12: $footer = $templater->render().$footer; break;
		} 
				
}				
//$footer .= '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script type="text/javascript" src="includes/yilmaz/tabli_film_seriti/assets/script/main.js"></script>';				
				
}
?>