Peço gentilmente, que me ajudem a descobrir e corrigir esses dois erros que ocorre na linha 132 e na linha 164 desse script abaixo, ou se existe alguma outra coisa a ser feito, que não tenha percebido...
O nome do arquivo é "catlisting.php" da loja virtual probid v5.5
Abaixo copiei os dois erros e colei o script completo para vossa analise...
Agradeço muito se alguém puder me ajudar a resolver essa situação, ou
se alguém tiver esse script dessa versão de loja funcionando, por favor envie para mim!!!
<? $getSubCategories=mysql_query("SELECT id,items_counter, hidden, parent FROM probid_categories WHERE parent='".$_REQUEST['parent]."' ORDER BY theorder ASC, name ASC");
while ($subCategories=mysql_fetch_array($getSubCategories)) {
if ($subCategories['hidden']==1&&$subcategories['parent']==0) {
Pergunta
restartcom
Boa tarde meus queridos do forum!!!
Peço gentilmente, que me ajudem a descobrir e corrigir esses dois erros que ocorre na linha 132 e na linha 164 desse script abaixo, ou se existe alguma outra coisa a ser feito, que não tenha percebido...
O nome do arquivo é "catlisting.php" da loja virtual probid v5.5
Abaixo copiei os dois erros e colei o script completo para vossa analise...
Agradeço muito se alguém puder me ajudar a resolver essa situação, ou
se alguém tiver esse script dessa versão de loja funcionando, por favor envie para mim!!!
_________________________________________________________________________________________________________
Warning: implode() [function.implode]: Invalid arguments passed in /home/megaprom/public_html/leilao/catlistings.php on line 132
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/megaprom/public_html/leilao/catlistings.php on line 164
________________________________________________________________________________________________________
<?
## v5.23 -> dec. 13, 2005
if (!eregi("categories.php",$_SERVER['PHP_SELF'])) header("Location: categories.php?show=subcats");
$parent=$_REQUEST['parent'];
if($parent > 0) {
$croot = $parent;
$nav = "";
$cntr = 0;
while ($croot>0) {
$sbcts = mysql_query("SELECT id,parent FROM probid_categories WHERE id=$croot'") or die(mysql_error());
$crw = mysql_fetch_array($sbcts);
if($cntr == 0) {
$nav = $c_lang[$crw['id]];
} else {
if($parent != $croot) {
$nav = "<a href=\"categories.php?parent=".$crw[id]."\">".$c_lang[$crw['id']]."</a> > ".$nav;
}
}
$cntr++;
$croot = $crw['parent'];
}
$navigation = "<a href=\"categories.php?show=subcats\"><b>$lang[cat]:</b></a> $nav";
}
headercat( $navigation );
if ($nbFeatItems>0) { ?>
<table width=100%" border="0" cellpadding="0" cellspacing="0">
<?
$numb=0;
for ($i=0;$i<$j;$i++) { ?>
<tr>
<? for ($k=0;$k<$layout['nb_feat_cat];$k++) {
$w=100/$layout['nb_feat_cat'];
$width=$w."%"; ?>
<td width=<?=$width;?>" align="center" valign="top"> <? if ($name[$numb]!="") { ?>
<table width="100%" border="0" cellspacing="5" cellpadding="3">
<tr>
<td height="110" align="center" class="gradient"><a href="<?=$path;?>auctiondetails.php?id=<?=$fid[$numb];?>"><img src="<? echo (($pic[$numb]!="")?"makethumb.php?pic=".$pic[$numb]."&w=".$layout['w_feat_cat]."&sq=Y&b=Y":"themes/".$setts['default_theme']."/img/system/noimg.gif");?>" border=0"></a> </td>
</tr>
<tr class="c1">
<td class="sell"><?=$imgarrwhite;?>
<a href="<?=$path;?>auctiondetails.php?id=<?=$fid[$numb];?>">
<?=$name[$numb];?>
</a></td>
</tr>
<tr class="c2">
<td valign="top" class="smallfont"><strong>
<?=$lang[currbid]?>
:</strong> <? echo displayAmount(getSqlField("SELECT * FROM probid_auctions WHERE id='".$fid[$numb]."'","maxbid"),$currency[$numb]);?><br>
<strong>
<?=$lang[ends]?>
:</strong> <? echo displaydatetime(getSqlField("SELECT * FROM probid_auctions WHERE id='".$fid[$numb]."'","enddate"),$setts['date_format]);
$numb++; ?> </td>
</tr>
</table>
<? } ?></td>
<? } ?>
</tr>
<? } ?>
</table>
<? } ?>
<!-- End Items pics -->
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<? $isSubcats = getSqlNumber("SELECT id FROM probid_categories WHERE parent='".$_REQUEST['parent']."'");
if ($isSubcats>0) { ?>
<td width=150" valign="top"> <table width="100%" border="0" cellpadding="3" cellspacing="0" class="contentfont">
<tr>
<td class="c4"><img src="themes/<?=$setts['default_theme];?>/img/pixel.gif" width="1" height="3"></td>
<td class="c3" width="100%"><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width=1" height="3"></td>
</tr>
<? $getSubCategories=mysql_query("SELECT id,items_counter, hidden, parent FROM probid_categories WHERE parent='".$_REQUEST['parent]."' ORDER BY theorder ASC, name ASC");
while ($subCategories=mysql_fetch_array($getSubCategories)) {
if ($subCategories['hidden']==1&&$subcategories['parent']==0) {
## do nothing (v5.23 addition)
} else { ?>
<tr>
<td class=c3"> </td>
<td class="c2" width="100%"><a href="categories.php?parent=<?=$subCategories['id];?>"><? echo $c_lang[$subCategories['id']]?></a> <? echo ($subCategories['items_counter']>0) ? "(".$subCategories['items_counter'].")":"";?></td>
</tr>
<? }
} ?>
</table></td>
<? } ?>
<td valign=top"> <table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr class="c1">
<td width="50" align="center" class="submenu"><?=$lang[picture]?></td>
<td align="center" class="submenu"><a href="categories.php?parent=<?=$_REQUEST['parent];?>&start=<?=$_REQUEST['start'];?>&orderField=itemname&orderType=<?=$newOrder;?>"><?=$lang[auc_name]?></a></td>
<td width=60" align="center" class="submenu"><a href="categories.php?parent=<?=$_REQUEST['parent];?>&start=<?=$_REQUEST['start'];?>&orderField=maxbid&orderType=<?=$newOrder;?>"><?=$lang[lastbid]?></a></td>
<td width=40" align="center" class="submenu"><a href="categories.php?parent=<?=$_REQUEST['parent];?>&start=<?=$_REQUEST['start'];?>&orderField=nrbids&orderType=<?=$newOrder;?>"><?=$lang[bids]?></a></td>
<td width=130" align="center" class="submenu"><a href="categories.php?parent=<?=$_REQUEST['parent];?>&start=<?=$_REQUEST['start'];?>&orderField=enddate&orderType=<?=$newOrder;?>"><?=$lang[endsin]?></a></td>
</tr>
<tr class=c5">
<td><img src="themes/<?=$setts['default_theme];?>/img/pixel.gif" width="1" height="1"></td>
<td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width=1" height="1"></td>
<td><img src="themes/<?=$setts['default_theme];?>/img/pixel.gif" width="1" height="1"></td>
<td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width=1" height="1"></td>
<td><img src="themes/<?=$setts['default_theme];?>/img/pixel.gif" width="1" height="1"></td>
</tr>
<?
// newest function
if ($_GET['start'] == "") $start = 0;
else $start = $_GET['start'];
$limit = 20;
$croot = $_REQUEST['parent'];
$cntr=0;
while ($croot>0) {
$crw = getSqlRow("SELECT * FROM probid_categories WHERE id=$croot'");
if($cntr == 0) {
$catname = $crw['name];
} else {
if($crw['parent'] != $croot) {
$catname = "$crw[name] : $catname";
}
}
$cntr++;
$croot = $crw['parent'];
}
$catname = trim($catname);
## get all subcats
asort($cat_array);
if ($catname!=") {
while (list($cat_array_id, $cat_array_name)=each($cat_array)) {
$strResult = strpos($cat_array_name,$catname);
if (trim($strResult)=="0") $cat_id[$catcnt++] = $cat_array_id;
}
$all_subcats = implode (",",$cat_id);
$subcatquery="(a.category IN (".$all_subcats.") OR a.addlcategory IN (".$all_subcats.")) AND ";
} else {
$subcatquery = "";
}
$mysqlVersion = substr(mysql_get_server_info(),0,1);
if ($mysqlVersion>=4) {
$additionalQuery = "SQL_CALC_FOUND_ROWS ";
} else {
## this is only used if the mySql is older than v4. Slower version
$nbItems = getSqlNumber("SELECT DISTINCT a.id, a.itemname, a.picpath, a.maxbid, a.currency,
a.nrbids, a.enddate FROM probid_auctions a WHERE
".$subcatquery."
a.active=1 AND a.closed=0 AND a.deleted!=1 AND a.listin!='store'
ORDER BY a.".$orderField." ".$orderType);
}
$getAuctions = mysql_query("SELECT ".$additionalQuery." DISTINCT a.id, a.itemname, a.picpath, a.maxbid, a.currency,
a.nrbids, a.enddate FROM probid_auctions a WHERE
".$subcatquery."
a.active=1 AND a.closed=0 AND a.deleted!=1 AND a.listin!='store'
ORDER BY a.".$orderField." ".$orderType." LIMIT $start,$limit");
if ($mysqlVersion>=4) $nbItems = mysql_result(mysql_query("Select FOUND_ROWS() AS nbr"),0,"nbr");
if ($nbItems==0) {
echo "<tr><td colspan=5 class=contentfont align=center>".$lang[noauct]."</td></tr>";
} else {
if ($nbItems>($start+$limit)) $final = $start+$limit;
else $final = $nbItems;
while ($auction = mysql_fetch_array($getAuctions)) { ?>
<tr class="<? echo (($count++)%2==0)?"c2":"c3"; ?>">
<td align="center"><?
if ($auction['picpath]!="") {
echo "<a href=\"auctiondetails.php?id=".$auction['id']."\"><img src=\"makethumb.php?pic=.$auction['picpath]."&w=40&sq=Y&b=Y\" border=0></a>";
} else echo "N/A"; ?> </td>
<td nowrap="nowrap" class=contentfont><span class="<? echo setStyle($auction['id']);?>"><a href=auctiondetails.php?id=<?=$auction['id];?>">
<?=$auction['itemname'];?>
</a> <? echo itemPics($auction['id']);?></span> </td>
<td align=center" class=contentfont><? echo displayAmount($auction['maxbid],$auction['currency']);?> </td>
<td class=contentfont align=center"><b>
<?=$auction['nrbids];?>
</b> </td>
<td align="center" class=contentfont><? echo timeleft($auction['enddate'],$setts['date_format']);?></td>
</tr>
<? } ?>
<tr>
<td colspan=5 class=contentfont align=center><?
paginate($start,$limit,$nbItems,"categories.php","&parent=.$_REQUEST['parent]."&orderField=$orderField&orderType=$orderType");
?></td>
</tr>
<? }?>
</table></td>
</tr>
</table>
Editado por restartcomLink para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.