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: 383
Joined: Mon Jun 25, 2018 1:33 pm

Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive » Sat Mar 09, 2019 9:56 pm

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 Forum! ⬳

Subscribe to my YouTube Channel!

Get The Best Web Hosting | ✔ Buy Cheap Domain Names

User avatar
Lumpy Burgertushie
Registered User
Posts: 66320
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Lumpy Burgertushie » Sun Mar 10, 2019 12:01 am

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Exclusive
Registered User
Posts: 383
Joined: Mon Jun 25, 2018 1:33 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive » Sun Mar 10, 2019 12:32 am

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 Forum! ⬳

Subscribe to my YouTube Channel!

Get The Best Web Hosting | ✔ Buy Cheap Domain Names

User avatar
Lumpy Burgertushie
Registered User
Posts: 66320
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Lumpy Burgertushie » Sun Mar 10, 2019 12:46 am

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
david63
Registered User
Posts: 16164
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by david63 » Sun Mar 10, 2019 7:54 am

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: 66320
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Lumpy Burgertushie » Sun Mar 10, 2019 8:37 am

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Exclusive
Registered User
Posts: 383
Joined: Mon Jun 25, 2018 1:33 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive » Sun Mar 10, 2019 5:13 pm

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 Forum! ⬳

Subscribe to my YouTube Channel!

Get The Best Web Hosting | ✔ Buy Cheap Domain Names

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1047
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy » Sun Mar 10, 2019 10:53 pm

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 / ''Proud member of the Studio"

User avatar
Exclusive
Registered User
Posts: 383
Joined: Mon Jun 25, 2018 1:33 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by Exclusive » Sun Mar 10, 2019 11:53 pm

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 Forum! ⬳

Subscribe to my YouTube Channel!

Get The Best Web Hosting | ✔ Buy Cheap Domain Names

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1047
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy » Mon Mar 11, 2019 9:45 am

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 / ''Proud member of the Studio"

User avatar
3Di
Former Team Member
Posts: 13769
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 » Mon Mar 11, 2019 10:31 pm

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
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

chuppito
Registered User
Posts: 9
Joined: Sun May 26, 2019 2:08 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by chuppito » Wed May 29, 2019 5:19 am

Hello is anyone found the solution to actually pass it in front of the title? Thank you

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1047
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy » Wed May 29, 2019 11:23 am

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

chuppito
Registered User
Posts: 9
Joined: Sun May 26, 2019 2:08 pm

Re: Topic Solved: [SOLVED] Prefix Placement

Post by chuppito » Wed May 29, 2019 11:27 am

I just ask if he happened to pass solved at the beginning of the title, it avoids duplicates

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1047
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Topic Solved: [SOLVED] Prefix Placement

Post by mrgoldy » Wed May 29, 2019 1:47 pm

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 / ''Proud member of the Studio"

Post Reply

Return to “phpBB Custom Coding”