>>  Site Map >>  Forums >>  Blocks 6x

Forum module - topics in forum:



Blocks 6x - Discussions regarding PHP-Nuke Blocks.



Bespoke Auction Block

I'm trying and trying being the main word here, to build a bespoke centre block to list all the auctions for my site, similar to the forum one.

I keep getting a parse error on line 30 or there abouts. Where am i going wronf here:-

Code: :
if( eregi( "block-Auktion_List.php", $PHP_SELF)) {
   Header("Location: index.php");
   die();
}

global $prefix, $db;


 $result = $db->sql_query("SELECT cid,title,price,bids,start,end,picture from ".$prefix."_auction_items order by cid");
         while(list($cid,$title,$price,$bids,$start,$end,$picture) = $db->sql_fetchrows($result))
{
         $content.="<a href=\"modules.php?name=auktion&file=viewitem&item=$cid">$title</a>";   
         $content.="<img src=modules/auktion/pictures/$picture width=100 height=100 border=0>";

        $content.="<td align=\"right\">$price</td>";
        $content.="<td align=\"center\">$bids</td>";
        $content.="<td align=\"right\">".timediff($end)."</td><tr>";
}

?>







I have anotated some points below:
Code: :
// I Assume you have the <?PHP at the start of the file, just that you included the end ?> and not the start
<?PHP
// Not suposed to use the $PHP_SELF variable anymore as it was droped by php, replaced with what i have below
if( eregi( "block-Auktion_List.php", $_SERVER['PHP_SELF']))
   {
      header("Location: index.php");
      die();
   }

global $prefix, $db;

$result = $db -> sql_query("SELECT cid,title,price,bids,start,end,picture from ".$prefix."_auction_items order by cid");
while(list($cid,$title,$price,$bids,$start,$end,$picture) = $db -> sql_fetchrows($result))
   {
    $content .= "<a href=\"modules.php?name=auktion&file=viewitem&item=$cid\">$title</a>"; // Had " without \ before >   
    $content .= "<img src=modules/auktion/pictures/$picture width=100 height=100 border=0>";
    $content .= "<td align=\"right\">$price</td>";
    $content .= "<td align=\"center\">$bids</td>";
    $content .= "<td align=\"right\">".timediff($end)."</td><tr>";
   }
?>


The only thing i saw that would have casued and actuall parse error was the missing \ and i assume that was line 30, if not point out what line was line 30 and post a few lines of code from before and after Smile




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS