if (isset($_SESSION['user_id'],
$_SESSION['username'],
$_SESSION['login_string'])) {
$user_id = $_SESSION['user_id'];
$login_string = $_SESSION['login_string'];
$username = $_SESSION['username'];
// Get the user-agent string of the user.
$user_browser = $_SERVER['HTTP_USER_AGENT'];
if ($stmt = $mysqli->prepare("SELECT password .......
$(document).on('click tap','button.fa',function(e) {
bk=true;
var spanText = $(this).val();
var x=spanText.split("_");
var id_tops = '<?php echo $id;?>';
e.preventDefault();
$.ajax({
type: "POST",
url: 'topchangepos.php',
data: {
where: x[1],
id: x[0],
idtop: id_tops
},
success: function(result) {
if (x[1] === "up")
{var res = +$("#"+x[0]+">p").text();
$("#"+x[0]+">p").text(res+1);}
else if (x[1] === "down")
{var res = +$("#"+x[0]+">p").text();
$("#"+x[0]+">p").text(res-1);}
}
});
});
var bk = false;
var currElClick = false;
$(document).on('click tap','.visualp', function(e) {
if (bk==true) {
bk=false;
return;
}
var that = $(this);
if (currElClick == $(that).find("button:first").val()) return false;
currElClick = $(that).find("button:first").val();
spanText = $(this).find("button:first").val();
x=spanText.split("_");
var id_tops = '<?php echo $id;?>';
e.preventDefault();
$('.comments').remove();
$.ajax({
type: "POST",
url: 'showcommentstop.php',
data: {
elementid: x[0],
topid: id_tops
},
success: function (list) {
if (list == '') {
} else {
$(that).append(list);
}
}
});
});