/** * Import a Twitter friend */ function importTwitterFriend($friend_data, $extra_tag = '') { $iduser = $_SESSION['do_User']->iduser; $tw_user_id = $friend_data['user_id']; $idcontact = $this->isTwFriendInContacts($iduser, $tw_user_id); list($fname, $lname) = explode(' ', $friend_data['name'], 2); $screen_name = $friend_data['screen_name']; $description = $friend_data['description']; $profile_image_url = $friend_data['profile_image_url']; $url = $friend_data['url']; $do_tag = new Tag(); if ($idcontact) { //update the data $c = new Contact(); $c->getId($idcontact); $c->firstname = $fname; $c->lastname = $lname; if ($c->picture == "") { $c->picture = $profile_image_url; } $c->tw_user_id = $tw_user_id; $c->update(); $do_tag->addTagAssociation($idcontact, 'Twitter', 'contact', $iduser); if ($extra_tag != '') { $do_tag->addTagAssociation($idcontact, $extra_tag, 'contact', $iduser); } } else { // new entry $c = new Contact(); $c->firstname = $fname; $c->lastname = $lname; $c->iduser = $iduser; $c->picture = $profile_image_url; $c->tw_user_id = $tw_user_id; $c->add(); $idcontact = $c->idcontact; $w = new ContactWebsite(); $w->idcontact = $idcontact; $w->website = 'http://twitter.com/' . $screen_name; $w->website_type = 'Twitter'; $w->feed_auto_fetch = 'Yes'; $w->add(); if ($url != '') { $w = new ContactWebsite(); $w->idcontact = $idcontact; $w->website = $url; $w->website_type = 'Personal'; $w->add(); } $link = '<br /><a href="http://twitter.com/' . $screen_name . '" target="_blank">Back to the Source of the Article</a><br />'; $do_contact_note = new ContactNotes(); $do_contact_note->idcontact = $idcontact; $do_contact_note->note = $description . $link; $do_contact_note->date_added = date('Y-m-d'); $do_contact_note->iduser = $iduser; $do_contact_note->add(); $do_tag->addTagAssociation($idcontact, 'Twitter', 'contact', $iduser); if ($extra_tag != '') { $do_tag->addTagAssociation($idcontact, $extra_tag, 'contact', $iduser); } } }
function turnFeedOff($idcontact_website) { $do_contact_website = new ContactWebsite(); $do_contact_website->getId($idcontact_website); $do_contact_website->feed_auto_fetch = 'No'; $do_contact_website->update(); }
function checkFbProfileUrlOnUpdate($idcontact, $profile_url) { $do_contact_website = new ContactWebsite(); $q = new sqlQuery($this->getDbCon()); $q->query("select idcontact_website from contact_website where idcontact = " . $idcontact . " AND website_type = 'Facebook' AND website = '" . $profile_url . "'"); if ($q->getNumRows() == 0) { $do_contact_website->idcontact = $idcontact; $do_contact_website->website = $profile_url; $do_contact_website->website_type = 'Facebook'; $do_contact_website->add(); } else { $q->fetch(); $idcontact_website = $q->getData("idcontact_website"); $do_contact_website->getId($idcontact_website); $do_contact_website->website = $profile_url; $do_contact_website->update(); } }
<?php /** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/ // Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com /** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/ //$GLOBALS['cfg_full_path'] = '/server/vhtdocs/ofuz.net/'; include_once 'config.php'; $do_contactwebsite = new ContactWebsite($GLOBALS['conx']); $do_contactwebsite->insertNoteForAutoFetchOn();
$ContactEmailAdd->add(); } } $ContactInstantMessage = $_SESSION['do_contact']->getChildContactInstantMessage(); $ContactInstantMessageAdd = new ContactInstantMessage(); if ($ContactInstantMessage->getNumRows()) { while ($ContactInstantMessage->next()) { $ContactInstantMessageAdd->addNew(); $ContactInstantMessageAdd->idcontact = $idcontact_inserted; $ContactInstantMessageAdd->im_type = $ContactInstantMessage->im_type; $ContactInstantMessageAdd->im_username = $ContactInstantMessage->im_username; $ContactInstantMessageAdd->add(); } } $ContactWebsite = $_SESSION['do_contact']->getChildContactWebsite(); $ContactWebsiteAdd = new ContactWebsite(); if ($ContactWebsite->getNumRows()) { while ($ContactWebsite->next()) { $ContactWebsiteAdd->addNew(); $ContactWebsiteAdd->idcontact = $idcontact_inserted; $ContactWebsiteAdd->website = $ContactWebsite->website; $ContactWebsiteAdd->website_type = $ContactWebsite->website_type; $ContactWebsiteAdd->add(); } } $ContactAddress = $_SESSION['do_contact']->getChildContactAddress(); $ContactAddressAdd = new ContactAddress(); if ($ContactAddress->getNumRows()) { while ($ContactAddress->next()) { $ContactAddressAdd->addNew(); $ContactAddressAdd->idcontact = $idcontact_inserted;