Topic Solved: [SOLVED] Prefix Placement

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
User avatar
Exclusive
Registered User
Posts: 590
Joined: Mon Jun 25, 2018 1:33 pm

Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive »

I have installed this extension, It is working fine but I have a problem I need to fix. In the event folder

Code: Select all

styles/all/template/event/
there is a

Code: Select all

viewtopic_topic_title_append.html
file which contains the code below;

Code: Select all

<!-- IF TOPIC_SOLVED_TITLE -->
&nbsp;
<a href="{{ U_SOLVED_POST }}"<!-- IF TOPIC_SOLVED_STYLE --> style="color: #{TOPIC_SOLVED_STYLE};"<!-- ENDIF -->>
	{TOPIC_SOLVED_TITLE}
</a>
<!-- ENDIF -->
<!-- IF TOPIC_SOLVED_IMAGE -->
<a href="{{ U_SOLVED_POST }}" title="{L_TOPIC_SOLVED}">
	{TOPIC_SOLVED_IMAGE}
	<!-- IF ! TOPIC_SOLVED_PHPBB31 -->
	<span class="sr-only">{L_TOPIC_SOLVED}</span>
	<!-- ENDIF -->
</a>
<!-- ENDIF -->
And the outcome is:

after-post-title.png


Now how do i make the prefix [SOLVED] to be place before the post title?

Example:

before-post-title.png

Although before now, I have posted here
Last edited by HiFiKabin on Sun Mar 10, 2019 11:00 am, edited 1 time in total.
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
Lumpy Burgertushie
Registered User
Posts: 67777
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Lumpy Burgertushie »

rename viewtopic_topic_title_append.html to <!-- EVENT viewtopic_topic_title_prepend -->

see if that works.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
Exclusive
Registered User
Posts: 590
Joined: Mon Jun 25, 2018 1:33 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive »

Lumpy Burgertushie wrote:
Sun Mar 10, 2019 12:01 am
rename viewtopic_topic_title_append.html to <!-- EVENT viewtopic_topic_title_prepend -->

see if that works.

robert
Without a .html??

It didn't work :cry:
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
Lumpy Burgertushie
Registered User
Posts: 67777
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Lumpy Burgertushie »

sorry, I should have been more careful. yes, leave the .html and just rename the file name.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
david63
Registered User
Posts: 17797
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by david63 »

Lumpy Burgertushie wrote:
Sun Mar 10, 2019 12:01 am
rename viewtopic_topic_title_append.html to <!-- EVENT viewtopic_topic_title_prepend -->

see if that works.

robert
That will not do anything - well it might cause an error.

Until you get a reply from the extension developer you could try

Code: Select all

<!-- IF TOPIC_SOLVED_TITLE -->
&nbsp;
<a href="{{ U_SOLVED_POST }}"<!-- IF TOPIC_SOLVED_STYLE --> style="color: #{TOPIC_SOLVED_STYLE};"<!-- ENDIF -->>
	{TOPIC_SOLVED_TITLE}
</a>
<!-- ENDIF -->
<!-- IF TOPIC_SOLVED_IMAGE -->
<a href="{{ U_SOLVED_POST }}" title="{TOPIC_SOLVED_IMAGE}{L_TOPIC_SOLVED}">
	<!-- IF ! TOPIC_SOLVED_PHPBB31 -->
	<span class="sr-only">{L_TOPIC_SOLVED}</span>
	<!-- ENDIF -->
</a>
<!-- ENDIF -->
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
Lumpy Burgertushie
Registered User
Posts: 67777
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Lumpy Burgertushie »

yep, sorry about that. my brain was not in gear that time.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
Exclusive
Registered User
Posts: 590
Joined: Mon Jun 25, 2018 1:33 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive »

david63 wrote:
Sun Mar 10, 2019 7:54 am
Until you get a reply from the extension developer you could try

Code: Select all

<!-- IF TOPIC_SOLVED_TITLE -->
&nbsp;
<a href="{{ U_SOLVED_POST }}"<!-- IF TOPIC_SOLVED_STYLE --> style="color: #{TOPIC_SOLVED_STYLE};"<!-- ENDIF -->>
	{TOPIC_SOLVED_TITLE}
</a>
<!-- ENDIF -->
<!-- IF TOPIC_SOLVED_IMAGE -->
<a href="{{ U_SOLVED_POST }}" title="{TOPIC_SOLVED_IMAGE}{L_TOPIC_SOLVED}">
	<!-- IF ! TOPIC_SOLVED_PHPBB31 -->
	<span class="sr-only">{L_TOPIC_SOLVED}</span>
	<!-- ENDIF -->
</a>
<!-- ENDIF -->
It didn't work.....!

Please pbpBB Moderators/Admin, Why did you mark this topic as solve? The title means:

Topic Solved: - (the extension name)

[SOLVED] Prefix Placement - (the question)
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1391
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy »

You're overlooking something.
The topic title is not the same as the post title (actually named post subject).

http://prntscr.com/mw265d

The topic title (the one you are modifying) is the one above the Forum rules.
For that one, changing it to _prepend will work, after you've purged the cache.

However, for the post subject, there are no template events in there.
So that means that the post was a reply when the topic had that specific title.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
Exclusive
Registered User
Posts: 590
Joined: Mon Jun 25, 2018 1:33 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive »

mrgoldy wrote:
Sun Mar 10, 2019 10:53 pm
The topic title (the one you are modifying) is the one above the Forum rules.
For that one, changing it to _prepend will work, after you've purged the cache.
Yes! Yesterday i renamed it to prepend and it worked, but you just figured out my problem now.

But it doesn't show in the browser's tab.
mrgoldy wrote:
Sun Mar 10, 2019 10:53 pm
However, for the post subject, there are no template events in there.
So that means that the post was a reply when the topic had that specific title.
It also worked for the subject, but the prefix still shows after subject title, any solution to this?
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1391
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy »

Like I said, there are no template events for the post subject. So the extension can not alter those through template events.
Those replies were made when the topic had that specific title mostlikely. Otherwise I/we will have to look at the extension’s repository. But I would highly suggest asking the developer.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
3Di
Former Team Member
Posts: 15512
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by 3Di »

Exclusive wrote:
Sun Mar 10, 2019 11:53 pm
but the prefix still shows after subject title
Delete the file viewtopic_topic_title_append.html which surely is still in the folder and purge the cache.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio
chuppito
Registered User
Posts: 11
Joined: Sun May 26, 2019 2:08 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by chuppito »

Hello is anyone found the solution to actually pass it in front of the title? Thank you
User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1391
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy »

You're best of creating your own topic, with a more detailed description/question than the one you just asked.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
chuppito
Registered User
Posts: 11
Joined: Sun May 26, 2019 2:08 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by chuppito »

I just ask if he happened to pass solved at the beginning of the title, it avoids duplicates
User avatar
mrgoldy
Development Team Member
Development Team Member
Posts: 1391
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy »

Well, if you use the viewtopic_topic_title_prepend template event, you can prepend something to the topic title.

Place the following file with the correct folder structure in your extension,
Put something in the file, for example "Hello".
Purge the cache.

styles/all/template/event/viewtopic_topic_title_prepend.html

But this all is for extensions and not Custom coding. If you want to add something to the topic title, hard-coded, just add it to the viewtopic_body.html.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
Post Reply

Return to “phpBB Custom Coding”