[CDB] Digests 3.2.11

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

Yes, make those changes. Sorry, I forgot to test everything with debug turned on.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
Praggle
Registered User
Posts: 64
Joined: Thu Feb 26, 2015 6:07 pm

Re: [ALPHA] Digests 3.0.0

Post by Praggle »

Now i want set up a cron job. My provider has no possibility for creating cron jobs, so i want to use an cron job provider like https://www.easycron.com/. They have already a good tutorial for the old digests-mod (https://www.easycron.com/cron-job-tutor ... bb-digests), but I don't know how to set it up for phpbb 3.1 now. Can you help me? What do i have to put exactly into the fields?

I have two tabs,
basic:
Image
and advanced:
Image
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

/bin/phpbbcli.php requires a terminal environment like cron or SSH or it will not work. So attempts to call it from an external service won't work. An undocumented system requirement of phpBB seems to be that your hosting must have a way of doing cron or have a cron-like capability if you plan to use a system cron. If you are using Windows hosting, you should investigate Windows scheduled tasks and use a batch (.bat) file with the appropriate command to emulate the cron command:

Code: Select all

cd "/path/to/board"; ./bin/phpbbcli.php cron:run
Ultimately I believe /bin/phpbbcli.php calls cron.php in the phpBB root directory. So it may be possible to kick it off externally with a URL like:

http://www.example.com/phpBB3/cron.php

There are effectively three means paths for running /ext/phpbbsevices/digests/cron/event/digests.php that should be covered:

- from a system cron
- by calling cron.php (technically an unsupported way. I may not get it past the extension review team if I support this method)
- in manual mode from the ACP digests interface

To support an external cron (if it's possible) I will need to support all three, so additional changes to the above program will be needed. If it works at all from cron.php using an external cron then you will have to undo the file changes I suggested needed to be done in this post.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
Praggle
Registered User
Posts: 64
Joined: Thu Feb 26, 2015 6:07 pm

Re: [ALPHA] Digests 3.0.0

Post by Praggle »

It is a Linux-System - shared hosting.

I have changed back line 110-112 in digests.php and I tried to call cron.php directly, but it doesn't seem to have any influence on the planned tasks and I have to confess, that I don't understand at all how it works.

I've also tried to trigger your digests.php or manual digests_test in the acp directly - without any success.

I am thinking also about the possibility to use the phpBB-internal cron-feature and to trigger an external page-reload. What do you think?

I don't want to make you any trouble with the extensions review team, but I think that a lot of phpBB-installations are running in shared-hosting environments without cron-access.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

Running cron.php should only do something for digests if more than one hour has passed since the last time it was run. You can force it to run again by a SQL statement like:

Code: Select all

update phpbb_config
set config_value = 0
where config_name = 'phpbbservices_digests_cron_task_last_gc';
After doing this, purge the cache.

The manual way of running digests should still work in the ACP. You may have made so many code changes that something has changed in its behavior. Reverting all changes should work.

The default phpBB cron is triggered by events on your forum. A system cron is not needed on very active board where you can pretty much guarantee someone is always on doing things. Digests must go out hourly, hence it's not a good idea to skip creating a system cron.

It's unusual but not unheard of for shared hosting not to support a cron. It may be something worth paying for. You can ask your web host.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
Praggle
Registered User
Posts: 64
Joined: Thu Feb 26, 2015 6:07 pm

Re: [ALPHA] Digests 3.0.0

Post by Praggle »

Will a digest be lost, if I use the default phpBB cron and nobody is using the board during the time of delivery? Or will it just be delivered next morning, when somebody is getting active on the board?
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

Giving this some thought, the right site monitoring service/cron tool could use any URL that renders a web page to kick off the digests. There just has to be a real browser behind the tool. With such a service, you would simply program it to call any URL on the forum that renders a web page, because phpBB injects the link to cron.php in the footer as an image link. A real browser will load the 1x1 pixel image and in doing so call cron.php, which will serve the image and execute phpBB's cron. By calling cron.php, digests should start if an hour has elapsed. Pick a page that is easy to render, like the FAQ page.

A casual search found one service that does this:

https://www.uptrends.com/en/monitoring/ ... monitoring

When cron.php is run, a HTTP header is sent to not cache the image, so when the page is refreshed the image will be reloaded and cron.php should run.

If you do this approach, turn off the system cron feature: ACP > Server settings > Run periodic tasks from system cron to No.
Last edited by MarkDHamill on Sat Feb 27, 2016 10:52 pm, edited 2 times in total.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [ALPHA] Digests 3.0.0

Post by 3Di »

A simple HTML refresh on index will do?
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

Yes, see my last post. The advice has been edited.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [ALPHA] Digests 3.0.0

Post by 3Di »

MarkDHamill wrote:Yes, see my last post. The advice has been edited.
Well, just create a file named overall_header_head_append.html into

forum_root/ext/blah/blah/styles/blah/template/event (create it if doen't exists)

Put inside the above newly created file the HTML refresh markup and you are done.
Nothing more to code, that's it. Just purge the cache, in case.
MarkDHamill wrote:because phpBB injects the link to cron.php in the footer as an image link.
edit: you can use also overall_footer_after.html if you think is better.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

3Di, maybe I'm missing something but this would only work if the user has a client that is always on with the browser turned on. I'm not sure Praggle wants to do that and is looking for some external service that will handle that part.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [ALPHA] Digests 3.0.0

Post by 3Di »

MarkDHamill wrote:3Di, maybe I'm missing something but this would only work if the user has a client that is always on with the browser turned on. I'm not sure Praggle wants to do that and is looking for some external service that will handle that part.
I see, are you sure about that? I didn't test it ofcourse... just trying to help.
Praggle wrote:Will a digest be lost, if I use the default phpBB cron and nobody is using the board during the time of delivery? Or will it just be delivered next morning, when somebody is getting active on the board?
You didn't IMHO answered here, out of curiosity: will it be lost?
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: [ALPHA] Digests 3.0.0

Post by MarkDHamill »

I appreciate your suggestions. Adding a meta tag to refresh a web page requires a browser to be active. I haven't tested it but I can't see how it would work otherwise.

On Praggles question, currently digests requires that the phpBB cron be called at least once an hour so digests for that hour can be delivered for that hour. I may add a feature in a future version to check if hours were missed and if so create them. Digests might be delivered a bit late in these cases, but it would be a popular feature.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
Praggle
Registered User
Posts: 64
Joined: Thu Feb 26, 2015 6:07 pm

Re: [ALPHA] Digests 3.0.0

Post by Praggle »

MarkDHamill wrote:I may add a feature in a future version to check if hours were missed and if so create them. Digests might be delivered a bit late in these cases, but it would be a popular feature.
That would be a good solution!
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [ALPHA] Digests 3.0.0

Post by 3Di »

MarkDHamill wrote:I appreciate your suggestions. Adding a meta tag to refresh a web page requires a browser to be active. I haven't tested it but I can't see how it would work otherwise.
Are we missing the part where Bots and Crawlers are always active?
Also, I believe (I did read something about) that's possible to create a workaround in PHP if not directly in HTML. Google is our best friend.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

Return to “Extensions in Development”