Advertisement:

Author Topic: Changing quote header text  (Read 28498 times)

Offline admactanium

  • Semi-Newbie
  • *
  • Posts: 96
Changing quote header text
« 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

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: Changing quote header text
« Reply #1 on: November 19, 2004, 08:37:08 AM »
in \Sources\Subs.php look for:
Code: [Select]
'~\[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:
Code: [Select]
'~\[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 :)

Offline Webby

  • Full Member
  • ***
  • Posts: 482
  • Gender: Male
  • Let's generate some buttons !
    • marcovanveelen.nl
Re: Changing quote header text
« Reply #2 on: November 19, 2004, 10:12:46 AM »
And what if you want it to say :

A.M.A. wrote :

etc. etc....

Offline admactanium

  • Semi-Newbie
  • *
  • Posts: 96
Re: Changing quote header text
« Reply #3 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.

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Changing quote header text
« Reply #4 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:

Code: [Select]
'~\[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:

Code: [Select]
$txt['quote_said'] = 'said';
[/quote]
Cristián Lávaque http://cristianlavaque.com

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Changing quote header text
« Reply #5 on: November 19, 2004, 09:19:37 PM »
Also change this line in Subs.php

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

to

Code: [Select]
'~\[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

Offline admactanium

  • Semi-Newbie
  • *
  • Posts: 96
Re: Changing quote header text
« Reply #6 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.

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Changing quote header text
« Reply #7 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:

Code: [Select]
<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

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Changing quote header text
« Reply #8 on: December 01, 2004, 10:27:02 AM »
"Unexpected T_CONSTANT_ENCAPSED_STRING" usually means you forgot a semicolon somewhere.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline asdboard

  • Semi-Newbie
  • *
  • Posts: 11
  • Gender: Male
Re: Changing quote header text
« Reply #9 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?

Offline B Patterson

  • Full Member
  • ***
  • Posts: 512
  • Gender: Male
  • Never Miss an Opportunity to be Great
Re: Changing quote header text
« Reply #10 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
Code: [Select]
[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:
Code: [Select]
[quote="Username Here"]Someone else said this[/quote] and it will come out properly, like:
Quote from: Username Here
Someone else said this

Is that near it, or am I completely off base here?

Offline Geno15

  • Semi-Newbie
  • *
  • Posts: 17
Re: Changing quote header text
« Reply #11 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.


Offline JimM

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,980
  • Gender: Male
    • Southern Spirit Hunters
Re: Changing quote header text
« Reply #12 on: February 06, 2009, 12:34:07 AM »
@Geno15 - Reply number 4 in this topic gives you exactly what you are looking for.
Jim "JimM" Moore
Former Support Specialist

Please do not PM me for support!                   
Installing SMF
Upgrade SMF
Manual Installation of Mods