3.1 & 3.2 Extensions Database 3.1 / 3.2Topic Age Day

<span class="qte-attr qte_31_32-qte">3.1.x &amp; 3.2.x</span>
User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Topic Age Day

Post by dmzx »

Extension Name: Topic Age Day
Author: dmzx

Extension Description:

phpBB extension that will display topic age day in viewforum.

dmzx/topicageday


Validation version


Added $user->lang method

Screenshot:
Image

Extension Download:
Download-link
Topic Age Day v1.0.2
Installation:
  1. Download the latest release.
  2. Unzip the downloaded release, and change the name of the folder to `topicageday`.
  3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist).
  4. Copy the `topicageday` folder to `/ext/dmzx/` if done correctly, you'll have the main extension class at
    (your forum root)/ext/dmzx/topicageday/composer.json
  5. Navigate in the ACP to `Customise -> Manage extensions`
  6. Look for `Topic Age Day` under the Disabled Extensions list, and click its `Enable` link.

User avatar

Jaantje
Users
Users
Posts: 356
Joined: 02 Nov 2014, 21:25
    Windows 8.1 Chrome

Re: Topic Age Day

Post by Jaantje »

Thanx, works :tumbsyes:
Grreeetttttzzzzz, Jaantje

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: Topic Age Day

Post by dmzx »

Download updated

User avatar

Jaantje
Users
Users
Posts: 356
Joined: 02 Nov 2014, 21:25
    Windows 8.1 Chrome

Re: Topic Age Day

Post by Jaantje »

Have made the update :tumbsyes:


Taka51
Users
Users
Posts: 30
Joined: 08 Jun 2015, 13:27
    Windows Vista Firefox

Re: Topic Age Day

Post by Taka51 »

Hello
Here is the French translation for this extension
Best regards
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
WebDvdBdR - Page d’index

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: Topic Age Day

Post by dmzx »

Taka51 wrote:hello
Here is the French translation for this extension
Best regards
:thumbup:


Taka51
Users
Users
Posts: 30
Joined: 08 Jun 2015, 13:27
    Windows Vista Firefox

Re: Topic Age Day

Post by Taka51 »

Hello

For those where the one used in French for this extension, here's how to have her in our language is correct and well spell

Ouvrir dmzx/topicageday/styles/prosilver/template/event/topiclist_row_append.html
Find This may be a partial find and not the whole line

Code: Select all

<!-- IF topicrow.TOPIC_AGE_DAYS > 0 --><span class="topicageday">{L_TOPICAGEDAYPOSTED} {topicrow.TOPIC_AGE_DAYS} <!-- IF topicrow.TOPIC_AGE_DAYS > 1 -->{L_TOPICAGEDAYS}<!-- ELSE -->{L_TOPICAGEDAY}<!-- ENDIF --> {L_TOPICAGEAGO}</span><!-- ENDIF -->
Replace with Replace the preceding lines with the following

Code: Select all

<!-- IF topicrow.TOPIC_AGE_DAYS > 0 --><span class="topicageday">{L_TOPICAGEDAYPOSTED} {L_TOPICAGEAGO} {topicrow.TOPIC_AGE_DAYS} <!-- IF topicrow.TOPIC_AGE_DAYS > 1 -->{L_TOPICAGEDAYS}<!-- ELSE -->{L_TOPICAGEDAY}<!-- ENDIF --></span><!-- ENDIF -->
enjoy

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Topic Age Day

Post by dmzx »

First post updated

User avatar

nelflucifer
Users
Users
Posts: 70
Joined: 03 Jan 2016, 12:24
    Windows 7 Opera

Re: Topic Age Day

Post by nelflucifer »

Super! The translation will be later (if needed...)
Image
Learn to read people's thoughts, not forgetting about their.
The extension translate from English to Russian...
English Forums
Available 251 extension with translation into Russian language...

User avatar

Darkside2016
Users
Users
Posts: 17
Joined: 24 Mar 2016, 20:48
    Windows 10 Firefox

Re: Topic Age Day

Post by Darkside2016 »

What i have to change that it will be shown as in the picture above ?

Like : Topic title topicage
in new line who has startet the thread

thx for help

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Topic Age Day

Post by dmzx »

Darkside2016 wrote: 18 May 2016, 23:08 What i have to change that it will be shown as in the picture above ?

Like : Topic title topicage
in new line who has startet the thread

thx for help
I changed the event location <!-- EVENT topiclist_row_append -->

Open viewforum_body.html
Find This may be a partial find and not the whole line

Code: Select all

<!-- EVENT topiclist_row_append -->
Delete it there.


Find This may be a partial find and not the whole line

Code: Select all

<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
Replace with Replace the preceding lines with the following

Code: Select all

<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- EVENT topiclist_row_append -->

Keep in mind that other extension that use the same event will also display there :wink:

grtz

User avatar

clight77
Donator
Donator
Posts: 502
Joined: 24 Sep 2015, 16:23
    Windows 10 Chrome

Re: Topic Age Day

Post by clight77 »

Changed mine a little bit :)
2016-07-22_062342.png
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.

User avatar

