Ejemplo n.º 1
0
 function getProfileImage($userid, $width = null, $height = null)
 {
     $image = getProfileImagePath($userid);
     if (file_exists($image)) {
         return getProfileImageUrl($userid, $width, $height);
     } else {
         $brw = $this->getBorrowerDetails($userid);
         $fb_data = unserialize(base64_decode($brw['fb_data']));
         if (!empty($fb_data['user_profile']['id'])) {
             //                return "https://graph.facebook.com/".$fb_data['user_profile']['id']."/picture?width=$width&height=$height";
             return "https://graph.facebook.com/" . $fb_data['user_profile']['id'] . "/picture?width=9999&height=9999";
         }
     }
     return getDefaultImageUrl();
 }
Ejemplo n.º 2
0
if ($session->userlevel != LENDER_LEVEL) {
    if ($session->userlevel == GUEST_LEVEL) {
        return $smarty->display('lender_invite_guest.tpl');
    }
    header("Location: " . SITE_URL);
    exit;
}
$invite_url = SITE_URL . 'i/' . $session->username;
$twitterParams = array("url" => $invite_url . "?s=2", "text" => "Use this link to fund a Zidisha microloan project for free! @ZidishaInc");
$twitter_url = "http://twitter.com/share?" . http_build_query($twitterParams);
$relative_invite_url = str_replace("https://www.", "", $invite_url);
$facebook_url = "http://www.facebook.com/sharer.php?s=100&p[url]=" . urlencode($relative_invite_url . "?s=3");
$invites = $database->getLenderInvites($session->userid);
$count_invites = count($invites);
$count_joined_invites = 0;
$default_image_url = getDefaultImageUrl();
foreach ($invites as $i => $invite) {
    if ($invite['invitee_id']) {
        $invitee = $database->getLenderDetails($invite['invitee_id']);
        $invitee['profile_url'] = SITE_URL . 'microfinance/profile/' . $invitee['username'] . '.html';
        $profile_image = $database->getProfileImage($invitee['userid']);
        $invitee['profile_image'] = $profile_image != $default_image_url ? $profile_image : null;
        $count_joined_invites += 1;
    } else {
        $invitee = null;
    }
    $invites[$i]['invitee'] = $invitee;
}
$user_guess = generateToken('lender_invite');
$invited = false;
if (isset($_SESSION['lender_invite_invited'])) {