Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2009-01-01 23:12:23

Registered: 2008-08-02
Posts: 13

Quote Back

Trying to make this mod,

In any other forum, when you quote someone using the quote button, the displayed text will provide a link back to the post it was quoted. I'm trying to add that to FluxBB 1.2. Not exactly sure the best way atm.

I also suggest this as a addition that should be added to the core of 1.3.

Any suggestions or insight would be greatly appreciated. Thanks!


#2 2009-01-01 23:46:04

From: South Yorkshire, England
Registered: 2008-05-06
Posts: 1,233

Re: Quote Back

I'd have thought the place to do that would be within post.php.

Screw the chavs and God save the Queen!


#3 2009-01-02 00:20:31

Registered: 2008-05-09
Posts: 171

Re: Quote Back

This is quick and dirty in that you'd probably want to change the text I've put in to use the language file, and also find a good way to deal with the formatting of the link (i.e. on its own line rather than just jammed at the beginning of the quote), but this will work:

in post.php find

$quote = '[quote='.$q_poster.']'.$q_message.'[/quote]'."\n";

replace with

$quote = '[quote='.$q_poster.'][url=viewtopic.php?pid='.$qid.'#p'.$qid.']click for quoted post[/url]  '.$q_message.'[/quote]'."\n";

Last edited by eliot (2009-01-02 00:52:38)


#4 2009-01-02 01:57:45

From: Southport, Uk
Registered: 2008-05-03
Posts: 489

Re: Quote Back

He didn't say he doesn't know how to do it, he say he does not know the best way and suggests it should be in the core wink


#5 2016-07-09 19:55:27

New member
Registered: 2016-07-04
Posts: 3

Re: Quote Back

I know this thread is extremely old, but I adapted the solution above for 1.5.10 and made it a little cleaner.

This now links the "User wrote:" text directly to the post the quote came from.

In post.php find:

$quote = '[quote='.$q_poster.']'.$q_message.'[/quote]'."\n";

Replace with:

$quote = '[quote='.$q_poster.';'.$qid.']'.$q_message.'[/quote]'."\n";

In include/parser.php find:

$text = preg_replace_callback('%\[quote=(&quot;|&\#039;|"|\'|)([^\r\n]*?)\\1\]%s', create_function('$matches', 'global $lang_common; return "</p><div class=\"quotebox\"><cite>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), $matches[2])." ".$lang_common[\'wrote\']."</cite><blockquote><div><p>";'), $text);

Add above:

//use this regex if there is a quote id
$text = preg_replace_callback('%\[quote=(&quot;|&\#039;|"|\'|)([^\r\n]*?);(\d+)\]%s', create_function('$matches', 'global $lang_common; return "</p><div class=\"quotebox\"><cite><a href=\"viewtopic.php?pid=$matches[3]#p$matches[3]\">".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), $matches[2])." ".$lang_common[\'wrote\']."</a></cite><blockquote><div><p>";'), $text);


Board footer

Powered by FluxBB