1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parse error

Discussion in 'PHP' started by dakota5369, Jul 10, 2014.

  1. #1
    i built a site for a friend of mine and i get this stupid error in the right sidebar.....Parse Error: Syntax Error, Unexpected '<' In/Home/Content/59/9338559/Html/BBoxingNews/Wp-Content/Themes/Militone/Lib/Functions/Theme-Functions.Php(516) : Eval()'D Code(4) : Eval()'D Code On Line 1

    now, when i say i built it, i just used a template. i am an idiot at programming, so when i googled similar problems, it was all a foreign language to me.

    he uses godaddy as a host and i cant even figure out how to get to the cpanel through them. it says its hosted by them, but when you go there it says there is no host account.

    so is this something that can be fixed through the editor in the backend? and if so, what the heck do i do?

    this showed up after the site was up for over a month. i did nothing at all with the code, and neither did he. so i figure it was hacked or is some bug.

    please help if you can and also please talk to me like an idiot and not someone who is a seasoned pro at this. thanks
     
    dakota5369, Jul 10, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    If you have a template which uses eval() for anything, anything at all, get rid of it. It's an open door for potential hackers. However, since you say this has been working for quite a while, I would suggest that SOMETHING has been done. Either someone installed another plugin, or updated the plugins already present, or something else (or, of course, you might have been hacked).
    What does it say in the lines indicated, in the Theme-Functions.php-file? Copy at least 10-20 lines of code, before and after the error.
    The error itself sounds like a wrongly parsed html-tag in PHP-code (for instance, a file where PHP code is started and ended every few lines), or a wrongfully quoted echo-statement.
     
    PoPSiCLe, Jul 10, 2014 IP
    sarahk likes this.
  3. dakota5369

    dakota5369 Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    i did use a template, but i have no idea what eval is. and i was done with the site and had not been to it and the guy i did it for wouldnt even know how to find any code let alone do anything to it. i have disabled all plug ins and it remains, so i dont think its the plug ins.

    i have no idea to tell what lines are what. not sure if it means literally line one or what. anyway, here is the entire code for it:

    <?php
    ////////////////////////////////////////////////////////////////////////////////
    // Global Define
    ////////////////////////////////////////////////////////////////////////////////
    // do not change this, its for translation and options string
    define('TEMPLATE_DOMAIN', 'militone');
    define('TEMPLATE_OPTIONS', TEMPLATE_DOMAIN . '_theme_options');

    ////////////////////////////////////////////////////////////////////////////////
    // Set up the content width value based on the theme's design and stylesheet.
    ////////////////////////////////////////////////////////////////////////////////

    if ( ! isset( $content_width ) )
    $content_width = 700;

    ////////////////////////////////////////////////////////////////////////////////
    // Global Setup
    ////////////////////////////////////////////////////////////////////////////////
    function mptheme_setup() {
    //Add Language Support
    load_theme_textdomain( TEMPLATE_DOMAIN, get_template_directory() . '/languages' );
    add_editor_style();
    add_theme_support( 'automatic-feed-links' );
    add_theme_support( 'html5', array('search-form', 'comment-form', 'comment-list') );
    add_theme_support( 'menus' );
    register_nav_menus( array(
    'primary' => __( 'Primary Menu', TEMPLATE_DOMAIN ),
    'footer' => __( 'Footer Menu', TEMPLATE_DOMAIN ),
    ));
    //Default Fallback Menu
    function default_wp_menu($args) {
    $pages_args = array(
    'depth' => 0,
    'sort_column' => 'menu_order, post_title',
    'echo' => false,
    'show_home' => true
    );
    $menu = wp_page_menu( $pages_args );
    $menu = str_replace( array( '<div class="menu"><ul>', '</ul></div>' ), array( '<ul class="sf-menu">', '</ul>' ), $menu );
    echo $menu;
    }

    // Custom background
    add_theme_support( 'custom-background', array(
    'default-color' => '',
    'default-image' => '',
    'wp-head-callback' => '_custom_background_cb',
    'admin-head-callback' => '',
    'admin-preview-callback' => ''
    ));

    // Custom Header
    add_theme_support( 'custom-header', array(
    'default-image' => '',
    'random-default' => false,
    'width' => 1500,
    'height' => 200,
    'flex-height' => true,
    'flex-width' => true,
    'default-text-color' => '',
    'header-text' => false,
    'uploads' => true,
    'wp-head-callback' => '',
    'admin-head-callback' => '',
    'admin-preview-callback' => '',
    ));

    // Standard post thumbnails
    add_theme_support( 'post-thumbnails' );
    //set_post_thumbnail_size( 150, 150 );
    // Custom size post thumbnails
    add_theme_support( 'add_image_size' );
    add_image_size( 'post-home', 386, 200, true );
    add_image_size( 'featured-sidebar', 80, 80, true );
    add_image_size( 'featured-glider', 1500, 250, true );
    }
    add_action( 'after_setup_theme', 'mptheme_setup' );

    ////////////////////////////////////////////////////////////////////////////////
    // Load Theme Styles and Javascripts
    ///////////////////////////////////////////////////////////////////////////////
    /*---------------------------load styles--------------------------------------*/
    function mptheme_load_styles() {
    global $theme_version,$is_IE;
    wp_enqueue_style( 'superfish', get_template_directory_uri(). '/lib/scripts/superfish-menu/superfish.css', array(), $theme_version );
    wp_enqueue_style( 'normalize', get_template_directory_uri(). '/lib/scripts/normalize.css', array(), $theme_version );
    wp_enqueue_style( 'tabber', get_template_directory_uri() . '/lib/scripts/tabber/tabber.css', array(), $theme_version );
    if ( ( is_home() && is_front_page() && ($paged < 1) ) && get_theme_option('slider_on') == 'Enable' ) {
    wp_enqueue_style( 'jd-gallery', get_template_directory_uri(). '/lib/scripts/jd-gallery/jd.gallery.css', array(), $theme_version );
    }
    if ( ( is_home() && is_front_page() && ($paged < 1) ) && get_theme_option('glider_on') == 'Enable' ) {
    wp_enqueue_style( 'glider', get_template_directory_uri(). '/lib/scripts/featured-glider/glider.css', array(), $theme_version );
    }
    wp_enqueue_style( 'fontawesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css', array(), '4.0.3' );
    }
    add_action( 'wp_enqueue_scripts', 'mptheme_load_styles' );

    /*---------------------------load js scripts--------------------------------------*/

    function mptheme_load_scripts() {
    global $theme_version,$is_IE;
    wp_enqueue_script("jquery");
    wp_enqueue_script("hoverIntent");
    wp_enqueue_script( 'modernizr', get_template_directory_uri(). '/lib/scripts/modernizr.js', array(), '2.6.2', $theme_version, true );
    wp_enqueue_script( 'superfish', get_template_directory_uri(). '/lib/scripts/superfish-menu/superfish.js', array('jquery'), '1.7.4', $theme_version, true );
    wp_enqueue_script( 'tabber', get_template_directory_uri() . '/lib/scripts/tabber/tabber.js', array(), $theme_version, true );
    if ( ( is_home() && is_front_page() && ($paged < 1) ) && get_theme_option('slider_on') == 'Enable' ) {
    wp_enqueue_script('mootools', get_template_directory_uri(). '/lib/scripts/jd-gallery/mootools.js', array('jquery'), $theme_version, '1.11', true );
    wp_enqueue_script('jd-gallery2', get_template_directory_uri(). '/lib/scripts/jd-gallery/jd.gallery.js', array('jquery'), $theme_version, '2.0', true );
    }
    if ( ( is_home() && is_front_page() && ($paged < 1) ) && get_theme_option('glider_on') == 'Enable' ) {
    wp_enqueue_script('glider', get_template_directory_uri(). '/lib/scripts/featured-glider/glider.js', array('jquery'), $theme_version, true );
    }
    if($is_IE):
    wp_enqueue_script('html5shim', '//html5shiv.googlecode.com/svn/trunk/html5.js', array(), $theme_version, false );
    endif;
    wp_enqueue_script('custom', get_template_directory_uri(). '/lib/scripts/custom.js', array(), $theme_version, true );
    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    wp_enqueue_script( 'comment-reply' );
    }
    add_action( 'wp_enqueue_scripts', 'mptheme_load_scripts' );

    ///////////////////////////////////////////////////////////////////////////////
    // Load Theme Cusrom Style
    ///////////////////////////////////////////////////////////////////////////////

    function theme_custom_style_init() {
    global $theme_version,$is_IE,$is_chrome;
    if($is_IE): ?>
    <!--[if gte IE 9]><style type="text/css">.post-image img:hover,.post-home,#sidebar .widget-title, #sidebar .widgettitle{filter: none;}</style><![endif]-->
    <?php endif; ?>
    <script type="text/javascript">
    document.write('<style type="text/css">.tabber{display:none;}<\/style>');
    </script>
    <?php print '<style type="text/css" media="all">' . "\n"; ?>
    <?php get_template_part ( '/lib/options/options-css' ); ?>
    <?php if( get_theme_option('custom_css') ): ?><?php echo get_theme_option('custom_css'); ?><?php endif; ?>
    <?php print '</style>' . "\n"; ?>
    <?php }
    add_action('wp_head','theme_custom_style_init');

    ///////////////////////////////////////////////////////////////////////////////
    // Load Theme Default Fonts
    ///////////////////////////////////////////////////////////////////////////////
    /*---------------------------load google webfont style--------------------------------------*/
    function mp_theme_load_gwf_styles() {
    if( get_theme_option('body_font') == 'Choose a font' || get_theme_option('body_font') == '') {
    wp_register_style('default_body_gwf', 'http://fonts.googleapis.com/css?family=Fjalla+One|Source+Sans+Pro');
    wp_enqueue_style('default_body_gwf');
    }
    }
    add_action('wp_enqueue_scripts', 'mp_theme_load_gwf_styles');

    ////////////////////////////////////////////////////////////////////////////////
    // Add Theme Custom Functions
    ////////////////////////////////////////////////////////////////////////////////
    include( get_template_directory() . '/lib/functions/theme-functions.php' );
    include( get_template_directory() . '/lib/functions/widget-functions.php' );
    include( get_template_directory() . '/lib/functions/option-functions.php' );
    ?>
     
    dakota5369, Jul 11, 2014 IP
  4. Zbee

    Zbee Active Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    Is that code from /Home/Content/59/9338559/Html/BBoxingNews/Wp-Content/Themes/Militone/Lib/Functions/Theme-Functions.Php? Because there aren't 516 lines even in that file.

    Would including extra PHP extend the length of theme-functions.php, popsicle? If so, it'd be in one of the included files, not theme-functions.
     
    Zbee, Jul 11, 2014 IP
  5. dakota5369

    dakota5369 Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    i am sorry, as i said in the original post, i am not well versed in coding at all. so i have no idea what 99% of what you said means. what i pasted was the Theme-Functions.php-file that i copied and pasted from the editor which was what the previous poster said to post. in the back end i went to the dashboard, then editor then the Theme-Functions.php-file and that is what is there. that is all that is there
     
    dakota5369, Jul 11, 2014 IP
  6. Zbee

    Zbee Active Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #6
    Well, the error message says there's an issue on line 516 of the file you copied, but that file only has 160-ish lines, so it must be in one of the files that are included at the bottom:
    /lib/functions/theme-functions.php <-- Possibly this one (it'd have to be at least 350 lines long)
    /lib/functions/widget-functions.php
    /lib/functions/option-functions.php

    Could you put the contents of those files somewhere (like, pastebin.com -- if you put it on pastebin.com you may consider telling to to make the text expire after a few days for security, I guess) and link it to us? Maybe we can see the problem.
    The files should be in /Home/Content/59/9338559/Html/BBoxingNews/Wp-Content/Themes/Militone/Lib/functions/
     
    Zbee, Jul 11, 2014 IP
  7. dakota5369

    dakota5369 Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #7
    if the location for those is in the cpanel, i have no idea how to get there. i have never used godaddy and tried for hours to find it. i can only find stuff through the back end
     
    dakota5369, Jul 11, 2014 IP
  8. Zbee

    Zbee Active Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    Should be in the same place as your found the other file.
     
    Zbee, Jul 11, 2014 IP
  9. dakota5369

    dakota5369 Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #9
    now i am completely lost. at the bottom of what? if i showed you everything in there, how could it be in the same place? i dont see anything anywhere that looks like what you asked me to post. i looked through the entire style.css too and didnt see anything
     
    dakota5369, Jul 12, 2014 IP
  10. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #10
    In the code you pasted, there are three files included:
    
    include( get_template_directory() . '/lib/functions/theme-functions.php' );
    include( get_template_directory() . '/lib/functions/widget-functions.php' );
    include( get_template_directory() . '/lib/functions/option-functions.php' );
    
    Code (markup):
    He asked you to paste the content of the top one, if the top one is more than 350ish lines long. If not, paste them all, perhaps.
    They're found where the path is indicated in the includ - ie. /lib/functions/theme-functions.php and so forth.

    But, given that you have this big a problem understanding this, I'd suggest you hire someone who can fix this for you - it probably won't be too expensive, and should be done quite quickly - an hour or so at the most.
     
    PoPSiCLe, Jul 12, 2014 IP
  11. Zbee

    Zbee Active Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #11
    Ah yes, thank you PoPSiCLe.

    Yeah, if this is over your head, dakota, then I can at least look for you, so you don't have to find the files.
     
    Zbee, Jul 12, 2014 IP