Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: admactanium in November 19, 2004, 07:48:33 VORMITTAG

Titel: Changing quote header text
Beitrag von: admactanium in November 19, 2004, 07:48:33 VORMITTAG
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
Titel: Re: Changing quote header text
Beitrag von: A.M.A in November 19, 2004, 08:37:08 VORMITTAG
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]
Titel: Re: Changing quote header text
Beitrag von: Webby in November 19, 2004, 10:12:46 VORMITTAG
And what if you want it to say :

A.M.A. wrote :

etc. etc....
Titel: Re: Changing quote header text
Beitrag von: admactanium in November 19, 2004, 04:03:41 NACHMITTAGS
yes, sorry. that's what i originally meant. rather than actually saying "user" i wanted to have the quote originator's name. thanks again.
Titel: Re: Changing quote header text
Beitrag von: Anguz in November 19, 2004, 09:16:19 NACHMITTAGS
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]
Titel: Re: Changing quote header text
Beitrag von: Anguz in November 19, 2004, 09:19:37 NACHMITTAGS
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">',
Titel: Re: Changing quote header text
Beitrag von: admactanium in November 20, 2004, 07:10:33 NACHMITTAGS
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.
Titel: Re: Changing quote header text
Beitrag von: Anguz in November 21, 2004, 12:38:22 VORMITTAG
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]
Titel: Re: Changing quote header text
Beitrag von: Oldiesmann in Dezember 01, 2004, 10:27:02 VORMITTAG
"Unexpected T_CONSTANT_ENCAPSED_STRING" usually means you forgot a semicolon somewhere.
Titel: Re: Changing quote header text
Beitrag von: asdboard in März 18, 2006, 06:36:18 NACHMITTAGS
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?
Titel: Re: Changing quote header text
Beitrag von: B Patterson in März 20, 2006, 07:33:22 NACHMITTAGS
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:
Zitat von: Username HereSomeone else said this

Is that near it, or am I completely off base here?
Titel: Re: Changing quote header text
Beitrag von: Geno15 in Januar 27, 2009, 11:22:59 VORMITTAG
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.

Titel: Re: Changing quote header text
Beitrag von: JimM in Februar 06, 2009, 12:34:07 VORMITTAG
@Geno15 - Reply number 4 in this topic gives you exactly what you are looking for.