Current location: Hot Scripts Forums » Programming Languages » PHP » Help! Parse error: syntax error, unexpected T_STRING


Help! Parse error: syntax error, unexpected T_STRING

Reply
  #1 (permalink)  
Old 02-10-10, 08:15 AM
Dealideal Dealideal is offline
New Member
 
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Help! Parse error: syntax error, unexpected T_STRING

Hello, and ughhhhh... here's the error:

Code:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ***** on line 330
I'm guessing - something is messed up with the nested single/double quotes.

Here's the function:

Code:

function some_function ($count=10, $exclude='user1,user2', $before='<li>', $nourl='www.boo.com', $after='</li>', $before_count='(', $after_count=')') {
global $wpdb, $posts;

    $posts=$wpdb->get_results("SELECT u.*, p.*
                                           , COUNT(*)AS CRNT
                                      FROM $wpdb->posts p LEFT JOIN $wpdb->users u
                                      ON u.ID = p.post_author
                                      WHERE p.post_status = 'publish'
                                      GROUP BY post_author
                                      ORDER BY CRNT DESC");
    $excludes=explode(',', $exclude);
    $style1='margin-bottom:10px';
    $style='width:200px; height:80px; clear:both; border-width:3px 3px 0 3px; border-color:#41525D; border-style: solid';
    $style2='float:right; width:70%; text-align:right; font-size:9px;color:#fff;';
    $style3='width:30%; float:left; font-size:9px; color:#fff;';
    $style4='width:190px; background:#41525D; height:15px; padding:5px; border:3px solid #41525D;';
    $authlink='http://www.skineart.com/art/author/';
    $infolink='http://www.skineart.com/topcontributors';
    $contributors='http://www.skineart.com/contributors';
    $blank='_blank';
    $follow='follow';
 	   
    foreach($posts as $post) {

    if (!in_array($post->display_name, $excludes)) {
    if (check_not_null($post->user_url) && $post->user_url != 'http://' && check_not_null($post->user_avatar)){
		$urle=$post->user_url; 
		echo "<a href='" .$urle. "' rel='".$follow."' target='".$blank."' title='" .$urle. "'><img src='" .$post->user_avatar. "' alt='" .$urle. "' /></a><a href='".$authlink.$post->user_nicename."'>$post->CRNT [+]</a>$post->display_name.$after;
		} else {
		$urle=$authlink.$post->post_author;
		echo "<div style='".$style1."'><div style='".$style4."'><div style='".$style3."'><a href='".$authlink.$post->user_nicename."'>$post->CRNT [+]</a></div><div style='".$style2."'>$post->display_name</div></div></div>".$after;
		} 			     
		if (++$ccount == $count) break;
           
       } 
    }
    echo "<a href='" .$infolink. "'>What's this?</a>";
    echo "<br/><br/>";
    echo "<a href='" .$contributors. "'>View full list of contributors</a>";
}
... and here's the line causing the error:

Code:
		echo "<div style='".$style1."'><div style='".$style4."'><div style='".$style3."'><a href='".$authlink.$post->user_nicename."'>$post->CRNT [+]</a></div><div style='".$style2."'>$post->display_name</div></div></div>".$after;
Please help!
Reply With Quote
  #2 (permalink)  
Old 02-10-10, 08:46 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Your error is in this line:
PHP Code:

echo "<a href='" .$urle"' rel='".$follow."' target='".$blank."' title='" .$urle"'><img src='" .$post->user_avatar"' alt='" .$urle"' /></a><a href='".$authlink.$post->user_nicename."'>$post->CRNT [+]</a>$post->display_name.$after
Should be:
PHP Code:

echo "<a href='" .$urle"' rel='".$follow."' target='".$blank."' title='" .$urle"'><img src='" .$post->user_avatar"' alt='" .$urle"' /></a><a href='".$authlink.$post->user_nicename."'>".$post->CRNT." [+]</a>".$post->display_name.$after
Or:
PHP Code:

echo "<a href='$urle' rel='$follow' target='$blank' title='$urle'><img src='".$post->user_avatar."' alt='$urle' /></a><a href='".$authlink.$post->user_nicename."'>".$post->CRNT." [+]</a>".$post->display_name.$after
__________________
Jerry Broughton

Last edited by job0107; 02-10-10 at 08:52 AM.
Reply With Quote
  #3 (permalink)  
Old 02-10-10, 09:21 AM
Dealideal Dealideal is offline
New Member
 
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Ah, Jerry, you're a lifesaver!
Thank you!!!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRIN aprogrammer PHP 20 08-31-11 05:56 AM
Parse error: parse error, unexpected '\"' unlisted80 PHP 5 07-19-06 01:35 AM
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' Dr. Forensics PHP 3 07-15-06 03:54 PM
Parse error: parse error, unexpected $ in... keefermedia PHP 4 04-23-06 11:21 AM
Parse error: parse error, unexpected T_VARIABLE aussietogo PHP 4 08-16-05 08:14 PM


All times are GMT -5. The time now is 08:10 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.