-
Notifications
You must be signed in to change notification settings - Fork 0
/
gadgets.php
154 lines (147 loc) · 5.67 KB
/
gadgets.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<title>Gadgets</title>
<?php
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
if (!filter_var($page, FILTER_VALIDATE_INT) === false) {
$start_from = ($page-1) * 3;
require_once("dbconnection.php");
include_once("common.htm");
echo("<script>
$(document).ready(function() {
$('.dropdown-button').dropdown({
inDuration: 300,
outDuration: 225,
constrain_width: false,
hover: true,
gutter: 0,
belowOrigin: false
}
);
});
</script>
<div class='row'>");
$page=$_GET['page'];
echo("<div id='part2'><h1>Gadgets</h1><hr/>");
$sql1="select * from TBL_NAME where Category='Gadgets'";
$result1=mysqli_query($con,$sql1);
$count=mysqli_num_rows($result1);
if($count!=0)
{
$total=ceil($count/3);
$sql="select * from TBL_NAME where Category='Gadgets' ORDER BY Id DESC LIMIT $start_from,3";
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_array($result,MYSQL_ASSOC))
{
$title=$row['Title'];
$date=$row['Date'];
$author=$row['Author'];
$title=$row['Title'];
$author=$row['Author'];
$date=$row['Date'];
$category=$row['Category'];
$link=$row['Link'];
$image=$row['Image'];
$Id=$row['Id'];
$linkenc=urlencode($link);
echo("<div class='col s4'>
<div class='card small'>
<div class='card-image' style='background:url($image); background-size:cover; background-position:center center;'>
<a style='float:right;' class='dropdown-button btn' href='#' data-activates='dropdown-gadgets$Id'>Share</a>
<!-- Dropdown Structure -->
<ul id='dropdown-gadgets$Id' class='dropdown-content'>
<li><a target='_blank' href='http://www.facebook.com/sharer/sharer.php?u=$link'>Facebook</a></li>
<li><a href='https://www.twitter.com/share?url=$link' target='_blank'>Twitter</a></li>
<li><a href='https://plus.google.com/share?url={$linkenc}' target='_blank'>GPlus</a>
</li>
</ul>
</div>
<div class='card-content'>
<p>
<span style='font-size:18px;color:#000;font-weight:bold;' class='card-title'>$title</span>
</p>
<div style='background:url(pics/$author.jpg);background-size:cover; background-position: center center;' class='team1'></div>
<a id='author'>$author</a>
<a id='date'>$date</a>
</div>
<div class='card-action'>
<a href='$link'>Read Now</a>
<a style='float:right' href='#'>$category</a>
</div>
</div>
</div> ");
}
echo("<ul class='pagination'>");
for ($i=1; $i<=$total; $i++) {
echo "<li class='waves-effect'><a href='gadgets.php?page=".$i."'>".$i."</a><li>";
};
echo("</ul></div>");
}
else
{
echo("<h1>Nothing to display right now.</h1></div>");
}
}
else
{
include_once("error.php");
echo("</div>");
die();
}
?>
<footer style="background:#000000;" class="page-footer">
<div class="container">
<div class="row">
<div class="col s4">
<a href="default.php" style="font-family:forque;font-size:22px;">The Frontier</a>
<div class="fb-page" data-href="https://www.facebook.com/TheFrontier.in" data-width="250" data-small-header="false" data-adapt-container-width="false" data-hide-cover="false" data-show-facepile="true" data-show-posts="false"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/TheFrontier.in"><a href="https://www.facebook.com/TheFrontier.in">VecTech</a></blockquote></div></div>
</div>
<div class="col s2">
<h3 style="color:#FFFFFF;margin:0;font-size:25px;float:left;">Categories</h3>
<div class="left">
<a href="news.php" style="font-size:18">News</a>
<br/><a href="gadgets.php" style="font-size:18">Gadgets</a>
<br/><a href="sci-fi.php" style="font-size:18">Sci-Fi</a>
<br/><a href="gaming.php" style="font-size:18">Gaming</a>
<br/><a href="reviews.php" style="font-size:18">Reviews</a>
</div>
</div>
<div class="col s2">
<h3 style="color:#FFFFFF;margin:0;font-size:25px;float:left;">Other Stuff</h3>
<div class="left">
<a href="about.php" style="font-size:18">About Us</a>
<br/><a style="font-size:18">Advertise</a>
<br/><a href="about.php#contact" style="font-size:18">Contact Us</a>
</div>
</div>
<div class="col s2">
<h3 style="color:#FFFFFF;margin:0;font-size:25px;float:left;">Connect</h3>
<div class="left">
<img style="margin-right:10px;" src='images/footer/Facebook.png' height="20"><a href='http://www.facebook.com/TheFrontier.in' style="font-size:18">Facebook</a>
<br/> <img style="margin-right:10px;" src='images/footer/Twitter.png' height="20"><a style="font-size:18px;">Twitter</a>
<br/> <img style="margin-right:10px;" src='images/footer/Flipboard.png' height="20"><a style="font-size:18px;">Flipboard</a>
</div>
</div>
<div class="col s2">
<h3 style="color:#FFFFFF;margin:0;font-size:25px;float:left;">Subscribe</h3>
<div class="row">
<div class="input-field col s12">
<input id="email" type="email" class="validate">
<label for="email">Email</label>
<br>
<button class="btn waves-effect waves-light subscribe" type="submit" name="action">Subscribe
<i class="material-icons">send</i>
</button>
</br>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2015 VecTech
<a class="grey-text text-lighten-4 right" href="#!">
</a>
</div>
</div>
</footer>