/* Decoded by unphp.net */ ?>query( "INSERT INTO " . USERPREFIX . "_admin_logs (name, date, ip, action, extras) values ('".$db->safesql($member_id['name'])."', '{$_TIME}', '{$_IP}', '66', '{$_REQUEST['do_template']}')" ); if( $auto_detect_config ) $config['http_home_url'] = ""; $handler = fopen( ENGINE_DIR . '/data/config.php', "w" ); fwrite( $handler, " $value ) { fwrite( $handler, "'{$name}' => '{$value}', " ); } fwrite( $handler, "); ?>" ); fclose( $handler ); } } if( $subaction == "new" ) { $b_form = "
$lang[opt_newtemp_1]     ' . $lang['opt_msgnew'] . '  

'; msg( "info", $lang['create_template'], $b_form ); exit(); } if( $subaction == "donew" ) { function open_dir($dir, $newdir) { //The function that will copy the files if( file_exists( $dir ) && file_exists( $newdir ) ) { $open_dir = opendir( $dir ); while ( false !== ($file = readdir( $open_dir )) ) { if( $file != "." && $file != ".." ) { if( @filetype( $dir . "/" . $file . "/" ) == "dir" ) { if( ! file_exists( $newdir . "/" . $file . "/" ) ) { mkdir( $newdir . "/" . $file . "/" ); @chmod( $newdir . "/" . $file, 0777 ); open_dir( $dir . "/" . $file . "/", $newdir . "/" . $file . "/" ); } } else { copy( $dir . "/" . $file, $newdir . "/" . $file ); @chmod( $newdir . "/" . $file, 0666 ); } } } } } $base_template = trim( totranslit($_REQUEST['base_template'], false, false) ); $template_name = trim( totranslit($_REQUEST['template_name'], false, false) ); if( preg_match( "/[\||\'|\<|\>|\[|\]|\"|\!|\?|\$|\@|\/|\|\&\~\*\+]/", $template_name ) ) { msg( "error", $lang['opt_error'], $lang['opt_error_1'], "?mod=templates&subaction=new&user_hash={$dle_login_hash}" ); } $result = @mkdir( ROOT_DIR . "/templates/" . $template_name, 0777 ); @chmod( ROOT_DIR . "/templates/" . $template_name, 0777 ); if( ! $result ) msg( "error", $lang['opt_error'], $lang['opt_cr_err'], "?mod=templates&subaction=new&user_hash={$dle_login_hash}" ); else open_dir( ROOT_DIR . "/templates/" . $base_template, ROOT_DIR . "/templates/" . $template_name ); $db->query( "INSERT INTO " . USERPREFIX . "_admin_logs (name, date, ip, action, extras) values ('".$db->safesql($member_id['name'])."', '{$_TIME}', '{$_IP}', '67', '{$template_name}')" ); msg( "success", $lang['opt_info'], $lang['opt_info_1'], "?mod=templates&user_hash={$dle_login_hash}" ); } if( $subaction == "delete" ) { if( strtolower( $do_template ) == strtolower($config['skin']) OR strtolower( $do_template ) == "smartphone" OR strtolower( $do_template ) == '' ) { msg( "Error", $lang['opt_error'], $lang['opt_error_4'], "?mod=templates&user_hash={$dle_login_hash}" ); } $msg = "
$lang[opt_info_2] $do_template?

"; msg( "info", $lang['opt_info_3'], $msg ); } if( $subaction == "dodelete" ) { if( strtolower( $do_template ) == strtolower($config['skin']) OR strtolower( $do_template ) == "smartphone" ) { msg( "Error", $lang['opt_error'], $lang['opt_error_4'], "?mod=templates&user_hash={$dle_login_hash}" ); } if(!$do_template OR preg_match( "/[\||\'|\<|\>|\[|\]|\"|\!|\?|\$|\@|\/|\|\&\~\*\+]/", $do_template ) ) { msg( "error", $lang['opt_error'], $lang['opt_error_1'], "?mod=templates&user_hash={$dle_login_hash}" ); } $db->query( "INSERT INTO " . USERPREFIX . "_admin_logs (name, date, ip, action, extras) values ('".$db->safesql($member_id['name'])."', '{$_TIME}', '{$_IP}', '68', '{$do_template}')" ); listdir( ROOT_DIR . "/templates/" . $do_template ); msg( "success", $lang['opt_info_3'], $lang['opt_info_4'], "?mod=templates&user_hash={$dle_login_hash}" ); } $show_delete_link = ''; $do_template = trim( totranslit($do_template, false, false) ); if( $do_template == '' or ! $do_template ) { $do_template = $config['skin']; } elseif( $do_template != $config['skin'] AND $do_template != "smartphone" ) { $show_delete_link = "$lang[opt_dellink]"; } if (!@is_dir ( ROOT_DIR . '/templates/' . $do_template )) { die ( "Template not found!" ); } if(!is_writable(ROOT_DIR . '/templates/' . $do_template . "/")) { $lang['stat_template'] = str_replace ("{template}", '/templates/'.$do_template.'/', $lang['stat_template']); $fail = "
{$lang['stat_template']}
"; } else $fail = ""; $js_array[] = "engine/skins/codemirror/js/code.js"; $css_array[] = "engine/skins/codemirror/css/default.css"; echoheader( "{$lang['header_tm_1']}", $lang['header_tm_2'] ); echo <<
{$lang['opt_edit_head']}
{$do_template}
  {$lang['opt_temphelp']}
{$lang['opt_enewtepl']} {$show_delete_link}
{$lang['opt_edteil']} {$do_template}
{$fail} HTML; echofooter(); ?>