|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
am having this error in the SERVER and not in not my LOCAL
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$' in /home/vozemg0/public_html/vozenow/admin/smarty/Smarty_Compiler.class.php on line 1632 any idea??????????????? |
|
#2
|
|||
|
|||
|
post some of the code around line 1632 in that file if you need help....
__________________
Sir, a desire of knowledge is the natural feeling of mankind; and every human being, whose mind is not debauched, will be willing to give all that he has to get knowledge. |
|
#3
|
|||
|
|||
|
I'm having the exact same problem HELP!
I too have this error:
Parse error: syntax error, unexpected $end ONLY on my live server NOT on my local machine or another server I tried. Both are using PHP and MySQL 5. I've been debugging it for hours and nothing. I have no missing braces of anything that I can find. Here's a link to the code (my part anyway, not the wordpress stuff, though I figure if wordpress had a problem, someone would have found it by now. Besides, this only happens when I activate my personal theme. the code is at pastebinDOTcom/m2703ffd1 This is driving me nuts. What do I do!?!? |
|
#4
|
|||
|
|||
|
Can you post your code her and tell me what line you are getting it on (from your error log)?
|
|
#5
|
||||
|
||||
|
If you receive an error on your live server, and not your test server, or vice versa...it's most likely because the two are using different error notification settings.
In any case, you can't diagnose this error without seeing relevant code. It's generally a typo or a missing closing bracket/semicolon.
__________________
Scripting problems? Windows questions? Ask the Windows Guru! Stay up to date with all of my latest content. Follow me on Twitter! Help us help you! Post your exact error message with these easy tips! |
|
#6
|
|||
|
|||
|
It says the error is on line 2 which is empty. I've messed with this file forever and nothing. I can only conclude it's in a file that loads BEFORE this one..
Code:
1.
<?php
2.
3.
function jd_permalink_from_postname($postname)
4.
{
5.
global $wpdb;
6.
7.
$post_id = jd_id_from_postname($postname);
8.
return get_permalink($post_id);
9.
}
10.
11.
function jd_id_from_postname($postname)
12.
{
13.
global $wpdb;
14.
15.
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name='$postname'");
16.
return $post_id;
17.
}
18.
19.
function jd_count_posts($an_ID)
20.
{
21.
global $wpdb;
22.
23.
$total_count = 0;
24.
$post_results = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent='$an_ID' ORDER BY post_date");
25.
foreach ($post_results as $therow)
26.
{
27.
// Apparently, attachments are also posts so an uploaded image was counting as a sub-page and messing this up so had to check that it's a page type
28.
$is_sub = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent='$therow->ID' AND post_type='page'");
29.
if ($is_sub)
30.
$total_count += jd_count_posts($therow->ID); // Add all the pages that are recursivly in this subcategory
31.
else
32.
$total_count++; // Here'a page
33.
}
34.
return (int) $total_count;
35.
}
36.
37.
// Returns an array of random numbers where the numbers are less than or equal to max, and don't repeat
38.
// Returns up to num_nums amount of numbers
39.
function jd_rand_array($max, $num_nums=2)
40.
{
41.
if ($num_nums > $max)
42.
$num_nums = $max;
43.
$to_return = array(); // Returns the set of numbers in an array
44.
$return_count = 0; // The return array must be sequential
45.
$used = "-"; // Tracks the numbers that have been used so there's no repeats. Leading - to prevent the strpos = 0 problem
46.
do {
47.
$test_num = rand()%$max;
48.
if (!strpos($used,"-$test_num-")) // there is no -randnum- substring in used, so it's not used
49.
{
50.
$to_return[$return_count] = $test_num; // Add the number to the return array
51.
$return_count++; // One more number
52.
$used .= "-$test_num-"; // Now it's used
53.
}
54.
} while ($return_count < $num_nums);
55.
return $to_return;
56.
}
57.
58.
function jt_last_comic()
59.
{
60.
global $wpdb;
61.
62.
$comic_parent = jd_id_from_postname("comics");
63.
// On the query, have to check type equal a page or else it will pick up revisions, drafts, etc
64.
$last = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_parent='$comic_parent' AND post_type='page'");
65.
return "comic".sprintf("%03d",$last);
66.
}
67.
68.
69.
/* Create widget compatible sidebars */
70.
if (function_exists("register_sidebar") )
71.
{
72.
register_sidebar(array('name'=>'Left',
73.
'before_widget' => '<table cellpadding=0 cellspacing=0 class="left_menu"><tr><td><img src="'.get_bloginfo('template_url').'/images/left_menu_top_left.gif"/></td><td class="menu_top" colspan=2></td><td><img src="'.get_bloginfo('template_url').'/images/menu_top_right.gif"/></td></tr><tr><td class="left_menu_left"></td><td class="menu_middle" colspan=2 valign="top">',
74.
'after_widget' => '</td><td class="menu_right"></td></tr><tr><td><img src="'.get_bloginfo('template_url').'/images/left_menu_bottom_left.gif"/></td><td class="left_menu_bottom_shadow"></td><td class="left_menu_bottom_noshadow"></td></td><td><img src="'.get_bloginfo('template_url').'/images/left_menu_bottom_right.gif"/></td></tr></table>',
75.
'before_title' => '<div class="left_menu_title">',
76.
'after_title' => '</div>',
77.
));
78.
79.
register_sidebar(array('name'=>'Right',
80.
'before_widget' => '<table cellpadding=0 cellspacing=0 class=right_menu><tr><td><img src="'.get_bloginfo('template_url').'/images/right_menu_top_left.gif"/></td><td class=menu_top colspan=2></td><td><img src="'.get_bloginfo('template_url').'/images/menu_top_right.gif"/></td></tr><tr><td class=right_menu_left></td><td class=menu_middle colspan=2 valign="top">',
81.
'after_widget' => '</td><td class=menu_right></td></tr><tr><td><img src="'.get_bloginfo('template_url').'/images/right_menu_bottom_left.gif"/></td><td class=right_menu_bottom_noshadow></td><td class=right_menu_bottom_shadow></td><td><img src="'.get_bloginfo('template_url').'/images/right_menu_bottom_right.gif"/></td></tr></table>',
82.
'before_title' => '<div class="right_menu_title">',
83.
'after_title' => '</div>',
84.
));
85.
}
86.
87.
?>
Here's the header file. There are some wordpress files that load before this, but like I said before, they shouldn't be the problem since it's only when my template loads that there's trouble: Code:
#
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
#
<!--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(); ?>>
#
#
<head profile="http://gmpg.org/xfn/11">
#
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
#
#
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
#
#
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
#
#
<style type="text/css" media="screen">
#
@import url( <?php bloginfo('stylesheet_url'); ?> );
#
</style>
#
#
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
#
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
#
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
#
#
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
#
<?php wp_get_archives('type=monthly&format=link'); ?>
#
<?php //comments_popup_script(); // off by default ?>
#
<?php wp_head(); ?>
#
</head>
#
#
<body>
#
#
<?php
#
srand ((double) microtime() * 1000000);
#
$t_index = rand(1,8); // 1 to 4 inclusive
#
?>
#
<!-- The pop-up box; must be declared before including the js functions -->
#
<div id="jsInfo"></div>
#
#
<script src="<?php bloginfo('template_url') ?>/positioning.js"></script>
#
<script src="<?php bloginfo('template_url') ?>/functions.js"></script>
#
#
<!-- Now for layout stuff -->
#
<style>
#
<?php
#
if ($GLOBALS["comic_mod"])
#
{
#
echo "#inner_content { margin-left:0; margin-right:0; width : 840px }";
#
echo "#page_top_img, #page_bottom_img { margin-left: 196px;}";
#
$page_bk_left_margin = "196px";
#
}
#
else
#
$page_bk_left_margin = "150px";
#
?>
#
</style>
#
#
<!-- for the sidebars and content. Keep them in place -->
#
<table id=page_spacer cellpadding=0 cellspacing=0 style="background-position: <?php echo $page_bk_left_margin?>;">
#
<tr><td colspan="3" id="page_top_spacer" onclick="document.getElementById('login').style.display='bl ock'" valign=left>
#
<a href="<?php bloginfo('url') ?>"/><img src='<?php bloginfo('template_url') ?>/images/jt_top.png' id=page_top_img /></td>
#
</tr>
#
<tr><td colspan="3" id="login">
#
<?php wp_loginout(); ?>
#
<?php wp_register(); ?>
#
<?php wp_meta(); ?>
#
</td></tr>
#
#
<tr>
#
#
<td id="left_column" valign="top" align="right" >
#
<!-- Browsers are stupid. Have to force them to keep the right width with images -->
#
<img src="<?php bloginfo('template_url') ?>/images/clear.gif" class="sidebar_spacer_img" />
#
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Left')) : ?>
#
Something's wrong with the sidebars. Call ADMIN!!!!
#
<?php endif; ?>
#
</td>
#
#
<td id="content" valign=top >
#
<div id="inner_content">
#
<!-- end header -->
By the way, I turned on all error reporting on my local machine and it didn't make any difference. This is the kind of thing that drives me nuts. If you fix this for me, I will be forever grateful Last edited by Iamgregor : March 21st, 2009 at 08:09 AM. Reason: forgot something |
|
#7
|
||||
|
||||
|
This usually indicates a missing opening or closing curly brace or a missing line-ending semi-colon.
I'm not seeing that in anything that you have here. Double check that your files are being saved as ANSI. It can cause weird issues if they're not. |
|
#8
|
|||
|
|||
|
Can you copy and paste the exact error you are getting?
The original post said it was line 1632... what changed? Last edited by jamestrowbridge : March 21st, 2009 at 04:26 PM. |
|
#9
|
|||
|
|||
|
Quote:
I'm not the original poster. In my case, the error always shows up in the functions.php file, line 2. Which of course is impossible since there's nothing there, a <?php tag above it and a function declaration below. In theory that means the error must be in the header or something. |
|
#10
|
|||
|
|||
|
Quote:
How do I do that in windows? I'm just saving them standard text PHP files. Note that I have more than 7 separate wordpress installations running many varied kinds of sites. None of them have this problem. |
|
#11
|
|||
|
|||
|
I spent the last several hours reinstalling PHP mysql and apache from scratch using the most recent versions available. Still no error locally, only live.
Last edited by Iamgregor : March 21st, 2009 at 04:51 PM. Reason: oops |
|
#12
|
|||
|
|||
|
If there is stuff above the part you posted, you should post that too.
|
|
#13
|
|||
|
|||
|
Quote:
The problem is FIXED. I did some very careful testing and found out that it really WAS the functions.php file (even though I knew it couldn't be). I copied the text from the file and pasted it to a new blank text file. Then I erased the original, renamed the new file to the old file's name, and uploaded it. Tada! This was one of the most annoying errors I've dealt with, but hopefully this experience will help someone else. |
|
#14
|
||||
|
||||
|
Quote:
Glad you got that working. |
|
#15
|
|||
|
|||
|
Quote:
Yes, sorry for not attributing. I saw your suggestion, but couldn't try it directly since "ascii" is not an option for saving the files in Windows that I can see. If there's an easier way, please let me know so I don't have to copy to new files again. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$' |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|