Script after the last post?

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
timeforhelp1
Registered User
Posts: 300
Joined: Thu Feb 19, 2009 5:34 pm

Script after the last post?

Post by timeforhelp1 »

I want to put a script after the last post, I get the after 1st post, but want the last post instead.
Any ideas?
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Script after the last post?

Post by mrgoldy »

What are we supposed to understand/get from that?
Please elaborate a bit more on what you're trying to do?
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
timeforhelp1
Registered User
Posts: 300
Joined: Thu Feb 19, 2009 5:34 pm

Re: Script after the last post?

Post by timeforhelp1 »

Exactly what I said, I want to add a script after the last post.
I can add a script/Ad after the 1st post, before the 1st post ect...
Knowledge Base - Advertisements in phpBB3

Now I want to do it after the last post of each page,so regardless of how many pages the topic is long, I want it after the last post of each page, it's a script, ok I'll call it an ad for easier understanding.
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Script after the last post?

Post by Noxwizard »

S_FIRST_ROW is the first post and S_LAST_ROW is the last.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Script after the last post?

Post by AmigoJack »

timeforhelp1 wrote: Sat Dec 23, 2017 4:51 pmExactly what I said
Glad we sorted that, as a "script" can be both JavaScript and PHP.

If you want to edit viewing a topic just go to that point where the loop of outputting all posts ends, as "after last post" is the same as "after all posts", hence you don't even need to bother with the loop at all. In theory.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Script after the last post?

Post by Sniper_E »

No... I'm pretty sure you do have to bother with the loop.

Let's get this sorted out too...
It has to be placed between the <!-- BEGIN postrow --> and the <!-- END postrow --> tags for the S_LAST_ROW to work.

Or did I miss understood what you were saying there Amigo.

Now getting off topic...
I do not understand "after last post" is the same as "after all posts"

To me "after last post" is in each page after the last post.
Hence: <!-- IF postrow.S_LAST_ROW -->

And "after all posts" is only in the last page of the topic after the last post.
Hence: <!-- IF postrow.S_LAST_ROW && postrow.S_LAST_PAGE -->

I just made that last page IF statement up... I would have to look up what the last page IF statement is. So don't quote me.
Noxwizard already gave him what he needed though. He wants it after the last post of each page.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Script after the last post?

Post by Sniper_E »

@ timeforhelp1 some other information that might help you if you ever choose to use it...

Using the <!-- IF postrow.S_FIRST_ROW --> under the <!-- BEGIN postrow --> tag your script will show just above the first post.

Code: Select all

<!-- BEGIN postrow -->
<!-- IF postrow.S_FIRST_ROW -->
<!-- INCLUDE my_script.html -->
<!-- ENDIF -->
Using the <!-- IF postrow.S_FIRST_ROW --> above the <!-- END postrow --> tag your script will show just below the first post.
Your first post will be on top... then your script... then all of the other posts will follow below that. Can you picture that? It breaks the posts.

Code: Select all

<!-- IF postrow.S_FIRST_ROW -->
<!-- INCLUDE my_script.html -->
<!-- ENDIF -->
<!-- END postrow -->
Using the <!-- IF postrow.S_LAST_ROW --> above the <!-- END postrow --> tag your script will show just below the last post.

Code: Select all

<!-- IF postrow.S_LAST_ROW -->
<!-- INCLUDE my_script.html -->
<!-- ENDIF -->
<!-- END postrow -->
Using the <!-- IF postrow.S_LAST_ROW --> under the <!-- BEGIN postrow --> tag your script will show just above the last post.
All your posts will show but the last one... then your script will show... then the last post will show It also will break the posts.

Code: Select all

<!-- BEGIN postrow -->
<!-- IF postrow.S_LAST_ROW -->
<!-- INCLUDE my_script.html -->
<!-- ENDIF -->
There are also IF statements for the number of row. You could even have your script show between the third and forth post on each page.
I hope that gives you a better understanding on the placement of the IF statements. Good luck on your quest!
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Script after the last post?

Post by AmigoJack »

"After last post" is equal to "after all posts" because you just need to insert whatever you want after <!-- END postrow -->. timeforhelp1 nowhere said in or at the beginning of the last post - there's no need for the loop to execute an IF for all posts at all.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Script after the last post?

Post by Sniper_E »

Ah yes Amego I see what you mean now. You are correct. I did misunderstand your comment.

The on top, below and in between posts examples I posted was to show positioning inside the loop is all.
It should help anyone understand how to position ads or scripts between the posts. We had that at STG.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
timeforhelp1
Registered User
Posts: 300
Joined: Thu Feb 19, 2009 5:34 pm

Re: Script after the last post?

Post by timeforhelp1 »

Thanks for commenting guys and will do some testing.
Also didn't realise there was a 'custom coding' part of the site, thanks for moving.
Post Reply

Return to “phpBB Custom Coding”