Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("connections.php");
- $id = $_SESSION['ID'];
- $check_pic = mysqli_query($con, " SELECT profile_pic FROM members WHERE ID='$username'");
- $get_pic_row = mysqli_fetch_assoc($check_pic);
- $profile_pic_db = $get_pic_row['profile_pic'];
- if ($profile_pic_db == "") {
- $profile_pic = "assets/img/default_pic.jpg";
- } else {
- $profile_pic = "userdata/profile_pics/" . $profile_pic_db;
- }
- //Profile Image upload script
- if ($sesID == $username) {
- if (isset($_FILES['profilepic'])) {
- if (((@$_FILES["profilepic"]["type"] == "image/jpeg") || (@$_FILES["profilepic"]["type"] == "image/png") || (@$_FILES["profilepic"]["type"] == "image/gif")) && (@$_FILES["profilepic"]["size"] < 3145728)) /* 1 mega byte */ {
- $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- $rand_dir_name = substr(str_shuffle($chars), 0, 15);
- mkdir("userdata/profile_pics/$rand_dir_name");
- if (file_exists("/userdata/profile_pics/$rand_dir_name/" . @$_FILES["profilepic"]["name"])) {
- echo @$_FILES["profilepic"]["name"] . " Already exists";
- } else {
- move_uploaded_file(@$_FILES["profilepic"]["tmp_name"], "userdata/profile_pics/$rand_dir_name/" . $_FILES["profilepic"]["name"]);
- //echo "Uploaded and stored in: userdata/profile_pics/$rand_dir_name/".@$_FILES["profilepic"]["name"];
- $profile_pic_name = @$_FILES["profilepic"]["name"];
- $profile_pic_query = mysqli_query($con, "UPDATE members SET profile_pic='$rand_dir_name/$profile_pic_name' WHERE ID='$username';");
- echo "<meta http-equiv='refresh' content='0'>";
- }
- } else {
- echo "<p>None or Too large pic!</p>";
- }
- }
- }
- ?>
- <!-- <form action="" method="POST" enctype="multipart/form-data">
- <input type="file" name="profilepic" id="fileupload" style="text-decoration: none; "/> <br /><br /><br /><br />
- <input type="submit" name ="uploadpic" value="Upload Image" class="myButton"style="width:18.6em; height:1.2em; font-size:8px; align: left; float:left; position:left; ">
- </form> -->
- <form action="" method="POST" enctype="multipart/form-data" style="float:center;">
- <div class="inputWrapper" style="float:middle;" >
- <input class="fileInput" type="file" name="profilepic" align="center" style="float:middle; width:150px;">
- </div><br />
- <img src="<?php echo $profile_pic;?>" align="center" style=" min-width:150px; max-height:150px; max-width:150px; overflow:hidden; margin:0 auto; "><br />
- <input type="submit" name="uploadpic" class="myButton" value="Upload Image" align="center" style="width:150px; height: 11px; padding: 6px; float:middle;"><br />
- </form>
- <div class="fufbut" align="center" >
- <?php $sesID = $_SESSION['ID'];
- if ($username != $sesID) {
- $forfollow = mysqli_query($con, "SELECT id FROM follow WHERE user_one='$sesID' AND user_two='$username'");
- if (mysqli_num_rows($forfollow) == 1) {
- echo "<a href='actions.php?action=unfollow&u=$username' class=\"myButtonnn\"><center>Unfollow</center></a>";
- } else {
- echo "<a href='actions.php?action=follow&u=$username' class=\"myButtonn\" ><center>Follow</center></a>";
- }
- }
- ?>
- </div>
- <br />
- <div class="userstats">
- <div class="infosection" align="center" style=" display:inline; float:center; ">
- <div class="folowz" style="display: inline-block; margin-right:18px;">
- <b style=" "><font size="1">Circle</font></b>
- <img src="assets/img/twistfo.png" style="width:35px; height:35px; ">
- <b>
- <?php
- $check_followers = mysqli_query($con, "SELECT id FROM follow WHERE user_two = '$username'");
- echo mysqli_num_rows($check_followers);
- ?>
- </b>
- </div>
- <div class="followiz" style="display: inline-block; ">
- <b style="color:white;"><font size="1">Following</font></b>
- <img src="assets/img/twistfoli.png" style="width:35px; height:35px;">
- <b>
- <?php
- $check_followerss = mysqli_query($con, "SELECT id FROM follow WHERE user_one = '$username'");
- echo mysqli_num_rows($check_followerss);
- ?>
- </b>
- </div>
- </div>
- </div>
- <!-- In use?? -->
- </div>
- <!--HOME SECTION END-->
- <div class="feedwrapper" align="middle" style="float:center; ">
- <div class="postdiv" align="center" style="float:center; display:inline-block; " >
- <?php
- require("connections.php");
- $firstname = $get['Firstname'];
- $lastname = $get['Lastname'];
- $getposts = mysqli_query($con, "SELECT * FROM Posts WHERE Postedby = $username") or die("connecting...");
- while ($row = mysqli_fetch_assoc($getposts)) {
- $body = $row['Postbody'];
- $date_added = $row['Postdate'];
- $added_by = $row['Postedby'];
- echo "<div class='Posted_by' ><a href='$added_by'>$firstname , $lastname</a> - $date_added - <a href=\"\"><img src=\"assets/img/grøngrab.png\" style=\"width:10%; height:10%; display: inline; float:right;\" class=\"grabbutton\"></a><br /><p> $body </p></div><br />";
- }
- ?>
- </div>
- </div>
- <!-- In use?? -->
- </div>
- </ul>
- </div>
- </div>
- </div>
- <!-- <img class="clixlogo" src="assets/img/messagepic.png" style="width:3%; height:3%; align:middle;"> <br />
- <img class="clixlogo" src="assets/img/settingspic.png" style="width:3%; height:3%; margin: 40px; "> -->
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement