Advertisement:

Author Topic: Have the same Message Icon for replies as that of the starting post  (Read 1104 times)

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 29
Hi everyone!

I have a bit of a dilemma and I would be very happy if someone would be willing shed some light on this subject. For SMF 2.0.11.

When someone posts a new topic they have the option to select a message icon from a dropdown menu. (For example, I have now chosen the question mark icon).
However, every time someone posts a reply, they have to select the icon all over again. The icon chosen by the OP for the thread isn't automatically selected for replies.

I find this a bit strange, so I would like to make the modification that the message icon from the starting post is automatically selected when you are replying.
(Alternatively, not being able to change it at all and just use the same icon automatically for replies would also be fine).

Could someone please tell me how I would achieve this adjustment or point me in the right direction?  Thank you very much for your support! :)
« Last Edit: December 28, 2015, 02:47:44 PM by jack_1985 »

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Have the same Message Icon for replies as that of the starting post
« Reply #1 on: December 28, 2015, 06:13:27 PM »
In concept it's more or less easy ;)

Sources/Post.php, find:
Code: [Select]
CASE WHEN ml.poster_time > ml.modified_time THEN ml.poster_time ELSE ml.modified_time END AS last_post_timeReplace with:
Code: [Select]
CASE WHEN ml.poster_time > ml.modified_time THEN ml.poster_time ELSE ml.modified_time END AS last_post_time, mf.icon
Find:
Code: [Select]
list ($locked, $context['notify'], $sticky, $pollID, $context['topic_last_message'], $id_member_poster, $id_first_msg, $first_subject, $lastPostTime) = $smcFunc['db_fetch_row']($request);Replace with:
Code: [Select]
list ($locked, $context['notify'], $sticky, $pollID, $context['topic_last_message'], $id_member_poster, $id_first_msg, $first_subject, $lastPostTime, $first_icon) = $smcFunc['db_fetch_row']($request);
Find:
Code: [Select]
// By default....
$context['use_smileys'] = true;
$context['icon'] = 'xx';
Replace with:
Code: [Select]
// By default....
$context['use_smileys'] = true;
$context['icon'] = !empty($first_icon) ? $first_icon : 'xx';

That works for the full reply. Quick reply needs other kind of "love"
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 29
Re: Have the same Message Icon for replies as that of the starting post
« Reply #2 on: December 29, 2015, 03:46:31 AM »
That solution works perfectly for the full reply! Thanks a lot! :)