getRecoverPass() != $_GET['recoverpass']) {
?>
emailLogo = "";
return $obj;
}
public function getPluginVersion() {
- return "2.1";
+ return "2.2";
}
public function updateScript() {
global $global;
//update version 2.0
if (AVideoPlugin::compareVersion($this->getName(), "2.0") < 0) {
$sqls = file_get_contents($global['systemRootPath'] . 'plugin/ReportVideo/install/updateV2.0.sql');
$sqlParts = explode(";", $sqls);
foreach ($sqlParts as $value) {
sqlDal::writeSql(trim($value));
}
}
//update version 2.1
if (AVideoPlugin::compareVersion($this->getName(), "2.1") < 0) {
$sqls = file_get_contents($global['systemRootPath'] . 'plugin/ReportVideo/install/updateV2.1.sql');
$sqlParts = explode(";", $sqls);
foreach ($sqlParts as $value) {
sqlDal::writeSql(trim($value));
}
}
return true;
}
public function getWatchActionButton($videos_id) {
global $global, $video;
if (!isVideo()) {
return '';
}
if (empty($video['id']) && empty($videos_id)) {
return '';
}
if (empty($video['id'])) {
$video['id'] = intval($videos_id);
}
include $global['systemRootPath'] . 'plugin/ReportVideo/actionButton.php';
if (isVideo() && !empty($video['users_id'])) {
$users_id = $video['users_id'];
echo self::actionButtonBlockUser($users_id);
}
}
function send($email, $subject, $body) {
if (empty($email)) {
return false;
}
global $global, $config;
- require_once $global['systemRootPath'] . 'objects/phpmailer/src/PHPMailer.php';
- require_once $global['systemRootPath'] . 'objects/phpmailer/src/SMTP.php';
- require_once $global['systemRootPath'] . 'objects/phpmailer/src/Exception.php';
+ require_once $global['systemRootPath'] . 'objects/PHPMailer/phpmailer/src/PHPMailer.php';
+ require_once $global['systemRootPath'] . 'objects/PHPMailer/phpmailer/src/SMTP.php';
+ require_once $global['systemRootPath'] . 'objects/PHPMailer/phpmailer/src/Exception.php';
//Create a new PHPMailer instance
$mail = new \PHPMailer\PHPMailer\PHPMailer;
setSiteSendMessage($mail);
//Set who the message is to be sent from
$mail->setFrom($config->getContactEmail(), $config->getWebSiteTitle());
//Set who the message is to be sent to
$mail->addAddress($email);
//$mail->addAddress($config->getContactEmail());
//Set the subject line
$mail->Subject = $subject;
$mail->msgHTML($body);
//send the message, check for errors
if ($mail->send()) {
_error_log("Notification email sent [{$subject}]");
return true;
} else {
_error_log("Notification email FAIL [{$subject}] - " . $mail->ErrorInfo);
return false;
}
}
private function replaceText($users_id, $videos_id, $text) {
$user = new User($users_id);
$userName = $user->getNameIdentification();
$video = new Video("", "", $videos_id);
$videoName = $video->getTitle();
$videoLink = Video::getPermaLink($videos_id);
$words = array($userName, $videoName, $videoLink);
$replace = array('{user}', '{videoName}', '{videoLink}');
return str_replace($replace, $words, $text);
}
private function getTemplateText($videos_id, $message) {
global $global, $config;
$obj = $this->getDataObject();
$text = file_get_contents("{$global['systemRootPath']}plugin/ReportVideo/template.html");
$video = new Video("", "", $videos_id);
$videoName = $video->getTitle();
$images = Video::getImageFromFilename($video->getFilename());
$videoThumbs = "