[BETA] [3.2] Prime Notify

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!
Suggested Hosts
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
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

I wouldn't modify the phpBB's core file but you could probably modify the version in my extension. Something like this:

Code: Select all

		$template_vars['FORUM_NAME'] = $this->get_data('forum_name');
Put it in the get_email_template_Variables() function just prior to the return statement. Note that I have not tested this.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

frankv
Registered User
Posts: 17
Joined: Mon May 24, 2004 6:37 pm

Re: [BETA] [3.2] Prime Notify

Post by frankv »

Code: Select all

			$username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
		}
		$template_vars['FORUM_NAME'] = $this->get_data('forum_name');

		return array(
			'AUTHOR_NAME'				=> htmlspecialchars_decode($username),
Nope

User avatar
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

I don't know where you put that but it wasn't in the ext\primehalo\primenotify\notification\type\post.php file. My guess is you put it in the core phpBB file.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

frankv
Registered User
Posts: 17
Joined: Mon May 24, 2004 6:37 pm

Re: [BETA] [3.2] Prime Notify

Post by frankv »

It is still not working in the core File

Code: Select all

public function get_email_template_variables()
	{
		if ($this->get_data('post_username'))
		{
			$username = $this->get_data('post_username');
		}
		else
		{
			$username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
		}
		$template_vars['FORUM_NAME'] = $this->get_data('forum_name');

		return array(
			'AUTHOR_NAME'				=> htmlspecialchars_decode($username),
			'POST_SUBJECT'				=> htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
			'TOPIC_TITLE'				=> htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),

			'U_VIEW_POST'				=> generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
			'U_NEWEST_POST'				=> generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread",
			'U_TOPIC'					=> generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
			'U_VIEW_TOPIC'				=> generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
			'U_FORUM'					=> generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}",
			'U_STOP_WATCHING_TOPIC'		=> generate_board_url() . "/viewtopic.{$this->php_ext}?uid={$this->user_id}&f={$this->get_data('forum_id')}&t={$this->item_parent_id}&unwatch=topic",
		);
	}
:-(

User avatar
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

Don't put it in the core file!
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

frankv
Registered User
Posts: 17
Joined: Mon May 24, 2004 6:37 pm

Re: [BETA] [3.2] Prime Notify

Post by frankv »

I tried to put it in your file and in the core file.

Still not working.
You may tell me the exact place in your file to put it?

Thank you again, Frank

User avatar
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

You tried to put it in my file and it didn't work? You put it in ext\primehalo\primenotify\notification\type\post.php? It should work there, I don't see why it wouldn't.

Code: Select all

	public function get_email_template_variables()
	{
		$prime_notify = \primehalo\primenotify\core\prime_notify::Instance();
		$template_vars = parent::get_email_template_variables();
		$msg = utf8_decode_ncr(censor_text($this->get_data('prime_notify_text')));
		$template_vars['MESSAGE'] = htmlspecialchars_decode($msg);
		$template_vars['S_VISIT_MSG'] = !$prime_notify->is_enabled('always_send', $this->user_loader->get_user($this->user_id));
		$template_vars['FORUM_NAME'] = $this->get_data('forum_name');
		return $template_vars;
	}
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

frankv
Registered User
Posts: 17
Joined: Mon May 24, 2004 6:37 pm

Re: [BETA] [3.2] Prime Notify

Post by frankv »

Thanks for your patience, I had a brick in front of my head.

Now it works!

Have a nice day and thank you again!

User avatar
3Di
Former Team Member
Posts: 15455
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [BETA] [3.2] Prime Notify

Post by 3Di »

primehalo wrote:
Sat Nov 02, 2019 6:34 pm

Code: Select all

		$msg = utf8_decode_ncr(censor_text($this->get_data('prime_notify_text')));
While the decode function remains the same in 3.2.9, the encode one I changed before of merge, see:
https://github.com/phpbb/phpbb/pull/5682/files

Since 3.2.9 is preferred to just use utf8_encode_ucr() instead of the block of code which uses utf8_encode_ncr().

Ie.: $msg = utf8_encode_ucr($msg);
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

User avatar
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

I had searched all PHP files for utf8_encode_ucr and came up empty. Is this a new function in phpBB 3.2.9?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
3Di
Former Team Member
Posts: 15455
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [BETA] [3.2] Prime Notify

Post by 3Di »

primehalo wrote:
Sat Nov 02, 2019 8:07 pm
I had searched all PHP files for utf8_encode_ucr and came up empty. Is this a new function in phpBB 3.2.9?
Yes, as I said before
3Di wrote:
Sat Nov 02, 2019 7:36 pm
Since 3.2.9
https://github.com/phpbb/phpbb/pull/568 ... fe7ac1R421
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

User avatar
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

Sorry, I didn't meant to sound stupid. I was just a little unclear about if it was a new function or a modification of an existing function. I don't want to restrict users to phpBB 3.2.9 but I can implement both methods, using utf8_encode_ucr if it exists and the current method if it doesn't. I don't run pre-release versions of phpBB so I'll need to wait for it to be released before I can test it.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
3Di
Former Team Member
Posts: 15455
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [BETA] [3.2] Prime Notify

Post by 3Di »

Sure, if (function_exist('blah') {} else {}. Just I wanted to inform you about the new function.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

achos2019
Registered User
Posts: 2
Joined: Tue Dec 03, 2019 8:35 pm

Re: [BETA] [3.2] Prime Notify

Post by achos2019 »

Dear all,

i have upgraded my board to 3.2.8 and since them the Prime Notify stops working(no emails where send). So my next step was to disable and uninstall the old beta version of primenotify. Then i installed the new version 1.0.0 but after enabling the problem still exist.

so i need help to get it working.Are there any known problems with version 3.2.8 ?

Thanks and best regards

Florian

User avatar
primehalo
Former Team Member
Posts: 2888
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] [3.2] Prime Notify

Post by primehalo »

As far as I know there aren't any issues. Do you receive the regular notification emails after uninstalling the extension?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

Post Reply

Return to “Extensions in Development”