Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Parse Error

parse error

4:43 pm on Jun 28, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 16, 2009
posts: 23
votes: 0

Hi all,
Please can someone help me out.... NAytime I want to use this file it keep s saying:
Parse error: syntax error, unexpected $end in D:\wamp\www\politics\templates\jxtc_political\js\modWidths.php on line 108

Here is the content of modWidths.php

<script language="javascript" type="text/javascript">
jQuery(document).ready(function() {
jQuery = jQuery.noConflict();

// ModTitle Fixes
var modTitleWrapWidth = jQuery('#userOne .module .tick').width();
jQuery('#userOne .module .tick .modtitlewrap').width(modTitleWrapWidth).css("margin", "0px auto");

var leftmodTitleWrapWidth = jQuery('#left .module .tick, #left .module .default').width();
jQuery('#left .module .tick .modtitlewrap, #left .module .default .modtitlewrap').width(leftmodTitleWrapWidth).css("margin", "0px auto");

var rightmodTitleWrapWidth = jQuery('#right .module .tick, #right .module .default').width();
jQuery('#right .module .tick .modtitlewrap, #right .module .default .modtitlewrap').width(rightmodTitleWrapWidth).css("margin", "0px auto");

jQuery('#maincontent div.usermodwrap:last-child, #bottomMods div.usermodwrap:last-child').css({padding:"0px"});

// User4 , User5, User6
/* var userFouruserFiveuserSixWidth = jQuery('#userFouruserFiveuserSix').width()/<?php echo $user4_user5_user6_count?>-60;
jQuery('#userFouruserFiveuserSix div.usermodwrap .usermod').width(userFouruserFiveuserSixWidth); */

<?php if($user4_user5_user6_count == 3) : ?>
jQuery('#userFouruserFiveuserSix div.usermodwrap:nth-child(0)').each(function(){
jQuery(this).css("width", "337px");

<?php if($user4_user5_user6_count == 2) : ?>
jQuery('#userFouruserFiveuserSix div.usermodwrap:nth-child(0)').each(function(){
jQuery(this).css("width", "60%");
jQuery('#userFouruserFiveuserSix div.usermodwrap:nth-child(1)').each(function(){
jQuery(this).css("width", "40%");

<?php if($user4_user5_user6_count == 1) : ?>
jQuery('#userFouruserFiveuserSix div.usermodwrap:nth-child(0)').each(function(){
jQuery(this).css("width", "100%");

jQuery('#userFouruserFiveuserSix div.usermodwrap:last').addClass("last");
jQuery('#userFouruserFiveuserSix div.usermodwrap').eq(1).addClass("second");

// bottomMods
var bottomModsWidth = jQuery('#bottomMods').width()/<?php echo $bottomMods_count?>-7.5;
jQuery('#bottomMods div.usermodwrap .usermod').width(bottomModsWidth);

jQuery('#bottomMods div.usermodwrap:nth-child(2)').css("float", "right");

jQuery('.module .centerH3').each(function() {
var centerH3Width = jQuery(this).children().children().width() + 21;
jQuery(this).width(centerH3Width).css("margin", "0px auto 12px auto");
jQuery(this).children().children().css("float", "none");
jQuery(this).children().css("float", "none");

jQuery('.module .tick .leftArrow, .module .default .leftArrow').each(function() {
var leftArrowWidth = jQuery(this).width();
var leftWrapWidth = jQuery(this).parent().parent().width() / - leftArrowWidth;
jQuery(this).css({'margin' : '0px 0px 0px ' + leftWrapWidth + 'px'});


jQuery(window).load(function() {
jQuery = jQuery.noConflict();

// Right Column Height
var contentHeight = jQuery('#content').height();
var rightColumnHeight = jQuery('#rightcolumn').height();
if(rightColumnHeight > contentHeight) {
contentHeight = rightColumnHeight;
else {

if(jQuery.browser.msie && parseInt(jQuery.browser.version) <= 7) {
var docHeight2 = jQuery("body").height();
else {
var docHeight2 = jQuery(document).height();

jQuery('#footerBG').css("top", docHeight2 + "px").css("position", "absolute");



Thanks for response!
5:42 pm on June 28, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 4, 2009
posts: 186
votes: 0

I *THINK* this might be causing a problem?

<?php echo $bottomMods_count?>

should be:

<?php echo $bottomMods_count; ?>

with the ; in it...also on those else if's I would change the them from:



some servers choke if you leave off the php directive...let us know if that works.
8:06 pm on June 28, 2010 (gmt 0)

New User

5+ Year Member

joined:June 28, 2010
votes: 0

Yes i agree with the above point and please don't use OPENING <? for PHP since they are the old way of representing php and outdated....pls use <?php ?>
8:22 pm on June 28, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Feb 22, 2009
votes: 0

Hi all,

since they are the old way of representing php and outdated

Not strictly true, this is something set in the php.ini file, and lots of servers out there are still using PHP4 and early PHP5, so although it is a good thing for script portability (should you decide to migrate servers) there are still many servers out there that may have the "short asp style" stags enabled in the php.ini file.

But definitely from a 'good coding practise' point of view, it is best to use the full tag, you will avoid headaches in the future ;)

Also when developing a script, turn on the full error reporting to see more detail of errors as they come up, generally put the directive under the opening php tag on the file/system you are working on:-

error_reporting(E_ALL|E_STRICT);// the |STRICT is optional, but this is what I always use

And yes, I think we all agree on the missing ; causing the parsing error!

9:18 am on June 29, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 16, 2009
votes: 0

Thank You very much... It worked especially the <?php tag stuff