-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThread.php
More file actions
127 lines (119 loc) · 3.97 KB
/
Copy pathThread.php
File metadata and controls
127 lines (119 loc) · 3.97 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
127
<?php
include_once "PHP/Functions.php";
if(isset($_GET['id'])){
$id = $_GET['id'];
$thread = getThreadbyID($id);
$posts = getPost($id);
?>
<html>
<head>
<script type="text/javascript">
function change(id){
var image = document.getElementById(id);
var thumb = document.getElementById("THM" +id);
var img = document.getElementById("IMG" +id);
if(thumb.style.display== "none"){
thumb.style.display="";
img.style.display = "none";
image.style.maxWidth = "150";
} else {
img.style.display = "";
thumb.style.display = "none";
image.style.maxWidth = "400px";
}
}
function highlightPosterID(posterid){
var posts = document.getElementsByClassName("Post");
for(var i =0; i< posts.length; i++){
var container = posts[i].getElementsByClassName("ui stacked segment")[0];
container.style.backgroundColor = "";
if(posts[i].id.indexOf(posterid)>-1){
container.style.backgroundColor = "yellow";
}
}
}
</script>
<?php getHead($thread['subject']);?>
<link rel="stylesheet" type="text/css" href="CSS/custom/Thread.css">
</head>
<body style="background-color:#2E4874; overflow:visible">
<div class='úi grid'>
<div class= "ui grid">
<div class = "sixteen wide column"><?php printHTMLHeader() ?></div>
<div class="four wide column">
</div>
<div class="eight wide column">
<div class="ui segment">
<div class="eight wide column" id="mainview">
<h1><?php echo '<b>' . $thread["subject"] . '</b>'?><h1>
<?php
foreach($posts as $post){
?>
<div class= "Post" id="post<?php echo $post['id_post'].$post['id_poster']?>" >
<div class="ui stacked segment">
<div class="ui threaded comments">
<div class="comment">
<div class="content">
<h1 class="ui header"><?php echo $post['poster_name']?></h1>
<i class="address card icon"></i>
<a class="author" onclick=highlightPosterID('<?php echo $post['id_poster']?>')>
ID : <?php echo $post['id_poster']?>
</a>
</br>
<i class="paper plane outline icon"></i>
<a class="trip-code">
Trip-code : <a href="search.php?tripcode=<?php echo $post['trip_code']?>" ><?php echo $post['trip_code']?></a>
</a>
</br>
<i class="calendar icon"></i>
<div class="metadata">
<span class="date">
<?php echo $post['time_posted']?>
</span>
</div><br>
<?php if ($post['image']){?>
<div class="ui left floated rounded image" style="max-width: 150px;" id="img<?php echo $post['id_post']?>">
<a>
<img src="<?php echo THUMB_DIR . $post['image']; ?>" alt="" onclick=change("img<?php echo $post['id_post']?>") id="THMimg<?php echo $post['id_post']?>")>
</a>
<a>
<img style="display:none" src="<?php echo IMG_DIR . $post['image']; ?>" alt="" onclick=change("img<?php echo $post['id_post']?>") id="IMGimg<?php echo $post['id_post']?>">
</a>
</div>
<?php }?>
<div class="text">
<h4><?php echo $post['comment']?></h4>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
<div class="four wide column">
</div>
<div class="four wide column">
</div>
<div class="eight wide column">
<div class="ui message">
<h2>Post Comment</h2>
<p>Please read the <a href="faq.php">rules</a> before posting</p>
</div>
<?php printHTMLNewPOSTForm($id);?>
</div>
<div class="four wide column">
</div>
</div>
</div>
</div>
</body>
</html>
<?php
}else{
header('location:index.php');
}
?>