| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xamppkk/htdocs-coblaa/social/ |
Upload File : |
<?php
if($status =='display_main_post')
{
$my_id = $_GET['my_id'];
$display_post ="select * from poststb ORDER BY id DESC";
$run_disp_post = mysqli_query($con,$display_post);
while($row_disp_post = mysqli_fetch_array($run_disp_post))
{
$post_id = $row_disp_post['id'];
$user_id = $row_disp_post['my_id'];
$post = $row_disp_post['post_text'];
$post_file_name = $row_disp_post['image_url'];
$post_file_type = $row_disp_post['file_type'];
?>
<div class="post_display" >
<div class="post_header_div" >
<?php
$display_profile_image ="select * from userstb where id='$user_id'";
$run_disp_profile_image = mysqli_query($con,$display_profile_image);
while($row_disp_profile_image = mysqli_fetch_array($run_disp_profile_image))
{
$user_profile = $row_disp_profile_image['profile_image'];
$user_name = $row_disp_profile_image['first_name'];
?>
<div class="post_header_profile">
<img src="avatar_image/<?php echo"$user_profile"; ?>" width="100%" height="100%" />
</div>
<div class="post_header_name"><?php echo"$user_name"; ?></div>
<?php } ?>
</div>
<?php
if($post !=="" ){ ?>
<div class="post_text_disp" ><?php echo"$post"; ?></div>
<?php
}
if($post_file_type =="JPG" || $post_file_type =="jpg" || $post_file_type =="PNG" || $post_file_type =="png" ){
?>
<img src="post_images/<?php echo"$post_file_name.$post_file_type";?>" width="100%" />
<?php
}
if($post_file_type =="MP4" || $post_file_type =="mp4" ){
?>
<video width="100%" heightk="240" controls>
<source src="post_videos/<?php echo"$post_file_name.$post_file_type";?>" type="video/mp4">
<source src="post_videos/<?php echo"$post_file_name.ogg";?>" type="video/ogg">
Your browser does not support the video tag.
</video>
<?php }
if($post_file_type =="MP3" || $post_file_type =="mp3" ){
?>
<audio controls style="width:100%;outline:none;">
<source src="post_audios/<?php echo"$post_file_name.$post_file_type";?>" type="audio/mpeg">
<source src="post_audios/<?php echo"$post_file_name.ogg";?>" type="audio/ogg">
Your browser does not support the audio tag.
</audio>
<?php } ?>
<input type="text" id="my_post_id" value="<?php echo $post_id ;?>" style="display:none;" />
<div class="post_view_div" >
<button class="post_comments_btn" >Comments</button>
<div class="post_comments_output" >
<?php
$display_comment ="select * from post_commenttb where post_id='$post_id'";
$run_disp_comment = mysqli_query($con,$display_comment);
$comment_num = mysqli_num_rows($run_disp_comment);
if($comment_num >0){echo"$comment_num";}
?>
</div>
<button onClick="save_post_like(this.name);" name="<?php echo"$post_id";?>" class="post_like_btn">Likes</button>
<div class="post_like_output" >
<?php
$display_like ="select * from post_liketb where post_id='$post_id'";
$run_disp_like = mysqli_query($con,$display_like);
$like_num = mysqli_num_rows($run_disp_like);
if($like_num >0){echo"$like_num";}
?>
</div>
</div><!-- end of post_view_div -->
<div class="new_comment_div" >
<?php
if(isset($_SESSION['id']))
{
$my_id = $_SESSION['id'];
$display_profile_image ="select * from userstb where id='$user_id'";
$run_disp_profile_image = mysqli_query($con,$display_profile_image);
while($row_disp_profile_image = mysqli_fetch_array($run_disp_profile_image))
{
$user_profile = $row_disp_profile_image['profile_image'];
$user_name = $row_disp_profile_image['first_name'];
?>
<div class="user_profile_comm">
<img src="avatar_image/<?php echo"$user_profile"; ?>" width="100%" height="100%" />
</div>
<?php } ?>
<textarea onkeyup="check_width_size();" type="text" id="new_comment_input<?php echo"$post_id";?>" class="new_comment_input" placeholder="Write a comment..." ></textarea>
<button onClick="insert_post_comment(this.name);" name="<?php echo"$post_id";?>" class="new_commnet_btn">send</button>
<?php }else{ ?>
<div class="user_profile_comm" ><img src="avatar_image/avatar2.jpg" width="100%" height="100%" /></div>
<a href="login.php"><textarea onkeyup="check_width_size();" type="text" id="new_comment_input<?php echo"$post_id";?>" class="new_comment_input" placeholder="Write a comment..." ></textarea></a>
<a href="login.php"><button onClick="insert_post_comment(this.name);" name="<?php echo"$post_id";?>" class="new_commnet_btn">send</button></a>
<?php } ?>
</div><!--end of new_comment_div-->
<div class="post_comment_display_div" >
<?php
$display_comment ="select * from post_commenttb where post_id='$post_id' ORDER BY id DESC";
$run_disp_comment = mysqli_query($con,$display_comment);
while($row_disp_comment = mysqli_fetch_array($run_disp_comment))
{
$comment_id = $row_disp_comment['id'];
$user_id_comm = $row_disp_comment['my_id'];
$comment = $row_disp_comment['comment'];
?>
<div classk="user_profile_comm_disp" style="width:100%;float:left;backgroundk:orange;" >
<?php
$display_profile_image ="select * from userstb where id='$user_id_comm'";
$run_disp_profile_image = mysqli_query($con,$display_profile_image);
while($row_disp_profile_image = mysqli_fetch_array($run_disp_profile_image))
{
$user_profile = $row_disp_profile_image['profile_image'];
$user_name = $row_disp_profile_image['first_name'];
?>
<img src="avatar_image/<?php echo"$user_profile"; ?>" class="user_profile_comm_disp" widthk="100%" heightk="100%" />
<?php } ?>
<div class="comment_display_output" ><?php echo"$comment"; ?></div>
<button onClick="show_reply_area_level_one(this.name);" name="<?php echo"$comment_id";?>" class="show_reply_div_btn" >Reply</button>
</div>
<div id="comment_reply_div<?php echo"$comment_id";?>" class="comment_reply_div" >
<button onClick="hide_reply_area_level_one(this.name);" name="<?php echo"$comment_id";?>" class="hide_reply_div_btn" >x</button>
<div class="level_one_reply_div_input">
<div class="user_profile_comm_reply" ><img src="avatar_image/avatar2.jpg" width="100%" height="100%" /></div>
<!--a href="login.php"--><textarea onkeyup="check_width_size();" type="text" id="new_com_reply_input<?php echo"$comment_id";?>" class="new_comm_reply_input" placeholder="Write a comment..." ></textarea>
<!--a href="login.php"--><button onClick="insert_comment_reply_level_one(this.name);" name="<?php echo"$comment_id";?>" class="new_comm_reply_btn">send</button>
</div>
<div class="reply_disp_div">
<input id="comm_id" value="<?php echo"$comment_id";?>"/>
<div id="reply_disp_output"></div>
</div>
</div><!--end of comment_reply_div-->
<?php } ?>
</div><!--end of post_comment_display_div-->
</div><!-- end of post_display-->
<?php } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_main_comment')
{
$comment_id = $_GET['comm_id'];
$disp_reply_level_one ="select * from reply_commenttb where comment_id='$comment_id' ORDER BY id DESC";
$run_reply_level_one = mysqli_query($con,$disp_reply_level_one);
while($row_disp_reply_level_one = mysqli_fetch_array($run_reply_level_one))
{
$reply_text = $row_disp_reply_level_one['reply_text'];
//$user_name = $row_disp_reply_level_one['first_name'];
?>
<div class="reply_disp_output">
<img src="avatar_image/avatar2.jpg" class="user_profile_comm_reply_disp_out" />
<div class="disp_reply_out_text" > <?php echo"$reply_text"; ?> </div>
</div>
<?php } ?>
<?php
}