[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!
Scam Warning
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)
Locked
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

You could disable the media embedded extension. You could also use text digests only. All HTML is removed. It's not terribly pretty, as you see nothing but plain text.

There is also nothing stopping you from patching my code or forking my extension making your own customized version. Some hints:
  • strip_tags() would let you decide which tags to allow, so don't allow <iframe> in the list of tags not to remove. I did something like this for my Smartfeed extension. This may be of interest.
  • Add the code after this line writing the result back to $digest_body.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

whocarez wrote:
Sun Feb 19, 2017 10:09 am
Another small issue is, that bots are also added to the digest, when a new one is added and Enable automatic subscriptions: is switched on. It is under normal circumstances no problem, but I used a script which added about 200 common bots and some of them had email addresses :-). So I got a lot of bounced emails for the standard weekly digest for which new users are automatically subscribed.

UPDATE `phpbb_users` SET `user_digest_type` = 'NONE' WHERE `group_id` =6 AND `user_digest_type` LIKE 'WEEK' solved the problem, but maybe the extension should exclude bots from subscribing to the digest :-).
In addition, it occurred to me that the SQL I used to fetch users to receive digests for a given hour could be improved to only permit normal users and founders to be in the query. So lines 410-455 of ext/phpbbservices/digests/cron/task/digests.php, currently:

