X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ffacebookaction.php;h=043a078cd5bbd2fa8b0849fa7dc3c5238927cc3f;hb=1df3eeba861f9f5b7be7fd1ad4298f614a6cbee5;hp=d5f0adbb88d3e17fdc386e328758f257c9d95708;hpb=1a8869424b9640a1d6a689e7882f04c757f78b38;p=quix0rs-gnu-social.git diff --git a/lib/facebookaction.php b/lib/facebookaction.php index d5f0adbb88..043a078cd5 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -1,279 +1,750 @@ . + * along with this program. If not, see . + * + * @category Faceboook + * @package Laconica + * @author Zach Copley + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ */ -if (!defined('LACONICA')) { exit(1); } - -require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); - -class FacebookAction extends Action { - - function handle($args) { - parent::handle($args); - } - - function get_facebook() { - $apikey = common_config('facebook', 'apikey'); - $secret = common_config('facebook', 'secret'); - return new Facebook($apikey, $secret); - } - - function update_profile_box($facebook, $fbuid, $user) { - - $notice = $user->getCurrentNotice(); - - # Need to include inline CSS for styling the Profile box - - $style = ''; - - $html = $this->render_notice($notice); - - $fbml = "$content $html"; - $fbml .= "$content $html"; - - $fbml_main = "$content $html"; - - $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main); - } - - # Display methods - - function show_header($selected ='Home') { - - $header = ''; - # $header .=''; - $header .= ''; - - $header .= - '' - .'' - .'' - .'' - .''; - $header .= '
'; - - echo $header; - - } - - function show_footer() { - $footer = '
'; - echo $footer; - } - - function show_login_form() { - - $loginform = - '

To add the Identi.ca application, you need to log into your Identi.ca account.

' - .'' - .' ' - .'' - .'

Login

' - .'
' - .'

Login with your username and password. Don\'t have a username yet?' - .' Register a new account.' - .'

' - .'
' - .'
' - .'
' - .'

' - .' ' - .' ' - .'

' - .'

' - .' ' - .' ' - .'

' - .'

' - .' ' - .'

' - .'
' - .'

' - .' Lost or forgotten password?' - .'

' - .'getProfile(); - $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - - $noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); - - # XXX: we need to figure this out better. Is this right? - if (strcmp($notice->uri, $noticeurl) != 0 && preg_match('/^http/', $notice->uri)) { - $noticeurl = $notice->uri; - } - - $html = - '
  • ' - .'' - .'';
-
-		if ($profile->fullname) {
-			$html .= $profile->fullname;
-		} else {
-			$html .= $profile->nickname;
-		}
-
-		$html .=
-		'' - .'' . $profile->nickname . '' - .'

    ' . $notice->rendered . '

    ' - .'

    ' - .''; - - if ($notice->source) { - $html .= _(' from '); - $html .= $this->source_link($notice->source); - } - - if ($notice->reply_to) { - $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); - $html .= - ' (' . _('in reply to...') . ')'; - } - - $html .= '

  • '; - - return $html; - } - - function source_link($source) { - $source_name = _($source); - - $html = ''; - - switch ($source) { - case 'web': - case 'xmpp': - case 'mail': - case 'omb': - case 'api': - $html .= $source_name; - break; - default: - $ns = Notice_source::staticGet($source); - if ($ns) { - $html .= '' . $ns->name . ''; - } else { - $html .= $source_name; - } - break; - } - - $html .= ''; - - return $html; - } - - function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) { - - $html = ''; - - if ($have_before || $have_after) { - $html = '