Forums

[closed] Parse error: syntax error, unexpected T_STRING (25 posts)

  1. boycalledben
    Member
    Posted 10 months ago #

    I am in the process of changing my web hosting from 000webhost to Vidahost, as I require more sql databases.

    I'm using the free Expositio theme (http://expositio.wpshower.com/) on my website http:boycalledben.co.uk

    The site works fine on 000webhost. However, I've now setup wordpress on Vidahost and have tried installing the exact same version of the theme, but when I activate the theme to use it, it comes up with the error:

    Parse error: syntax error, unexpected T_STRING in /home/boycalle/public_html/wp-content/themes/expositio/includes/theme_options.php on line 1

    Now my knowledge of HTML and CSS is minimal, but PHP doesn't even feature on my radar.

    Can anybody help?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 10 months ago #

  3. jnhghy
    Member
    Posted 10 months ago #

    Hi, can you paste the first lines from /home/boycalle/public_html/wp-content/themes/expositio/includes/theme_options.php ? it might be a missing tag....

  4. boycalledben
    Member
    Posted 10 months ago #

    Thanks Esmi, I haven't tried there as the response is usually quite slow, but I will bear it in mind.

    Here you go jnhghy,

    <?php/**  *	Admin styles & scripts  */add_action( 'admin_init', 'free01_admin_init' );function free01_admin_init() {   wp_register_style( 'free01_admin_css', get_bloginfo( 'template_url' ) . '/includes/theme_options.css' );   wp_register_script( 'free01_admin_js', get_bloginfo( 'template_url' ) . '/includes/theme_options.js' );}function free01_admin_styles() {   wp_enqueue_style('postbox');   wp_enqueue_style('media-upload');   wp_enqueue_style('thickbox');   wp_enqueue_style( 'free01_admin_css' );   wp_enqueue_style( 'farbtastic' );}function free01_admin_js() {   wp_enqueue_script('media-upload');   wp_enqueue_script('thickbox');   wp_enqueue_script( 'free01_admin_js' );   wp_enqueue_script( 'farbtastic' );}/**  *	Add admin pages  */function free01_options_page() {    add_theme_page( 'Theme Options', 'Theme Options', 'edit_theme_options', basename(__FILE__), 'free01_options' );    add_action( 'admin_print_styles', 'free01_admin_styles' );    add_action( 'admin_enqueue_scripts', 'free01_admin_js' );}add_action('admin_menu', 'free01_options_page');/***** Options page *****/function free01_options() {    if ( isset( $_POST['update_options'] ) ) { free01_options_update(); }  //check options update	?>    <div class="wrap free01">        <div id="icon-options-general" class="icon32"><br /></div>		<h2><?php _e('Theme Options', 'free01'); ?></h2>				<form method="post" action="">            <fieldset>                <input type="hidden" name="update_options" value="true"/>                <div id="poststuff" class="metabox-holder">                    <div class="meta-box-sortables">                        <!-- General -->                        <div class="postbox">                            <div class="handlediv" title="<?php _e('Click to toggle'); ?>">                                <br/>                            </div>                            <h3 class="hndle"><span><?php _e('General', 'free01'); ?></span></h3>                            <div class="inside">								                                <table class="form-table">                                    <tr>                                        <th scope="row"><?php _e('Favicon URL:'); ?></th>                                        <td>                                            <label for="free01_favicon_url"><input type="text" name="free01_favicon_url" id="free01_favicon_url" size="76" value="<?php echo get_option('free01_favicon_url'); ?>"/> <input id="free01_favicon_url_button" class="button" type="button" value="Upload" /></label><br/>                                            <?php _e( 'Max width 32 px', 'free01' ); ?>                                            <br/>                                            <?php                                                if ( get_option('free01_favicon_url') ) :                                                $size = getimagesize(get_option('free01_favicon_url'));                                            ?>                                                <p><img src="<?php echo get_option('free01_favicon_url'); ?>" <?php echo $size[3]; ?> alt=""/></p>                                            <?php endif; ?>                                        </td>                                    </tr>                                    <tr>                                        <th scope="row"><?php _e('Font size:'); ?></th>                                        <td>                                            <label for="free01_font_size">												<select name="free01_font_size" id="free01_font_size">													<option value="12" <?php echo get_option('free01_font_size') == 12 ? 'selected="selected"' : '' ?>> 12 </option>													<option value="14" <?php echo get_option('free01_font_size', 14) == 14 ? 'selected="selected"' : '' ?>> 14 </option>													<option value="16" <?php echo get_option('free01_font_size') == 16 ? 'selected="selected"' : '' ?>> 16 </option>													<option value="18" <?php echo get_option('free01_font_size') == 18 ? 'selected="selected"' : '' ?>> 18 </option>												</select>											</label><br/>                                            <?php _e( 'Font size of the whole theme', 'free01' ); ?>                                        </td>                                    </tr>									<tr>                                        <th scope="row"><?php _e('Font family:'); ?></th>                                        <td>                                            <label for="free01_font_family">												<select name="free01_font_family" id="free01_font_family">													<option value="Helvetica" <?php echo get_option('free01_font_family', 'Helvetica') == 'Helvetica' ? 'selected="selected"' : '' ?>> <?php echo __('Helvetica') ?> </option>													<option value="Arial" <?php echo get_option('free01_font_family') == 'Arial' ? 'selected="selected"' : '' ?>> <?php echo __('Arial') ?> </option>													<option value="Georgia" <?php echo get_option('free01_font_family') == 'Georgia' ? 'selected="selected"' : '' ?>> <?php echo __('Georgia') ?> </option>													<option value="Droid Sans Mono" <?php echo get_option('free01_font_family') == 'Droid Sans Mono' ? 'selected="selected"' : '' ?>> <?php echo __('Droid Sans Mono') ?> </option>													<option value="Arvo" <?php echo get_option('free01_font_family') == 'Arvo' ? 'selected="selected"' : '' ?>> <?php echo __('Arvo') ?> </option>													<option value="Bentham" <?php echo get_option('free01_font_family') == 'Bentham' ? 'selected="selected"' : '' ?>> <?php echo __('Bentham') ?> </option>																									</select>											</label><br/>                                            <?php _e( 'Font size of the whole theme', 'free01' ); ?>                                        </td>                                    </tr>									<tr>                                        <th scope="row"><?php _e('Text color:'); ?></th>                                        <td>                                            <label for="free01_text_color"><input type="text" name="free01_text_color" id="free01_text_color" size="8" value="<?php echo get_option('free01_text_color', '#000'); ?>" data-hex="true" /><a id="colorpicker_text_color_link" href="javascript:;"><?php echo __('Select a Color') ?></a><div id="colorpicker_text_color"></div></label><br/>                                            <?php _e( 'Main Text color', 'free01' ); ?>                                        </td>                                    </tr>									<tr>                                        <th scope="row"><?php _e('Link color:'); ?></th>                                        <td>                                            <label for="free01_link_color"><input type="text" name="free01_link_color" id="free01_link_color" size="8" value="<?php echo get_option('free01_link_color', '#000'); ?>" data-hex="true" /><a id="colorpicker_link_color_link" href="javascript:;"><?php echo __('Select a Color') ?></a><div id="colorpicker_link_color"></div></label><br/>                                            <?php _e( 'Link color of the theme', 'free01' ); ?>                                        </td>                                    </tr>									<tr>                                        <th scope="row"><?php _e('Background color:'); ?></th>                                        <td>                                            <label for="free01_bg_color"><input type="text" name="free01_bg_color" id="free01_bg_color" size="8" value="<?php echo get_option('free01_bg_color', '#fff'); ?>" data-hex="true" /><a id="colorpicker_bg_color_link" href="javascript:;"><?php echo __('Select a Color') ?></a><div id="colorpicker_bg_color"></div></label><br/>                                            <?php _e( 'Background color of the theme', 'free01' ); ?>                                        </td>                                    </tr>									<tr>                                        <th scope="row"><?php _e('Google Analytics'); ?></th>                                        <td>                                            <label for="free01_google_analytics"><textarea type="text" name="free01_google_analytics" id="free01_google_analytics" cols="63" rows="5"><?php echo get_option('free01_google_analytics', ''); ?></textarea></label><br/>                                            <?php _e( 'Copy & paste your analytics here', 'free01' ); ?>                                        </td>                                    </tr>                                </table>								<p><input type="submit" value="<?php _e('Save Changes', 'free01'); ?>" class="button button-primary"/></p>							</div>							<script type="text/javascript">								(function($) {									jQuery(function() {										jQuery('#free01_favicon_url_button').click(function() {											formfield = $(this).prev().attr('name');											tb_show('', 'media-upload.php?type=image&TB_iframe=true');											return false;										});										jQuery('#colorpicker_text_color').farbtastic('#free01_text_color');										jQuery('#colorpicker_link_color').farbtastic('#free01_link_color');										jQuery('#colorpicker_bg_color').farbtastic('#free01_bg_color');																		jQuery('#colorpicker_text_color_link').click( function() {											jQuery('#colorpicker_text_color').toggle();										});										jQuery('#free01_text_color').blur( function() {											jQuery('#colorpicker_text_color').hide();										});										jQuery('#free01_text_color').focus( function() {											jQuery('#colorpicker_text_color').show();										});										jQuery('#colorpicker_link_color_link').click( function() {											jQuery('#colorpicker_link_color').toggle();										});										jQuery('#free01_link_color').blur( function() {											jQuery('#colorpicker_link_color').hide();										});										jQuery('#free01_link_color').focus( function() {											jQuery('#colorpicker_link_color').show();										});										jQuery('#colorpicker_bg_color_link').click( function() {											jQuery('#colorpicker_bg_color').toggle();										});										jQuery('#free01_bg_color').blur( function() {											jQuery('#colorpicker_bg_color').hide();										});										jQuery('#free01_bg_color').focus( function() {											jQuery('#colorpicker_bg_color').show();										});										window.send_to_editor = function(html) {											imgurl = $('img', html).attr('src');											$('#' + formfield).val(imgurl);											tb_remove();										}									})								})(jQuery)							</script>                        </div>                        <!-- /General -->																							</div>                </div>            </fieldset>        </form>				            </div><?php}function free01_options_update() {		if (isset($_POST['free01_favicon_url'])) update_option('free01_favicon_url', trim(strip_tags(($_POST['free01_favicon_url']))));	if (isset($_POST['free01_font_size'])) update_option('free01_font_size', trim(strip_tags(($_POST['free01_font_size']))));	if (isset($_POST['free01_font_family'])) update_option('free01_font_family', trim(strip_tags(($_POST['free01_font_family']))));	if (isset($_POST['free01_text_color'])) update_option('free01_text_color', trim(strip_tags(($_POST['free01_text_color']))));	if (isset($_POST['free01_link_color'])) update_option('free01_link_color', trim(strip_tags(($_POST['free01_link_color']))));	if (isset($_POST['free01_bg_color'])) update_option('free01_bg_color', trim(strip_tags(($_POST['free01_bg_color']))));	if (isset($_POST['free01_google_analytics'])) update_option('free01_google_analytics', trim(stripslashes_deep($_POST['free01_google_analytics'])));	}

    [ Please do not bump, that's not permitted here. ]

  5. jnhghy
    Member
    Posted 10 months ago #

    ok, create a copy of the code above and then replace it with the one here.
    It may give you another error but at least will tell us exactly where the error is.

  6. boycalledben
    Member
    Posted 10 months ago #

    Yeah, I'm getting the same error.

    So what do I do from here?

  7. jnhghy
    Member
    Posted 10 months ago #

    at line 1?

  8. boycalledben
    Member
    Posted 10 months ago #

    Yeah, still line 1.

  9. jnhghy
    Member
    Posted 10 months ago #

    ok what about with this one?

  10. boycalledben
    Member
    Posted 10 months ago #

    Now the error is:

    Parse error: syntax error, unexpected '}' in /home/boycalle/public_html/wp-content/themes/expositio/includes/theme_options.php on line 149

  11. jnhghy
    Member
    Posted 10 months ago #

    from where have you downloaded this theme? it has lots of errors so you could have downloaded the theme from the wrong source and it might not have support anymore or if you've downloaded it from the right place... this would be very strange, in the mean time have you tried to contact the theme support? as esmi suggested? if you want we can debug theme_options.php also ... now you know the drill paste the code in a pastebin and share it here so I can have a look.

  12. boycalledben
    Member
    Posted 10 months ago #

    I have downloaded it 3 times from the official site.

    I will post on the theme support, but answers are rare if at all.

    Please can you debug. What would you like me to post? The code I've been using is all from this thread.

  13. jnhghy
    Member
    Posted 10 months ago #

    If you look at line 149 there is an extra "}" right here:
    </div><?php}function free01_options_update() {
    it should look like this:
    </div><?php function free01_options_update() {
    please modify this ... we ar almost at the end of the file so the number of possible errors is small.

  14. boycalledben
    Member
    Posted 10 months ago #

    Ok, that line has been edited now.

    I'm now getting the error:

    Parse error: syntax error, unexpected $end in /home/boycalle/public_html/wp-content/themes/expositio/includes/theme_options.php on line 160

    (That's the last line)

    Here's the last 12 lines of code

    </div><?php function free01_options_update() {
                    if (isset($_POST['free01_favicon_url'])) update_option('free01_favicon_url',
    trim(strip_tags(($_POST['free01_favicon_url']))));      if (isset($_POST['free01_font_size']))
    update_option('free01_font_size', trim(strip_tags(($_POST['free01_font_size']))));
    if (isset($_POST['free01_font_family'])) update_option('free01_font_family',
    trim(strip_tags(($_POST['free01_font_family']))));      if (isset($_POST['free01_text_color']))
    update_option('free01_text_color', trim(strip_tags(($_POST['free01_text_color']))));
    if (isset($_POST['free01_link_color'])) update_option('free01_link_color',
    trim(strip_tags(($_POST['free01_link_color']))));       if (isset($_POST['free01_bg_color']))
    update_option('free01_bg_color', trim(strip_tags(($_POST['free01_bg_color']))));
    if (isset($_POST['free01_google_analytics'])) update_option('free01_google_analytics',
    trim(stripslashes_deep($_POST['free01_google_analytics'])));    }
  15. jnhghy
    Member
    Posted 10 months ago #

    Let's try this code now.

  16. boycalledben
    Member
    Posted 10 months ago #

    Ok, I've tried that and now I can actually preview the theme, but it's all messed up.

    Screenshot: http://i803.photobucket.com/albums/yy318/digitalsparrow/mywebsite.png

    And these two errors on all of the back end pages:

    Warning: Cannot modify header information - headers already sent by (output started at /home/boycalle/public_html/wp-content/themes/expositio/includes/theme_options.php:18) in /home/boycalle/public_html/wp-includes/functions.php on line 861

    Warning: Cannot modify header information - headers already sent by (output started at /home/boycalle/public_html/wp-content/themes/expositio/includes/theme_options.php:18) in /home/boycalle/public_html/wp-includes/functions.php on line 862

  17. jnhghy
    Member
    Posted 10 months ago #

    The messed up issue might get fixed with this code.
    We'll have to check the functions.php code to see if it's trying to include functions that might already be sent.

  18. boycalledben
    Member
    Posted 10 months ago #

    That seems to have done the trick, thank you so much for your help

    It's really strange, because whilst I have been speaking to you, I tried installing the same theme using a different domain of mine, but still hosted by the same company (000webhost), and even that was coming up with the errors.

    I don't understand how it can work for one site and not another.

    Thanks again.

  19. ebertrand-photos
    Member
    Posted 9 months ago #

    Hello everybody,
    I have actually the same problem than boycalledben, trying to install the free "expositio" theme.
    I downloaded it from http://wp-themes-pro.com/themes-gratuits/expositio/telechargement.
    From where did you downloaded the one that works ?
    Thank you by advance.

  20. jnhghy
    Member
    Posted 9 months ago #

    ebertrand-photos,
    From what I know there was no good source and boycakkedben had to modify the theme in order to make it work.

  21. ebertrand-photos
    Member
    Posted 9 months ago #

    Ah ok, that's right, I did not read your last previous exchanges very well, sorry.
    I finally decided to buy the COLr template instead of trying to fix the Expositio one.
    Thank you for your answer.

  22. boycalledben
    Member
    Posted 9 months ago #

    Hey dude,

    jnhghy kindly helped me out in this forum, but there is a much simpler solution over on the Expositio forums.

    http://wpshower.com/forums/showthread.php?t=3232

    Change this part of theme_options.php :

    <?php
    /**
    *	Admin styles & scripts
    */

    To this:

    <?php
    /* Admin styles & scripts */
  23. ebertrand-photos
    Member
    Posted 9 months ago #

    Hi Ben,
    I did that, saved the file and re-export it by FTP to my server, but the problem is exactly the same ("Parse error: syntax error, unexpected T_STRING in /homez.111/emmanuelu/www/wp-portfolio/wp-content/themes/expositio/includes/theme_options.php on line 1").
    It does not matter, I paid for the COLr V5 theme. I should be able to publish it by the next week-end.
    Thank you for all.

  24. SobiaD
    Member
    Posted 2 months ago #

    Hi everyone !!!! I m new to wordpress and wanted some changes in the website.As to change the code for searchbox I go into header.php and made some changes and just hit update button...but the page does'nt appear and it show error on it

    Parse error: syntax error, unexpected T_STRING in /home/austinba/public_html/wp-content/themes/directorypress/header.php on line 155

    I am confused where did the error coming .I am giving you the code :`
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <!--[if lte IE 8 ]> <html lang="en" class="ie ie8"> <![endif]-->
    <!--[if IE 9 ]> <html lang="en" class="ie"> <![endif]-->
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>

    <?php wp_head(); ?>
    <!--[if lt IE 9]>
    <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>

    <body <?php ppt_body_class(); ?>>

    <?php premiumpress_top(); /* HOOK */ ?>

    <div class="wrapper <?php $PPTDesign->CSS("ppt_layout_width"); ?>">

    <?php premiumpress_header_before(); /* HOOK */ ?>

    <div id="header" class="full">

    <?php function _bit_header_inside(){ /* HEADER WITH LOGO + BANNER */

    global $wpdb,$PPT;

    return '<div class="w_960">

    <div class="f_half left" id="logo">

    <a href="'.$GLOBALS['bloginfo_url'].'/" title="'.get_bloginfo('name').'">

    <img src="'.$PPT->Logo(true).'" alt="'.get_bloginfo('name').'" />

    </a>

    </div>

    </div> <!-- end header w_960 -->';

    } ?>

    <?php echo premiumpress_header_inside(_bit_header_inside()); /* HOOK / FILTER */ ?>

    <div class="clearfix"></div>

    </div> <!-- end header -->

    <?php premiumpress_header_after(); /* HOOK */ ?>

    <?php premiumpress_menu_before(); /* HOOK */ ?>

    <?php function _bit_menu_inside(){ /* MENU BAR */

    global $wpdb,$PPT; $string='';

    $string .= '<div class="menu" id="menubar"> <div class="w_960">';

    if(has_nav_menu('PPT-CUSTOM-MENU-PAGES')){ $string .= wp_nav_menu( $GLOBALS['blog_custom_menu'] ); }else{

    $string .= '<ul>

    <li class="first"><a href="'.$GLOBALS['bloginfo_url'].'/" title="'.get_bloginfo('name').'">'.$PPT->_e(array('head','1')).'</a></li>
    '.premiumpress_pagelist().'
    </ul>';

    }

    $string .= '</div><!-- end menubar w_960 --> </div><!-- end menubar -->';

    return $string;

    }
    ?>

    <?php echo premiumpress_menu_inside(_bit_menu_inside()); /* HOOK / FILTER */ ?>

    <?php echo premiumpress_menu_after(); /* HOOK */ ?>

    <?php if(isset($GLOBALS['ppt_layout_styles']['submenubar']) && isset($GLOBALS['ppt_layout_styles']['submenubar']['hide']) && $GLOBALS['ppt_layout_styles']['submenubar']['hide'] == 1){ ?>

    <?php }else{ ?>

    <?php premiumpress_submenu_before(); /* HOOK */ ?>

    <div id="submenubar">

    <?php function _bit_submenu_inside(){ /*SUB MENU BAR */

    global $wpdb,$PPT, $userdata; get_currentuserinfo(); $string='';

    $string .= '<div class="w_960">';

    if(isset($GLOBALS['ppt_layout_styles']['submenubar']) && isset($GLOBALS['ppt_layout_styles']['submenubar']['search']) && $GLOBALS['ppt_layout_styles']['submenubar']['search'] == 1){

    $string .= '<div id="hpages"><ul>'.premiumpress_pagelist().'</ul></div>';

    }else{

    $string .= "<form method='get' action=<'".$GLOBALS['bloginfo_url']."/ <name='searchBox' id='searchBox'>
    <input type='text' value=".$PPT->_e(array('head','2'))." name='s' id='s' onfocus="this.value=";"'/>;

    if(isset($GLOBALS['ppt_layout_styles']['submenubar']) && isset($GLOBALS['ppt_layout_styles']['submenubar']['hidecat']) && $GLOBALS['ppt_layout_styles']['submenubar']['hidecat'] == 1){ }else{
    // BUILD CATEGORY DROP DOWN LIST
    $catdata = premiumpress_categorylist(0,'toponly');
    if(strlen($catdata) > 1){
    $string .= '<select id="catsearch" name="cat"><option value=""> </option>'.$catdata.'</select>';
    }
    }

    $string .= '<div class="searchBtn left" onclick="document.searchBox.submit();">  </div>';

    if(get_option("display_advanced_search") ==1){
    $string .= '<a href="javascript:jQuery(';
    $string .= "'#AdvancedSearchBox').show();";
    $string .= 'javascript:void(0);"';
    $string .="><small>".$PPT->_e(array('head','3'))."</small></a>";
    }
    $string .= '</form>';

    }

    $string .= '';

    $string .= '</div> <!-- end w_960 -->';

    return $string;

    } ?>

    <?php echo premiumpress_submenu_inside(_bit_submenu_inside()); /* HOOK / FILTER */ ?>

    </div><!-- end submenubar -->
    <div class="flashbanner"><img title="JAM Music" src="http://www.austinbandsearch.com/wp-content/themes/directorypress/template_directorypress/images/flashbanner.jpg" alt="JAM Music" width="960" height="238"/></div>

    <?php premiumpress_submenu_after(); /* HOOK */ ?>

    <?php } ?>
    `
    I dont know where is the error plz help me

  25. kmessinger
    Volunteer Moderator
    Posted 2 months ago #

    Look, read the forum welcome sticky. If you have a problem start your own post. If you have a theme you paid for contact them. There is no support here for themes you pay for . . .

Topic Closed

This topic has been closed to new replies.

About this Topic