News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Quote modification

Started by silber112, December 19, 2017, 03:08:08 PM

Previous topic - Next topic

silber112

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

silber112

Just found the code in subs.php:

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 :(

Arantor

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]';

silber112

You are awesome!

Thanks a lot!!!  ;D

Advertisement: