require("include/top.php");
$query ="SELECT prods.name,prods.group1,prods.group2,prods.group3,users.nickname,users.avatar ";
$query.="FROM prods,users ";
$query.="WHERE prods.id=".$which." AND users.id=prods.added";
$result = mysql_query($query);
$prod = mysql_fetch_array($result);
if ($prod["group1"]):
$gquery="select name,acronym from groups where id='".$prod["group1"]."'";
$gresult=mysql_query($gquery);
while($gtmp = mysql_fetch_array($gresult)) {
$prod["groupname1"]=$gtmp["name"];
$prod["groupacron1"]=$gtmp["acronym"];
}
endif;
if ($prod["group2"]):
$gquery="select name,acronym from groups where id='".$prod["group2"]."'";
$gresult=mysql_query($gquery);
while($gtmp = mysql_fetch_array($gresult)) {
$prod["groupname2"]=$gtmp["name"];
$prod["groupacron2"]=$gtmp["acronym"];
}
endif;
if ($prod["group3"]):
$gquery="select name,acronym from groups where id='".$prod["group3"]."'";
$gresult=mysql_query($gquery);
while($gtmp = mysql_fetch_array($gresult)) {
$prod["groupname3"]=$gtmp["name"];
$prod["groupacron3"]=$gtmp["acronym"];
}
endif;
if (strlen($prod["groupname1"].$prod["groupname2"].$prod["groupname3"])>27):
if (strlen($prod["groupname1"])>10 && $prod["groupacron1"]) $prod["groupname1"]=$prod["groupacron1"];
if (strlen($prod["groupname2"])>10 && $prod["groupacron2"]) $prod["groupname2"]=$prod["groupacron2"];
if (strlen($prod["groupname3"])>10 && $prod["groupacron3"]) $prod["groupname3"]=$prod["groupacron3"];
endif;
if(!$f) $f=1;
?>
require("include/bottom.php"); ?>