SimplePortal

Customization => Custom Coding => Topic started by: Snoopix on January 05, 2014, 03:32:17 PM

Title: change time format on portal articles
Post by: Snoopix on January 05, 2014, 03:32:17 PM
Hi guys, i want change time format on portal articles,

Code: [Select]
<div class="middletext">', $article['message']['time'], ' ', $txt['by'], ' ', $article['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $article['topic']['views'], ' | ', $txt['sp-articlesComments'], ': ', $article['topic']['replies'], '</div>';
but i don't know how do it, i want change only this time format not default time format (all forum).

ps. sorry my english is bad : 3
Title: Re: change time format on portal articles
Post by: [SiNaN] on January 06, 2014, 01:05:32 PM
Sources/PortalArticles.php

Code: (Find) [Select]
'time' => timeformat($row['poster_time']),
Code: (Replace) [Select]
'time' => timeformat($row['poster_time'], '%d %m %Y'),
Change '%d %m %Y' as the desired time format. You can use the same style that you use in SMF admin settings.
Title: Re: change time format on portal articles
Post by: Snoopix on January 06, 2014, 06:05:46 PM
hi

for change recent topics block's time format need change time format on function ssi_recentTopics (ssi.php)?

thx a lot

Title: Re: change time format on portal articles
Post by: ccbtimewiz on January 06, 2014, 08:06:16 PM
hi

for change recent topics block's time format need change time format on function ssi_recentTopics (ssi.php)?

thx a lot



Yes, since the sp_recent function in the PortalBlocks.php file uses SSI.

Alternatively you could just rewrite all the queries and place them in this function.
Title: Re: change time format on portal articles
Post by: [SiNaN] on January 07, 2014, 05:50:59 AM
You can do this instead:

Sources/PortalBlocks.php

Code: (Find) [Select]
if ($display == 'compact')
Code: (Replace) [Select]
foreach ($items as $key => $item)
$items[$key]['time'] = timeformat($item['timestamp'], '%d %m %Y', 'none');

if ($display == 'compact')

Again change '%d %m %Y' as the desired time format.
SimplePortal 2.3.8 © 2008-2024, SimplePortal