Customize text inside phpBB quote

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
jonathandoyle
Registered User
Posts: 36
Joined: Tue Mar 17, 2015 10:07 am

Customize text inside phpBB quote

Post by jonathandoyle »

By default, the phpbb quote command displays : "X wrote blah blah"
I would like to have quotes displaying "X said blah blah" when referring to speeches rather than writings.
Although this looks easy as it only changes the text and not the style, I do not see any easy way to implement this using BBCode customizations in the admin panel ?
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72339
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Customize text inside phpBB quote

Post by KevC »

Not quite sure what you mean about the style or are you suggesting you want 2 different kinds of quotes. One for posts and one for writings? If that's the case I think you might need an extension for something more extensive.

language/en/common.php

Around line 890 is

'WROTE' => 'wrote',


Change it to

'WROTE' => 'said',


Note that you'll have to make that change every time you update.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
jonathandoyle
Registered User
Posts: 36
Joined: Tue Mar 17, 2015 10:07 am

Re: Customize text inside phpBB quote

Post by jonathandoyle »

KevC wrote: Mon Apr 02, 2018 2:14 pm you want 2 different kinds of quotes. One for posts and one for writings?
Absolutely. So your proposal to edit language/en/common.php does not solve my problem because it will simply change the unique behavior, when I want two different behaviors.
KevC wrote: Mon Apr 02, 2018 2:14 pm If that's the case I think you might need an extension for something more extensive.
That would mean a lot of work, wouldn't it ? Perhaps not worth the trouble.
I thought I could simply duplicate all the parts related to the "quote" bbcode in the source code and then edit the part I want, but maybe there are too many different locations of the code involved.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Customize text inside phpBB quote

Post by Lumpy Burgertushie »

you don't have to do any of that. simply create a new custom bbcode that does whatever you want.

you can look in the bbcode.html file for your style to see how the quote bbcode is structured and then use that as the base for your new one.

then, when you want to do whatever you are talking about just use that instead of the quote bbcode.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
jonathandoyle
Registered User
Posts: 36
Joined: Tue Mar 17, 2015 10:07 am

Re: Customize text inside phpBB quote

Post by jonathandoyle »

Lumpy Burgertushie wrote: Mon Apr 02, 2018 6:32 pm you don't have to do any of that. simply create a new custom bbcode that does whatever you want.

you can look in the bbcode.html file for your style to see how the quote bbcode is structured and then use that as the base for your new one.

then, when you want to do whatever you are talking about just use that instead of the quote bbcode.

robert
Sure, I was thinking exactly along those lines, but as I said above, the problem is that there are several more files to edit, and it is not obvious (at least for a non-expert like me) to guess which files need to be edited.

Suppose I want to call my new command "vquote" (v as in verbal). What you suggested translates into this :

1) Edit language/mylanguage/common.php, by adding into it
the item

Code: Select all

'SAID'=>'said'
(which imitates the already present

Code: Select all

 'WROTE'=>'wrote' 
)

2) Edit styles/mystyle/template/bbcode.html, by duplicating all the quote-related part, and replacing "quote" with "vquote" , "$L_WROTE" with "$L_SAID" into the new copy. (note that it seems that $L_WROTE is not the same variable as WROTE in common.php, so either I need to do some complementary editing elsewhere or leave this part unedited).

When I look into includes/bbcode.php, I see a switch statement with a

Code: Select all

case BBCODE_ID_QUOTE:
. I guess I should duplicate that too, and create my own

Code: Select all

case BBCODE_ID_VQUOTE:
. But in what file are the BBCODE_ID_ constants defined ?


So you see, the instructions you gave were incomplete.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Customize text inside phpBB quote

Post by david63 »

I hope you are aware that the quote bbCode is one of the more complex areas of phpBB and is the most complex bbCode that there is.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Customize text inside phpBB quote

Post by Lumpy Burgertushie »

I was not suggesting that you edit any code anywhere. just create a new custom bbcode in the admin panel under the posting tab.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
jonathandoyle
Registered User
Posts: 36
Joined: Tue Mar 17, 2015 10:07 am

Re: Customize text inside phpBB quote

Post by jonathandoyle »

Lumpy Burgertushie wrote: Tue Apr 03, 2018 10:02 pm I was not suggesting that you edit any code anywhere. just create a new custom bbcode in the admin panel under the posting tab.
robert
I'm afraid that's not possible for what I want.
In the admin panel, you define those custom bbcodes by giving a name and specifying an html reformulation.
But the "quote" command has no simple html equivalent that I'm aware of. As david63 said above, "quote" is one of the most complex operations in phpBB.
User avatar
Ger
Registered User
Posts: 2108
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Customize text inside phpBB quote

Post by Ger »

Would this work for you?

[cite={TEXT1}]{TEXT2}[/cite]

Code: Select all

<blockquote>
<div>
<cite>{TEXT1} said:</cite>
{TEXT2}
</div>
</blockquote>
Image
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:

-Don't PM me for support-
Post Reply

Return to “phpBB Custom Coding”