Fejl i kode
Hej nogen der kan side hvad fejlen i denne kode er ?<?
$cfg['limit'] = 10; // Antal resultater pr. side.
$cfg['pages_each_way'] = 2; // Sider der peger hver vej
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM friends where userID=".$userID." and status = 'accepted'"),0);
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$start_point = ($offset-($cfg['pages_each_way']*$cfg['limit']) < 0) ? 0 : $offset-($cfg['pages_each_way']*$cfg['limit']);
$end_point = ($offset+($cfg['pages_each_way']*$cfg['limit']) > $total) ? $total : $offset+($cfg['pages_each_way']*$cfg['limit']);
$page_number = ($start_point/$cfg['limit'])+1;
?>
<?
$sql = mysql_query("SELECT *,DATE_FORMAT(account_createt,'%d-%m/%y Kl. %H:%s') AS account_createt from user_informations where userID = '$userID'") or die(mysql_error());
while ($user_informations = mysql_fetch_assoc($sql)) {
$sql = mysql_query("SELECT * from profile_point where userID = '$userID'") or die(mysql_error());
while ($profile_point = mysql_fetch_assoc($sql)) {
$sql = mysql_query("SELECT * from user_profiles where userID = '$userID'") or die(mysql_error());
while ($user_profiles = mysql_fetch_assoc($sql)) {
$sql = mysql_query("SELECT *,DATE_FORMAT(lastseen,'%d-%m-%Y kl. %H:%s') AS lastseen from user_login_informations where userID = '$userID'") or die(mysql_error());
while ($user_login_informations = mysql_fetch_assoc($sql)) {
function age( $day, $month, $year ) {
$days = date("d") - $day ;
$months = ( date("m") - $month ) * 30 ;
$years = ( date("Y") - $year ) * 365 ;
$total = ( $days + $months + $years ) / 365 ;
return floor( $total ) ;
}
$age = age($user_profiles[birthday_day],$user_profiles[birthday_month],$user_profiles[birthday_year]) ;
echo "<table width='600' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td height='19' colspan='4' background='images/themes/standard/boxes/corner_center_top.gif'> </td>
</tr>
<tr>
<td width='2' rowspan='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
<td width='447' valign='top'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td height='10' colspan='5'></td>
</tr>
<tr>
<td width='10'></td>
<td align='left' valign='top'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='125' class='header'>Status</td>
<td class='text'>$user_login_informations[login_status]</td>
</tr>
<tr>
<td class='header'>Brugernavn</td>
<td class='text'>$user_informations[username]</td>
</tr>
<tr>
<td class='header'>Humør</td>
<td class='text'><a href=''>$profile_humour[header]</a> - <a href=''><i>Rediger</i></a></td>
</tr>
<tr>
<td class='header'>Navn</td>
<td class='text'>$user_informations[firstname] $user_informations[lastname]</td>
</tr>
<tr>
<td class='header'>Alder</td>
<td class='text'>$age</td>
</tr>";
echo empty($user_informations['province']) ? '' : "
<tr>
<td class='header'>Landsdel</td>
<td class='text'>$user_informations[province]</td>
</tr>
";
echo empty($user_informations['city']) ? '' : "
<tr>
<td class='header'>Postnr./by</td>
<td class='text'>$user_informations[zip_code] $user_informations[city]</td>
</tr>
";
echo " <tr>
<td class='header'>Køn</td>
<td class='text'>$user_informations[sex]</td>
</tr>
<tr>
<td class='header'>Oprettet</td>
<td class='text'>$user_informations[account_createt]</td>
</tr>
<tr>
<td class='header'>Seneste login</td>
<td class='text'>HER HER HEER HER</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>";
echo "</td>
<td width='10'> </td>
<td width='150' height='120' align='center' valign='top'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='top'>";
echo empty($user_informations['profile_image_1']) ? "<img src='profiles/no_images.gif' width='130' height='100' id='headimage'>" : "
<img src='profiles/$userID/images/$user_informations[profile_image_1]' width='130' height='100' id='headimage'>
";
echo "</td>
</tr>
<tr>
<td height='10'></td>
</tr>
<tr>
<td align='center'>";
echo empty($user_informations['profile_image_2']) ? '' : "
<img src='profiles/$userID/images/$user_informations[profile_image_2]' width='40' height='35' onclick='chanceimage(this)'>
"; echo empty($user_informations['profile_image_3']) ? '' : "
<img src='profiles/$userID/images/$user_informations[profile_image_3]' width='40' height='35' onclick='chanceimage(this)'>
"; echo empty($user_informations['profile_image_4']) ? '' : "
<img src='profiles/$userID/images/$user_informations[profile_image_4]' width='40' height='35' onclick='chanceimage(this)'>
";
echo "</td>
</tr>
</table>";
echo "</td>
<td width='10'></td>
</tr>
<tr>
<td colspan='5' height='10'></td>
</tr>
</table>";
echo "</td>
<td width='149' align='right' valign='top'>";
echo "<table width='149' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td colspan='2' height='10'></td>
</tr>
<tr>
<td colspan='2' height='19' background='images/themes/standard/boxes/corner_user_profile_friends_top.gif'></td>
</tr>
<tr>
<td width='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
<td>";
echo "friends";
echo "</td>
</tr>
<tr>
<td colspan='2' height='14' background='images/themes/standard/boxes/corner_user_profile_friends_bottom.gif'></td>
</tr>
<tr>
<td height='10' colspan='2'></td>
</tr>
</table>";
echo "</td>
<td width='2' rowspan='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
</tr>
<tr>
<td colspan='2'> </td>
</tr>
<tr>
<td height='14' colspan='4' background='images/themes/standard/boxes/corner_center_middle.gif'></td>
</tr>
<tr>
<td width='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
<td colspan='2'>";
echo "profile informations";
echo "</td>
<td width='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
</tr>
<tr>
<td height='14' colspan='4' background='images/themes/standard/boxes/corner_center_middle.gif'></td>
</tr>
<tr>
<td width='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
<td colspan='2'>";
echo "<div style='width: 596px; height: 350px; overflow: auto;'></div>";
echo "</td>
<td width='2' background='images/themes/standard/boxes/corner_boxes_line.gif'></td>
</tr>
<tr>
<td colspan='4' height='14' background='images/themes/standard/boxes/corner_center_bottom.gif'></td>
</tr>
</table>";
}
}
}
}
?>
