PHP Error | Parse syntax error, unexpected T_OBJECT_OPERATOR
Posted: Fri Apr 18, 2008 11:36 am
I'm getting this error:
I'm using:
2.2.8 (Unix) Apache;
5.2.5 PHP
5.0.45 MySQL
Following are the files associated:
index.php
Code: Select all
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/b*****n/public_html/video/templates/default/index.php on line 502.2.8 (Unix) Apache;
5.2.5 PHP
5.0.45 MySQL
Following are the files associated:
index.php
Code: Select all
<?php
require_once 'admin/sort.php';
function randtag($str){
$font_size = rand(1,5);
$color_array = array('black', 'blue', 'green', 'white');
shuffle($color_array);
$font_color = $color_array[0];
$link = ' <a href="index.php?tag='.$str.'" style="text-decoration:none"><font size="'.$font_size.'" color="'.$font_color.'">'.$str.',</font></a> ';
return $link;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title><? if(isset($_GET['tag'])){ echo ucwords($_GET['tag']).' Videos - '.$sqlinfo['site_slogan']; } else { echo $sqlinfo['site_slogan']; }?></title>
<meta name="keywords" content="<? if(isset($_GET['tag'])){ echo $_GET['tag'].', '; }?><?=$sqlinfo['site_keywords']?>">
<meta name="description" content="<?=$sqlinfo['site_description']?>">
<style type="text/css">@import url(<?='templates/'.$sqlinfo['template']?>/newstyle.php);</style>
<link rel="shortcut icon" href="images/favicon.ico">
</head>
<body>
<form name="search" action="index.php" method="get">
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="509"><div class="logo"></div></td>
<td width="391" align="right"><input name="tag" type="text" id="tag" style="font-family:Verdana; font-size:18px; border:2px solid #ed891a;" onfocus="if(this.value=='Search...')this.value=''" value="Search..." />
<input type="submit" value="Search!" style="font-family:Verdana; font-size:18px; background-color:#ed891a; border:2px solid #ed891a; color:#FFFFFF;"></td>
</tr>
<tr>
<td colspan="2" style="padding-top:10px;"><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="topnav_left"></td>
<td class="topnav_bg"><a href="<?=$sqlinfo['site_url']?>">Home</a> <a href="index.php?tag=<?php echo $sqlinfo['link1']?>"><?php echo $sqlinfo['link1']?></a> <a href="index.php?tag=<?php echo $sqlinfo['link2']?>"><?php echo $sqlinfo['link2']?></a> <a href="index.php?tag=<?php echo $sqlinfo['link3']?>"><?php echo $sqlinfo['link3']?></a> <a href="index.php?tag=<?php echo $sqlinfo['link4']?>"><?php echo $sqlinfo['link4']?></a></td>
<td class="topnav_right"></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" style="padding-top:10px;"><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="520" valign="top">
<table width="520" border="0" cellspacing="0" cellpadding="0">
<?
foreach ($feed as $entry) {
$videoId = $entry->getVideoId();
$thumbnailUrl = $entry->medx-MoBiLeroup->thumbnail[0]->url;
$videoTitle = $entry->medx-MoBiLeroup->title;
$viewCount = $entry->statistics->viewCount;
$authorUsername = $entry->author[0]->name;
$videoDescription = $entry->medx-MoBiLeroup->description;
$videoRating = $entry->rating->average;
$duration = $entry->medx-MoBiLeroup->duration->seconds;
$videoTitle2 = substr($videoTitle, 0, 40);
$newtitle = ucwords(str_replace($string, $replace, $videoTitle));
//$desc = htmlspecialchars(wordwrap(substr($videoDescription, 0, 100) . '...', 30, ' ', 1));
//Check title
$check_title = substr($videoId, 0, 1);
if($check_title == '_'){ $url = 'show_video.php?video_id='.$videoId; } else { $url = $newtitle.'__'.$videoId.'.html'; }
?>
<tr>
<td class="list_left"></td>
<td width="130" valign="top" class="list_bg"><a href="<?=$url?>"><img src="<?=$thumbnailUrl?>" style="border:3px solid #216b88;" width="121" height="86" ></a></td>
<td width="372" valign="top" class="list_bg" style="padding-left:10px;">
<a href="<?=$url?>"><b><?=$videoTitle2?></b></a>
<br /><br />
<div title="<?=$videoRating?>" style="background:url(templates/<?=$sqlinfo['template']?>/images/stars.gif); width:<?=$videoRating*20?>px; height:20px;"></div>
<br />
<div style="font-size:11px;"><b>Views:</b> <?=number_format($viewCount)?> | <b>Username:</b> <?=$authorUsername?></div>
</td>
<td class="list_right"></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<? } ?>
<tr>
<td colspan="4" align="center" valign="bottom"><span class="table_content">
<?
$pages = ceil(990/$sqlinfo['videos_per_page']);
if(isset($_GET['page']) and $_GET['page'] != 1){ $pageless = $_GET['page']-1; $pagemore = $_GET['page']+1; } else { $pageless = 1; $pagemore = 2; }
//Set Pages
echo '<br /><br />';
if($pages>7) {
if($currentpage>4) {
echo ' <a href="index.php?page=1&tag='.$tag.'" style="color:#ed8621"><<</a> ';
}
}
echo ' <a href="index.php?page='.$pageless.'&tag='.$tag.'" style="padding-right:20px; color:#ed8621"><</a> ';
$startpage = $currentpage-3<1?1:$currentpage-3;
$endpage = $startpage+6>$pages?$pages:$startpage+6;
for($i=0;$i<$pages;$i++) {
if($i+1>=$startpage && $i+1<=$endpage) {
if($i+1==$currentpage) {
$current = 1;
}else{
$current = 0;
}
$next = $i+1;
if($current == 1){ echo '<b>'.$next.'</b>'; }
else { echo ' <a href="index.php?tag='.$tag.'&page='.$next.'" style="color:#ed8621">'.$next.'</a> '; }
}
}
if ($_GET['page'] < $pages){ echo ' <a href="index.php?page='.$pagemore.'&tag='.$tag.'" style="padding-left:20px; color:#ed8621">></a> '; }
if($pages>7) {
if($currentpage<$pages-3) {
echo ' <a href="index.php?tag='.$tag.'&page='.$pages.'" style="color:#ed8621">>></a> ';
}
}
?>
</td>
</tr>
</table>
</td>
<td width="380" valign="top">
<div class="welcome_top"></div>
<div class="welcome_bg"><h1>Welcome to <?=str_replace('http://', '', $sqlinfo['site_url']); ?></h1><?=ucwords(str_replace('http://', '', $sqlinfo['site_url'])); ?> is your source for the funniest videos online. Using YouTube's API we're able to provide you with millions of <b>funny videos</b> from all over the world. We also provide you with the embed code so you can place it on your MySpace profile. That's right all these videos can also be <b>MySpace videos</b>.</div>
<div class="welcome_bottom"></div><br />
<div class="welcome_top"></div>
<center><div class="welcome_bg"><?=$sqlinfo['336_280']?></div></center>
<div class="welcome_bottom"></div><br />
<div class="featured_top"></div>
<div class="featured_bg">
<h1>Featured Video </h1>
<center>
<embed src="http://www.youtube.com/v/IQaC8gjnOYE" type="application/x-shockwave-flash" wmode="transparent" width="300" height="240"></embed>
</center>
</div><div class="featured_bottom"></div><br>
<div class="welcome_top"></div>
<div class="welcome_bg">
<h1>Random Cloud Tags </h1><? while($taginfo = mysql_fetch_assoc($get_tags)){ echo randtag($taginfo['tag']); } ?>
</div>
<div class="welcome_bottom"></div>
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" style="padding-top:10px;"><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="footer_left"></td>
<td class="footer_bg">Copyright © 2008 <?=$sqlinfo['site_url']?>. All Rights Reserved.<br />
All videos are hosted on YouTube and are property of their respected owners.</td>
<td class="footer_right"></td>
</tr>
</table></td>
</tr>
</table>
</form>
<?=$sqlinfo['tracker']?>
</body>
</html>