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
Post time display
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 8, 2011 - 3:40 pm

To turn off the nicedate default and turn on date and time you would use these parameters. These are the same as I posted above:

sp_ForumIndexLastPost('tagClass=spInRowPostLink&nicedate=0&date=1&time=1',__sp('Last Post'));

In other words, include any that you want to change the default for.

This is also fairly standard now among WP template tags - this is how theirs work as well.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 4:08 pm

Great that works and I understand how to do it, just a bit of formatting to sort out now. Old site looks like this

Aug 8, 2011

17.30 pm

by name

Hopefully I should be able to sort that out..........[Image Can Not Be Found]

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 8, 2011 - 4:24 pm

date and time formatting are determined on the forum admin > Options > Content settings

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 4:33 pm

Yes got that but how do I get the time on a new line, it's all too cluttered.

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 4:58 pm

Actually....   while on the topic. What's the odds of additional argument to omit the BR tag between date and time?

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 6:00 pm

This is how my current V4.4.5 active forum handles time, it looks good.

 

Image Enlarger

 

This is the new forum which admittedly has a bigger font but I think that it would be fine if it had similar formatting.

Image Enlarger

 

Lee (because I am reluctant to ask these very busy people anything else) what would be the best way of having August 8th, 2011 and then 5:58pm on a new line?

Like this.

First Post:

Bra1n

August 8, 2011

5:58 pm

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 6:56 pm

Conrad I wish I had my server back up. I can't play with the code at all right now 🙁

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 9:41 pm

I took a peek. Seems like you showed a pic of your forum view.

In spForumView.php (template) you make a call to sp_TopicIndexFirstPost() to show first poster and details. If you give args for the date and time, the date and time are written as one line. There's no args or filters to change that. You "could" write a filter and do a preg_replace() of the span containing the date and time and convert the '-' minus or hypen to a linebreak (br) to make it two lines.

OR you could copy the sp_TopicIndexFirstPost() and custom name it, and modify the code to suite your needs.

OR you can sweet talk Andy or Steve into making that hypen whatever you want with another arg added to the core.

You would also need to do the same thing for sp_TopicIndexFirstPost()

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 10:46 pm

@Conrad

I was having a little fun. Paste:

function stack_date_time($out){
    return preg_replace("/(<span.*[0-9])-([0-9].*<\/span>)/", "$1<br />$2", $out);
}


add_filter('sph_TopicIndexFirstPost', 'stack_date_time');
add_filter('sph_TopicIndexLastPost', 'stack_date_time');

in your themes spFunctions.php

Basically its a "plugin" that will take that date/time one liner and replace the hyphen with a linebreak. I'm pretty sure it will fail (and do nothing) if you change your forums time/date format in the admin backend.

This works for "Forum View" as you pictured.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 9, 2011 - 2:09 am

Sorry guys - got caught up on other issues last night and I am working alone this week.
I have opened a ticket on this and will add a parameter to all date displays - 'stack' - which will do what you both want...

andy-signature.png
YELLOW
SWORDFISH
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: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625