当前位置: 首页>>代码示例>>PHP>>正文


PHP Contact::free方法代码示例

本文整理汇总了PHP中Contact::free方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::free方法的具体用法?PHP Contact::free怎么用?PHP Contact::free使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contact的用法示例。


在下文中一共展示了Contact::free方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: eventGetContacts

 function eventGetContacts(EventControler $evtcl)
 {
     $plugType = 'email';
     $provider_box = $evtcl->provider_box;
     $email_box = $evtcl->email_box;
     $password_box = $evtcl->password_box;
     $msg = "";
     $contacts = "";
     $ok = false;
     if (empty($email_box)) {
         $msg = "Email missing !";
     }
     if (empty($password_box)) {
         $msg = "Password missing !";
     }
     if (empty($provider_box)) {
         $msg = "Provider missing !";
     }
     if ($msg == "") {
         $inviter = new OpenInviter();
         $inviter->startPlugin($provider_box);
         $internal = $inviter->getInternalError();
         if ($internal) {
             $msg = $internal;
         } elseif (!$inviter->login($email_box, $password_box)) {
             $internal = $inviter->getInternalError();
             $msg = $internal ? $internal : "Login failed. Please check the email and password you have provided and try again later !";
         } elseif (false === ($contacts = $inviter->getMyContacts())) {
             $msg = "Unable to get contacts !";
         } else {
             $msg = "Contacts imported successfully.";
             $ok = true;
             //$_POST['oi_session_id']=$inviter->plugin->getSessionID();
         }
     }
     if ($ok) {
         /*print_r($contacts);
         		exit();*/
         foreach ($contacts as $email => $name) {
             $do_contact = new Contact();
             $do_contact->firstname = $name;
             $do_contact->iduser = $_SESSION['do_User']->iduser;
             $do_contact->add();
             $lastInsertedContId = $do_contact->getPrimaryKeyValue();
             $do_contact->addEmail($email, 'Home');
             $do_contact->free();
             //contact view
             $do_cv = new ContactView();
             $do_cv->idcontact = $lastInsertedContId;
             $do_cv->firstname = $name;
             $do_cv->email_address = $email;
             $do_cv->add();
             $do_cv->free();
         }
     }
     $_SESSION['in_page_message'] = $msg;
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:57,代码来源:OfuzEmailImporter.class.php

示例2: Contact

                  thisDiv.style.display = "none";
            </script>
            <?php 
        }
        $do_contact = new Contact();
        $name = $_SESSION['do_ofuz_fb']->getFbUserName($friend);
        // will contain the firstand last name in facebook
        $affiliations = $_SESSION['do_ofuz_fb']->getFbUserAffiliations($friend);
        $work_history = $_SESSION['do_ofuz_fb']->getWorkHistory($friend);
        $profile_url = $_SESSION['do_ofuz_fb']->getProfileURL($friend);
        $profile_pic_with_logo = $_SESSION['do_ofuz_fb']->getProfilePicWithLogo($friend);
        $friends_data = array("fb_uid" => $friend, "name" => $name, "affiliations" => $affiliations, "work" => $work_history, "profile_url" => $profile_url, "pic_with_logo" => $profile_pic_with_logo, "listname" => $list_name_array);
        //print_r($friends_data);
        //echo '<br />';
        $do_contact->importFacebookFriends($friends_data);
        $do_contact->free();
    }
    //rebuilding the userXX_contact table
    /*$contact_view = new ContactView();
      $contact_view->setUser($_SESSION['do_User']->iduser);
      $contact_view->rebuildContactUserTable();*/
    if ($_SESSION["page_from"] == 'reg') {
        $message = 'Facebook contacts have been imported successfully';
        ?>
          <script type="text/javascript">
              window.location = "/welcome_to_ofuz.php?message=<?php 
        echo $message;
        ?>
";
          </script>
        <?php 
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:ww_s1_fbconnect.php

示例3: AutoResponder

 * A cron job script for sending the autoresponders.
 * Will get the autoresponders with the tags and will send the email to the contacts associated with the tag_name
 * @see class/Autoresponder.class.php
 */
include_once 'config.php';
$AutoResponder = new AutoResponder();
$AutoResponder->getAutoresponders();
if ($AutoResponder->getNumRows()) {
    while ($AutoResponder->next()) {
        $User = new User();
        $User->getId($AutoResponder->iduser);
        $User->sessionPersistent('do_User', 'contacts.php', OFUZ_TTL);
        $email_template = new EmailTemplate();
        $email_template->bodyhtml = nl2br(stripslashes($AutoResponder->bodyhtml));
        $email_template->subject = $AutoResponder->subject;
        $email_template->senderemail = $User->email;
        $email_template->sendername = $User->firstname . ' ' . $User->lastname;
        $resp_name = $AutoResponder->resp_name;
        $Contact = new Contact();
        $Contact->getContactsForAutoResponder($AutoResponder->iduser, $AutoResponder->tag_name, $AutoResponder->num_days_to_send);
        if ($Contact->getNumRows()) {
            while ($Contact->next()) {
                $values = array("idcontact" => $Contact->idcontact, "firstname" => $Contact->firstname, "lastname" => $Contact->lastname, "position" => $Contact->position, "company" => $Contact->company, "idtag" => $Contact->idtag, "resp_name" => $resp_name, "flag" => "unsubscribe_autoresponder");
                $Contact->sendMessage($email_template, $values);
                echo '<br /> Email Sent to :' . $Contact->email_address;
            }
        }
        $Contact->free();
    }
    $AutoResponder->free();
}
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:cron_autoresponder.php

示例4: MergeContactsAutomated


//.........这里部分代码省略.........
                             $found = true;
                             while ($q_master->fetch()) {
                                 if ($q_rel->getData("website") == $q_master->getData("website") && $q_rel->getData("website_type") == $q_master->getData("website_type")) {
                                     $found = true;
                                     break;
                                 } else {
                                     $found = false;
                                 }
                             }
                             if (!$found) {
                                 $q->query("update contact_website set idcontact = " . $id_to_keep . " where idcontact_website = " . $q_rel->getData("idcontact_website"));
                             }
                         }
                     }
                 } else {
                     $q->query("update contact_website set idcontact = " . $id_to_keep . " where idcontact = " . $contact_id_del);
                 }
                 //Update the ContactAddress with $id_to_keep
                 $q = new sqlQuery($this->getDbCon());
                 $q_master = new sqlQuery($this->getDbCon());
                 $q_rel = new sqlQuery($this->getDbCon());
                 $q_master->query("select * from contact_address where idcontact = " . $id_to_keep);
                 if ($q_master->getNumRows() > 0) {
                     $update_ids_array = array();
                     $q_rel->query("select * from contact_address where idcontact = " . $contact_id_del);
                     if ($q_rel->getNumRows()) {
                         while ($q_rel->fetch()) {
                             $found = true;
                             while ($q_master->fetch()) {
                                 if ($q_rel->getData("address") == $q_master->getData("address") && $q_rel->getData("address_type") == $q_master->getData("address_type") && $q_rel->getData("city") == $q_master->getData("city") && $q_rel->getData("country") == $q_master->getData("country") && $q_rel->getData("state") == $q_master->getData("state") && $q_rel->getData("street") == $q_master->getData("street") && $q_rel->getData("zipcode") == $q_master->getData("zipcode")) {
                                     $found = true;
                                     break;
                                 } else {
                                     $found = false;
                                 }
                             }
                             if (!$found) {
                                 $q->query("update contact_address set idcontact = " . $id_to_keep . " where idcontact_address = " . $q_rel->getData("idcontact_address"));
                             }
                         }
                     }
                 } else {
                     $q->query("update contact_address set idcontact = " . $id_to_keep . " where idcontact = " . $contact_id_del);
                 }
                 //Update the ContactRssFeed with $id_to_keep
                 $q = new sqlQuery($this->getDbCon());
                 $q_master = new sqlQuery($this->getDbCon());
                 $q_rel = new sqlQuery($this->getDbCon());
                 $q_master->query("select * from contact_rss_feed where idcontact = " . $id_to_keep);
                 if ($q_master->getNumRows() > 0) {
                     $update_ids_array = array();
                     $q_rel->query("select * from contact_rss_feed where idcontact = " . $contact_id_del);
                     if ($q_rel->getNumRows()) {
                         while ($q_rel->fetch()) {
                             $found = true;
                             while ($q_master->fetch()) {
                                 if ($q_rel->getData("feed_type") == $q_master->getData("feed_type") && $q_rel->getData("rss_feed_url") == $q_master->getData("rss_feed_url") && $q_rel->getData("username") == $q_master->getData("username")) {
                                     $found = true;
                                     break;
                                 } else {
                                     $found = false;
                                 }
                             }
                             if (!$found) {
                                 $q->query("update contact_rss_feed set idcontact = " . $id_to_keep . " where idcontact_rss_feed = " . $q_rel->getData("idcontact_rss_feed"));
                             }
                         }
                     }
                 } else {
                     $q->query("update contact_rss_feed set idcontact = " . $id_to_keep . " where idcontact = " . $contact_id_del);
                 }
                 $q = new sqlQuery($this->getDbCon());
                 //Update the ContactNotes with $id_to_keep
                 $q->query("update contact_note set idcontact = " . $id_to_keep . " where idcontact = " . $contact_id_del);
                 //Update the Contacttasks with $id_to_keep
                 $q->query("update task set idcontact = " . $id_to_keep . " where idcontact = " . $contact_id_del);
                 //update the invoice with #id_to_keep and idcompany
                 $idcompany = $this->getIdCompanyForContact($id_to_keep);
                 $inv_addr = $this->ajaxGetInvoiceAddress($id_to_keep);
                 $q->query("update invoice set idcontact = " . $id_to_keep . ",idcompany = {$idcompany},invoice_address='{$inv_addr}' where idcontact = " . $contact_id_del);
                 //Update the google_contact_info with $id_to_keep
                 //$q->query("update google_contact_info set idcontact = ".$id_to_keep. " where idcontact = ".$contact_id_del);
                 // Update the shared contact
                 $do_cont_sharing->resetContactSharingOnMerging($id_to_keep, $contact_id_del);
                 // delete contact
                 $do_deleting_contact->getId($contact_id_del);
                 $do_deleting_contact->delete();
             }
         }
         // For each ends here
         $do_deleting_contact->free();
         //exit;
         //$rlog = new UpdateRecordLog();
         //$rlog->setLastUpdate("contact", $id_to_keep);
         //$this->setActivity();
         return $id_to_keep;
     } else {
         return false;
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:101,代码来源:.Contact.class.php

示例5: eventImportAccount

 function eventImportAccount(EventControler $evtcl)
 {
     $msg = "";
     $uploaded_file = $_FILES['fields']['name']['import_account'];
     $target_path = 'files/' . $uploaded_file;
     if (!move_uploaded_file($_FILES['fields']['tmp_name']['import_account'], $target_path)) {
         $msg = "There was an error uploading the file, please try again!";
     } else {
         chmod($target_path, 0755);
         if (file_exists($target_path)) {
             //$xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT']."/".$target_path);
             $str_xml = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $target_path);
             $str_xml = preg_replace('/[^(\\x20-\\x7F)]*/', '', $str_xml);
             $xml = simplexml_load_string($str_xml);
             echo '<pre>';
             print_r($xml);
             echo '</pre>';
             die;
             if ($xml !== FALSE) {
                 $c_cnt = count($xml->contact);
                 if ($c_cnt) {
                     for ($i = 0; $i < $c_cnt; $i++) {
                         $do_contact = new Contact();
                         $contact = $xml->contact[$i];
                         $do_contact->firstname = $contact->firstname;
                         $do_contact->lastname = $contact->lastname;
                         $do_contact->position = $contact->position;
                         $do_contact->company = $contact->company;
                         $do_contact->idcompany = $contact->idcompany;
                         $do_contact->iduser = $_SESSION['do_User']->iduser;
                         $do_contact->picture = $contact->picture;
                         $do_contact->summary = $contact->summary;
                         $do_contact->birthday = $contact->birthday;
                         $do_contact->portal_code = $contact->portal_code;
                         $do_contact->fb_userid = $contact->fb_userid;
                         $do_contact->tw_user_id = $contact->tw_user_id;
                         $do_contact->email_optout = $contact->email_optout;
                         $do_contact->add();
                         $lastInsertedContId = $do_contact->getPrimaryKeyValue();
                         /**
                          *Contact Address	
                          */
                         $ca_cnt = count($contact->contact_address);
                         if ($ca_cnt) {
                             for ($ca_cnt_i = 0; $ca_cnt_i < $ca_cnt; $ca_cnt_i++) {
                                 $do_contact_address = new ContactAddress();
                                 $contact_address = $contact->contact_address[$ca_cnt_i];
                                 $do_contact_address->city = $contact_address->city;
                                 $do_contact_address->country = $contact_address->country;
                                 $do_contact_address->state = $contact_address->state;
                                 $do_contact_address->street = $contact_address->street;
                                 $do_contact_address->zipcode = $contact_address->zipcode;
                                 $do_contact_address->idcontact = $lastInsertedContId;
                                 $do_contact_address->address = $contact_address->address;
                                 $do_contact_address->address_type = $contact_address->address_type;
                                 $do_contact_address->add();
                                 $do_contact_address->free();
                             }
                         }
                         /**
                          *Contact Email	
                          */
                         $ce_cnt = count($contact->contact_email);
                         if ($ce_cnt) {
                             for ($ce_cnt_i = 0; $ce_cnt_i < $ce_cnt; $ce_cnt_i++) {
                                 $do_contact_email = new ContactEmail();
                                 $contact_email = $contact->contact_email[$ce_cnt_i];
                                 $do_contact_email->idcontact = $lastInsertedContId;
                                 $do_contact_email->email_address = $contact_email->email_address;
                                 $do_contact_email->email_type = $contact_email->email_type;
                                 $do_contact_email->email_isdefault = $contact_email->email_isdefault;
                                 $do_contact_email->add();
                                 $do_contact_email->free();
                             }
                         }
                         /**
                          *Contact Phone 
                          */
                         $cp_cnt = count($contact->contact_phone);
                         if ($cp_cnt) {
                             for ($cp_cnt_i = 0; $cp_cnt_i < $cp_cnt; $cp_cnt_i++) {
                                 $do_contact_phone = new ContactPhone();
                                 $contact_phone = $contact->contact_phone[$cp_cnt_i];
                                 $do_contact_phone->phone_number = $contact_phone->phone_number;
                                 $do_contact_phone->phone_type = $contact_phone->phone_type;
                                 $do_contact_phone->idcontact = $lastInsertedContId;
                                 $do_contact_phone->add();
                                 $do_contact_phone->free();
                             }
                         }
                         /**
                          *Contact Note	
                          */
                         $cn_cnt = count($contact->contact_note);
                         if ($cn_cnt) {
                             for ($cn_cnt_i = 0; $cn_cnt_i < $cn_cnt; $cn_cnt_i++) {
                                 $do_contact_note = new ContactNotes();
                                 $contact_note = $contact->contact_note[$cn_cnt_i];
                                 $do_contact_note->idcontact = $lastInsertedContId;
                                 $do_contact_note->note = $contact_note->note;
//.........这里部分代码省略.........
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:101,代码来源:RestoreAccount.class.php

示例6: jobqueue_fb_friend_import

 /**
  * Method to import the facebook friends using the queue
  * @param object $job
  * @see Contact::importFacebookFriends();
  */
 public function jobqueue_fb_friend_import($job)
 {
     include_once 'facebook_client/facebook.php';
     include_once 'class/OfuzFacebook.class.php';
     //$qry = new sqlQuery($this->getDbCon());
     //$qry_d = new sqlQuery($this->getDbCon());
     $data = $job->obj_data;
     $iduser = $job->iduser;
     $obj = unserialize($data);
     if (is_object($obj)) {
         try {
             @($friends = $obj->getFbFriends());
             // will contain the fbid of friends
         } catch (Exception $e) {
             echo 'Friends Not Found !!';
         }
         $list = $obj->getFriendsList();
         $count = count(@$friends);
         $i = 1;
         $j = 0;
         foreach (@$friends as $friend) {
             $frnd_list = array();
             $frnd_list = $list;
             $list_name_array = array();
             if (is_array($frnd_list)) {
                 foreach ($frnd_list as $frnd_list) {
                     $list_id = $frnd_list['flid'];
                     $frnds_in_list = $obj->getFriendsInList($list_id);
                     if (@in_array($friend, $frnds_in_list)) {
                         $list_name_array[] = $frnd_list['name'];
                     }
                 }
             }
             $j++;
             //echo '11';
             $do_contact = new Contact();
             $name = $obj->getFbUserName($friend);
             // will contain the firstand last name in facebook
             $affiliations = $obj->getFbUserAffiliations($friend);
             $work_history = $obj->getWorkHistory($friend);
             $profile_url = $obj->getProfileURL($friend);
             $profile_pic_with_logo = $obj->getProfilePicWithLogo($friend);
             $friends_data = array("fb_uid" => $friend, "name" => $name, "affiliations" => $affiliations, "work" => $work_history, "profile_url" => $profile_url, "pic_with_logo" => $profile_pic_with_logo, "listname" => $list_name_array);
             $do_contact->importFacebookFriends($friends_data, $iduser);
             $do_contact->free();
         }
         echo '<h2>Friends have been imported for Userid ' . $iduser . '</h2> ';
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:54,代码来源:OfuzBeanstalkd.class.php


注:本文中的Contact::free方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。