</span></a> <?php } else { ?> <a href="#" class="project-action-btn" id="liked_project" data-id="<?php echo $project['project_id']; ?> " style="display: none;">Liked <span class="totalLikes"><?php echo getLikes($project['project_id']); ?> </span></a> <a href="#" class="project-action-btn" id="like_project" data-id="<?php echo $project['project_id']; ?> ">Like <span class="totalLikes"><?php echo getLikes($project['project_id']); ?> </span></a> <?php } ?> <a href="#" class="project-action-btn" id="report_project" data-id="<?php echo $project['project_id']; ?> ">Report</a> <a href="#" class="project-action-btn" id="report_project" data-id="<?php echo $project['project_id']; ?> "><img src = "images/shareicon.png" width = "18" height = "18"></a>
} //Like an activity if (isset($_REQUEST['action']) && $_REQUEST['action'] == "addlike") { $success = addNewLike($pdo); if ($success == "allok") { $reply['status'] = "success"; } else { $reply['status'] = "fail"; } } //Get count and list of people liked a post if (isset($_REQUEST['action']) && $_REQUEST['action'] == "like") { $result = array(); $noOfLikes = getNoOfLikes($pdo); if ($noOfLikes != 0) { $result = getLikes($pdo); if ($result != null) { $reply['status'] = "success"; $reply['total_l'] = $noOfLikes; $reply['like'] = $result; } else { $reply['status'] = "fail"; } } else { $reply['status'] = "success"; $reply['total_l'] = "No"; $reply['like'] = $result; } } //Get the list of question and the users question if (isset($_REQUEST['action']) && $_REQUEST['action'] == "questionlist") {
function addLike($ip, $dedicationId) { global $likesTable; global $likesTableAttributes; global $database; global $mysqli; $ip = mysqli_real_escape_string($mysqli, $ip); $dedicationId = mysqli_real_escape_string($mysqli, $dedicationId); $query = "SELECT * FROM `" . $database . "`.`" . $likesTable . "` WHERE `ip` = '" . $ip . "' AND `dedicationId` = '" . $dedicationId . "' "; $result = $mysqli->query($query); if (mysqli_num_rows($mysqli->query($query)) == null) { $query = "INSERT INTO `" . $database . "`.`" . $likesTable . "` (" . $likesTableAttributes . ") VALUES (NULL, '" . $ip . "', '" . $dedicationId . "', CURRENT_TIMESTAMP);"; if ($mysqli->query($query)) { increaseLikesCount($dedicationId); } } return getLikes($dedicationId); }
} // betarea pre-set bets $coinperbet = $game['g_coinPerBet']; $betarr = array($coinperbet, $coinperbet * 2, $coinperbet * 3, $coinperbet * 4, $coinperbet * 5, $coinperbet * 5 * 2); // for getting related games $temp = array(); $related_games = array(); $games_file = $basedir . '/temp/all_games.txt'; if (file_exists($games_file)) { $all_games = json_decode(file_get_contents($games_file), true); } else { $all_games = getAllGames(); } $all_games = filterPublicGames($all_games); if ($user_id) { $my_likes = getLikes($user_id); $my_bookmarks = getBookmarks($user_id); } else { $my_likes = false; $my_bookmarks = false; } $i = 0; foreach ($all_games as $ag) { if ($LANGUAGE == 'en') { $this_field = 'g_engPage'; } else { $this_field = 'g_japPage'; } if ($i == $config['list_area_recs_per_page']) { break; }
<h4><a id="likeButton" href="like.php?type=photographs&id=<?php echo $photo->id; ?> " onclick="javascript: location.reload();" data-role="button" class="btn btn-lg btn-success "> <span class="glyphicon glyphicon-thumbs-up hvr-push "></span></a> <a id="commentButton" href="photo.php?id=<?php echo $photo->id; ?> " data-role="button" class="btn btn-lg btn-primary"> <span class="glyphicon glyphicon-comment hvr-push"></span></a> <span class="btn-lg btn-danger glyphicon glyphicon-heart pull-right"><?php include 'getLikes.php'; getLikes($photo->id); ?> </span> </h4> </div> </div> </div> <div class="col-lg-3"> <?php foreach ($photos2 as $photo2) { ?> <div class="hvr-float-shadow"> <div class="photos1"> <a href="photo2.php?id=<?php echo $photo2->id;
$url = SITE_URL . '/home.php?iid=' . $_POST['ideathread_id']; $text = '<i>' . ucwords($user) . '</i>' . ' liked your ideathread ' . '<i>' . $ideathread_title . '</i>'; addNotification($sent_to, $text, $_SESSION['uid'], $url); plusInteraction($_POST['ideathread_id']); addInteraction($_SESSION['uid'], 'like', $sent_to, 'ideathread', $_POST['ideathread_id']); } else { $responce['result'] = ''; } echo json_encode($responce); //print_r(json_encode($response)); break; case 'remove-like-project': require_once DIR_APP . 'projects.php'; $id = RemoveProjectLike($_POST['project_id'], $_SESSION['uid']); if (!empty($id)) { $likes = getLikes($_POST['project_id']); $responce['result'] = 'OK'; $responce['id'] = $id; $responce['likes'] = $likes; } else { $responce['result'] = ''; } echo json_encode($responce); break; case 'remove-like-idea': require_once DIR_APP . 'projects.php'; $id = RemoveIdeaLike($_POST['ideathread_id'], $_SESSION['uid']); minusInteraction($_POST['ideathread_id']); if (!empty($id)) { $likes = getIdeaLikes($_POST['ideathread_id']); $responce['result'] = 'OK';