Something That Runs On Every Hit

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
SpeedRacer350
Registered User
Posts: 8
Joined: Sat May 13, 2023 1:05 am

Something That Runs On Every Hit

Post by SpeedRacer350 »

Quick Question: I want to put a piece of code that runs on every hit/access to my forum. Is there a phpbb module that runs every time?
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 522
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: Something That Runs On Every Hit

Post by danieltj »

What do you mean exactly?

Are you looking for an extension that lets you run code that you provide on every page load? If so, there might possibly be something out there but I don’t recall anything that does that.

Many extensions run every page load but they do a specific function. What is it you’re actually trying to achieve here?
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.
User avatar
SpeedRacer350
Registered User
Posts: 8
Joined: Sat May 13, 2023 1:05 am

Re: Something That Runs On Every Hit

Post by SpeedRacer350 »

Why did this get moved to extensions? If you don't understand my question, then you're either being purposefully obtuse, or you don't have an answer.
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 522
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: Something That Runs On Every Hit

Post by danieltj »

Do not call me names because I've asked you a question.

I didn't move your topic, but if it was moved from another forum it's because your topic is a better fit here and personally I agree because you're asking for functionality that most likely would be something an extension would achieve rather than something the core software would do.

To the point of your original question, what are you trying to achieve here? I ask that because I'm trying to understand if you want to place code like Google Analytics (or something else) that is executed every page load or perhaps some kind of php based background script to perform a function.

I replied to this topic with the best intentions, trying to provide some help to you.
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3892
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: Something That Runs On Every Hit

Post by Kailey »

OK, let's all settle down. I won't name-call who moved the topic, but I can assure you it was moved to Extension Requests because you originally posted in the Support Forum. That forum is dedicated for support of the core phpBB product. Your question and desired outcome do not fall within the scope of support, hence the move.

If you're not looking for an extension, then the next best forum would be either Custom Coding (for modifying phpBB's core functionality without the use of an extension) or the Wanted forum (for paid requests).
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53529
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Something That Runs On Every Hit

Post by Brf »

Yes. Custom Coding or Extension Writers are most appropriate.

There is plenty of code that runs on every page, such as the database connection code, then user session code. If you would explain what you want to accomplish, we can suggest a location.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6314
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Something That Runs On Every Hit

Post by thecoalman »

At the bottom of common.php is usually the most appropriate.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
SpeedRacer350
Registered User
Posts: 8
Joined: Sat May 13, 2023 1:05 am

Re: Something That Runs On Every Hit

Post by SpeedRacer350 »

thecoalman wrote: Wed Jun 26, 2024 3:26 pm At the bottom of common.php is usually the most appropriate.
Thank you. I saw that module and thought that might be what I'm looking for based solely on its name. But PHPBB is a monster system, and I'm not familiar with its flow.
User avatar
SpeedRacer350
Registered User
Posts: 8
Joined: Sat May 13, 2023 1:05 am

Re: Something That Runs On Every Hit

Post by SpeedRacer350 »

danieltj wrote: Wed Jun 26, 2024 2:50 pm Do not call me names because I've asked you a question.

I didn't move your topic, but if it was moved from another forum it's because your topic is a better fit here and personally I agree because you're asking for functionality that most likely would be something an extension would achieve rather than something the core software would do.

To the point of your original question, what are you trying to achieve here? I ask that because I'm trying to understand if you want to place code like Google Analytics (or something else) that is executed every page load or perhaps some kind of php based background script to perform a function.

I replied to this topic with the best intentions, trying to provide some help to you.
I didn't call you a name. Now you're being overly sensitive in addition to acting like you don't understand in order to be difficult. I've been in tech for decades. That's not a new concept for me on a tech forum.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6314
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Something That Runs On Every Hit

Post by thecoalman »

As Kailey noted we don't need to turn this into mud slinging fest. Don't make me get my lockinator out. The reasons for the questions is we have a wide array of users here that range from people with complete lack of knowledge to people that are very capable.

For example my answer applies to php code. If you are looking to add HTML you should look at the template overall_header.html and I should of determined that beforehand.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
Toxyy
Registered User
Posts: 964
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek

Re: Something That Runs On Every Hit

Post by Toxyy »

SpeedRacer350 wrote: Wed Jun 26, 2024 3:35 pm I didn't call you a name. Now you're being overly sensitive in addition to acting like you don't understand in order to be difficult. I've been in tech for decades. That's not a new concept for me on a tech forum.
The reason he's asking what you're wanting to do is that depending on your answer, there are many different event locations and event variables that you can use to do what you want. And as thecoalman says, if it's plain HTML, then you may just need a template event. Your use case depends on the answer that you'll get, there is no straightforward answer to "where can I put X that will run on every page" because there are many places you can do that. Just depends on what you're wanting to do.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension

Return to “phpBB Custom Coding”