<commit_before><?php
/*	Project:	EQdkp-Plus
 *	Package:	EQdkp-plus
 *	Link:		http://eqdkp-plus.eu
 *
 *	Copyright (C) 2006-2016 EQdkp-Plus Developer Team
 *
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU Affero General Public License as published
 *	by the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU Affero General Public License for more details.
 *
 *	You should have received a copy of the GNU Affero General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if(!defined('EQDKP_INC')) {
	die('Do not access this file directly.');
}

if(!class_exists('pdh_w_notifications')) {
	class pdh_w_notifications extends pdh_w_generic {
		
		public function add($strType, $intToUserID, $strFromUsername, $strRecordsetId, $strLink, $strAdditonalData=''){
			
			if($this->server_path != "/" && $this->server_path != ""){
				$strLink = str_replace($this->server_path, '{SERVER_PATH}', $strLink);
			} else {
				$strLink = '{SERVER_PATH}'.$strLink;
			}
			$strLink = str_replace($this->root_path, '{SERVER_PATH}', $strLink);
			$strLink = str_replace($this->SID, '{SID}', $strLink);
			$strLink = str_replace('?', '{SID}', $strLink);
			$strLink = str_replace('//', '/', $strLink);
			
			$objQuery = $this->db->prepare("INSERT INTO __notifications :p")->set(array(
					'type'				=> $strType,
					'user_id'			=> $intToUserID,
					'dataset_id'		=> $strRecordsetId,
					'username'			=> $strFromUsername,
					'link'				=> $strLink,
					'time'				=> $this->time->time,
					'additional_data'	=> $strAdditonalData,
			))->execute();

			if($objQuery) {
				$this->pdh->enqueue_hook('notifications_update', array($objQuery->insertId));
				return $objQuery->insertId;<commit_msg>Removed trailing slash<commit_after><?php
/*	Project:	EQdkp-Plus
 *	Package:	EQdkp-plus
 *	Link:		http://eqdkp-plus.eu
 *
 *	Copyright (C) 2006-2016 EQdkp-Plus Developer Team
 *
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU Affero General Public License as published
 *	by the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU Affero General Public License for more details.
 *
 *	You should have received a copy of the GNU Affero General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if(!defined('EQDKP_INC')) {
	die('Do not access this file directly.');
}

if(!class_exists('pdh_w_notifications')) {
	class pdh_w_notifications extends pdh_w_generic {
		
		public function add($strType, $intToUserID, $strFromUsername, $strRecordsetId, $strLink, $strAdditonalData=''){					
			if($this->server_path != "/" && $this->server_path != ""){
				$strLink = str_replace($this->server_path, '{SERVER_PATH}', $strLink);
			} else {
				$strLink = '{SERVER_PATH}'.$strLink;
			}
			
			$strLink = str_replace('{SERVER_PATH}/', '{SERVER_PATH}', $strLink);
			$strLink = str_replace($this->root_path, '{SERVER_PATH}', $strLink);
			$strLink = str_replace($this->SID, '{SID}', $strLink);
			$strLink = str_replace('?', '{SID}', $strLink);
			$strLink = str_replace('//', '/', $strLink);
			
			$objQuery = $this->db->prepare("INSERT INTO __notifications :p")->set(array(
					'type'				=> $strType,
					'user_id'			=> $intToUserID,
					'dataset_id'		=> $strRecordsetId,
					'username'			=> $strFromUsername,
					'link'				=> $strLink,
					'time'				=> $this->time->time,
					'additional_data'	=> $strAdditonalData,
			))->execute();

			if($objQuery) {
				$this->pdh->enqueue_hook('notifications_update', array($objQuery->insertId));
				return $objQuery->insertId;
{'fraction_non_alphanumeric': 0.1500960614793468, 'fraction_numerical': 0.004322766570605188, 'mean_word_length': 4.012033694344163, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1120156', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1379, 'n_words': 373}