I make this error
Parse error: syntax error, unexpected T_STRING in /membri/universal3000/chat_universal2/web/rwrss.php on line 110
Thanks to whoever solves this problem
Parse error: syntax error, unexpected T_STRING in /membri/universal3000/chat_universal2/web/rwrss.php on line 110
PHP Code:
<?php
include("config.php");
include("core.php");
include("lastRSS.php");
$bcon = connectdb();
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
if (!$bcon)
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "<img src=\"../images/notok.gif\" alt=\"!\"/><br/>";
echo "<b><strong>Errore! Impossibile collegarsi al database...</strong></b><br/><br/>";
echo "Questo errore si verifica di solito quando c'è il backup del database, si prega di essere pazienti...";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$brws = explode("/",$HTTP_USER_AGENT);
$ubr = $brws[0];
$uip = getip();
$rssid = $_GET["rssid"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$fid = $_GET["fid"];
$action = $_GET["action"];
$uid = getuid_sid($sid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$hvia = $HTTP_VIA;
cleardata();
if($action=="showfrss")
{
addonline(getuid_sid($sid),"RSS aggregator","");
echo "<head>";
echo "<title>RSS aggregator</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rss WHERE fid='".$fid."'"));
$num_items = $noi[0]; //changable
$items_per_page= 5;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT id, title, dscr, imgsrc, pubdate FROM ibwf_rss WHERE fid='".$fid."' ORDER BY id LIMIT $limit_start, $items_per_page";
echo "<p>";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
if(trim($item[3]!=""))
{
$img = "<img src=\"$item[3]\" alt=\"*\"/>";
}else{
$img="";
}
$lnk = "$img<a href=\"rwrss.php?action=readrss&sid=$sid&rssid=$item[0]&fid=$fid\">".htmlspecialchars($item[1])."</a><br/>";
$feedsc = htmlspecialchars($item[2]);
echo $lnk;
echo $feedsc;
echo "<br/>Publish Date: $item[4]<br/>";
}
}
echo "</p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"rwrss.php?action=$action&page=$ppage&sid=$sid&fid=$fid\">«Indietro</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"rwrss.php?action=$action&page=$npage&sid=$sid&fid=$fid\">Avanti»</a>";
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "<form action=\"inbox.php\" method=\"get\">";
$rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"3\"/>";
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
$rets .= "<input type=\"hidden\" name=\"fid\" value=\"$fid\"/>";
$rets .= "<input type=\"Submit\" value=\"vai a pagina" Name=\"Submit\"/></form>";
echo $rets;
}
echo "</p>";
echo "<p align=\"center\">";
echo "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo htmlspecialchars(getfname($fid))."</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p></body>";
}
else if($action=="readrss")
{
addonline(getuid_sid($sid),"RSS Reader","");
echo "<head>";
echo "<title>RSS Reader</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$rssinfo = mysql_fetch_array(mysql_query("SELECT lupdate, link FROM ibwf_rss WHERE id='".$rssid."'"));
$updt = time() - 3600;
if($rssinfo[0]<$updt)
{
///code to refresh info
$rss = new lastRSS;
$rss->cache_dir = './rsscache';
$rss->cache_time = 3600;
$rss->date_format = 'd m y - H:i';
$rss->stripHTML = true;
$rssurl = $rssinfo[1];
if ($rs = $rss->get($rssurl))
{
$title = $rs["title"];
$pgurl = $rs["link"];
$srcd = $rs["description"];
$pubdate = $rs["lastBuildDate"];
mysql_query("UPDATE ibwf_rss SET lupdate='".time()."', title='".$title."', pgurl='".$pgurl."', srcd='".$srcd."', pubdate='".$pubdate."' WHERE id='".$rssid."'");
mysql_query("DELETE FROM ibwf_rssdata WHERE rssid='".$rssid."'");
$rssitems = $rs["items"];
for($i=0;$i<count($rssitems);$i++)
{
$rssitem = $rssitems[$i];
mysql_query("INSERT INTO ibwf_rssdata SET rssid='".$rssid."', title='".mysql_real_escape_string($rssitem["title"])."', link='".$rssitem["link"]."', text='".mysql_real_escape_string($rssitem["description"])."', pubdate='".$rssitem["pubDate"]."'");
}
}
else {
$errt = "Error: It's not possible to get the service...";
mysql_query("INSERT INTO ibwf_rssdata SET rssid='".$rssid."', title='ERROR!', link='', text='".mysql_real_escape_string($errt)."', pubdate='".time()."'");
}
}
$rssinfo = mysql_fetch_array(mysql_query("SELECT pgurl, title, srcd, imgsrc FROM ibwf_rss WHERE id='".$rssid."'"));
echo "<img src=\"$rssinfo[3]\" alt=\"*\"/><br/>";
echo "<b>$rssinfo[1]</b><br/><small>";
echo $rssinfo[2];
echo "</small></p>";
if($page=="" || $page<=0)$page=1;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rssdata WHERE rssid='".$rssid."'"));
$num_items = $noi[0]; //changable
$items_per_page= 5;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT id, title, text, pubdate FROM ibwf_rssdata WHERE rssid='".$rssid."' ORDER BY id LIMIT $limit_start, $items_per_page";
echo "<p><small>";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$lnk = "<img src=\"../images/star.gif\" alt=\"*\"/><b>".$item[1]."</b><br/>";
$feedsc = $item[2];
echo $lnk;
echo $feedsc;
echo "<br/>Publish Date: $item[3]<br/><img src=\"../images/line.jpg\" alt=\"*\"/><br/>";
}
}
echo "</small></p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"rwrss.php?action=$action&page=$ppage&sid=$sid&rssid=$rssid&fid=$fid\">«Indietro</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"rwrss.php?action=$action&page=$npage&sid=$sid&rssid=$rssid&fid=$fid\">Avanti»</a>";
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "<form action=\"inbox.php\" method=\"get\">";
$rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"3\"/>";
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
$rets .= "<input type=\"hidden\" name=\"fid\" value=\"$fid\"/>";
$rets .= "<input type=\"hidden\" name=\"rssid\" value=\"$rssid\"/>";
$rets .= "<input type=\"Submit\" value=\"vai a pagina\" Name=\"Submit\"/></form>";
echo $rets;
}
echo "</p>";
echo "<p align=\"center\">";
if($fid!=""||$fid>0)
{
$fname = htmlspecialchars(getfname($fid));
echo "<b>8 </b><a accesskey=\"8\" href=\"rwrss.php?action=showfrss&sid=$sid&fid=$fid\"><img src=\"../images/rss.gif\" alt=\"rss\"/>$fname Extras</a><br/>";
echo "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">$fname</a><br/>";
}
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p></body>";
}
else{
addonline(getuid_sid($sid),"Lost in RSS aggregator","");
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "I don't know how did you get into here, but there's nothing to show<br/><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p></body>";
}
Comment