Home › Forums › Back End › Parse error: syntax error, unexpected $end ….. i cant figure where it is ..
- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
January 30, 2012 at 10:40 am #36398dagashParticipant
i am working with theme option page at wordpress .
this is my code :
$themename = "3thoob";
$shortname = "3th1";
// Create theme options
$options = array (
array( "name" =>__('إعدادات تويتر'),
"desc" => __('فقط أضف اسم الحساب والذي يكون بعد علامة / في الرابط'),
"id" => $shortname."_twitter",
"std" => "wordpress",
"type" => "text"),
array( "name" => __('إعدادت الإعلان'),
"desc" => __("أضف رابط صور الإعلان"),
"id" => $shortname."_Ads",
"std" => __(""),
"type" => "text"),
array( "name" => __('من أنا'),
"desc" => __("أضف هنا النص الذي تريد ان يظهر في خانة ( من أنا ) في أسفل الصفحة الرئيسية"),
"id" => $shortname."_whoimi",
"std" => __("اكتب ما تريد هنا"),
"type" => "textarea",
"options" => array( "rows" => "5",
"cols" => "80") )
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET == basename(__FILE__) ) {
if ( 'save' == $_REQUEST ) {
foreach ($options as $value) {
update_option( $value, $_REQUEST[ $value ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value ] ) ) { update_option( $value, $_REQUEST[ $value ] ); } else { delete_option( $value ); } }
header("Location: themes.php?page=theme-options.php&saved=true");
die;
} else if( 'reset' == $_REQUEST ) {
foreach ($options as $value) {
delete_option( $value ); }
header("Location: themes.php?page=theme-options.php&reset=true");
die;
} else if ( 'reset_widgets' == $_REQUEST ) {
$null = null;
update_option('sidebars_widgets',$null);
header("Location: themes.php?page=theme-options.php&reset=true");
die;
}
}
add_theme_page($themename." Options", "3thoob Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST ) echo '';'.$themename.' '.__('settings saved.','thematic').'
if ( $_REQUEST ) echo '';'.$themename.' '.__('settings reset.','thematic').'
if ( $_REQUEST ) echo '';'.$themename.' '.__('widgets reset.','thematic').'
?>
Options
3thoob theme.
}
add_action('admin_menu' , 'mytheme_add_admin');
?>//the last line
and the error is :
Parse error: syntax error, unexpected $endthe error happened at the last line …
i cant figure what the wrong here …… ??
January 30, 2012 at 11:08 am #95703leehughesMemberThis is a guess from someone who knows zip about php but try adding an extra } above the add_action
so
}
add_action('admin_menu' , 'mytheme_add_admin');
?>//the last line -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘Back End’ is closed to new topics and replies.