Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: admactanium on November 19, 2004, 07:48:33 AM

Title: Changing quote header text
Post by: admactanium on November 19, 2004, 07:48:33 AM
hello. i've been messing around with my quoting formatting a bit. but i was wondering where is the code that actually writes the quote info. for instance, the default says "quote from user at today 1:32" and whatnot. i'd like it to simply say "user said:" also, i'd also like to install line breaks before and after the quoted text as it seems to be too tight to the borders right now. any help would be appreciated. i'm a coding newb. :D
Title: Re: Changing quote header text
Post by: A.M.A on November 19, 2004, 08:37:08 AM
in \Sources\Subs.php look for:
'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~ei' => isset($disabled['quote']) ? '\'<div>\'' : '\'<div class="quoteheader"><a href="' . $scripturl . '?$2">' . $txt['smf239'] . ': $1 ' . $txt[176] . ' \' . timeformat(\'$3\') . \'</a></div><div class="quote">\'',
replace it with:
'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~ei' => isset($disabled['quote']) ? '\'<div>\'' : '\'<div class="quoteheader"><a href="' . $scripturl . '?$2">User said:</a></div><div class="quote"><br/>\'',[/quote][/quote]
Title: Re: Changing quote header text
Post by: Webby on November 19, 2004, 10:12:46 AM
And what if you want it to say :

A.M.A. wrote :

etc. etc....
Title: Re: Changing quote header text
Post by: admactanium on November 19, 2004, 04:03:41 PM
yes, sorry. that's what i originally meant. rather than actually saying "user" i wanted to have the quote originator's name. thanks again.
Title: Re: Changing quote header text
Post by: Anguz on November 19, 2004, 09:16:19 PM
You can give the quote body some padding using .quote CSS class.

For the quote header the way you want it, look for the line A.M.A pointed out and change it to this:


'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~ei' => isset($disabled['quote']) ? '\'<div>\'' : '\'<div class="quoteheader"><a href="' . $scripturl . '?$2">$1 ' . $txt['quote_said'] . ':</a></div><div class="quote">\'',


Then in your language dir, add this line to the file Modifications.english.php:


$txt['quote_said'] = 'said';
[/quote]
Title: Re: Changing quote header text
Post by: Anguz on November 19, 2004, 09:19:37 PM
Also change this line in Subs.php


'~\[quote(?: author)?=&quot;(.{1,80}?)&quot;\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',


to


'~\[quote(?: author)?=&quot;(.{1,80}?)&quot;\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">$1 ' . $txt['quote_said'] . ':</div><div class="quote">',
Title: Re: Changing quote header text
Post by: admactanium on November 20, 2004, 07:10:33 PM
hi anguz,

i'm getting a:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/jeffnee/public_html/scar/forum/Sources/Subs.php on line 1533

error now. i've done the first replacement on subs.php and added that line into modifications but when i try to do the second substitution (the one directly above this post) it can't find the original line you asked me to find.

again, any help is appreciated. thanks.
Title: Re: Changing quote header text
Post by: Anguz on November 21, 2004, 12:38:22 AM
That error seems to be in the function setupThemeContext from the line number.

The line in my last reply is next to the other one. I actually missed a third line.

Here's what to replace from the original RC2 Subs.php:


<edit file>
$sourcedir/Subs.php
</edit file>

<search for>
'~\[quote(?: author)?=&quot;(.{1,80}?)&quot;\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',
'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~ei' => isset($disabled['quote']) ? '\'<div>\'' : '\'<div class="quoteheader"><a href="' . $scripturl . '?$2">' . $txt['smf239'] . ': $1 ' . $txt[176] . ' \' . timeformat(\'$3\') . \'</a></div><div class="quote">\'',
'~\[quote author=(.{1,80}?)\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',
</search for>

<replace>
'~\[quote(?: author)?=&quot;(.{1,80}?)&quot;\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">$1 ' . $txt['quote_said'] . ':</div><div class="quote">',
'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader"><a href="' . $scripturl . '?$2">$1 ' . $txt['quote_said'] . ':</a></div><div class="quote">',
'~\[quote author=(.{1,80}?)\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">$1 ' . $txt['quote_said'] . ':</div><div class="quote">',
</replace>
[/quote][/quote][/quote][/quote]
Title: Re: Changing quote header text
Post by: Oldiesmann on December 01, 2004, 10:27:02 AM
"Unexpected T_CONSTANT_ENCAPSED_STRING" usually means you forgot a semicolon somewhere.
Title: Re: Changing quote header text
Post by: asdboard on March 18, 2006, 06:36:18 PM
I've been trying to follow the above indications on how to change the quote header text, but the Subs.php in 1.1RC2 seems to be a bit different from the one discussed here. Can anybody tell me what part of the file should I change?
Title: Re: Changing quote header text
Post by: B Patterson on March 20, 2006, 07:33:22 PM
I'm sorry, but maybe I'm missing something.  You want to have all the time "XXX said:" as the quote header?  isn't that kind of impossible?  I mean, if I just type [quote]Someone else said this[/quote] how is the parser going to know who said it?

If you want to quote it, and include the name, use the format of:
[quote="Username Here"]Someone else said this[/quote] and it will come out properly, like:
Quote from: Username HereSomeone else said this

Is that near it, or am I completely off base here?
Title: Re: Changing quote header text
Post by: Geno15 on January 27, 2009, 11:22:59 AM
Can anyone Tell How to Get Rid of The Date In a Quote Box on A Yaabb Classic Theme

For instance when you quote someone on my board, it come out

Quote from: Geno on {March 20, 2006, 07:33:22 PM}

I would just have it read  Quote from Geno.

Anyone know? Thanks.

Title: Re: Changing quote header text
Post by: JimM on February 06, 2009, 12:34:07 AM
@Geno15 - Reply number 4 in this topic gives you exactly what you are looking for.