-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramming.php
More file actions
126 lines (111 loc) · 3.26 KB
/
programming.php
File metadata and controls
126 lines (111 loc) · 3.26 KB
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
<?php
require('asset/mysql_con.php');
include_once("analyticstracking.php");
?>
<!DOCTYPE html>
<html>
<head>
<title> TISUTISU.org Programming - Physics - Technology </title>
<link rel="stylesheet" type="text/css" href="asset/stylesheet.css" />
</head>
<body>
<div class="header">
<h1>TisuTisu</h1>
</div>
<div class="nav">
<ul>
<li><a href="index.php"> HOME </a></li>
<li><a href="programming.php">Programming </a></li>
<li><a href="physics.php">Physics </a></li>
<li><a href="anime.php">Anime </a></li>
</ul>
</div>
<div class="aside_container">
<div class="aside">
<h3> Postingan Terakhir : </h3>
<ol>
<?php
// membuat kode posting terakhir
$query = mysqli_query($link, "select * from db_content order by id asc");
for($i=0; $i<3; $i++){
if($q = mysqli_fetch_array($query, MYSQLI_ASSOC)){
$data = $q['judul'];
$data_id = $q['id'];
?>
<li><a href="article/index.php?id=<?php echo $data_id; ?>&article=<?php echo str_replace(' ','-',$data); ?>&comment="><?php echo $data; ?></a></li>
<?php
}
}
?>
</ol>
</div>
<div class="aside">
<h3> have any account?<br /> you can Login in this form :</h3>
<table>
<form action="aunt_login.php" method="post">
<tr>
<td>Username:</td>
<td><input type="text" name="user" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="pass" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Login"/></td>
</tr>
</form>
</table>
</div>
</div>
<?php
$query = mysqli_query($link, "select * from db_content where category='programming' order by id desc");
while($q = mysqli_fetch_array($query, MYSQLI_ASSOC)){
$judul = $q['judul'];
$isi = $q['isi'];
$tanggal = $q['tanggal'];
$user = $q['user'];
$id = $q['id'];
$category = $q['category'];
$pquery = mysqli_query($link, "SELECT * FROM pageview WHERE page='$id'");
// function readmore
$string = strip_tags($isi);
if(strlen($string) > 500) {
// truncate string
$string_cut = substr($string, 0, 500);
// make sure it ends in a word so assassinate doesn't become ass
$string = substr($string_cut, 0, strrpos($string_cut, ' '));
} else {
$string = $isi;
}
?>
<div class="article">
<h2> <?php echo $judul; ?></h2>
<div style="font-family: Helvetica Neue; margin-bottom:30px">By <?php echo ucfirst($user); ?></div>
<p>
<?php echo $string; ?>
<br />
<br />
<a href="article/index.php?id=<?php echo $id; ?>&article=<?php echo str_replace(' ','-',$judul); ?>&comment=">Readmore </a>
</p>
<br />
<hr>
<h4>Viewed <?php echo mysqli_num_rows($pquery); ?> times <?php for($i=0;$i<60;$i++){ echo " "; } ?> <?php echo $tanggal; ?></h4>
<?php
// menghitung komentar
$komen = mysqli_query($link, "select * from db_comment where id_article=$id");
$jumlah_komen = mysqli_num_rows($komen);
?>
<h5><?php echo "Category: " . $category; ?></h4>
<h4><?php echo $jumlah_komen; ?> Comments</h4>
</div>
<?php
}
?>
</div>
<div class="footer">
<p> @2015 <a href="https://www.facebook.com/dhen.Jore.Ceria"><u>Catur Sura</u></a> | Hi, Welcome to my Noob site.</p>
</div>
</body>
</html>