Osclass Support Forums

Osclass theme support => Ideas, improvements and tips => Topic started by: Dawid on March 20, 2018, 09:33:30 AM

Title: LAST VISIT USER - Plugin
Post 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 :
 
Title: Re: LAST VISIT USER - Plugin
Post by: MB Themes on March 20, 2018, 10:01:29 AM
@Dawid
You have it in database, table t_user, column dt_access_date
Title: Re: LAST VISIT USER - Plugin
Post by: Dawid on March 20, 2018, 10:05:17 AM
Thanks im find this but how i can show this " dt_access_date " , whats function must use ? MB can Yoy help me ?
Title: Re: LAST VISIT USER - Plugin
Post by: MB Themes on March 20, 2018, 10:48:37 AM
@Dawid
I would do it like this:
Code: [Select]
$user_data = User::newInstance()->findByPrimaryKey(osc_item_user_id());
echo $user['dt_access_date'];
Title: Re: LAST VISIT USER - Plugin
Post by: Dawid on March 20, 2018, 11:07:19 AM
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').'&nbsp;</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').'&nbsp;</span>'; i need add this "YOURS CODE IN THIS PLACES"
      }

      }
   }


Can You help me modyfi ?
Title: Re: LAST VISIT USER - Plugin
Post by: MB Themes on March 20, 2018, 11:12:10 AM
simply add it on that place
Title: Re: LAST VISIT USER - Plugin
Post by: Dawid on March 20, 2018, 11:19:48 AM
not working :(  :o
Title: Re: LAST VISIT USER - Plugin
Post by: MB Themes on March 20, 2018, 03:26:16 PM
echo $user['dt_access_date'];

should be

echo $user_data['dt_access_date'];
Title: Re: LAST VISIT USER - Plugin
Post by: Dawid on March 20, 2018, 10:58:03 PM
Perfect , Thank You very mutch :)