-
Notifications
You must be signed in to change notification settings - Fork 0
/
friendpindata.php
74 lines (67 loc) · 2.15 KB
/
friendpindata.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
session_start();
$con = mysqli_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysqli_error($con));
}
mysqli_select_db($con,"visbookmark");
if(!isset($_SESSION['name'])){
header("Location: login.php");
exit();
die();}
$emailstore = $_SESSION['friendname'];
$emailstore = stripslashes($emailstore);
$emailstore = mysqli_real_escape_string($con,$emailstore);
$sql1 ="SELECT * FROM bookmarks WHERE username='$emailstore' and public='y'";
$result=mysqli_query($con,$sql1);
if (!$result)
{
die(mysqli_error($con));
}
echo "<div id='columns'>";
echo "<script>
$(document).ready( function() {
var container = $('#columns');
$('#columns').masonry({
columnWidth: 10,
itemSelector: '.pin',
isOriginLeft: true
});
$('#del').click(function() {
console.log('clicked');
});
}); </script>";
$count2=mysqli_num_rows($result);
if($count2 > 0)
{
while($row = mysqli_fetch_array($result))
{
if($row['visitcount']==0)
{
$disp="";
}
else
{
$disp = "Times visited:".$row['visitcount']." ";
}
$sql4 = "select * from pinlike where likedby='".$_SESSION['friendname']."' and pinid =".$row['bookmarkid'];
$result4=mysqli_query($con,$sql4);
if (!$result4)
{
die(mysqli_error($con));
}
$count3=mysqli_num_rows($result4);
if($count3>0)
{
echo "<div class ='pin'><p>".$row['caption']."</p><a href='pinvisitcounter.php?pinid=".$row['bookmarkid']."'><img src='".$row['image']."'/></a><b><font color='000'>Liked</font></b><br><br><p>".$disp."</p></div>";
}
else
{
echo "<div class ='pin'><p>".$row['caption']."</p><a href='pinvisitcounter.php?pinid=".$row['bookmarkid']."'><img src='".$row['image']."'/></a><p><form class='delpin'>
<input type='hidden' class ='which_clicked' name='which_clicked' value=".$row['bookmarkid']."><input type='hidden' name='friendname' value='".$_SESSION['friendname']."'> <input type='submit' class='btn btn-primary' id='del' class='del' name='like' value='Like'></form>".$disp."</p></div>";
}
}
}
echo "</div>";
?>