-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpost.php
205 lines (186 loc) · 11.1 KB
/
post.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php
$gelensef = $_GET["sef"];
$sor = mysqli_query("SELECT * FROM article WHERE article_seo='$gelensef' LIMIT 1");
$kayitlar=@mysqli_fetch_assoc($sor);
$Article_image = $kayitlar["article_image"];
$Article_seo = $kayitlar["article_seo"];
$Article_date = $kayitlar["article_date"];
$Article_title = $kayitlar["article_title"];
$Article_category = $kayitlar["article_category"];
$Article_content = $kayitlar["article_content"];
$Article_readcount = $kayitlar["article_readcount"];
$Article_numberofcomment= $kayitlar["numberofcomment"];
$Article_author = $kayitlar["article_author"];
$Article_id = $kayitlar["id"];
okunmaekle($Article_id);
?>
<script type="text/javascript">
$(function(){
$(".cevapla").click(function(e){
e.preventDefault();
$("#yorumlar #commentcontent").focus();
var yorumID = $(this).attr("comment-id");
$("#yorumlar #replycommentid").val(yorumID);
});
});
</script>
<script type="text/javascript">
function kayit(){
var commentcontent = $("#yorumlar #commentcontent").val();
var replycommentid = $("#yorumlar #replycommentid").val();
var articleid = $("#yorumlar #articleid").val();
if(commentcontent == "")
{
UIkit.notification({message: 'Lütfen Boş Alan Bırakmayınız...', status: 'danger'});
}else{
$.ajax(
{
type: "POST",
url: "<?=$sitelink?>ajax.php",
data : {type:'commentssave', commentcontent:commentcontent,replycommentid:replycommentid,articleid:articleid},
success: function(sonuc){
if(sonuc == 1)
{
var newHTML = "<div class='uk-alert-success' uk-alert><a class='uk-alert-close' uk-close></a><p>Yorumunuz Kaydedildi. Onaylanınca Yayımlanacaktır.</p></div>";
document.getElementById("uyari").innerHTML=newHTML;
}else{
var newHTML = "<div class='uk-alert-danger' uk-alert><a class='uk-alert-close' uk-close></a><p>Yorumunuz Kaydedilirken Hata Oluştu</p></div>";
alert(sonuc);
document.getElementById("uyari").innerHTML=newHTML;
}
}
})
}
}
</script>
<div class="uk-container">
<ul class="uk-breadcrumb">
<li><a href="<?=$sitelink?>">Ana Sayfa</a></li>
<li><a href="<?=$sitelink?>blog.html"><?=$Article_category?></a></li>
<li><span><?=$Article_title?></span></li>
</ul>
<article class="uk-article">
<h1 class="uk-article-title"><a class="uk-link-reset" href=""><?=$Article_title?></a></h1>
<p class="uk-article-meta"><span uk-icon="icon: user"></span> <a href="#"><?=$Article_author?></a> <span uk-icon="icon: calendar"></span><?=$Article_date?> <span uk-icon="icon: tag"></span> <a href="<?=$sitelink?>blog.html"><?=$Article_category?></a> <span uk-icon="icon: users"></span><?=$Article_readcount?> Okunma <span uk-icon="icon: comments"></span> <?=$Article_numberofcomment?> Yorum</p>
<div class="uk-panel">
<img class="uk-align-left uk-margin-remove-adjacent" src="<?=$sitelink?>img/article_img/<?=$Article_image?>" width="500" height="300" alt="<?=$Article_title?>">
<p class="uk-dropcap"><?=$Article_content?></p>
</div>
</article>
</div>
<div class="uk-container" style="margin-top: 40px;">
<?php
$soryorum = mysqli_query("SELECT * FROM comments WHERE comments_articleid='$Article_id' && comments_confirmation=1 && comments_replyid=0 ORDER BY comments_datestamp DESC");
while($yorum=@mysqli_fetch_assoc($soryorum)){
$Comments_usersid = $yorum["comments_usersid"];
$Comments_id = $yorum["id"];
$Comments_content = $yorum["comments_content"];
$Comments_date = $yorum["comments_date"];
$Comments_replyid = $yorum["comments_replyid"];
$kullanicicek = @mysqli_fetch_assoc(mysqli_query("SELECT * FROM users WHERE id='$Comments_usersid' LIMIT 1"));
?>
<ul class="uk-comment-list">
<li>
<article class="uk-comment uk-comment-primary uk-visible-toggle">
<header class="uk-comment-header uk-position-relative">
<div class="uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto">
<img class="uk-comment-avatar uk-border-circle" src="
<?php
if($Comments_usersid==0){
echo $sitelink."img/admin.png";
}else{
echo $sitelink."img/avatar.jpg";
}
?>" width="80" height="80" alt="">
</div>
<div class="uk-width-expand">
<h4 class="uk-comment-title uk-margin-remove"><a class="uk-link-reset" href="#">
<?php
if ($kullanicicek["id"]==0) {
echo "Admin";
} else {
echo $kullanicicek["users_username"];
}
?>
</a></h4>
<p class="uk-comment-meta uk-margin-remove-top"><a class="uk-link-reset" href="#"><?=$Comments_date?></a></p>
</div>
</div>
<div class="uk-position-top-right uk-position-small uk-hidden-hover"><a comment-id="<?=$Comments_id?>" class="uk-link-muted cevapla" href="javascript:void(0)">Cevapla</a></div>
</header>
<div class="uk-comment-body">
<p><?=$Comments_content?></p>
</div>
</article>
<?php
$soraltyorum = mysqli_query("SELECT * FROM comments WHERE comments_articleid='$Article_id' && comments_confirmation=1 && comments_replyid='$Comments_id' ORDER BY comments_datestamp DESC");
while($altyorum=@mysqli_fetch_assoc($soraltyorum)){
$Commentss_usersid = $altyorum["comments_usersid"];
$Commentss_id = $altyorum["id"];
$Commentss_content = $altyorum["comments_content"];
$Commentss_date = $altyorum["comments_date"];
$Commentss_replyid = $altyorum["comments_replyid"];
$kullanicicekalt = @mysqli_fetch_assoc(mysqli_query("SELECT * FROM users WHERE id='$Commentss_usersid' LIMIT 1"));
?>
<ul>
<li>
<article class="uk-comment uk-comment-primary uk-visible-toggle" style="margin-top: -50px;">
<header class="uk-comment-header uk-position-relative">
<div class="uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto">
<img class="uk-comment-avatar uk-border-circle" src="<?php
if($Commentss_usersid==0){
echo $sitelink."img/admin.png";
}else{
echo $sitelink."img/avatar.jpg";
}
?>" width="80" height="80" alt="">
</div>
<div class="uk-width-expand">
<h4 class="uk-comment-title uk-margin-remove"><a class="uk-link-reset" href="#"> <?php
if ($Commentss_usersid==0) {
echo "Admin";
} else {
echo $kullanicicekalt["users_username"];
}
?></a></h4>
<p class="uk-comment-meta uk-margin-remove-top"><a class="uk-link-reset" href="#"><?=$Commentss_date?></a></p>
</div>
</div>
<div class="uk-position-top-right uk-position-small uk-hidden-hover"><a comment-id="<?=$Commentss_id?>" class="uk-link-muted cevapla" href="javascript:void(0)">Cevapla</a></div>
</header>
<div class="uk-comment-body">
<p><?=$Commentss_content?></p>
</div>
</article>
</li>
</ul>
<?php
}
?>
</li>
</ul>
<?php
}
?>
</div>
<br/>
<?php
if(isset($_SESSION["kullanici"]) || isset($_SESSION["BaydoganMirac-Admin"])){
?>
<div id="yorumlar" class="yorumlar uk-container uk-section uk-section-secondary uk-padding-small">
<h1>Yorum Yapın</h1>
<input id="replycommentid" type="hidden" name="replycommentid" value="0">
<input id="articleid" type="hidden" name="articleid" value="<?=$Article_id?>">
<textarea id="commentcontent" class="uk-textarea uk-margin-small" placeholder="Yorumunuz..." name="commentcontent"></textarea>
<button onclick="kayit()" id="commentsubmit" class="uk-button uk-button-secondary">Gönder</button>
</div>
<div id="uyari" class="uk-container"></div>
<?php
}else{
?>
<div uk-alert class="uk-container uk-alert-danger">Yorum Yapabilmek İçin Üye Olmanız Veya Giriş Yapmanız Gerekmektedir. <a href="<?=$sitelink?>kayit-ol-giris-yap.html">Kayıt Ol/Giriş Yap</a></div>
<?php
}
?>