Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
show number and date/time of last edits
Avatar
ovizii
Member
Free Members
sp_UserOfflineSmall Offline
Mar 8, 2012 - 9:01 am

the pre v5. themes where showing the number of times a post had been edited as well as the name of the user who did the editing and the date/time when it was last edited.

 

this is important in an older thread, where one would go end edit the first psot in a thread to update or correct so people looking at a long thread would immediately see that a psot was edited/by whom/when 

 

since I am currently trying to modify/customize the css-only theme (a copy of it that I renamed) I'd like to know what php code snippet I need to show that.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 8, 2012 - 9:29 am

IF a post has been edited then it should show up as a little pencil icon beside the post number. We used to get many complaints about showing the information within the post so moved it to a popup. Do you not see this?

andy-signature.png
YELLOW
SWORDFISH
Avatar
ovizii
Member
Free Members
sp_UserOfflineSmall Offline
Mar 8, 2012 - 3:14 pm

I found it. An way to get it back as it was? My users are asking for this feature 🙁 

I searched your code and couldn't find a function that outputs this info (the editing history) is there one?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 8, 2012 - 8:58 pm

in the topic view functions, the template tag is sp_PostIndexEditHistory()...  

so find that template tag call in the spTopicView.php template file...  and then replace it with your code to display the edit history...  $spThisPost->edits contains the data and you can look in the current template tag for how to handle the data...

Avatar
ovizii
Member
Free Members
sp_UserOfflineSmall Offline
Mar 9, 2012 - 1:52 am

can I ask you for more help? I suck at this 🙁 I can do some basic php editing meaning I can fiddle with wordpress plugins and themes but these SP themes look a bit different to me. 

 

original theme code snippet:

 

sp_SectionStart('tagClass=spPostContentSection', 'content');
sp_PostIndexContent('', __sp('Awaiting Moderation'));
sp_SectionEnd('', 'content');

 

say I wanted to output the text you see when you click the view edit history button straight before this line: sp_SectionEnd('', 'content'); what code would I need to insert there? I think it is an array, containing those edits, but I have no idea how to output its contents 🙁

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 9, 2012 - 4:47 am

You know something. Both Steve and I have been stupid here! I just checked the code - which I should have done when you first asked - only to find that I had already coded this to be displayed the old way if required!

Fine the call to sp_PostIndexEditHistory() in your topic template and add the argument '&popup=0'.

Of course you will need to move the position where that function is called to get it out of the post 'icon' section and into the 'content' section.

andy-signature.png
YELLOW
SWORDFISH
Avatar
ovizii
Member
Free Members
sp_UserOfflineSmall Offline
Mar 9, 2012 - 6:42 am

works perfectly, thank you very much!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 9, 2012 - 6:59 am

Great.
Off though. I was smart enough to code it that way and yet dumb enough to forget I had done it!

andy-signature.png
YELLOW
SWORDFISH
Avatar
ovizii
Member
Free Members
sp_UserOfflineSmall Offline
Mar 9, 2012 - 6:59 am

sorry, one last question: the current code:

 

sp_PostIndexEditHistory('tagClass=spButton spLeft&popup=0', '', __sp('<span class="edited">Edited by %USER% on %DATE% </span>'), __sp('View edit history'));

 

does show all edits. can I modify it to show only the last edit?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 9, 2012 - 9:30 am

:faceplant:

forgot myself we had allowed the option for not in popup...

I do not see a way to limit the info to the last edit...  looked at code this time wink

I know we used to do that, so we should probably support it now too...  but it should be doable without an explicit template tag argument...

problem for me now is I cannot get it to show (or save) more than the last edit...  so need to do some research...

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: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625