ZippeL
Users
Users
Posts: 20
Joined: 20 Aug 2016, 06:37
    Windows 10 Firefox

Re: Topic Age Day

Post by ZippeL »

Thans for nice hack.

I want make dynamic date but can't fully do it. So I make some as posts' experience.
This changes maked for rus lang, but I think that you can adaptive it for yourself :eyes2:

Some global function from tvdev engine

Code: Select all

function getWord($number, $suffix) {
	$keys = array(2, 0, 1, 1, 1, 2);
	$mod = $number % 100;
	$suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)];
	return $suffix[$suffix_key];
}

function get_elapsed_time_plural($time_start) {
	$divider['years']   = (60 * 60 * 24 * 365);
	$divider['months']  = (60 * 60 * 24 * 365 / 12);
	$divider['weeks']   = (60 * 60 * 24 * 7);
	$divider['days']    = (60 * 60 * 24);
	$divider['hours']   = (60 * 60);
	$divider['minutes'] = (60);

	$langs['years']		= array("год", "года", "лет");
	$langs['months']	= array("месяц", "месяца", "месяцев");
	$langs['weeks']		= array("неделя", "недели", "недель");
	$langs['days']		= array("день", "дня", "дней");
	$langs['hours']		= array("час", "часа", "часов");
	$langs['minutes']	= array("минуту", "минуты", "минут");

	foreach ($divider as $unit => $div) {
		${'elapsed_time_'.$unit} = floor(((time() - $time_start) / $div));
		if (${'elapsed_time_'.$unit} >= 1)
			break;
	}
	$elapsed_time = ${'elapsed_time_'.$unit} . ' ' . getWord(${'elapsed_time_'.$unit}, $langs[$unit]);

	return $elapsed_time;
}
Then in listener replace for this

Code: Select all

//$topic_row ['TOPIC_AGE_DAYS'] = $this->user->lang('TOPICAGEDAYPOSTED', round((time() - $row['topic_time']) / 86400));
$topic_row ['TOPIC_AGE_DAYS'] = $this->user->lang( 'TOPICAGEDAYPOSTED', get_elapsed_time_plural( $row[ 'topic_time' ] ) );
In common you must comment array and add this string

Code: Select all

'TOPICAGEDAYPOSTED' => 'стаж темы: %1$s',
And you can see something that
Image

Bonus for you ;) :dance:

Code: Select all

span.topicageday {
padding-left: 2px;
vertical-align: super;
color: #4C5D77;
font-size: 10px;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
}

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Android Chrome

Re: Topic Age Day

Post by dmzx »

ZippeL wrote: 20 Aug 2016, 06:48 Thans for nice hack.

I want make dynamic date but can't fully do it. So I make some as posts' experience.
This changes maked for rus lang, but I think that you can adaptive it for yourself :eyes2:

Some global function from tvdev engine

Code: Select all

function getWord($number, $suffix) {
	$keys = array(2, 0, 1, 1, 1, 2);
	$mod = $number % 100;
	$suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)];
	return $suffix[$suffix_key];
}

function get_elapsed_time_plural($time_start) {
	$divider['years']   = (60 * 60 * 24 * 365);
	$divider['months']  = (60 * 60 * 24 * 365 / 12);
	$divider['weeks']   = (60 * 60 * 24 * 7);
	$divider['days']    = (60 * 60 * 24);
	$divider['hours']   = (60 * 60);
	$divider['minutes'] = (60);

	$langs['years']		= array("год", "года", "лет");
	$langs['months']	= array("месяц", "месяца", "месяцев");
	$langs['weeks']		= array("неделя", "недели", "недель");
	$langs['days']		= array("день", "дня", "дней");
	$langs['hours']		= array("час", "часа", "часов");
	$langs['minutes']	= array("минуту", "минуты", "минут");

	foreach ($divider as $unit => $div) {
		${'elapsed_time_'.$unit} = floor(((time() - $time_start) / $div));
		if (${'elapsed_time_'.$unit} >= 1)
			break;
	}
	$elapsed_time = ${'elapsed_time_'.$unit} . ' ' . getWord(${'elapsed_time_'.$unit}, $langs[$unit]);

	return $elapsed_time;
}
Then in listener replace for this

Code: Select all

//$topic_row ['TOPIC_AGE_DAYS'] = $this->user->lang('TOPICAGEDAYPOSTED', round((time() - $row['topic_time']) / 86400));
$topic_row ['TOPIC_AGE_DAYS'] = $this->user->lang( 'TOPICAGEDAYPOSTED', get_elapsed_time_plural( $row[ 'topic_time' ] ) );
In common you must comment array and add this string

Code: Select all

'TOPICAGEDAYPOSTED' => 'стаж темы: %1$s',
And you can see something that
Image

Bonus for you ;) :dance:

Code: Select all

span.topicageday {
padding-left: 2px;
vertical-align: super;
color: #4C5D77;
font-size: 10px;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
}
Nice :thumbup: will check it out!

[ Post made via Samsung Galaxy S4 ] Image

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: Topic Age Day

Post by dmzx »

First post updated

Post Reply Previous topicNext topic