Skip to content

Commit

Permalink
sub
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Jun 20, 2010
1 parent 7609e86 commit b5b16eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
17 changes: 14 additions & 3 deletions app/facebook/plugins/facebook.php
Expand Up @@ -38,11 +38,22 @@ function send_to_facebook( &$model, &$rec ) {

global $db,$prefix,$request;



// $sql = "SELECT facebook_id FROM ".$prefix."facebook_users WHERE profile_id = ".get_profile_id();
$sql = "SELECT facebook_id,oauth_key FROM identities,facebook_users WHERE facebook_users.profile_id = identities.id and identities.person_id = ".get_person_id();
$sql = "SELECT facebook_id,oauth_key FROM ".$prefix."identities,".$prefix."facebook_users WHERE ".$prefix."facebook_users.profile_id = ".$prefix."identities.id and ".$prefix."identities.person_id = ".get_person_id();
$result = $db->get_result( $sql );

if ($db->num_rows($result) == 1) {

if ($db->num_rows($result) == 1) {

} else {


$sql = "SELECT facebook_id,oauth_key FROM identities,facebook_users WHERE facebook_users.profile_id = identities.id and identities.person_id = ".get_person_id();
$result = $db->get_result( $sql );

}


ini_set('display_errors','1');
Expand Down Expand Up @@ -200,7 +211,7 @@ function send_to_facebook( &$model, &$rec ) {
$l->save_changes();
}

}


}
}
Expand Down
9 changes: 8 additions & 1 deletion app/twitter/plugins/twitter.php
Expand Up @@ -28,7 +28,14 @@ function send_to_twitter( &$model, &$rec ) {
$result = $db->get_result( $sql );

if ($db->num_rows($result) == 1) {


} else {
$sql = "SELECT oauth_key,oauth_secret FROM identities,twitter_users WHERE twitter_users.profile_id = identities.id and identities.person_id = ".get_person_id();
$result = $db->get_result( $sql );

}

if ($db->num_rows($result) == 1) {
// http://abrah.am
if (!class_exists('TwitterOAuth'));
lib_include('twitteroauth');
Expand Down

0 comments on commit b5b16eb

Please sign in to comment.