Hast du das mit dem letzten geschriebenen Beitrag auch schon?
Ich habe das gerade anhand
dieser Anleitung gemacht. Natürlich auch gleich so dass Today/Yesturday auf die Uhrzeit und allow_view_online mit einwirken
Hab das so gemacht. Allerdings habe ich das in die usercp_viewprofile.php eingebaut.
Code: Alles auswählen
//Begin Last Post in Profile
$sql = 'SELECT p.post_id, p.topic_id, p.post_time, t.topic_title FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
WHERE p.topic_id = t.topic_id AND p.poster_id=' . $profiledata['user_id'] . ' ORDER BY p.post_time DESC LIMIT 0,1';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain users post information.", '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$currentpost = $row['topic_title'];
$currentpostid=$row['post_id'];
$currenttopicid=$row['topic_id'];
// $currentposttime = $row['post_time'];
$currentposttime = ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $profiledata['user_allow_viewonline'])) ? (($row['post_time'])? create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'];
if ( $board_config['time_today'] < $row['post_time'])
{
$currentposttime = ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $profiledata['user_allow_viewonline'])) ? (($row['post_time'])? sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $row['post_time'], $board_config['board_timezone'])):$lang['Never_last_logon']):$lang['Hidde_last_logon'];
}
else if ( $board_config['time_yesterday'] < $row['post_time'])
{
$currentposttime = ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $profiledata['user_allow_viewonline'])) ? (($row['post_time'])? sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $row['post_time'], $board_config['board_timezone'])):$lang['Never_last_logon']):$lang['Hidde_last_logon'];
}
}
$db->sql_freeresult($result);
//Ende Last Post in Profile
Gefällt mir so gut das ich es bei mir auch gleich eingebaut habe.