Weder die SuFu noch Allzwecklexikon Google wussten weiter. Ich möchte ein bestimmtes Feld auslesen, und zwar den Minecraftnicknamen. Dieses Feld wird bei der Registrierung mit dem Usernamen gefüttert, welcher dann eine Statistik abruft. Aber seht selbst:
viewtopci_body.html:
Code: Alles auswählen
<!-- BEGIN custom_fields -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- END custom_fields -->
<!-- PHP -->
$user->get_profile_fields($user->data['user_id']);
$mcnick = $user->profile_fields['pf_minecraftnick'];
$link = mysql_connect('localhost', 'root', 'root');
$sql = "SELECT * FROM `gs_mc`.`lb-players` WHERE `playername` = '$mcnick';";
$mc_time = mysql_query($sql, $link);
while($row = mysql_fetch_object($mc_time))
{
$mc_online = $row->onlinetime;
$mc_login = $row->lastlogin;
$mc_online = (int)$mc_online;
$mc_online = $mc_online / 60;
echo "<dd><strong>Onlinezeit:</strong> " .$mc_online. " Minuten</dd>";
echo "<dd><strong>Letzer Serverlogin:</strong> " .$mc_login. "</dd>";
}
<!-- ENDPHP -->
Vielen Dank,
monumentum