Kodening problem
HejJeg har problem her.
Fatal error: Call to undefined function: main() in /home/ecar/public_html/template.php on line 510
og her er filen.
----
<?php
include_once "myconnect.php";
include_once "session.php";
include_once "styles.php";
include_once "left_panel.php";
include_once "right_panel.php";
include_once "date_time_format.php";
include_once "send_alerts.php";
if(isset($_COOKIE["codds_blead_user"]))
{
$username=$_COOKIE["codds_blead_user"];
$sql="SELECT * FROM sbbleads_members WHERE sb_username = '$username'" ;
$rs_query=mysql_query($sql);
if ( $rs=mysql_fetch_array($rs_query) )
{
$_SESSION["sbbleads_username"]=$rs["sb_username"] ;
$_SESSION["sbbleads_userid"]=$rs["sb_id"] ;
$_SESSION["sbbleads_memtype"]=$rs["sb_memtype"];
}
}
//include_once "check_msg_function.php";
$config=mysql_fetch_array(mysql_query("select * from sbbleads_config "));
//======================code here is equivalent to chron file code=============================
mysql_query("update sbbleads_members set sb_memtype=".$config["sb_memtype"]." where sb_expiry_date < NOW()");
if(date("Ymd",time())>$config["sb_last_sent"])
{
//echo "working";
send_mail_alerts();////
mysql_query("update sbbleads_config set sb_last_sent=".date("Ymd",time())." where 1");
}
//==============================update stats===================================================
$sql="Update sbbleads_stats set sb_hits_thismonth=sb_hits_thismonth+1,sb_hits=sb_hits+1" ;
mysql_query($sql);
$sql="Select * from sbbleads_stats " ;
$rs0_query=mysql_query($sql);
$rs0=mysql_fetch_array($rs0_query);
if (!((date("m",time())==$rs0["sb_thismonth"])) )
{
$sql="Update sbbleads_stats set sb_hits_lastmonth=sb_hits_thismonth,
sb_thismonth=".date("m",time()) ;
mysql_query($sql);
$sql="Update sb_bleads_stats set sb_hits_thismonth=0" ;
mysql_query($sql);
}
//=============================================================================================
// LOAD style number from the config file
$config=mysql_fetch_array(mysql_query("select * from sbbleads_config "));
$icons=mysql_fetch_array(mysql_query("select * from sbbleads_icons where sb_id=".$config["sb_icon_list"]));
$keyword="";
$title_str="";
$site_keywords="";
if(isset($_REQUEST["keyword"])&&($_REQUEST["keyword"]<>""))
{
$keyword=$_REQUEST["keyword"];
$title_str=$keyword." : ";
$site_keywords=$keyword.",";
}
if(preg_match("/\/selloffers.php/",$_SERVER['PHP_SELF']))
{
$title_str.="Sell Offers : ";
$site_keywords.="Sell Offers,";
}
elseif(preg_match("/\/buyoffers.php/",$_SERVER['PHP_SELF']))
{
$title_str.="Buy Offers : ";
$site_keywords.="Buy Offers,";
}
elseif(preg_match("/\/products.php/",$_SERVER['PHP_SELF']))
{
$title_str.="Products : ";
$site_keywords.="Products,";
}
elseif(preg_match("/\/profiles.php/",$_SERVER['PHP_SELF']))
{
$title_str.="Companies : ";
$site_keywords.="Companies,";
}
if(isset($_REQUEST["id"])&&($_REQUEST["id"]<>"")&&($_REQUEST["id"]<>0))
{
$id=$_REQUEST["id"];
if(preg_match("/\/view_offer.php/",$_SERVER['PHP_SELF']))
{
$offer=mysql_fetch_array(mysql_query("select * from sbbleads_offers where sb_id=$id"));
$title_str.=$offer["sb_title"]." : ";
$site_keywords.=$offer["sb_title"].",";
}
elseif(preg_match("/\/view_offer_buy.php/",$_SERVER['PHP_SELF']))
{
$offer=mysql_fetch_array(mysql_query("select * from sbbleads_offers_buy where sb_id=$id"));
$title_str.=$offer["sb_title"]." : ";
$site_keywords.=$offer["sb_title"].",";
}
elseif(preg_match("/\/view_product.php/",$_SERVER['PHP_SELF']))
{
$offer=mysql_fetch_array(mysql_query("select * from sbbleads_products where sb_id=$id"));
$title_str.=$offer["sb_title"]." : ";
$site_keywords.=$offer["sb_title"].",";
}
elseif(preg_match("/\/view_profile.php/",$_SERVER['PHP_SELF']))
{
$offer=mysql_fetch_array(mysql_query("select * from sbbleads_companyprofiles where sb_id=$id"));
$title_str.=$offer["sb_companyname"]." : ";
$site_keywords.=$offer["sb_companyname"].",";
}
}
if(isset($_REQUEST["cid"])&&($_REQUEST["cid"]<>"")&&($_REQUEST["cid"]<>0))
{
$cid=$_REQUEST["cid"];
$catpath="";
$catpath2="";
$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $cid );
while ($rs=mysql_fetch_array($cat_query))
{
$catpath .=$rs["sb_cat_name"]." : ";
$catpath2 .=$rs["sb_cat_name"].",";
$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $rs["sb_pid"] );
}
$title_str.=$catpath;
$site_keywords.=$catpath2;
}
$title_str.=$config["sb_site_name"];
$site_keywords.=$config["sb_site_keywords"];
?><html>
<head>
<title><? echo $title_str;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta http-equiv="keywords" content="<?php echo $site_keywords;?>">
<script language="JavaScript" type="text/JavaScript">
<!--
function sb_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body bgcolor="<?php echo $softbiz_page_bg; ?>" leftmargin="1" topmargin="1" rightmargin="1">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="center" valign="middle"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><font size="1">
</font></font><font class='normal'>
</select>
<br>
</font></div></td>
</tr>
<tr align="left">
<td valign="top" ><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<!--<img src="images/sbbleads_icons/<? echo $config["sb_logo"];?>">-->
<img src="images/logo.gif" width="239" height="100"></td>
<td align="center">
<?php
mt_srand( (double)microtime() * 1000000);
$rs_t_query=mysql_query("select * from sbbleads_ads where approved= 'yes' and credits > displays");
//die($rs_t_query);
$cnt= mysql_num_rows($rs_t_query);
$rs_t_query1=mysql_query("select * from sbbleads_affiliate_banner where sbaff_active= 'yes'");
//die($rs_t_query);
$cnt2 = mysql_num_rows($rs_t_query1);
if(!is_numeric($cnt))
$cnt=0;
if(!is_numeric($cnt2))
$cnt2=0;
$sbdowhat=0; //stands for do nothing
if ( ($cnt == 0) && ($cnt2 > 0) )
{ //no banner but affiliate exists
$sbdowhat=1; /// stands for "affiliate";
}
elseif( ($cnt > 0) && ($cnt2 == 0) )
{ //no affiliate but banner exists
$sbdowhat=2; // stands for "banner";
}
elseif( ($cnt > 0) && ($cnt2 > 0) )
{ //
$sbrandon=mt_rand(1,2);
if($sbrandon == 1)
$sbdowhat=1;
else
$sbdowhat=2;
}
if($sbdowhat == 1)
{
if($cnt2>1)
$rnum= mt_rand(1,$cnt2);
else
$rnum=1;
for ($i=0;$i<$rnum;$i++)
$rs_t=mysql_fetch_array($rs_t_query1);
echo $rs_t["sbaff_text"];
}
elseif($sbdowhat == 2)
{
if($cnt>1)
$rnum= mt_rand(1,$cnt);
else
$rnum=1;
for ($i=0;$i<$rnum;$i++)
$rs_t=mysql_fetch_array($rs_t_query);
$id=$rs_t["id"];
$sbtitle=$rs_t["sbtitle"];
$url=$rs_t["url"];
$bannerurl=$rs_t["bannerurl"];
echo "<a href='$url' target=\"_blank\"><img src='$bannerurl' width=468 height=60 border=0 alt=\"$sbtitle\"></a>";
mysql_query("update sbbleads_ads set displays=displays+1 where id=$id");
}
?>
</td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td width="100%" height="100%" align="center" valign="top" > <table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="index.php" method="get">
</form>
<tr>
<td height="25" align="center" valign="bottom"> <table width="95%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td height="25" class="<?php
if(!preg_match("/\/index.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/index.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="index.php" >Home</a>
<?php
}
else
{
echo "HOME";
}
?>
</td>
<td width="7" > </td>
<td height="25" class="<?php
if(!preg_match("/\/selloffers.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/selloffers.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="selloffers.php" >Sell Offers</a>
<?php
}
else
{
echo "SELL OFFERS";
}
?>
</td>
<td width="7" > </td>
<td height="25" class="<?php
if(!preg_match("/\/buyoffers.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/buyoffers.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="buyoffers.php" >Buy Offers</a>
<?php
}
else
{
echo "BUY OFFERS";
}
?>
</td>
<td width="7" > </td>
<td height="25" class="<?php
if(!preg_match("/\/products.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/products.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="products.php" >Products</a>
<?php
}
else
{
echo "PRODUCTS";
}
?>
</td>
<td width="7" > </td>
<td height="25" class="<?php
if(!preg_match("/\/profiles.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/profiles.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="profiles.php">Companies</a>
<?php
}
else
{
echo "COMPANIES";
}
?>
</td>
<td width="7" > </td>
<td height="25" class="<?php
if(!preg_match("/\/cart_items.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/cart_items.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="cart_items.php">Inquiry Basket</a>
<?php
}
else
{
echo "INQUIRY BASKET";
}
?>
</td>
<td width="7" > </td>
<td class="<?php
if(isset($_SESSION["sbbleads_userid"]))
{
if(!preg_match("/\/userhome.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab"; }
else
{ echo "activetab"; }
}
else
{
if(!preg_match("/\/signin.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab"; }
else
{ echo "activetab"; }
}
?>
">
<?php
if(isset($_SESSION["sbbleads_userid"]))
{
if(!preg_match("/\/userhome.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="userhome.php" >Member Home</a>
<?php
}
else
{
echo "MEMBER HOME";
}
}
else
{
if(!preg_match("/\/signin.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="signin.php" >Login</a>
<?php
}
else
{
echo "LOGIN";
}
}
?>
</td>
<td width="7" > </td>
<td width="80" class="<?php
if(!preg_match("/\/tracking.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
">
<?php
if(!preg_match("/\/tracking.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="tracking.php" >Tracking</a>
<?php
}
else
{
echo "TRACKING";
}
?>
</td>
<td width="7" > </td>
<td class="<?php
if(!preg_match("/\/linktous.php/",$_SERVER['SCRIPT_NAME']))
{ echo "inactivetab";}
else
{ echo "activetab"; }
?>
" width="80">
<?php
if(!preg_match("/\/linktous.php/",$_SERVER['SCRIPT_NAME']))
{
?>
<a href="linktous.php" >Contact Us</a>
<?php
}
else
{
echo "CONTACT US";
}
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr height=20>
<td colspan="3" align="right" class="sidetitle" ><table width="100%" border="0" cellspacing="0" cellpadding="0" class="sidetitle" >
<tr>
<td> <? echo sb_date(time());?></td>
<td align="right">
<?
if(isset($_SESSION["sbbleads_userid"])) {
echo "Logged in as <b>" . $_SESSION["sbbleads_username"] . "</b>" ;
?>
| <a href="logout.php" class="titlelink">LOGOUT</a>
<?
}
else
{
?>
<font size=1>Welcome <strong>Guest</strong>,
Please <a href="signin.php" class="titlelink">LOGIN</a>
to your account or <a href="signup.php"class="titlelink">SIGNUP</a>
with us for business opportunities</font>
<?
}
?>
</td>
</tr>
</table>
</td>
</tr>
<tr class="mainbgcolor" >
<td align="center" valign="middle"> <font face="verdana, arial" size="1" class='red'>
<?
if ( isset($_REQUEST["msg"])&&$_REQUEST['msg']<>"")
{
print($_REQUEST['msg']);
}
//end if
?>
</font> </td>
</tr>
<tr valign="top" width=100%>
<td class="mainbgcolor" > <div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="150" align="left">
<? left();?>
</td>
<td align="center">
<?php main();?>
</td>
<td align="center">
<p align="right">
<? right();?></p>
</td>
</tr>
</table>
</div></td>
</tr>
<!-- <tr height=2>
<td colspan="3" class="seperatorstyle" ></td>
</tr>-->
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" >
<table align="center" width="100%" cellpadding="2" cellspacing="0" class="bottomstyle">
<tr>
<td align="center"> <a href="index.php" class="bottomlink">HOME</a>
| <a href="selloffers.php" class="bottomlink">SELL OFFERS</a> | <a href="buyoffers.php" class="bottomlink">BUY
OFFERS</a> | <a href="products.php" class="bottomlink">PRODUCTS</a>
| <a href="profiles.php" class="bottomlink">COMPANIES</a> |
<?php
if(!isset($_SESSION["sbbleads_userid"]))
{?>
<a href="signin.php" class="bottomlink">LOGIN</a>
<?php
}
else
{
?>
<a href="userhome.php" class="bottomlink">MEMBER AREA</a>
<?
}?>
| <a href="cart_items.php" class="bottomlink">INQUIRY BASKET</a> |
<a href="linktous.php" class="bottomlink">CONTACT US</a> <br>
<a href="post_offer.php" class="bottomlink">POST SELL OFFERS</a> |
<a href="post_offer_buy.php" class="bottomlink">POST BUY OFFERS</a>
| <a href="post_product.php" class="bottomlink">POST PRODUCTS</a>
| <a href="show_messages.php" class="bottomlink">CHECK INQUIRIES</a>
| <a href="manage_search.php" class="bottomlink">MY SEARCHES</a> |
<a href="manage_favorites.php" class="bottomlink">MY FAVORITES</a>
| <a href="choose_membership.php" class="bottomlink">UPGRADE MEMBERSHIP</a><br>
<a href="terms.php" target="_blank" class="bottomlink">TERMS OF USE</a> | <a href="privacy.php" target="_blank" class="bottomlink">PRIVACY
POLICY</a> | <a href="legal.php" target="_blank" class="bottomlink">LEGAL POLICY</a>
</td></tr></table></td>
</tr>
<tr>
<td valign="top" ><div align="center"><font color="#003366" size="3" face="Verdana, Arial, Helvetica, sans-serif"><? //echo $config["sb_html_footer"];?></font></div></td>
</tr>
<tr>
<td valign="top" ><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><font size="1">Powered
by <a class="softbiz" href="mailto:skh_000@yahoo.com" target="_blank">CODDS</a></font></font></div></td>
</tr>
</table>
</body>
</html>
----
Er der nogen der ved hvor fejlen er ?
