Skip to content

Commit

Permalink
Small fixes here and there
Browse files Browse the repository at this point in the history
-Made the del picture and repiles text change color on table row hover
-Added cursor pointer for all buttons
-Now supports new line (nl2br)
To do list:
session life time
.....and i think my final project would be done !
  • Loading branch information
hiimdoublej committed Jun 7, 2016
1 parent 2009bf4 commit fcb29d2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 33 deletions.
8 changes: 4 additions & 4 deletions comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<?php
while($row=$res->fetch(PDO::FETCH_OBJ))
{
echo "<tr><td>".$row -> msg."</td>";
echo "<tr><td>".nl2br($row -> msg)."</td>";
echo "<td>".$row -> username."</td>";
echo "<td>".$row -> msg_time."</td>";
if($_SESSION['user']==$row->uid)
Expand Down Expand Up @@ -158,14 +158,14 @@
<?php
while($row=$res->fetch(PDO::FETCH_OBJ))
{
echo "<tr><td>".$row -> cmt."</td>";
echo "<tr><td>".nl2br($row -> cmt)."</td>";
echo "<td>".$row -> username."</td>";
echo "<td>".$row -> cmt_time."</td>";
if($_SESSION['user']==$row->uid)
{
?>
<td id="actions">
<form action="comment.php" method="POST" >
<form action="" method="POST" >
<button type="submit" id="del_btn" name="delete_cmt" value ="delete"
style="border:0;background transparent;"
onclick="return confirm('Delete this reply?')"/>
Expand Down Expand Up @@ -193,7 +193,7 @@
echo "</div>";
}
?>
<form action="comment.php" method="POST">
<form action="" method="POST">
<input type="hidden" name="submit_comment" value="1" />
<?php echo "<input type='hidden' name='m_id' value=".$parent_id.">"; ?>
<textarea name="comment" id = 'msg'></textarea><br />
Expand Down
6 changes: 3 additions & 3 deletions home.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<form action="search.php" method="POST">
<input type="hidden" name="search_submit" value="1" />
<textarea name="message_target" id = 'msg_search_box'></textarea>
<input name="message_target" id = 'msg_search_box'></textarea>
<button type="submit" id ='msg_search'>Search for message</button>
<br />
</form>
Expand All @@ -62,7 +62,7 @@
<?php
while($row=$result->fetch(PDO::FETCH_OBJ))
{
echo "<tr><td>".$row -> msg."</td>";
echo "<tr><td>".nl2br($row -> msg)."</td>";
echo "<td>".$row -> username."</td>";
echo "<td>".$row -> msg_time."</td>";
if($userRow['user_id']==$row->uid)
Expand All @@ -73,7 +73,7 @@
<button type="submit" id="del_btn" name="delete_action" value ="delete"
style="border:0;background transparent;"
onclick="return confirm('Delete this message?')"/>
<img style ="width:30px;height:30px;"src="delete.png" class = "invert" title = "Delete This Message" alt="submit" />
<img style ="width:100%;height:100%;"src="delete.png" class = "invert" title = "Delete This Message" alt="submit" />
<?php
echo "<input type='hidden' name='del_msg_id' value=".$row->msg_id.">"
?>
Expand Down
14 changes: 7 additions & 7 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
echo "</div>";
?>
<table class = "table-fill">
<tr><th>Message</th>
<th>By</th>
<th>Time</th>
<tr><th id="text">Message</th>
<th id="name">By</th>
<th id="time">Time</th>
<th id="actions">Delete</th>
<?php
while($row=$stmt->fetch(PDO::FETCH_OBJ))
{
echo "<tr><td>".$row -> msg."</td>";
echo "<tr><td>".nl2br($row -> msg)."</td>";
echo "<td>".$row -> username."</td>";
echo "<td>".$row -> msg_time."</td>";
if($_SESSION['user']==$row->uid)
Expand All @@ -47,15 +47,15 @@
</form>
</a>
</td>
</tr>
<?php
}
else
{
echo "<td></td></tr>";
echo "<td></td>";
}
echo"</tr>";
}
echo "</table>";
echo "</table><br>";
}
else
{
Expand Down
52 changes: 33 additions & 19 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
margin:0;
padding:0;
}
button{
cursor: pointer;
}
#login-form
{
margin-top:70px;
Expand Down Expand Up @@ -129,22 +132,39 @@ textarea#msg{
height: 120px;
border: 3px solid #cccccc;
padding: 5px;
font-size: 18px;
font-family: Tahoma, sans-serif;
background-position: bottom right;
background-repeat: no-repeat;
resize : none;
}
textarea#msg_search_box{
font-size: 18px;
margin-left:40px;
width: 40%;
height: 25px;
border: 3px solid #cccccc;
padding: 5px;
font-family: Tahoma, sans-serif;
background-position: bottom right;
background-repeat: no-repeat;
resize : none;
}

input#msg_search_box{
font-size: 18px;
margin-left:40px;
margin-bottom: 20px;
width: 40%;
height: 20px;
height: 25px;
border: 3px solid #cccccc;
padding: 5px;
font-family: Tahoma, sans-serif;
background-position: bottom right;
background-repeat: no-repeat;
resize : none;
}

button#msg_submit{
border: 2px solid #fafafa;
width: 40%;
Expand All @@ -164,9 +184,8 @@ margin-top: 10px;
button#msg_search{
border: 2px solid #fafafa;
position: relative;
top:-12px;
width:20%;
height:35px;
height:40px;
background:#3e94ec;
background:-moz-linear-gradient(top, #595959 , #515151);
color:#f9f9f9;
Expand All @@ -175,20 +194,27 @@ button#msg_search{
font-weight:bolder;
text-transform:uppercase;
}
button#view_replies
tr button
{
text-align: left;
width: 100%;
height: 100%;
border:0;
font-size: 25px;
color:#4e5066;
background: transparent;
}
button#view_replies:hover
tr:hover button
{
border:0;
font-size: 25px;
color:#fafafa;
background: transparent;
}
tr:hover img
{
-webkit-filter: invert(100%);
}
/* css for home page */

/* imported table style */
Expand Down Expand Up @@ -278,7 +304,7 @@ th:last-child {

tr {
border-top: 1px solid #C1C3D1;
border-bottom-: 1px solid #C1C3D1;
border-bottom: 1px solid #C1C3D1;
color:#666B85;
font-size:16px;
font-weight:normal;
Expand All @@ -289,7 +315,6 @@ tr:hover td {
background:#4E5066;
color:#FFFFFF;
border-top: 1px solid #22262e;
border-bottom: 1px solid #22262e;
}

tr:first-child {
Expand Down Expand Up @@ -327,7 +352,6 @@ td {
text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.1);
border-right: 1px solid #C1C3D1;
word-break:break-all;
max-width: 70px;
}
td#actions
{
Expand Down Expand Up @@ -361,17 +385,7 @@ td.text-center {
td.text-right {
text-align: right;
}
img.invert:hover {
filter: invert(100%);
-webkit-filter: invert(100%);
-moz-filter: invert(100%);
-o-filter: invert(100%);
-ms-filter: invert(100%);
}
button#del_btn
{
background-color: transparent;
}

a#back_to_home
{
margin-left: 45px;
Expand Down

0 comments on commit fcb29d2

Please sign in to comment.