Osclass Support Forums
Osclass theme support => Ideas, improvements and tips => Topic started by: Dawid on March 20, 2018, 09:33:30 AM
-
Hi Friends :)
I have question or sugestion , Its possible to show last visit registered used ? ( Last visit user : 20.03.2018 / 9:21pm) in item.php ?
look to picture :
-
@Dawid
You have it in database, table t_user, column dt_access_date
-
Thanks im find this but how i can show this " dt_access_date " , whats function must use ? MB can Yoy help me ?
-
@Dawid
I would do it like this:
$user_data = User::newInstance()->findByPrimaryKey(osc_item_user_id());
echo $user['dt_access_date'];
-
Thanks very mutch but still can add this to me code :( wrrrr ... :o
// Show if user is online
function useronline_show_user_status() {
$itemUserId = osc_item_user_id();
$conn = getConnection();
$userOnline=$conn->osc_dbFetchResult("SELECT * FROM %st_useronline WHERE userid = '%s'",DB_TABLE_PREFIX, $itemUserId);
if($userOnline !=''){
if(osc_get_preference('useronline_set_text_image', 'useronline')=='image') { echo '<img src="'.osc_base_url().'oc-content/plugins/useronline/images/online.png" />' ; } else {
echo '<span style="color:#00CC00 !important; font-weight:bold">'.osc_get_preference('useronline_text', 'useronline').' </span><br><span style=" font-style: italic; font-size: 12px;"><i class="fa fa-info"></i> Aktywny teraz</span>'; }
} else {
if(osc_get_preference('useronline_set_text_image', 'useronline')=='image') { echo '<img src="'.osc_base_url().'oc-content/plugins/useronline/images/offline.png" />' ;
} else {
echo '<span style="color:#F00 !important; font-weight:bold">'.osc_get_preference('useroffline_text', 'useronline').' </span>'; i need add this "YOURS CODE IN THIS PLACES"
}
}
}
Can You help me modyfi ?
-
simply add it on that place
-
not working :( :o
-
echo $user['dt_access_date'];
should be
echo $user_data['dt_access_date'];
-
Perfect , Thank You very mutch :)