is_logged_in()) { //$user_home->redirect('connect.php'); } else { //$stmt = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid"); //$stmt->execute(array(":uid"=>$_SESSION['userSession'])); //$user = $stmt->fetch(PDO::FETCH_ASSOC); } $uid = $_GET['uid']; if((!$_GET['uid'])&&($user_home->is_logged_in())) $uid=$_SESSION['userSession']; if(!is_numeric($uid)) { echo "wrong profile id."; exit; } if($_GET['delprofilepic']==1) { unlink('images/profilepics/'.$user['ProfilePic']); $update_q = $user_home->runQuery("UPDATE tbl_users SET ProfilePic='' WHERE userID=:uid"); $update_q->execute(array(":uid"=>$uid)); $_SESSION['ProfilePic']=''; } if(!empty($_FILES["fileToUpload"]['name'])) { function imageResize($imageResourceId,$width,$height) { $ratio = $width/$height; $targetWidth =200; $targetHeight =200/$ratio; $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight); imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height); return $targetLayer; } if(is_array($_FILES)) { $file = $_FILES['fileToUpload']['tmp_name']; $sourceProperties = getimagesize($file); $fileNewName = time(); $folderPath = "images/profilepics/"; $ext = pathinfo($_FILES['fileToUpload']['name'], PATHINFO_EXTENSION); $imageType = $sourceProperties[2]; switch ($imageType) { case IMAGETYPE_PNG: $imageResourceId = imagecreatefrompng($file); $targetLayer = imageResize($imageResourceId,$sourceProperties[0],$sourceProperties[1]); imagepng($targetLayer,$folderPath. $fileNewName. "." . $ext); break; case IMAGETYPE_GIF: $imageResourceId = imagecreatefromgif($file); $targetLayer = imageResize($imageResourceId,$sourceProperties[0],$sourceProperties[1]); imagegif($targetLayer,$folderPath. $fileNewName. "." . $ext); break; case IMAGETYPE_JPEG: $imageResourceId = imagecreatefromjpeg($file); $targetLayer = imageResize($imageResourceId,$sourceProperties[0],$sourceProperties[1]); imagejpeg($targetLayer,$folderPath. $fileNewName. "." . $ext); break; default: echo "Invalid Image type."; exit; break; } $pic=$fileNewName. "." . $ext; $update_q = $user_home->runQuery("UPDATE tbl_users SET ProfilePic=:pic WHERE userID=:uid"); $update_q->execute(array(":uid"=>$uid,":pic"=>$pic)); $_SESSION['ProfilePic']=$pic; //move_uploaded_file($file, $folderPath. $fileNewName. ".". $ext); //echo "Image Resize Successfully."; } } if($_POST['posted']) { $_POST['onoma'] = filter_var($_POST['onoma'], FILTER_SANITIZE_STRING); $_POST['onoma'] = str_replace("%", "", $_POST['onoma']); $_POST['onoma'] = str_replace("'", "", $_POST['onoma']); $_POST['onoma'] = str_replace("?", "", $_POST['onoma']); $_POST['onoma'] = str_replace('"', '', $_POST['onoma']); $_POST['onoma'] = str_replace("*", "", $_POST['onoma']); $_POST['onoma'] = str_replace("&", "", $_POST['onoma']); $_POST['favorite_book'] = filter_var($_POST['favorite_book'], FILTER_SANITIZE_STRING); $_POST['favorite_book'] = str_replace("%", "", $_POST['favorite_book']); $_POST['favorite_book'] = str_replace("'", "", $_POST['favorite_book']); $_POST['favorite_book'] = str_replace("?", "", $_POST['favorite_book']); $_POST['favorite_book'] = str_replace('"', '', $_POST['favorite_book']); $_POST['favorite_book'] = str_replace("*", "", $_POST['favorite_book']); $_POST['favorite_book'] = str_replace("&", "", $_POST['favorite_book']); $_POST['favorite_phrase'] = filter_var($_POST['favorite_phrase'], FILTER_SANITIZE_STRING); $_POST['favorite_phrase'] = str_replace("%", "", $_POST['favorite_phrase']); $_POST['favorite_phrase'] = str_replace("'", "", $_POST['favorite_phrase']); $_POST['favorite_phrase'] = str_replace("?", "", $_POST['favorite_phrase']); $_POST['favorite_phrase'] = str_replace('"', '', $_POST['favorite_phrase']); $_POST['favorite_phrase'] = str_replace("*", "", $_POST['favorite_phrase']); $_POST['favorite_phrase'] = str_replace("&", "", $_POST['favorite_phrase']); $upd_q = $user_home->runQuery("UPDATE tbl_users SET FullName=:onoma, FavoriteBook=:book, FavoritePhrase=:phrase WHERE userID=:uid"); $upd_q->execute(array(":uid"=>$_SESSION['userSession'],":onoma"=>$_POST['onoma'],":book"=>$_POST['favorite_book'],":phrase"=>$_POST['favorite_phrase'])); $upd=1; } $stmt2 = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid"); $stmt2->execute(array(":uid"=>$uid)); $user = $stmt2->fetch(PDO::FETCH_ASSOC); if($user['NumReviews']<26) $badge="rookie"; else if(($user['NumReviews']>=26)&&($user['NumReviews']<51)) $badge="lover"; else if(($user['NumReviews']>=51)&&($user['NumReviews']<101)) $badge="expert"; else if(($user['NumReviews']>=101)&&($user['NumReviews']<251)) $badge="genius"; else if($user['NumReviews']>=251) $badge="guru"; if($_GET['follow']==1) { $aaaa = $user_home->runQuery("SELECT * FROM tbl_follow WHERE userID=:uid AND Following=:fid"); $aaaa->execute(array(":uid"=>$_SESSION['userSession'],":fid"=>$_GET['uid'])); if($aaaa->rowCount()==0) { // register follow $bbbb = $user_home->runQuery("INSERT INTO tbl_follow VALUES ('', :uid, :fid, NOW())"); $bbbb->execute(array(":uid"=>$_SESSION['userSession'],":fid"=>$_GET['uid'])); $followed=1; //update quick stats $user_follow_q = $user_home->runQuery("UPDATE tbl_users SET NumFollowers=NumFollowers+1 WHERE userID=:uid"); $user_follow_q->execute(array(":uid"=>$_GET['uid'])); $user_follow_q2 = $user_home->runQuery("UPDATE tbl_users SET NumFollowing=NumFollowing+1 WHERE userID=:uid"); $user_follow_q2->execute(array(":uid"=>$_SESSION['userSession'])); // send notification $subject = "Έχεις έναν νέο follower"; $message = "Αγαπητέ χρήστη

"; $message .= "Ο χρήστης ".$_SESSION['FullName']." ξεκίνησε να σας ακολουθεί! Και θα ενημερώνεται κάθε φορά που γράφετε ένα νέο review."; $user_home->send_mail($user['userEmail'],$message,$subject); } else $folowexists=1; } if($_GET['unfollow']==1) { $aaaa = $user_home->runQuery("SELECT * FROM tbl_follow WHERE userID=:uid AND Following=:fid"); $aaaa->execute(array(":uid"=>$_SESSION['userSession'],":fid"=>$_GET['uid'])); if($aaaa->rowCount()>0) { // register follow $bbbb = $user_home->runQuery("DELETE FROM tbl_follow WHERE userID=:uid AND Following=:fid"); $bbbb->execute(array(":uid"=>$_SESSION['userSession'],":fid"=>$_GET['uid'])); $unfollowed=1; //update quick stats $user_follow_q = $user_home->runQuery("UPDATE tbl_users SET NumFollowers=NumFollowers-1 WHERE userID=:uid"); $user_follow_q->execute(array(":uid"=>$_GET['uid'])); $user_follow_q2 = $user_home->runQuery("UPDATE tbl_users SET NumFollowing=NumFollowing-1 WHERE userID=:uid"); $user_follow_q2->execute(array(":uid"=>$_SESSION['userSession'])); } else $nofollow=1; } //$stmt2 = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid"); //$stmt2->execute(array(":uid"=>$uid)); //$user = $stmt2->fetch(PDO::FETCH_ASSOC); if($user['userID']==$_SESSION['userSession']) $me=true; if($me) { // get followers $getfollowers = $user_home->runQuery("SELECT * FROM tbl_follow WHERE Following=:uid"); $getfollowers->execute(array(":uid"=>$_SESSION['userSession'])); $followers=$getfollowers->rowCount(); $getfollowing = $user_home->runQuery("SELECT * FROM tbl_follow WHERE userID=:uid"); $getfollowing->execute(array(":uid"=>$_SESSION['userSession'])); $following=$getfollowing->rowCount(); } else { $checkifyoufollow = $user_home->runQuery("SELECT * FROM tbl_follow WHERE userID=:uid AND Following=:fid"); $checkifyoufollow->execute(array(":uid"=>$_SESSION['userSession'],":fid"=>$_GET['uid'])); if($checkifyoufollow->rowCount()>0) $ifollow=1; } if(($me)&&(!isset($_GET['tab']))) $_GET['tab']='editprofile'; if((!$me)&&(!isset($_GET['tab']))) $_GET['tab']='reviews'; $tab1q = $user_home->runQuery("SELECT * FROM reviews WHERE userID=:uid"); $tab1q->execute(array(":uid"=>$uid)); $tab1num = $tab1q->rowCount(); $tab2q = $user_home->runQuery("SELECT * FROM tbl_follow WHERE Following=:uid"); $tab2q->execute(array(":uid"=>$uid)); $tab2num = $tab2q->rowCount(); $tab3q = $user_home->runQuery("SELECT * FROM tbl_follow WHERE userID=:uid"); $tab3q->execute(array(":uid"=>$uid)); $tab3num = $tab3q->rowCount(); $tab4q = $user_home->runQuery("SELECT * FROM book_subscriptions WHERE userID=:uid"); $tab4q->execute(array(":uid"=>$uid)); $tab4num = $tab4q->rowCount(); ?> - Bookfriends.gr
0) $user['ProfilePic']='https://graph.facebook.com/'.$user['FBID'].'/picture/?type=large'; else $prefix='images/profilepics/'; if(!empty($user['ProfilePic'])) { $headertitle = "
".$user['FullName']."

"; if($user_home->is_logged_in()) { if($ifollow!=1) $headertitle .= " ακολούθησε τον χρήστη"; else $headertitle .= " Ακολουθείς τον χρήστη!
[Κάνε κλικ για unfollow]
"; } } else { $headertitle = "
".$user['FullName']."

"; if($user_home->is_logged_in()) { if($ifollow!=1) $headertitle .= " ακολούθησε τον χρήστη"; else $headertitle .= " Ακολουθείς τον χρήστη!
[Κάνε κλικ για unfollow]
"; } } } else { if($_SESSION['FBID']>0) $user['ProfilePic']='https://graph.facebook.com/'.$_SESSION['FBID'].'/picture/?type=large'; else $prefix='images/profilepics/'; if(!empty($user['ProfilePic'])) { $headertitle = "
".$user['FullName']."

επεξεργασία προφίλ"; } else { $headertitle = "
".$user['FullName']."

επεξεργασία προφίλ"; } if($user['Flag']=='Public') $headertitle .= "

"; } include("header_nosearch.php"); ?>
Reviews

Followers

Following

Βιβλία

Reviews

Followers

Following

Αγαπημένα βιβλία

It is a far, far better thing that I do, than I have ever done; it is a far, far better rest I go to than I have ever known.";?>
  • "; else { ?>

    Ο χρήστης δεν έχει profile picture
Αλλαγή φωτογραφίας profile
ή διαγραφή
0) { $getreviewsq = $user_home->runQuery("SELECT * FROM reviews LEFT JOIN books2024 ON reviews.ISBN=books2024.ISBN WHERE reviews.userID=:uid ORDER BY reviews.ID DESC"); $getreviewsq->execute(array(":uid"=>$uid)); while($getreview = $getreviewsq->fetch(PDO::FETCH_ASSOC)) { ?>



Ο χρήστης δεν έχει ακόμα Reviews.
0) { $getreviewsq = $user_home->runQuery("SELECT *, book_subscriptions.ISBN AS ISBNnumber FROM book_subscriptions LEFT JOIN books ON book_subscriptions.ISBN=books2024.ISBN LEFT JOIN books_data ON book_subscriptions.ISBN=books_data.ISBN WHERE book_subscriptions.userID=:uid GROUP BY book_subscriptions.ID DESC"); $getreviewsq->execute(array(":uid"=>$uid)); while($getreview = $getreviewsq->fetch(PDO::FETCH_ASSOC)) { if($getreview['Reviews']>0) { $bookstars = round($getreview['Stars']/$getreview['Reviews'],1); $bookstars2 = round($bookstars); } ?>

0) { for($i=0;$i<$bookstars2;$i++) { ?>

Συνολική βαθμολογία:
Reviews:

Δες το "; ?>
Ο χρήστης δεν παρακολουθεί κανένα βιβλίο προς το παρόν.
0) { $getreviewsq = $user_home->runQuery("SELECT * FROM tbl_follow LEFT JOIN tbl_users ON tbl_follow.userID=tbl_users.userID WHERE tbl_follow.Following=:uid ORDER BY tbl_follow.ID DESC"); $getreviewsq->execute(array(":uid"=>$uid)); while($foluser = $getreviewsq->fetch(PDO::FETCH_ASSOC)) { ?>
Ο χρήστης δεν έχει ακόμη Followers.
0) { $getreviewsq = $user_home->runQuery("SELECT * FROM tbl_follow LEFT JOIN tbl_users ON tbl_follow.Following=tbl_users.userID WHERE tbl_follow.userID=:uid ORDER BY tbl_follow.ID DESC"); $getreviewsq->execute(array(":uid"=>$uid)); while($foluser = $getreviewsq->fetch(PDO::FETCH_ASSOC)) { ?>
Ο χρήστης δεν ακολουθεί κανέναν.