<< Home

Change Last Visit Date?

Use this forum for issues related to TriniTronic's Nice User Info plugin.

Moderator: jamesSBT

Change Last Visit Date?

Postby bmtoth » Sat Apr 23, 2011 7:26 am

Is there a way to change the way the last visit date is "presented"?

For instance, right now it looks something like this:
2011-04-23 13:44:24

Can it be changed to present the date like this:
April 4, 2011 at 1:44pm

If so, how?

Thanks!
bmtoth
Lithos
Lithos
 
Posts: 2
Joined: Sat Apr 23, 2011 7:23 am

Re: Change Last Visit Date?

Postby Michael » Sat Apr 23, 2011 12:02 pm

Hi,

There is no way to change the date formate through the interface at this time. However, it is a fairly straight forward change programatically. Make sure you have a backup copy of the script (like your original download package). Then do the following:

1. FTP into your site.
2. retrieve the following file and download it to your local machine:

For Joomla 1.5 retrieve: your_joomla_directory/plugins/system/niceuserinfo.php

For Joomla 1.6 retrieve: your_joomla_directory/plugins/system/niceuserinfo/niceuserinfo.php

3. Find the lines of code that look like the code below, they should be around line 126.

Code: Select all
            case 'registerdate':
                  $ui = $this->u->registerDate ? $this->u->registerDate : $this->guestregisterdate;
               break;
            case 'lastvisitdate':
                  $ui = $this->u->lastvisitDate ? $this->u->lastvisitDate : $this->guestlastvisitdate;
               break;


4. Change the lines of code to the following:

Code: Select all
            case 'registerdate':
                  $ui = $this->u->registerDate ? date("F j, Y", strtotime($this->u->registerDate)) : $this->guestregisterdate;
               break;
            case 'lastvisitdate':
                  $ui = $this->u->lastvisitDate ? date("F j, Y", strtotime($this->u->lastvisitDate)) : $this->guestlastvisitdate;
               break;


5. Save your changes and upload the altered script to the same location you downloaded it from.

That should be all there is to it. Notice the bit of code that looks like this "F j, Y". This bit of code controls the date format pattern. You can alter and change the date format pattern. To learn more about date format patterns in PHP visit this link http://php.net/manual/en/function.date.php.

~ Best regards
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2480
Joined: Thu Aug 14, 2008 12:30 am

Re: Change Last Visit Date?

Postby bmtoth » Sat Apr 23, 2011 1:28 pm

Thanks so much for the quick response and step-by-step directions.

It worked perfectly!

Thanks again! :D
bmtoth
Lithos
Lithos
 
Posts: 2
Joined: Sat Apr 23, 2011 7:23 am

Re: Change Last Visit Date?

Postby Michael » Sat Apr 23, 2011 2:11 pm

Super great! I am happy that it was successful for you.

~ Best
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2480
Joined: Thu Aug 14, 2008 12:30 am


Return to Joomla: Nice User Info

Who is online

Users browsing this forum: No registered users and 0 guests