/** * Comment likes delete * * @return voud; * @access private */ function ossn_comment_like_delete($name, $type, $params) { $delete = new OssnLikes(); if (!isset($params['comment'])) { return false; } $delete->deleteLikes($params['comment'], 'annotation'); if (isset($params['annotation'])) { $delete->deleteLikes($params['annotation'], 'annotation'); } }
<?php /** * Open Source Social Network * * @packageOpen Source Social Network * @author Open Social Website Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ ossn_trigger_callback('comment', 'load', $params['comment']); $OssnLikes = new OssnLikes(); $comment = arrayObject($params['comment'], 'OssnWall'); $user = ossn_user_by_guid($comment->owner_guid); if ($comment->type == 'comments:post' || $comment->type == 'comments:entity') { $type = 'annotation'; } $likes_total = $OssnLikes->CountLikes($comment->id, $type); $datalikes = ''; if ($likes_total > 0) { $datalikes = $likes_total; $likes_total = '<span class="dot-likes">.</span><div class="ossn-like-icon"></div>' . $likes_total; } ?> <div class="comments-item" id="comments-item-<?php echo $comment->id; ?> "> <div class="ossn-comment-menu" onclick="Ossn.CommentMenu(this);"> <?php
<?php /** * Open Source Social Network * * @package Open Source Social Network * @author Open Social Website Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $OssnLikes = new OssnLikes(); $OssnComments = new OssnComments(); $object = $params['entity_guid']; $count = $OssnLikes->CountLikes($object, 'entity'); if (ossn_isLoggedIn()) { ?> <div class="like_share comments-like-comment-links"> <div id="ossn-like-<?php echo $object; ?> " class="button-container"> <?php if (!$OssnLikes->isLiked($object, ossn_loggedin_user()->guid, 'entity')) { $link['onclick'] = "Ossn.EntityLike({$object});"; $link['href'] = 'javascript::;'; $link['text'] = ossn_print('ossn:like'); echo ossn_view('system/templates/link', $link); } else { $user_liked = true; $link['onclick'] = "Ossn.EntityUnlike({$object});";
<?php /** * Open Source Social Network * * @packageOpen Source Social Network * @author Open Social Website Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $OssnLikes = new OssnLikes(); $anotation = input('post'); $entity = input('entity'); if (!empty($anotation)) { $subject = $anotation; $type = 'post'; } if (!empty($entity)) { $subject = $entity; $type = 'entity'; } if ($OssnLikes->Like($subject, ossn_loggedin_user()->guid, $type)) { if (!ossn_is_xhr()) { redirect(REF); } else { header('Content-Type: application/json'); echo json_encode(array('done' => 1, 'button' => ossn_print('ossn:unlike'))); } } else { if (!ossn_is_xhr()) {
<?php /** * Open Source Social Network * * @package Open Source Social Network * @author Open Social Website Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $OssnLikes = new OssnLikes(); $anotation = input('annotation'); if ($OssnLikes->UnLike($anotation, ossn_loggedin_user()->guid, 'annotation')) { if (!ossn_is_xhr()) { redirect(REF); } else { header('Content-Type: application/json'); echo json_encode(array('done' => 1, 'button' => 'Like')); } } else { if (!ossn_is_xhr()) { redirect(REF); } else { header('Content-Type: application/json'); echo json_encode(array('done' => 0, 'button' => 'Unlike')); } } exit;
/** * Delete photos like * * @return voud; * @access private */ function ossn_photos_likes_comments_delete($name, $type, $params) { if (class_exists('OssnLikes')) { $likes = new OssnLikes(); $likes->deleteLikes($params['photo']['guid'], 'entity'); $comments = new OssnComments(); $comments->commentsDeleteAll($params['photo']['guid'], 'comments:entity'); } }
<?php /** * Open Source Social Network * * @packageOpen Source Social Network * @author Open Social Website Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $OssnLikes = new OssnLikes(); $object = $params->guid; $count = $OssnLikes->CountLikes($object); $user_liked = ''; if (ossn_isLoggedIn()) { if ($OssnLikes->isLiked($object, ossn_loggedin_user()->guid)) { $user_liked = true; } } /* Likes and comments don't show for nonlogged in users */ if ($OssnLikes->CountLikes($object)) { ?> <div class="like_share"> <div class="ossn-like-icon"></div> <?php if ($user_liked == true && $count == 1) { ?> <?php echo ossn_print("ossn:liked:you"); ?>