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
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 7, 2011 - 5:19 pm

Great stuff Andy well done, now if I were to actually want the actual time of the most recent post to be displayed, how would I go about that? :ducks:

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

Grrrrrr! I'd give you the answer if I could as I figured it out. But my dev server with the code is unplugged until further notice. (still painting)

It is a argument though.

Aren't I helpful? [Image Can Not Be Found]

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

You set the 'nicedate' parameter to false and set the 'date' and the 'time' parameters to true (if you wanted them both).

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 7:31 am

Er forgive my ignorance and some of my time, where might I find these functions and their arguments?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 8, 2011 - 8:11 am

In the Group View the 'nicedate' option is used in the function: sp_ForumIndexLastPost()

In the Forum View in the functions: sp_TopicIndexFirstPost() and sp_TopicIndexLastPost()

In the Topic View in the function: sp_PostIndexUserDate()

And in the List View in the function: sp_ListLastPost()

All of these template functions can be found in the relevant view functions file in the /forum/content folder.

And of course all are called from the appropriate templates.

'nicedate' is set on as the default. Other options are 'date' and 'time'. So if you wanted to switch from nicedate to both date and time then you could use

...nicedate=0&date=1&time=1...

for example.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 8, 2011 - 11:03 am

For now I just changed the definitions in the array for each function, are you telling me there is an easy way of making a one click choice?

I have a lot to learn as you can tell, but thanks for the advice I have the date and time displayed as I required.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 8, 2011 - 11:51 am

You should never change the function code. You change the parameters in the template call to the function. Parameters are done the say way that Wp does them in their template tags.

The available parameters are listed at the top of each function (these will be documented) and any you want to change from the default you pass in the template where it is called. each parameter requires an ampersand between them. I gave you the string to use in that last post I made. If you look at the templates you will see how this is done.

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

OK I have reset all the arrays, however I am still confused [Image Can Not Be Found]

In the forum/content folder there is sp-group-view-functions.php where I can find the function sp_ForumIndexLastPost(). I know now that I should not meddle with the array below it but I can't seem to find the function call in the templates. I presume that you are referring to the theme templates so if you tell me which file calls the function sp_ForumIndexLastPost() I'll figure the rest out myself.

Thanks for the lessons by the way. On the plus side if I can figure this stuff out you should be encouraged !

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

Well the main template file names are consistent with the functions file. As in spGroupView.php. This matches and primarily uses the functions that are found in the sp-group-view-functions.php file. Same for 'Forum View' and 'Topic View'.

if you are still using the iForum theme though, that has a few extras... It also does not use ALL of the template functions as it is a more minimal and experimental theme.

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

My theme is based on the default theme. I have opened spGroupView.php and I found the sp_ForumIndexLastPost , I did actually look there before asking earlier but had left the () on the end of my search string and my text search didn't find it - doh! That's how much of a newbie I am.

Could you just tell me by demonstration how I should modify the following code:

sp_ForumIndexLastPost('tagClass=spInRowPostLink',__sp('Last Post'));

Many thanks

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