$datauser = new stdClass(); if ($querydata = $DB->get_records_sql($sqlfilteruser, array($USER->id))) { foreach ($querydata as $data) { $datauser->facebookid = $data->facebookid; $datauser->link = "https://www.facebook.com/app_scoped_user_id/" . $data->facebookid . "/"; $datauser->firstname = $data->firstname; $datauser->middlename = ""; $datauser->lastname = $data->lastname; } } } else { $datauser = $DB->get_record("facebook_user", array("moodleid" => $USER->id)); } //Tesis Roberto Jaunez if ($USER->id == 10644 || $USER->id == 2 || $USER->id == 40214 || $USER->id == 381 || $USER->id == 60246 || $USER->id == 32806 || $USER->id == 28988) { $toprow = array(); $toprow[] = new tabobject("Tu cuenta", new moodle_url('/local/facebook/connect.php'), "Tu cuenta"); $toprow[] = new tabobject("Facebook Analysis", new moodle_url('/local/facebook/facebookalgorithm.php'), "Facebook Analysis"); echo $OUTPUT->tabtree($toprow, "Tu cuenta"); } $table = facebook_connect_table_generator($datauser->facebookid, $datauser->link, $datauser->firstname, $datauser->middlename, $datauser->lastname); // Look if the account was already linked $duplicate = $DB->get_record("facebook_user", array("facebookid" => $facebook_id, "status" => FACEBOOK_STATUS_LINKED)); // if it isn't linked it will return false, if the status is 0 someone already linked it but it is not active. $button = new connect(null, array("duplicate" => $duplicate)); $button->display(); } } } // if the user has the account linkd it will show his information and some other actions the user can perform. echo $OUTPUT->footer();