";
$sql = "SELECT Avatar FROM userdata WHERE Nickname = '".$rows["a_name"]."'";
$result = mysql_query ($sql);
$Avatar=mysql_fetch_array ($result);
if($rows["a_name"] == "")
{
$rows["a_name"] = "guest";
}
if($rows["a_like"] == "")
{
$rows["a_like"] = "0";
}
if($rows["a_dislike"] == "")
{
$rows["a_dislike"] = "0";
}
echo" \n
|
#". $rows['a_id']." , by:".$rows['a_name'];
if(($_SESSION["user_nickname"] == $rows["a_name"] && $settings["closed"] != 1)|| $_SESSION["user_admin"]=="1")
{
echo "";
}
echo " |
". $rows['a_answer']. " |
";
if($rows['a_attachment'] != "")
{
$pos1 = strpos($rows['a_attachment'], "-");
$pos2 = strpos($rows['a_attachment'], "-",$pos1+1);
$attname = substr($rows['a_attachment'], $pos2+1);
echo "
Attachment:
".$attname." |
";
}
echo "
Date: ".$rows['a_datetime']."
|
";
if(isset($_SESSION["user_id"]))
{
$sql = "SELECT * FROM forum_like WHERE question = '".$id."' AND answer = '".$rows["a_id"]."'";
$result = mysql_query ($sql);
$liked = false;
$disliked = false;
while($Like=mysql_fetch_array($result))
{
if($Like[2]==$_SESSION["user_nickname"])
{
$liked = true;
$disliked = true;
}
}
if(!$liked)
echo $rows['a_like']."";
else
echo $rows['a_like']."";
if(!$disliked)
echo $rows['a_dislike']."";
else
echo $rows['a_dislike']."";
}
else
{
echo $rows['a_like']."".
$rows['a_dislike']."";
}
echo "
|
|
|