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: 209
Joined: Thu Feb 19, 2009 5:34 pm

Script after the last post?

Post by timeforhelp1 » Fri Dec 22, 2017 10:40 pm

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
posey
Registered User
Posts: 706
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Script after the last post?

Post by posey » Sat Dec 23, 2017 11:59 am

What are we supposed to understand/get from that?
Please elaborate a bit more on what you're trying to do?
''I'm pretty sure there's a lot more to life than being really, really, ridiculously good looking. And I plan on finding out what that is.''

timeforhelp1
Registered User
Posts: 209
Joined: Thu Feb 19, 2009 5:34 pm

Re: Script after the last post?

Post by timeforhelp1 » Sat Dec 23, 2017 4:51 pm

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: 10282
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Script after the last post?

Post by Noxwizard » Sat Dec 23, 2017 5:03 pm

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: 5177
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Script after the last post?

Post by AmigoJack » Wed Dec 27, 2017 10:02 am

timeforhelp1 wrote:
Sat Dec 23, 2017 4:51 pm
Exactly 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 worst thing about censorship is ███████████

User avatar
Sniper_E
Registered User
Posts: 710
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 » Thu Dec 28, 2017 2:50 am

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: 710
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 » Thu Dec 28, 2017 7:46 am

@ 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: 5177
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Script after the last post?

Post by AmigoJack » Thu Dec 28, 2017 8:22 am

"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 worst thing about censorship is ███████████

User avatar
Sniper_E
Registered User
Posts: 710
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 » Thu Dec 28, 2017 3:00 pm

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: 209
Joined: Thu Feb 19, 2009 5:34 pm

Re: Script after the last post?

Post by timeforhelp1 » Sat Dec 30, 2017 1:29 pm

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”

Who is online

Users browsing this forum: No registered users and 2 guests