-3
我的腳本在132行有錯誤,所以cron以錯誤結尾,你能協助嗎?我沒有做這個腳本及編碼器已不存在,因此,如果有人能幫助我,我會很感激在我的網站腳本上出現錯誤的php代碼
thank you
<?php
include('/home/admin/domains/domain.com/public_html/admin/inc/connect.inc.php');
require_once('/home/admin/domains/domain.com/public_html/inc/lastadd.php");
echo RSS_Display("http://www.site.com/embedrss", 12);
?>
<?
$RSS_Content = array();
function RSS_Tags($item, $type)
{
$y = array();
$tnl = $item->getElementsByTagName("title");
$tnl = $tnl->item(0);
$title = $tnl->firstChild->textContent;
$tnl = $item->getElementsByTagName("link");
$tnl = $tnl->item(0);
$link = $tnl->firstChild->textContent;
$tnl = $item->getElementsByTagName("description");
$tnl = $tnl->item(0);
$description = $tnl->firstChild->textContent;
$y["title"] = $title;
$y["link"] = $link;
$y["description"] = $description;
$y["type"] = $type;
return $y;
}
function RSS_Channel($channel)
{
global $RSS_Content;
$items = $channel->getElementsByTagName("item");
// Processing channel
$y = RSS_Tags($channel, 0); // get description of channel, type 0
array_push($RSS_Content, $y);
// Processing articles
foreach($items as $item)
{
$y = RSS_Tags($item, 1); // get description of article, type 1
array_push($RSS_Content, $y);
}
}
function RSS_Retrieve($url)
{
global $RSS_Content;
$doc = new DOMDocument();
$doc->load($url);
$channels = $doc->getElementsByTagName("channel");
$RSS_Content = array();
foreach($channels as $channel)
{
RSS_Channel($channel);
}
}
function RSS_RetrieveLinks($url)
{
global $RSS_Content;
$doc = new DOMDocument();
$doc->load($url);
$channels = $doc->getElementsByTagName("channel");
$RSS_Content = array();
foreach($channels as $channel)
{
$items = $channel->getElementsByTagName("item");
foreach($items as $item)
{
$y = RSS_Tags($item, 1); // get description of article, type 1
array_push($RSS_Content, $y);
}
}
}
function RSS_Display($url, $size = 15, $site = 0)
{
global $RSS_Content;
$opened = false;
$page = "";
$site = (intval($site) == 0) ? 1 : 0;
RSS_Retrieve($url);
if($size > 0)
$recents = array_slice($RSS_Content, $site, $size + 1 - $site);
foreach($recents as $article)
{
$type = $article["type"];
if($type == 0)
{
if($opened == true)
{
$page .="";
$opened = false;
}
$page .="";
}
else
{
if($opened == false)
{
$page .= "";
$opened = true;
}
}
$title = $article["title"];
$link = $article["link"];
$links[]=$link;
$description = $article["description"];
$page .= "";
if($description != false)
{
$page .= "";
}
$page .= "";
if($type==0)
{
$page .="";
}
}
if($opened == true)
{
$page .="";
}
?>
<?
foreach($links as $lnk) {
$ch = curl_init();//start curl
curl_setopt($ch, CURLOPT_URL, $lnk); //curl Targeted URL
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$source = curl_exec($ch);
$videoid_start = strpos($source,'http://www.traileraddict.com/emd/');
$videoid_end = $videoid_start+60;
$poster_start = strpos($source,'dir=');
$poster_end = strpos($source,'.jpg" style="');
$desc_start = strpos($source,'Upscale Font');
$desc_end = strpos($source,'Tags:');
$title_start = strpos($source,'<title>');
$title_end = strpos($source,'</title>');
$videoid_content="";
$poster_content='';
$desc_content='';
$title_content='';
/*HERE STATRTS THE Poster CODE*/
for ($i=$poster_start;$i<$poster_end;$i++) {
$poster_content .= $source[$i];
}
$poster_content= trim(str_replace('dir=','',$poster_content));
/*HERE STATRTS THE Title CODE*/
for ($i=$title_start;$i<$title_end;$i++) {
$title_content .= $source[$i];
}
$title_content= trim(str_replace('<title>','',$title_content));
$title_content= trim(str_replace(' - Trailer Addict','',$title_content));
if (empty($title_content))
{
?>
<center>No Title</center>
<?
}
if (empty($poster_content))
{
$contents = file_get_contents('/home2/playtwof/public_html/dailytrailers/posters/noposter.jpg');
$title_poster = $title_content;
$title_poster = trim(str_replace(' ','',$title_poster));
$title_poster = trim(str_replace(':','',$title_poster));
$title_poster = trim(str_replace("'","",$title_poster));
$title_poster = trim(str_replace("&","",$title_poster));
$fp = fopen('/home2/playtwof/public_html/dailytrailers/posters/'.$title_poster.'.jpg', 'w');
fwrite($fp, $contents);
fclose($fp);
}
else {
$contents = file_get_contents('http://www.traileraddict.com'.$poster_content.'.jpg');
$title_poster = $title_content;
$title_poster = trim(str_replace(' ','',$title_poster));
$title_poster = trim(str_replace(':','',$title_poster));
$title_poster = trim(str_replace("'","",$title_poster));
$title_poster = trim(str_replace("&","",$title_poster));
$fp = fopen('/home2/playtwof/public_html/dailytrailers/posters/'.$title_poster.'.jpg', 'w');
fwrite($fp, $contents);
fclose($fp);
}
/*HERE ENDS THE Poster CODE*/
/*HERE ENDS THE Title CODE*/
/*HERE STATRTS THE Description CODE*/
for ($i=$desc_start;$i<$desc_end;$i++) {
$desc_content .= $source[$i];
}
$desc_content= trim(str_replace('Upscale Font','',$desc_content));
$desc_content= trim(str_replace('<a href="/tags/hatchet">','',$desc_content));
$desc_content= trim(str_replace('<span id="morelink" name="morelink"><a href="javascript:viewinfo();"><img src="/images/moreinfo.png" alt="More Trailer Details" border="0" align="absmiddle"></a>','',$desc_content));
$desc_content= trim(str_replace('</div>','',$desc_content));
$desc_content= trim(str_replace('" style="float:left; margin-top:2px;" border="0" />','',$desc_content));
$desc_content= trim(str_replace('<span id="moredet" name="moredet" style="display:none;">','',$desc_content));
$desc_content= trim(str_replace('<a href="javascript:lessinfo();"><img src="/images/lessinfo.png" alt="Hide Trailer Details" border="0" align="absmiddle"></a></a></span> <span id="morelink" name="morelink"><a href="javascript:viewinfo();"><img src="/images/moreinfo.png" alt="More Trailer Details" border="0" align="absmiddle"></a><br></span> </span>','',$desc_content)); $desc_content= trim(str_replace('<img src="/images/lessinfo.png" alt="Hide Trailer Details" border="0" align="absmiddle">','',$desc_content));
$desc_content= trim(str_replace('<span id="morelink" name="morelink"><img src="/images/moreinfo.png" alt="More Trailer Details" border="0" align="absmiddle">','',$desc_content));
if (empty($desc_content))
{
?>
<center>Sorry, No description for this trailer!<br /></center>
<?
}
for ($i=$videoid_start;$i<$videoid_end;$i++) {
if (is_numeric($source[$i]))
$videoid_content .= $source[$i];
}
$desc_content= trim(str_replace("'","",$desc_content));
$title_content = trim(str_replace("'",'',$title_content));
$title_poster = trim(str_replace("'","",$title_poster));
mysql_query("insert into trailer set titlu='$title_content',poster='$title_poster.jpg',descriere='$desc_content',video_id='$videoid_content',hits=1");
}
}
?>
語法高亮顯示您的錯誤。這是一個報價問題。一個基本的文本編輯器或IDE會馬上捕捉到這一點。 –