[MODDB] Smart Dates

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

[MODDB] Smart Dates

Post by igorw »

MOD Title: Smart Dates
MOD Description: This MOD will change the formating to "2 hours ago", "3 days ago", ect.
MOD Version: MODDB
phpBB Version: 2.0.22

MOD Download: Release topic

Demo:
General Config:
Image

Edit profile:
Image

Viewing Post:
Image

Index:
Image
Last edited by igorw on Mon Feb 05, 2007 8:29 pm, edited 7 times in total.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken »

Very nice !!!
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here
kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

Nice mod! It would be great if the mod automatically was able to figure out the amount of minutes/days/months ago instead of having them preset.
My MODs

Need a coder?

Enjoy my Mods? - Image
User avatar
Elias
Registered User
Posts: 5114
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Post by Elias »

Nice MOD.
Great job.
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|
Offering private web hosting. Contact me for details.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Thanks guys!
kkroo wrote: Nice mod! It would be great if the mod automatically was able to figure out the amount of minutes/days/months ago instead of having them preset.


Give me an example...
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo »

here is an example code is just wrote:

Code: Select all

<?php

// set default which is seconds
$time_ago = 5023;
$unit = 'secs';

// min
if ( ( $time_ago/60) > 1 )
{
	$time_ago = $time_ago/60;
	$unit = 'min';
}
  
// hours
if ( ( $time_ago/60) > 1 && $unit !== 'secs')
{
	$time_ago = $time_ago/60;
	$unit = 'hours';
}

// days
if ( ( $time_ago/24) > 1 && $unit !== 'secs' && $unit !== 'min' )
{
	$time_ago = $time_ago/24;
	$unit = 'days';
}

//
// follow example for weeks, months, and years
//

// remove decimals or round, your choice
$time_ago = sprintf("%d",$time_ago);

// output: 1 hours
echo $time_ago . ' ' . $unit;
?>
My MODs

Need a coder?

Enjoy my Mods? - Image
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

you forgot :

Code: Select all

$lang['Seconds'] = 'Seconds';
$lang['Minutes'] = 'Minutes';
$lang['Hours'] = 'Hours';
in lang_main.php

and i cannot set in edit profile if i want to use smart dates...
Peter77sx
Registered User
Posts: 3259
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx »

Do you plan on taking this out of BETA?
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Mickroz, you are correct - it will be added. Thank you :)

Peter77sx: What do you mean excactly? Submitting it to the MODDB?
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Post by Noobarmy »

i think he means are you actually still bothering with it :P
Image
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

eviL<3 wrote: Mickroz, you are correct - it will be added. Thank you :)


the language,or that you can set it to show smart dates in editing your profile?
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Noobarmy - as it seems yes :D
Mickroz: Sorry, i don't quite understand what you mean...
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

im not getting this in edit profile
Image

only when i log in the ACP and edit a user i see this.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Did you enable it in the admin config? Did you do the changes to includes/usercp_register.php and templates/subSilver/profile_add_body.tpl?

Check those ;)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
Mickroz
Registered User
Posts: 661
Joined: Thu Mar 06, 2003 11:20 pm
Location: Netherlands
Contact:

Post by Mickroz »

its enabled,i did the changes and checked them,couldn't find anything wrong there,i will check them again just to make sure.
Locked

Return to “[2.0.x] MODs in Development”