View difference between Paste ID: Mhwx2Mvu and XDtJpLSC
SHOW: | | - or go back to the newest paste.
1-
<?php
1+
<?php 
2-
2+
	global $SMTheme, $post;
3-
if ( ( $pagenow == "themes.php" ) && current_user_can('administrator') && isset( $_GET['activated'] ) && ( $_GET['activated']=='true' ) ) {
3+
4-
	if (!include_once( get_template_directory() . '/inc/activation.php' )) {
4+
	if( is_page(1053) || $post->post_parent == 1053 || ($post->ancestors && in_array( 1053, $post->ancestors) ) ) 
5-
		$stylesheet = get_option( 'theme_switched' );
5+
	{
6-
		switch_theme( $stylesheet, $stylesheet );
6+
		get_sidebar( 'drugi' );
7-
		if ( file_exists( get_template_directory() . '/inc/activation.php' ) ) {
7+
8-
			$error_message[]="PHP hasn't access to file /inc/activation.php. Check the file permissions and try again please.";
8+
	else 
9-
		} else {
9+
	{
10-
			$error_message[]="File /inc/activation.php doesn't exists. Try to upload the theme again.";
10+
		if ( !in_array($SMTheme->layout, array(1,3,6) ) )
11
			get_sidebar('right'); 
12-
		$message="<h2>The theme wasn't activated by following reasons:</h2><ul><li>".implode("</li><li>",$error_message)."</li></ul>"."Your theme was switched back to ".$stylesheet.".";
12+
		if ( !in_array($SMTheme->layout, array(1,2) ) )
13-
		wp_die($message,'',array('back_link'=>"/wp-admin/themes.php"));
13+
			get_sidebar('left');
14
		if ( $SMTheme->layout == 6 ) {
15-
}
15+
			get_sidebar('right'); 
16-
16+
17-
17+
18-
18+