Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Time in Recent Post Widget
Avatar
Hari
Member
Free Members
sp_UserOfflineSmall Offline
Dec 11, 2015 - 5:06 am

Sorry for a bunch of small questions today. But today is "rollout" day for the new forum and my members generate a lot of questions I cant answer. This will fade in the coming days. 🙂

Is there an easy way in the Recent Post Widget to not only display the date, but also the time of the post shown?

This is something missed from the old mingle recent post list.

Maybe I can add some html code in the date-field of the widget to add the time?

Any idea?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 11, 2015 - 5:29 am

The only way would be to change the php code in the source tag. If you want to go ahead and do that I can tell you where to go...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Hari
Member
Free Members
sp_UserOfflineSmall Offline
Dec 11, 2015 - 5:52 am

Yes pls tell me. If its not to complicated I might make an exception.

Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 11, 2015 - 6:26 am

The code file is in the forum-plugins folder /template-tags/library/sp-RecentPosts-tag.php

The date section is commented. The function:

sp_date('d', $spThisListTopic->post_date)

is also used to display the time by simply changing the 'd' to a 't' - so you can repeat the call on that line of code. Something along the lines of:

$out.= "<span class='$textClass'>".$beforeDate.sp_date('d', $spThisListTopic->post_date)." - ".sp_date('t', $spThisListTopic->post_date)."$afterDate</span>
";

for example

andy-signature.png
YELLOW
SWORDFISH
Avatar
Hari
Member
Free Members
sp_UserOfflineSmall Offline
Dec 11, 2015 - 6:37 am

Thanks! Will try.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Dec 11, 2015 - 9:29 am

Let us know how you get on..

Avatar
Hari
Member
Free Members
sp_UserOfflineSmall Offline
Jan 8, 2016 - 5:24 pm

Happy new year!

Found the time to try and works! Thanks, this was one of the issues, many of my readers where complaining about, because the navigation is mostly done via the sidebar of "recent posts".

What is the easiest way to automate the change, so that I dont need to do it with every update? Do I need a child theme anyhow or is there a simpler, quicker way to permanently incorporate this?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 8, 2016 - 5:37 pm

I have no advice on automating code changes to core files I am afraid. As we always say to people - changes like that are really up to you - there really isn't anything we can do to help with that.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Hari
Member
Free Members
sp_UserOfflineSmall Offline
Jan 8, 2016 - 5:39 pm

One additional question I became aware of after the change.

I have set the limit to 30 "items" in the widget.

But shown are only 17 topics with new posts within the timespan of two days.

Question:

What does the number of items count. The topics or the posts? If posts I could understand the 17, if 30 posts are part of only 17 topics.

Or is there an inherent timecount, that cuts anything beyond 24 hours?

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 8, 2016 - 8:03 pm

No, there is no time limit applied to the recent posts tag...

not sure what you mean by 'items'?  assume you mean the 'limit' option in the widget?  would probably be useful to see a screenshot of your widget options...

it should be posts not topics that gets limited...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620