News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Changing quote header text

Started by admactanium, November 19, 2004, 07:48:33 AM

Previous topic - Next topic

admactanium

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

A.M.A

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]
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Webby

And what if you want it to say :

A.M.A. wrote :

etc. etc....

admactanium

yes, sorry. that's what i originally meant. rather than actually saying "user" i wanted to have the quote originator's name. thanks again.

Anguz

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]
Cristián Lávaque http://cristianlavaque.com

Anguz

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">',
Cristián Lávaque http://cristianlavaque.com

admactanium

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.

Anguz

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]
Cristián Lávaque http://cristianlavaque.com

Oldiesmann

"Unexpected T_CONSTANT_ENCAPSED_STRING" usually means you forgot a semicolon somewhere.
Michael Eshom
Christian Metal Fans

asdboard

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?

B Patterson

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?

Geno15

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.


JimM

@Geno15 - Reply number 4 in this topic gives you exactly what you are looking for.
Jim "JimM" Moore
Former Support Specialist

Advertisement: