Advertisement:

Author Topic: SMF Quote modification  (Read 525 times)

Offline silber112

  • Jr. Member
  • **
  • Posts: 270
SMF Quote modification
« on: December 19, 2017, 03:08:08 PM »
Hello  ;)

I would like to change the structure of the quotes in my forum

When you click on the quote boton this comes out:

[  quote author=USER link=_____ date=_____]
TEXT
[  /quote]


I would like to change that including @USER, it would look like this:

[  quote author=USER link=_____ date=_____]@USER
TEXT
[  /quote]


The purpose of this is to notify my users when someone quotes them..(I have instaled in my forum the metion mod).

¿What files do I have to edit to archive that? THANKS IN ADVANCE  ;D

Offline silber112

  • Jr. Member
  • **
  • Posts: 270
Re: SMF Quote modification
« Reply #1 on: December 19, 2017, 05:03:07 PM »
Just found the code in subs.php:

Code: [Select]
array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '([^<>]{1,192}?)'),
'link' => array('match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d+)'),
'date' => array('match' => '(\d+)', 'validate' => 'timeformat'),
),
'before' => '<div class="quoteheader"><div class="topslice_quote"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . $txt['search_on'] . ' {date}</a></div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',

The issue is that the link doesnt work as it should :(

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,123
    • StoryBB/StoryBB on GitHub
Re: SMF Quote modification
« Reply #2 on: December 19, 2017, 05:21:21 PM »
No, you won't want to modify it there - that's the bbcode where it renders. You need to modify the routine that actually spits out the original bbcode in the first place.

I haven't tested it but I'm pretty sure all you need to do is modify Post.php in two places:

Code: (find) [Select]
// Add a quote string on the front and end.
$form_message = '[quote author=' . $mname . ' link=topic=' . $topic . '.msg' . (int) $_REQUEST['quote'] . '#msg' . (int) $_REQUEST['quote'] . ' date=' . $mdate . ']' . "\n" . rtrim($form_message) . "\n" . '[/quote]';

Code: (replace) [Select]
// Add a quote string on the front and end.
$form_message = '[quote author=' . $mname . ' link=topic=' . $topic . '.msg' . (int) $_REQUEST['quote'] . '#msg' . (int) $_REQUEST['quote'] . ' date=' . $mdate . ']@' . $mname . "\n" . rtrim($form_message) . "\n" . '[/quote]';

Code: (find) [Select]
// Add a quote string on the front and end.
$context['quote']['xml'] = '[quote author=' . $row['poster_name'] . ' link=topic=' . $row['id_topic'] . '.msg' . (int) $_REQUEST['quote'] . '#msg' . (int) $_REQUEST['quote'] . ' date=' . $row['poster_time'] . ']' . $lb . $row['body'] . $lb . '[/quote]';

Code: (replace) [Select]
// Add a quote string on the front and end.
$context['quote']['xml'] = '[quote author=' . $row['poster_name'] . ' link=topic=' . $row['id_topic'] . '.msg' . (int) $_REQUEST['quote'] . '#msg' . (int) $_REQUEST['quote'] . ' date=' . $row['poster_time'] . ']@' . $row['poster_name'] . $lb . $row['body'] . $lb . '[/quote]';
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

Nothing turns to hate so bitter as what once was love.

Offline silber112

  • Jr. Member
  • **
  • Posts: 270
Re: SMF Quote modification
« Reply #3 on: December 20, 2017, 03:53:31 AM »
You are awesome!

Thanks a lot!!!  ;D