Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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)
  • Author
    Posts
  • #36398
    dagash
    Participant

    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








    switch ( $value ) {
    case 'text':
    ?>




    break;

    case 'select':
    ?>




    break;

    case 'textarea':
    $ta_options = $value;
    ?>




    break;

    case 'nothing':
    $ta_options = $value;
    ?>

    " />








    break;

    case 'radio':
    ?>




    break;

    case 'checkbox':
    ?>




    break;

    default:

    break;
    }
    }
    ?>


    $option) {
    $radio_setting = get_option($value);
    if($radio_setting != ''){
    if ($key == get_option($value) ) {
    $checked = "checked="checked"";
    } else {
    $checked = "";
    }
    }else{
    if($key == $value){
    $checked = "checked="checked"";
    }else{
    $checked = "";
    }
    }?>
    />



    if(get_option($value)){
    $checked = "checked="checked"";
    }else{
    $checked = "";
    }
    ?>
    />















    3thoob theme.



    }
    add_action('admin_menu' , 'mytheme_add_admin');
    ?>//the last line

    and the error is :



    Parse error: syntax error, unexpected $end

    the error happened at the last line …

    i cant figure what the wrong here …… ??

    #95703
    leehughes
    Member

    This 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

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.