News:

Wondering if this will always be free?  See why free is better.

Main Menu

No 'last edit' for Administrators

Started by Durr, October 27, 2009, 10:11:51 AM

Previous topic - Next topic

SoLoGHoST

Ohhh, WoW, thanks Arantor, that's the Main problem than.  Will fix it up a little for you than.

SoLoGHoST


Kruss

Perfect! It works. Thanks a lot, to both SoLoGHoST and Arantor :)
One last question if you don't mind...

If I wanted to do this for the previous messages, can I just add the code you wrote on the Display.php as well?

Quote from: SoLoGHoST on October 27, 2009, 03:20:35 PM
Sorry, for the double post.

Doing it this way will prevent your previous posts from displaying last modified by Admin, but another way to do this for future posts, would be to do it in Subs-Post.php in the modifyPost() function.  Look here...
if (!empty($msgOptions['modify_time']))
{
$messages_columns['modified_time'] = $msgOptions['modify_time'];
$messages_columns['modified_name'] = $msgOptions['modify_name'];
$messages_columns['id_msg_modified'] = $modSettings['maxMsgID'];
}


You can check for $user_info['is_admin'] and if so, don't add them...

Cheers :)


SoLoGHoST

Hello, this will do it for all messages within the topic (limited by those on that particular topic page).  So you don't need it.  But are you talking about all edited posts?  Or just those edited by an Administrator??  The one you are using only does posts edited by an Administrator.

Kruss

Just all edited post by the Administrator actually. I know I can turn off the 'Last modification' option for everyone. The one you helped me with still shows the "Last Edit" for the previous messages.

MultiformeIngegno

SoLoGHoST: can you please post a "sum" of the edits to make with these recent fixes?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

SoLoGHoST

Quote from: Kruss on November 04, 2009, 12:45:55 PM
Just all edited post by the Administrator actually. I know I can turn off the 'Last modification' option for everyone. The one you helped me with still shows the "Last Edit" for the previous messages.

Ok, I don't know what you are talking about here.  The $messages_request array gets loaded with all posts within the topic from start to finish via limit of how many posts to display per page.  So you didn't do just one post here, you did them all!

Bro, I have to go, so I will catch up on this topic tomorrow.

Quote from: lorenzone92 on November 04, 2009, 02:03:40 PM
SoLoGHoST: can you please post a "sum" of the edits to make with these recent fixes?
I'll do this tomorrow if I have the time.  Although, I know Arantor knows what's going on, so if he beats me to it, Cheers ;)

Kruss

Quote from: SoLoGHoST on November 04, 2009, 02:36:55 PM
Quote from: Kruss on November 04, 2009, 12:45:55 PM
Just all edited post by the Administrator actually. I know I can turn off the 'Last modification' option for everyone. The one you helped me with still shows the "Last Edit" for the previous messages.

Ok, I don't know what you are talking about here.  The $messages_request array gets loaded with all posts within the topic from start to finish via limit of how many posts to display per page.  So you didn't do just one post here, you did them all!

Bro, I have to go, so I will catch up on this topic tomorrow.

No problem. I appreciate all the help. :)
Actually, ignore my post above. It was a mistake on my part. I forgot to re-upload the Display.template.php so the "Last Modified" was still showing up.

All is well now. Thanks a lot again!


MultiformeIngegno

Quote from: SoLoGHoST on November 04, 2009, 02:36:55 PM
Quote from: lorenzone92 on November 04, 2009, 02:03:40 PM
SoLoGHoST: can you please post a "sum" of the edits to make with these recent fixes?
I'll do this tomorrow if I have the time.  Although, I know Arantor knows what's going on, so if he beats me to it, Cheers ;)
Thanks!!! :D
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Arantor

Quote from: lorenzone92 on November 04, 2009, 02:03:40 PM
I'll do this tomorrow if I have the time.  Although, I know Arantor knows what's going on, so if he beats me to it, Cheers ;)

Sorry, I'm not in a position to do this at the moment.

SoLoGHoST

Ok, Arantor.  Strange choice of words there (position?).  Well, I'll be doing it tomorrow than.  All of the edits are already in this topic, you just need to get the right ones.

SoLoGHoST

Ok, For SMF 2.0.x Durr has shown us his edits within this topic in THIS POST.  However, to accomplish this for SMF 1.1.10, you'll need to do the following EDITS.

Open ./Sources/Display.php

FIND:$messages_request = db_query("
SELECT
ID_MSG, icon, subject, posterTime, posterIP, ID_MEMBER, modifiedTime, modifiedName, body,
smileysEnabled, posterName, posterEmail,
ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead
FROM {$db_prefix}messages
WHERE ID_MSG IN (" . implode(',', $messages) . ")
ORDER BY ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);


REPLACE WITH:$messages_request = db_query("
SELECT
msgs.ID_MSG, msgs.icon, msgs.subject, msgs.posterTime, msgs.posterIP, msgs.ID_MEMBER, msgs.modifiedTime, msgs.modifiedName, msgs.body,
msgs.smileysEnabled, msgs.posterName, msgs.posterEmail,
msgs.ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead, mmbrs.ID_GROUP AS modifiedGroup
FROM {$db_prefix}messages AS msgs
LEFT JOIN {$db_prefix}members AS mmbrs ON (mmbrs.realName = msgs.modifiedName)
WHERE msgs.ID_MSG IN (" . implode(',', $messages) . ")
ORDER BY msgs.ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);


FIND:'name' => $message['modifiedName']

ADD AFTER:,
'group' => $message['modifiedGroup']


OPEN ./Themes/default/Display.template.php

FIND:if ($settings['show_modify'] && !empty($message['modified']['name'])

ADD AFTER: && $message['modified']['group'] != 1

There ya go all done.  So will now work for SMF 1.1.x.

Cheers :)

SN

this should be a Mod, its a very useful edit

SoLoGHoST

You are free to use the code if you'd like.  We all pretty much contributed to it here.  So, maybe just give us a little credit or something is all, if you use it.  Honestly, this is too small of a mod and too easy for me to care to make it a mod.  So, like I said, feel free to make it a mod if you'd like.  You don't have to mention anything about me, but perhaps the other members who contributed to it may want a word or 2 stating that they helped with this mods creation.

In any case,
Good Luck :)

Advertisement: