/**
 * Delete user notifiactions when user deleted
 *
 * @return void;
 * @access private
 */
function ossn_user_notifications_delete($callback, $type, $params)
{
    $delete = new OssnNotifications();
    $delete->deleteUserNotifications($params['entity']);
}
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
//declear empty variables;
$friends_c = '';
//init classes
$notification = new OssnNotifications();
$messages = new OssnMessages();
$count_notif = $notification->countNotification(ossn_loggedin_user()->guid);
$count_messages = $messages->countUNREAD(ossn_loggedin_user()->guid);
$friends = ossn_loggedin_user()->getFriendRequests();
if (count($friends) > 0 && !empty($friends)) {
    $friends_c = count($friends);
}
?>
<li id="ossn-notif-friends">
    <a onClick="Ossn.NotificationFriendsShow(this);" class="ossn-notifications-friends" href="javascript::;">
                       <span>
                      <?php 
if ($friends_c > 0) {
    ?>
                          <div class="ossn-icon ossn-icons-topbar-friends-new ossn-icons-topbar"></div>
                          <span class="ossn-notification-container"><?php 
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
?>
    <h2><?php 
echo ossn_print('notifications');
?>
</h2>
<?php 
$get = new OssnNotifications();
$notifications = $get->get(ossn_loggedin_user()->guid);
echo '<div class="ossn-notifications-all ossn-notification-page">';
if ($notifications) {
    foreach ($notifications as $not) {
        echo "{$not}";
    }
}
echo '</div>';
Example #4
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$user = ossn_loggedin_user();
$notification = new OssnNotifications();
if ($notification->clearAll($user->guid)) {
    ossn_trigger_message(ossn_print('ossn:notification:mark:read:success'));
    redirect(REF);
} else {
    ossn_trigger_message(ossn_print('ossn:notification:mark:read:error'), 'error');
    redirect(REF);
}