Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Más funciones actualizadas

  • Loading branch information...
commit cfd2742b5aa87e7cbd5466e2fe7ca0e387096cd3 1 parent 9205615
Cristo cristomc authored
2  vdl-includes/vdl-core/core_profile.class.php
View
@@ -70,7 +70,7 @@ public function get_profile($_user,$_refer){
}
}*/
$result = array();
- array_push($result,$a_result1);
+// array_push($result,$a_result1);
array_push($result,$a_result2);
return $result;
}
139 vdl-includes/vdl-core/core_user.class.php
View
@@ -13,40 +13,67 @@ class CORE_USER extends CORE_MAIN{
private $_user_site;
private $_user_bio;
private $_user_img_prof;
-
+ private $_user_prof_visits;
+ private $_user_prof_friends;
+ private $_user_prof_nets;
+ private $_user_session_id;
+
//===>Protected
protected function s_password($_value){
- $this->_user_password;
+ $this->_user_password = $_value;
}
protected function s_nickname($_value){
- $this->_user_nickname;
+ $this->_user_nickname = $_value;
+ }
+
+ protected function s_name($_value){
+ $this->_user_name = $_value;
}
protected function s_location($_value){
- $this->_user_location;
+ $this->_user_location = $_value;
+ }
+
+ protected function s_sex($_value){
+ $this->_user_sex = $_value;
+ }
+ protected function s_bday($_value){
+ $this->_user_bday = $_value;
}
protected function s_age($_value){
- $this->_user_age;
+ $this->_user_age = $_value;
}
protected function s_email($_value){
- $this->_user_email;
+ $this->_user_email = $_value;
}
protected function s_site($_value){
- $this->_user_site;
+ $this->_user_site = $_value;
}
protected function s_bio($_value){
- $this->_user_bio;
+ $this->_user_bio = $_value;
}
protected function s_img_prof($_value){
- $this->_user_img_prof;
+ $this->_user_img_prof = $_value;
}
+ protected function s_prof_visits($_value){
+ $this->_user_prof_visits = $_value;
+ }
+
+ protected function s_prof_friends($_value){
+ $this->_user_prof_friends = $_value;
+ }
+
+ protected function s_prof_nets($_value){
+ $this->_user_prof_nets = $_value;
+ }
+
protected function is_friend($_user1,$_user2){
$connection = parent::connect();
$query = sprintf("SELECT vdl_users.id FROM vdl_users WHERE vdl_users.user_id='%s'", $_user1);
@@ -67,6 +94,59 @@ public function __construct (){
parent::__construct();
}
+ public function nickname(){
+ return $this->_user_nickname;
+ }
+
+ public function name(){
+ return $this->_user_name;
+ }
+
+ public function location(){
+ return $this->_user_location;
+ }
+
+ public function sex(){
+ return $this->_user_sex;
+ }
+
+ public function bday(){
+ return $this->_user_bday;
+ }
+
+
+ public function age(){
+ return $this->_user_age;
+ }
+
+ public function email(){
+ return $this->_user_email;
+ }
+
+ public function site(){
+ return $this->_user_site;
+ }
+
+ public function bio(){
+ return $this->_user_bio;
+ }
+
+ public function img_prof(){
+ return $this->_user_img_prof;
+ }
+
+ public function prof_visits(){
+ return $this->_user_prof_visits;
+ }
+
+ public function prof_friends(){
+ return $this->_user_prof_friends;
+ }
+
+ public function prof_nets(){
+ return $this->_user_prof_nets;
+ }
+
//===>Modify user data
public function set_user(){
@@ -96,18 +176,18 @@ public function get_user($_user1,$_refer){
///===>Comprobar que es amigo
$client = htmlspecialchars(trim($_refer));
$user = htmlspecialchars(trim($_user1));
- if (!$client){
- ///===>extraer informacion limitada si no lo es
- $query = sprintf("SELECT
- vdl_users.nickname,
- vdl_users.genre,
- vdl_users.bio,
- vdl_users.website,
- vdl_users.prof_nets
- FROM vdl_users WHERE vdl_users.user_id='%s'", $user);
- $result=mysql_query($query,$connection);
- }
- else{
+// if (!$client){
+ //===>extraer informacion limitada si no lo es
+// $query = sprintf("SELECT
+// vdl_users.nickname,
+// vdl_users.genre,
+// vdl_users.bio,
+// vdl_users.website,
+// vdl_users.prof_nets
+// FROM vdl_users WHERE vdl_users.user_id='%s'", $user);
+// $result=mysql_query($query,$connection);
+// }
+// else{
///===>extraer informacion completa si es amigo
$query = sprintf("SELECT
vdl_users.nickname,
@@ -122,19 +202,26 @@ public function get_user($_user1,$_refer){
vdl_users.prof_nets
FROM vdl_users WHERE vdl_users.user_id='%s'", $user);
$result=mysql_query($query,$connection);
- }
+// }
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
-
- $a_result = array();
while ($row = mysql_fetch_assoc($result)){
- array_push($a_result,$row);
+ $this->s_nickname($row["nickname"]);
+ $this->s_name($row["name"]);
+ $this->s_location($row["location"]);
+ $this->s_sex($row["genre"]);
+ $this->s_bday($row["bday"]);
+ $this->s_bio($row["bio"]);
+ $this->s_email($row["email"]);
+ $this->s_site($row["website"]);
+ $this->s_img_prof($row["img_prof"]);
+ $this->s_prof_nets($row["prof_nets"]);
}
- return $a_result;
+ return true;
}
public function add_user($_user_id,$_passwd,$_nickname,$_name,$_location,$_genre,$_bday,$_email,$_bio){
43 vdl-profile/index.php 100644 → 100755
View
@@ -34,37 +34,17 @@
$author = $prof->get_profile($_GET["nick"],$visitor);
else
$author = $prof->get_profile($_SESSION["user_id"],$visitor);
- foreach ($author as $data){
- if (isset($data['email']))
- $email = $data['email'];
- else
- $email ="";
- $nickname = $data["nickname"];
-// $size = 200;
-// $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5( strtolower($email) )."&size=".$size;
- $website = $data['website'];
- if (isset($data['name']))
- $name = $data['name'];
- else
- $name ="";
- if (isset($data['location']))
- $location = $data['location'];
- else
- $location ="";
- $genre = $data['genre'];
- if (isset($data['bday']))
- {
- $bday = $data['bday'];
- $age = $data['age'];
- }
- else
- {
- $bday ="";
- $age = "";
- }
- $bio = $data['bio'];
- $photo = $data['img_prof'];
- $nets =$data['prof_nets'];
+ $website = $prof->site();
+ $name = $prof->name();
+ $nickname = $prof->nickname();
+ $location = $prof->location();
+ $genre = $prof->sex();
+ $bday = $prof->bday();
+ $age = $prof->age();
+ $bio = $prof->bio();
+ $photo = $prof->img_prof();
+ $email = $prof->email();
+ $nets = $prof->prof_nets();
?>
<div class="grid_4">
@@ -86,7 +66,6 @@
echo '<a href="mailto:'.$email.'">'.$email.'</a><br/>';
echo '<a href="http://'.$website.'">'.$website.'</a><br/>';
echo $bio . '</br>';
- }
echo '<div class="clear"></div>';
echo "</article>";
?>
Please sign in to comment.
Something went wrong with that request. Please try again.