/** * Get the actual like count * @param no-param * @return int */ function iva_post_like() { $can_vote = false; $postid = $_POST['post_id']; $postcount = get_post_meta($postid, 'post_like', true); $task = $_POST['task']; $ip = GetIpAddress(); $has_already_voted = Alreadyliked($postid, $ip); if (!$has_already_voted) { $can_vote = true; } if ($can_vote) { if ($task == "like") { $like_count = get_post_meta($postid, 'post_like', true); update_post_meta($postid, 'post_like', $like_count + 1); $postcount = get_post_meta($postid, 'post_like', true); } } echo $postcount; exit; }
} //execute if login button pressed if (isset($_POST['submit'])) { //check if ip address is blocked $blocked = ConfirmIpAddress(GetIpAddress()); if ($blocked != 1) { //if username and password match if (ConfirmUser($_POST['username'], MD5($_POST['password']))) { $_SESSION['user_logged'] = $_POST['username']; $_SESSION['user_password'] = MD5($_POST['password']); //select all athletes at start $_SESSION['select_all'] = 1; //ClearLoginAttempts(GetIpAddress()); redirect("./logged_user.php", 301); } else { AddLoginAttempt(GetIpAddress()); ?> <p> Invalid Username and/or Password<br /> Not registered? </p> <p> <a href="register.php">Click here</a> to register. </p> <form name="user_login" action="<?php echo $_SERVER['$PHP_SELF']; ?> " method="post"> <fieldset> <label for="username"> Username: <input type="text" name="username" id="username" /> </label> <label for="password"> Password: <input