Skip to content

Commit

Permalink
Adjusted the Licensing to GPL 3.0
Browse files Browse the repository at this point in the history
Also, minor bug fixes.
  • Loading branch information
Michieal authored Feb 10, 2022
1 parent a12ec41 commit 16ab6eb
Show file tree
Hide file tree
Showing 9 changed files with 743 additions and 20 deletions.
674 changes: 674 additions & 0 deletions MarkNotification/LICENSE.txt

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions MarkNotification/actions/delnotif.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* Open Source Social Network
* @link https://www.opensource-socialnetwork.org/
* @package MarkNotification
* @author Michieal O'Sullivan
* @copyright (C) Apophis Software
* @license GNU General Public License https://www.gnu.org/licenses/gpl-3.0.en.html
*/
require_once(__MARKNOTIFICATION__ . "libraries/marknotif.php");

$guid = filter_var($_GET['guid'], FILTER_VALIDATE_INT);
Expand Down
8 changes: 8 additions & 0 deletions MarkNotification/actions/marknotif.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* Open Source Social Network
* @link https://www.opensource-socialnetwork.org/
* @package MarkNotification
* @author Michieal O'Sullivan
* @copyright (C) Apophis Software
* @license GNU General Public License https://www.gnu.org/licenses/gpl-3.0.en.html
*/
require_once(__MARKNOTIFICATION__ . "libraries/marknotif.php");

$guid = filter_var($_GET['guid'], FILTER_VALIDATE_INT);
Expand Down
8 changes: 8 additions & 0 deletions MarkNotification/actions/markunread.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* Open Source Social Network
* @link https://www.opensource-socialnetwork.org/
* @package MarkNotification
* @author Michieal O'Sullivan
* @copyright (C) Apophis Software
* @license GNU General Public License https://www.gnu.org/licenses/gpl-3.0.en.html
*/
require_once(__MARKNOTIFICATION__ . "libraries/marknotif.php");

$guid = filter_var($_GET['guid'], FILTER_VALIDATE_INT);
Expand Down
27 changes: 17 additions & 10 deletions MarkNotification/libraries/marknotif.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* Open Source Social Network
* @link https://www.opensource-socialnetwork.org/
* @package MarkNotification
* @author Michieal O'Sullivan
* @copyright (C) Apophis Software
* @license GNU General Public License https://www.gnu.org/licenses/gpl-3.0.en.html
*/

/**
* Mark the singular Notification as read.
Expand All @@ -12,12 +20,12 @@ function marknotif_read($guid) {
return false;
}
$Notification = new OssnNotifications;
error_log("Notification marked read.");
$Notification->statement("UPDATE ossn_notifications SET viewed='' WHERE(owner_guid='{ossn_loggedin_user()->getGUID()}' and guid='{$guid}');");
$ownerGuid = ossn_loggedin_user()->getGUID();
$Notification->statement("UPDATE ossn_notifications SET viewed='' WHERE(owner_guid='{$ownerGuid}' and guid='{$guid}');");
if($Notification->execute()) {
return true;
}
error_log("Notification failed to mark read.");
error_log("Notification failed to mark read.",0);
return false;

}
Expand All @@ -38,12 +46,12 @@ function marknotif_unread($guid) {
// if the value is not null it's read.
$nix = NULL;
$Notification = new OssnNotifications;
error_log("Notification marked unread.");
$Notification->statement("UPDATE ossn_notifications SET viewed={$nix} WHERE(owner_guid='{ossn_loggedin_user()->getGUID()}' and guid='{$guid}');");
$ownerGuid = ossn_loggedin_user()->getGUID();
$Notification->statement("UPDATE ossn_notifications SET viewed={$nix} WHERE(owner_guid='{$ownerGuid}' and guid='{$guid}');");
if($Notification->execute()) {
return true;
}
error_log("Notification failed to mark unread.");
error_log("Notification failed to mark unread.",0);
return false;
}

Expand All @@ -59,15 +67,14 @@ function marknotif_delete($guid) {
if (empty($guid)) {
return false;
} else {
;
$ownerGuid = ossn_loggedin_user()->getGUID();
$Notification->statement("DELETE FROM ossn_notifications WHERE(
owner_guid='{ossn_loggedin_user()->getGUID()}' and guid='{$guid}');");
owner_guid='{$ownerGuid}' and guid='{$guid}');");
if ($Notification->execute()) {
error_log("Notification Deleted Successfully.");
return true;
}
}
error_log("Notification Deletion Failed.");
error_log("Notification Deletion Failed.",0);
return false;
}

8 changes: 8 additions & 0 deletions MarkNotification/locale/ossn.en.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* Open Source Social Network
* @link https://www.opensource-socialnetwork.org/
* @package MarkNotification
* @author Michieal O'Sullivan
* @copyright (C) Apophis Software
* @license GNU General Public License https://www.gnu.org/licenses/gpl-3.0.en.html
*/
ossn_register_languages('en', array(
'mark:notification:read' => 'Mark Read ✔️',
'mark:notification:read:title' => 'Mark Notification as read.',
Expand Down
11 changes: 11 additions & 0 deletions MarkNotification/ossn_com.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<?php

/**
* Apophis Software Component for OSSN v. 5.6 - 6.1.
*
* @package Apophis Software MarkNotification
* @author Apophis Software
* @copyright (C) Apophis Software
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
* @link https://www.apophissoftware.com/
*/

define('__MARKNOTIFICATION__', ossn_route()->com . 'MarkNotification/');

function ossn_mark_notifications_init() {
Expand Down
10 changes: 5 additions & 5 deletions MarkNotification/ossn_com.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<component xmlns="http://www.opensource-socialnetwork.org/v/3.0">
<name>Mark Notification</name>
<id>MarkNotification</id>
<author>Michieal O'Sullivan</author>
<description>Allows Users to mark a notification as read, without being taken to the notification's topic item.</description>
<license>Open Source Social Network License (OSSN LICENSE)</license>
<author_url>http://www.apophissoftware.com</author_url>
<license_url>http://www.opensource-socialnetwork.org/licence/</license_url>
<author>Michieal O'Sullivan</author>
<author_url>https://www.apophissoftware.com/</author_url>
<license>GNU General Public License v3</license>
<license_url>https://www.gnu.org/licenses/gpl-3.0.en.html</license_url>
<version>6.1</version>
<requires>
<type>ossn_version</type>
<version>6.1</version>
<version>6.1.0.1</version>
</requires>
<requires>
<type>ossn_component</type>
Expand Down
9 changes: 4 additions & 5 deletions MarkNotification/plugins/default/marknotif/pages/all.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php
/**
* Open Source Social Network
*
* @package (softlab24.com).ossn
* @author OSSN Core Team <[email protected]>
* @copyright (C) SOFTLAB24 LIMITED
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
* @link https://www.opensource-socialnetwork.org/
* @package MarkNotification
* @author Michieal O'Sullivan
* @copyright (C) Apophis Software
* @license GNU General Public License https://www.gnu.org/licenses/gpl-3.0.en.html
*/

$get = new OssnNotifications;
Expand Down

0 comments on commit 16ab6eb

Please sign in to comment.