Code: Select all

		// Get users requesting digests for the current hour. Also, grab the user's style, so the digest will have a familiar look.
		if ($this->config['override_user_style'])
		{
			$sql_array = array(
				'SELECT'	=> 'u.*, s.*',
			
				'FROM'		=> array(
					USERS_TABLE		=> 'u',
					STYLES_TABLE	=> 's',
				),
			
				'WHERE'		=> 's.style_id = ' . $this->config['default_style'] . ' 
								AND (' . 
									$daily_digest_sql . $weekly_digest_sql . $monthly_digest_sql . 
								") 
								AND (user_digest_send_hour_gmt = $current_hour_gmt OR user_digest_send_hour_gmt = $current_hour_gmt_plus_30) 
								AND user_inactive_reason = 0
								AND user_digest_type <> '" . constants::DIGESTS_NONE_VALUE . "'",
			
				'ORDER_BY'	=> ' user_lang',
			);
		}
		else
		{
			$sql_array = array(
				'SELECT'	=> 'u.*, s.*',
			
				'FROM'		=> array(
								USERS_TABLE		=> 'u',
								STYLES_TABLE	=> 's',
				),
			
				'WHERE'		=> 'u.user_style = s.style_id
								AND (' . 
									$daily_digest_sql . $weekly_digest_sql . $monthly_digest_sql . 
								") 
								AND (user_digest_send_hour_gmt = $current_hour_gmt OR user_digest_send_hour_gmt = $current_hour_gmt_plus_30) 
								AND user_inactive_reason = 0
								AND user_digest_type <> '" . constants::DIGESTS_NONE_VALUE . "'",
			
				'ORDER_BY'	=> 'user_lang',
			);
		}
will be this in the next version:

Code: Select all

		// Get users requesting digests for the current hour. Also, grab the user's style, so the digest will have a familiar look.
		$allowed_user_types = 'AND ' . $this->db->sql_in_set('user_type', array(USER_FOUNDER, USER_NORMAL));

		if ($this->config['override_user_style'])
		{

			$sql_array = array(
				'SELECT'	=> 'u.*, s.*',
			
				'FROM'		=> array(
					USERS_TABLE		=> 'u',
					STYLES_TABLE	=> 's',
				),
			
				'WHERE'		=> 's.style_id = ' . $this->config['default_style'] . ' 
								AND (' . 
									$daily_digest_sql . $weekly_digest_sql . $monthly_digest_sql . 
								") 
								AND (user_digest_send_hour_gmt = $current_hour_gmt OR user_digest_send_hour_gmt = $current_hour_gmt_plus_30) 
								AND user_inactive_reason = 0 " . $allowed_user_types . "
								AND user_digest_type <> '" . constants::DIGESTS_NONE_VALUE . "'",
			
				'ORDER_BY'	=> ' user_lang',
			);

		}
		else
		{

			$sql_array = array(
				'SELECT'	=> 'u.*, s.*',
			
				'FROM'		=> array(
								USERS_TABLE		=> 'u',
								STYLES_TABLE	=> 's',
				),
			
				'WHERE'		=> 'u.user_style = s.style_id
								AND (' . 
									$daily_digest_sql . $weekly_digest_sql . $monthly_digest_sql . 
								") 
								AND (user_digest_send_hour_gmt = $current_hour_gmt OR user_digest_send_hour_gmt = $current_hour_gmt_plus_30) 
								AND user_inactive_reason = 0 " . $allowed_user_types . "
								AND user_digest_type <> '" . constants::DIGESTS_NONE_VALUE . "'",
			
				'ORDER_BY'	=> 'user_lang',
			);
		}
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
whocarez
Registered User
Posts: 158
Joined: Sat Apr 18, 2009 9:19 pm

Re: [RC] Digests 3.2.0-RC7

Post by whocarez »

Thank you!
andy65
Registered User
Posts: 2
Joined: Sat Feb 25, 2017 8:18 pm

Re: [RC] Digests 3.2.0-RC7

Post by andy65 »

Hallo at all,

i have a private forum and this ext is very good for me.

I'm trying to set up a cron to send the digest to users but I have problems.

Cron is as follows:
/usr/local/cpanel/3rdparty/bin/php /home2/degustib/public_html/forum/phpbb/bin/phpbbcli.php cron:run

the cpanel returns the following errors:
PHP Warning: include(./includes/functions_content.php): failed to open stream: No such file or directory in /home/degustib/public_html/forum/phpbb/ext/phpbbservices/digests/cron/task/digests.php on line 271
PHP Warning: include(./includes/functions_content.php): failed to open stream: No such file or directory in /home/degustib/public_html/forum/phpbb/ext/phpbbservices/digests/cron/task/digests.php on line 271
PHP Warning: include(): Failed opening './includes/functions_content.php' for inclusion (include_path='/usr/local/cpanel/3rdparty/php/56/lib/php:.') in /home/degustib/public_html/forum/phpbb/ext/phpbbservices/digests/cron/task/digests.php on line 271
I'm using the latest version of Digest for PHPBB3 3.2

How can I fix the problem?
Thanks and bye!
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

It appears that the system cron is not being run from the phpBB root path. Read the Wiki.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
andy65
Registered User
Posts: 2
Joined: Sat Feb 25, 2017 8:18 pm

Re: [RC] Digests 3.2.0-RC7

Post by andy65 »

Thank you...

in fact i set a cron on cpanel:
/usr/local/cpanel/3rdparty/bin/php /home2/degustib/public_html/forum/phpbb/bin/phpbbcli.php cron:run


but i have this reply from my cpanel
PHP Warning: include(./includes/functions_content.php): failed to open stream: No such file or directory in /home/degustib/public_html/forum/phpbb/ext/phpbbservices/digests/cron/task/digests.php on line 271
PHP Warning: include(./includes/functions_content.php): failed to open stream: No such file or directory in /home/degustib/public_html/forum/phpbb/ext/phpbbservices/digests/cron/task/digests.php on line 271
PHP Warning: include(): Failed opening './includes/functions_content.php' for inclusion (include_path='/usr/local/cpanel/3rdparty/php/56/lib/php:.') in /home/degustib/public_html/forum/phpbb/ext/phpbbservices/digests/cron/task/digests.php on line 271


[Twig_Error_Loader]
The "" directory does not exist.


cron:run [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--safe-mode] [-e|--env ENV] [--] <command> [<name>]

if i modify the cron:
/usr/local/cpanel/3rdparty/bin/php /home2/degustib/public_html/forum/phpbb/bin/phpbbcli.php cron:run


Cpanel reply to me:
[RuntimeException]
Could not obtain cron lock.


cron:run [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--safe-mode] [-e|--env ENV] [--] <command> [<name>]
i don't know how is wrong... :cry:
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

I think it's because you are using absolute path names.

I have found on shared hosting that crons sometimes don't allow multiple commands. That's why I added to the Wiki page a workaround for these situations using wget or curl. You might want to try that. Look for my link a few posts back.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
stevenospam
Registered User
Posts: 45
Joined: Thu Dec 15, 2011 2:02 am

Re: [RC] Digests 3.2.0-RC7 upgrade to 3.2 problem

Post by stevenospam »

I am upgrading from PHPBB 3.0 Digests 2.2.21 to PHPBB 3.2. I followed the upgrade to 3.2 procedures without a problem and ran the install update database successfully. I copied the files from the Digest 3.2.0-RC7 unzipped directory to /phpbb3/ext/phpbbservices/digests. Under the digests directory there are the directories acp thru ucp and the ext.php file as well as composer.json, etc. When I try to enable the extension from the ACP I get the screen to confirm the Digest enable and then:
The forum.mydomain.com page isn’t working

forum.mydomain.com is currently unable to handle this request.
HTTP ERROR 500

I'm stuck!
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

Not much to go on here. Did you apply this code patch?

Are you using the version for phpBB 3.2 linked on the first post of the topic?

HTTP 500 errors are usually written to the web server error log. You may find it in your web host control panel or in a file called error_log in your forum folder or web root folder. There may be clues there.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
stevenospam
Registered User
Posts: 45
Joined: Thu Dec 15, 2011 2:02 am

Re: [RC] Digests 3.2.0-RC7

Post by stevenospam »

The suggested fix did the trick and Digests is now enabled. I'm confused though because I don't find any digest config modules when I look in the ACP's System/Module Management/Administration Control Panel. I do see Digests in System/Module Management/User Control Panel. Where do I config the Digest defaults for everyone?
richey
Registered User
Posts: 619
Joined: Mon Feb 18, 2002 4:26 pm
Location: now@Cyberspace
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by richey »

Hi,

I've uninstalled my previous version of Digests, deleted the old files, uploaded the new ones, wanted to enable the Extension, but received a strange error message in a red box:
Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.

A module already exists: ACP_CAT_DIGESTS

Return to the extension list
The extension has not been installed. Any idea what I can do to fix this?
.
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

stevenospam wrote:
Tue Mar 07, 2017 11:55 pm
The suggested fix did the trick and Digests is now enabled. I'm confused though because I don't find any digest config modules when I look in the ACP's System/Module Management/Administration Control Panel. I do see Digests in System/Module Management/User Control Panel. Where do I config the Digest defaults for everyone?
Perhaps uninstalling the extension then reinstalling it will fix this issue, just make sure to make the code patch before enabling the extension next time.

They can be entered manually but you really have to know what you are doing.

Or you can try the solution in the next post.
Last edited by MarkDHamill on Thu Mar 09, 2017 3:33 am, edited 1 time in total.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by MarkDHamill »

richey wrote:
Wed Mar 08, 2017 11:57 am
Hi,

I've uninstalled my previous version of Digests, deleted the old files, uploaded the new ones, wanted to enable the Extension, but received a strange error message in a red box:
Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.

A module already exists: ACP_CAT_DIGESTS

Return to the extension list
The extension has not been installed. Any idea what I can do to fix this?
My recommendation is to remove them through the database.

First, disable the extension if it is enabled.

Next, get rid of all modules for digest that may exist using a tool like phpMyAdmin. Change the table prefix here from phpbb_ if you don't use that table prefix:

Code: Select all

DELETE FROM `phpbb_modules` WHERE `module_langname` LIKE '%DIGEST%';
Next purge the cache.

Then try enabling the extension again.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
richey
Registered User
Posts: 619
Joined: Mon Feb 18, 2002 4:26 pm
Location: now@Cyberspace
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by richey »

Hi Mark,
MarkDHamill wrote:
Thu Mar 09, 2017 3:27 am

Code: Select all

DELETE FROM `phpbb_modules` WHERE `module_langname` LIKE '%DIGEST%';
Next purge the cache.
Then try enabling the extension again.
in my phpbb_modules table, there is nothing that contains the string 'digest'! :shock:
.
richey
Registered User
Posts: 619
Joined: Mon Feb 18, 2002 4:26 pm
Location: now@Cyberspace
Contact:

Re: [RC] Digests 3.2.0-RC7

Post by richey »

p.s. the whole database doesn't contain "acp_digests" (except for the log table which contains that the module was removed), which makes it even more strange ...
.
Locked

Return to “Extensions in Development”