Jump to content

Search the Community

Showing results for tags 'unexpected t_variable'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hey, I just started using WordPress - I'm a complete newbie, and am super perplexed by this error I'm getting in functions.php. I'm hoping I am just making a simple mistake, but I'd really appreciate some suggestions as to what the issue is. The error: Parse error: syntax error, unexpected T_VARIABLE in /homepages/33/d123623052/htdocs/rap3/wp-content/themes/business-turnkey/functions.php on line 196 That line would be at the very bottom of my code. From what I can tell, this error occurs when the code is missing a punctuation mark like a [ ( { , ' etc. I've been looking over the code for ages, and from what I can see all the brackets have a matching end, there's no out of place punctuation. <?php define('THEME_URI', get_stylesheet_directory_uri()); define('THEME_IMAGES', THEME_URI . '/assets/img'); define('THEME_CSS', THEME_URI . '/assets/css'); define('THEME_JS', THEME_URI . '/assets/js'); define('THEME_TEMPLATES', THEME_URI . '/assets/templates'); $GLOBALS['content_width'] = 900; /* Define Theme Defaults */ $options = get_option('turnkey_theme_options'); if($options['templatestyle'] == null) $options['templatestyle'] = 'modern'; if($options['typography'] == null) $options['typography'] = 'typography1'; function turnkeySlider() { $options = get_option('turnkey_theme_options'); if($options['sliderTimer'] != null) $rotateTimer = $options['sliderTimer']; else $rotateTimer = 5000; ?> <script type="text/javascript" charset="utf-8"> jQuery(document).ready(function($) { $('.slide-container').cycle({ fx: 'scrollHorz',next: '#slide-nav .next',prev: '#slide-nav .prev',pause: 1, timeout:<?php echo $rotateTimer; ?>}); }); </script> <?php } add_action('wp_head', 'turnkeySlider'); require_once ( get_stylesheet_directory() . '/theme-options.php' ); require_once ( 'slider/turnkey-slider.php' ); if (function_exists('register_sidebar')) { register_sidebar(array( 'name'=> 'Homepage Widgets', 'id' => 'homepage_widgets', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); register_sidebar(array( 'name'=> 'Sidebar 1', 'id' => 'sidebar_1', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' )); register_sidebar(array( 'name'=> 'Sidebar 2', 'id' => 'sidebar_2', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' )); register_sidebar(array( 'name'=> 'Footer Widgets', 'id' => 'footer-widgets', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); } if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'turnkey_mainnav' => 'TurnKey Main Navigation', 'turnkey_secondary' => 'TurnKey Secondary Navigation' ) ); }; add_theme_support( 'post-thumbnails' ); // Makes Sure thumbnails show up in RSS function do_post_thumbnail_feeds($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'do_post_thumbnail_feeds'); add_filter('the_content_feed', 'do_post_thumbnail_feeds'); // Define Thumbnail Images Sizes if ( function_exists( 'add_image_size' ) ) { add_image_size( 'post-thumb-threecol', 390, 200, true ); add_image_size( 'post-thumb-onetwocol', 520, 200, true ); /* Slide Image */ add_image_size( 'special', 580, 340, true ); } if ( !is_admin() ) { // instruction to only load if it is not the admin area function googlejquery() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); } add_action('init', 'googlejquery'); wp_register_script('functions', get_bloginfo('template_directory') . '/assets/js/functions.js'); wp_register_script('cycle', get_bloginfo('template_directory') . '/assets/js/cycle.min.js'); wp_register_script('lightbox', get_bloginfo('template_directory') . '/assets/js/lightbox_me.js'); // enqueue the script wp_enqueue_script('jquery'); wp_enqueue_script('functions'); wp_enqueue_script('cycle'); wp_enqueue_script('lightbox'); }; function the_breadcrumb() { if (!is_home()) { echo '<a href="'; echo get_option('home'); echo '">'; bloginfo('name'); echo "</a> » "; if (is_category() || is_single()) { the_category('title_li='); if (is_single()) { echo " » "; the_title(); } } elseif (is_page()) { echo " <span class='current'> "; echo the_title(); echo " </span> "; } } } function rap_register_sidebars() { register_sidebar(array( 'name' => 'Scheduling campaign sidebar', 'id' => 'rap-scheduling-sidebar', 'description' => 'Sidebar for Scheduling Campaign template pages only.', 'before_widget' => '<div class="widget">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>' )); } // Add Automatic Feed Links add_theme_support('automatic-feed-links'); add_filter('widget_text', 'do_shortcode'); add_action('widgets_init', 'rap_register_sidebars'); // Below added by Jessica 6/24/13 to display Salesforce lookup fields on Gravity Forms field mapping page add_filter('gf_salesforce_skip_reference_types', '__return_false'); // Below added by Jessica to change the field value on the Join Us and Training forms add_action("gform_pre_submission_1", "pre_submission_JoinUs"); add_action("gform_pre_submission_8", "pre_submission_Training"); add_action("gform_pre_submission_15", "pre_submission_HCAP"); function pre_submission_JoinUs($form){ if ($_POST["input_15"] == 'Former Retail Worker') $_POST["input_15"] = 'Retail Worker'; } function pre_submission_Training($form){ if ($_POST["input_18"] == 'Former Retail Worker') $_POST["input_18"] = 'Retail Worker'; } function pre_submission_HCAP($form){ if ($_POST["input_15"] == 'Former Retail Worker') $_POST["input_15"] = 'Retail Worker'; } ?>
  2. Even though I literally copied and pasted the code below directly from the php.net manual on gd and image functions, I'm getting a syntax error message "unexpected t_variable" when I try to run the code. The culprit, according to the error message, is line 6 here: $gd = imagecreatetruecolor($x, $y); But there are NOT any missing semicolons or brackets in that line or before it. So why won't this code run for me? Here's the entire code: <?php $x = 200; $y = 200; $gd = imagecreatetruecolor($x, $y); $corners[0] = array('x' => 100, 'y' => 10); $corners[1] = array('x' => 0, 'y' => 190); $corners[2] = array('x' => 200, 'y' => 190); $red = imagecolorallocate($gd, 255, 0, 0); for ($i = 0; $i < 100000; $i++) { imagesetpixel($gd, round($x),round($y), $red); $a = rand(0, 2); $x = ($x + $corners[$a]['x']) / 2; $y = ($y + $corners[$a]['y']) / 2; } header('Content-Type: image/png'); imagepng($gd); ?> Here is a link to that page (scroll down a tiny bit) if it helps: http://www.php.net/manual/en/function.imagesetpixel.php BTW, my server is gd enabled. Maybe that version is too new? Somewhere in the back of my mind I remember that a newer version might exclude some functionality? I don't know...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.