[Tips] No quote last post without extension

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
Post Reply
User avatar
Big Monstro
Registered User
Posts: 54
Joined: Tue Nov 15, 2016 5:42 pm

[Tips] No quote last post without extension

Post by Big Monstro »

Hello,

I suppose that forum is the best place to talk about tips...

Do you know it's possible to hide the quote button in last post without any extension?

Open viewtopic_body.html and replace...

Code: Select all

<!-- IF postrow.U_QUOTE -->
by...

Code: Select all

<!-- IF not (postrow.S_LAST_ROW and CURRENT_PAGE eq TOTAL_PAGES) and postrow.U_QUOTE -->
The equality CURRENT_PAGE eq TOTAL_PAGES checks if you are on the last page. Otherwise, S_LAST_ROW is not the last post on the topic (just the last one on the current page).


Open posting_topic_review.html and replace the first occurence of...

Code: Select all

<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
by...

Code: Select all

<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE and not topic_review_row.S_FIRST_ROW -->
I add not S_FIRST_ROW in posting_topic_review.html, as the last post actually displays in the first place.


Finally, purge the cache.

Works both on proSilver and subSilver2.
User avatar
david63
Registered User
Posts: 18446
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: [Tips] No quote last post without extension

Post by david63 »

Whilst what you say probably works (cannot say one way or the other as I have not checked it) the philosophy behind phpBB 3.1 is that you do not modify core code but use extensions.

Obviously on your own board you are free to do whatever you want but personally I do not believe that people should be encouraged to change core code as it means that they either have to reapply those edits after each update/upgrade or they are forced into using the auto update method where numerous users encounter problems.

Also there is no guarantee that core edits will work with any future version.
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
Big Monstro
Registered User
Posts: 54
Joined: Tue Nov 15, 2016 5:42 pm

Re: [Tips] No quote last post without extension

Post by Big Monstro »

Hello david63 and thank you for the answer about the phpBB philosophy.

Please note that my trick doesn't involve editing the core code (PHP files from phpBB package). It's much safer as that edits only two templates. When you upgrade the board, the default styles are automatically updated (without cancelling the custom changes). The other styles must be manually updated, anyway.

The only drawback of my method is you have to edit all styles on your board. Unless you have a lot of styles, it's not a big deal. As long as the variables S_FIRST_ROW, S_LAST_ROW, CURRENT_PAGE and TOTAL_PAGES are supported, that tips will continue to work.

Best regard,
Big Monstro
User avatar
david63
Registered User
Posts: 18446
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: [Tips] No quote last post without extension

Post by david63 »

Big Monstro wrote:Please note that my trick doesn't involve editing the core code (PHP files from phpBB package). It's much safer as that edits only two templates.
That statement is not true. Any file that is shipped with phpBB is considered to be a core file so editing templates is editing core files.
Big Monstro wrote:When you upgrade the board, the default styles are automatically updated (without cancelling the custom changes).
That presumes that the user will use the automatic update procedure. With phpBB 3.1 there is a move towards using either full file replacement or changed files as this is a quicker and easier method.
Big Monstro wrote:The only drawback of my method is you have to edit all styles on your board.
And the update would have to be done after each update to the non core styles as there is no auto update for non core files.

As I said before there is nothing wrong in changing files - it is just that users need to be aware of the potential problems.
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
Post Reply

Return to “phpBB Discussion”