Hi,
I'm trying to add some info between the user info and contact links in posts in viewtopic.php
This is the code I added and for some reason it stops me from being able to see anyone elses posts except for the first one. I'm still new to PHP and editing stuff and such so I could be doing things in a completely bizarre way. So my question is why is this doing what it is doing?
<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
$sqlkb = "SELECT * FROM `Player` WHERE (PlayerName = '".$cur_post['username']."')";
$resultkb = mysql_query($sqlkb);
$PlayerStats = mysql_fetch_row($resultkb);
$sqlkb = "SELECT * FROM `Involved` WHERE (PlayerID = '".$PlayerStats[0]."')";
$resultkb = mysql_query($sqlkb);
$TotalKills = mysql_num_rows($resultkb);
$sqlkb = "SELECT * FROM `Kill` WHERE (PlayerID = '".$PlayerStats[0]."')";
$resultkb = mysql_query($sqlkb);
$TotalLosses = mysql_num_rows($resultkb);
$sqlkb = "SELECT * FROM `Corp` WHERE (CorpID = '".$PlayerStats[5]."')";
$resultkb = mysql_query($sqlkb);
$Corp = mysql_fetch_row($resultkb);
if($PlayerStats[0] == NULL) {
} else {
echo '<dd>';
echo '<dd> </dd>';
echo 'Corp: <a href="http://mysite.com/?mode=corp&id='.$PlayerStats[5].'&view=1&kn=0">'.$Corp[1].'</a><br />';
echo 'Points: '.$PlayerStats[4].'<br />';
echo 'Kills: <a href="http://mysite.com/?mode=player&id='.$PlayerStats[0].'&kn=0&view=1">'.$TotalKills.'</a><br />';
echo 'Losses: <a href="http://mysite.com/?mode=player&id='.$PlayerStats[0].'&kn=0&view=2">'.$TotalLosses.'</a>';
echo '<dd> </dd>';
echo '</dd>';
}
} else {
}
<?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode(' ', $user_contacts).'</dd>'."\n"; ?>
The original code looks like:
<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
<?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode(' ', $user_contacts).'</dd>'."\n"; ?>
Many thanks for any help.