Example #1
0
 function proceedTwitterUserConnected()
 {
     if (isTwitterLogin()) {
         if ($id_user = $this->twittermodel->isTwitterConnected()) {
             $this->user_io_m->saveAccountToSessionInfo($id_user);
             redirect("user");
         } else {
             redirect("member/twitter_register");
         }
     } else {
         redirect("member/login");
     }
 }
Example #2
0
 function jsdetect()
 {
     $facebookconnected = $twitterconnected = 0;
     if (isFacebookLogin()) {
         $facebookconnected = 1;
     }
     if (isTwitterLogin()) {
         $twitterconnected = 1;
     }
     header("content-type:application/x-javascript");
     echo "var SYS_JS_SOCIAL = {};";
     echo "SYS_JS_SOCIAL.facebook = {$facebookconnected};";
     echo "SYS_JS_SOCIAL.twitter = {$twitterconnected};";
     echo "var USER_ID = " . getAccountUserId() . ";";
 }
 function postOnWall()
 {
     $message = $this->input->post('message');
     $userdataobj = getAccountUserDataObject();
     if (isFacebookLogin()) {
         $this->facebookconnect_io_m->postOnUserWall($userdataobj->id_user, $message, $message, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
     }
     if (isTwitterLogin()) {
         $this->twittermodel->postOnWall($message, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
     }
     echo json_encode(array('message' => 'Post on your wall successfully.'));
     exit;
 }
				<?php 
if ($this->facebookconnect_io_m->init('userid', getAccountUserId())) {
    ?>
					<br/><br/>
					<a href="javascript:void(0);" onclick="callFuncShowMyFacebookFriends();" class="button spctext">
						Invite your facebook friends 
				    </a>
				<?php 
}
?>
 
				
				<div class="clear"></div>
				
				<?php 
if (isTwitterLogin()) {
    ?>
					<br/><br/>
					<a href="javascript:void(0);" onclick="callFuncShowMyTwitterFriends();" class="button spctext">
						Invite your twitter friends 
				    </a>
				<?php 
}
?>
 
				
				<div class="clear"></div>
				
				<div class="filter-split body-container">
					<label><b>From:</b></label> 
					<div class="inputcls">
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('user_m');
     $this->load->model('wall_m');
     $this->load->model('qa_m');
     $this->load->model('wallet_m');
     $this->load->model('friend_m');
     $this->load->model('pet_m');
     $this->load->model('wishlist_m');
     $this->load->model('lock_m');
     $this->load->model('collection_m');
     $this->load->model('photos_m');
     $this->load->model('backstage_m');
     $this->load->model('rate_m');
     $this->load->model('gift_m');
     //$this->load->model( 'flirt_m' );
     $this->load->model('mapflirt_m');
     $this->load->model('peep_m');
     $this->load->model('block_m');
     $this->load->model('online_m');
     $this->load->model('random_message_m');
     $this->load->model('hentai_m');
     $this->load->model('watching_video_m');
     $this->load->model('peepbought_history_m');
     $this->load->model('report_abuse_m');
     $this->load->model('favourite_m');
     $this->load->model('trialpay_m');
     if (!isLogin()) {
         $currenturl = fullURL();
         if (false !== strpos($currenturl, '/videos/')) {
             $redr = str_replace(array('/user/videos/video/', '/user/videos/series/'), array('/videos/category/video/', '/videos/category/series/'), $currenturl);
             redirect($redr);
             die;
         }
         //redirect("member");
     }
     if (isLogin()) {
         $userdata = getAccountUserDataObject(true);
         if ($userdata->status != 0) {
             //show_404();
             die("This account had been deactivated.");
         }
         $facebookdata = $this->db->where('userid', getAccountUserId())->get(TBL_FACEBOOK_CONNECT)->result();
         $twitterdata = $this->db->where('userid', getAccountUserId())->get(TBL_TWITTER_CONNECT)->result();
         if (!$facebookdata and !$twitterdata) {
             //force connect page
             if (isset($_SESSION['admin_switch_user'])) {
             } else {
                 if ($this->uri->segment(2) != 'connect') {
                     redirect("user/connect");
                 }
             }
         }
         /*****
         			if($facebookdata ){ //AND !isset($_SESSION['facebookinvokedtime'])
         				if(!isFacebookLogin()){
         					$url = $this->facebookmodel->getLoginLogoutUrl();
         					$_SESSION['facebookinvokedtime'] = 1;
         					if(ENVIRONMENT != 'development'){
         						redirect( $url );
         					}
         				}
         			}
         			***/
         if ($twitterdata and $twitterdata[0]->session_data) {
             if (!isTwitterLogin()) {
                 $this->twittermodel->invokedSessionLogin($twitterdata[0]->session_data);
             }
         }
         if (isset($_SESSION['reffer_video_url'])) {
             $tmp = $_SESSION['reffer_video_url'];
             unset($_SESSION['reffer_video_url']);
             redirect($tmp);
         }
         $this->user_io_m->userSyncCashAndValue(getAccountUserId());
         $current_dbprefix = $this->db->dbprefix;
         $this->db->set_dbprefix('');
         $check = $this->db->where('userid', getAccountUserId())->get('cometchat_status')->result();
         if (empty($check)) {
             $this->db->set('userid', getAccountUserId());
             $this->db->set('message', NULL);
             $this->db->set('status', 'available');
             $this->db->set('typingto', NULL);
             $this->db->set('typingtime', NULL);
             $this->db->insert('cometchat_status');
         }
         $this->db->set_dbprefix($current_dbprefix);
     }
     //$fb = site_url()."/media/js/fb.js";
     $this->template->append_metadata('<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>');
 }
function forceUserConnect()
{
    $userdataobj = getAccountUserDataObject();
    $ci =& get_instance();
    $checkError = array();
    if ($ci->facebookmodel->isUserLoggedin()) {
        $facebookid = $ci->facebookmodel->getFacebookid();
        $facebookconnectdataobj = $ci->facebookconnect_io_m->init('facebookid', $facebookid);
        if ($facebookconnectdataobj and $facebookconnectdataobj->userid != getAccountUserId()) {
            if ($id_user = $ci->facebookmodel->isFacebookConnected()) {
                $ci->mod_io_m->update_map(array('access_token' => $ci->facebookmodel->getUserAccessToken()), array('userid' => $id_user), TBL_FACEBOOK_CONNECT);
            }
            $ci->user_io_m->userLogout();
            reloadJS_url("member/login");
        } else {
            if (!$facebookconnectdataobj) {
                if ($ci->facebookmodel->getTotalFriends() < $GLOBALS['global']['FACEBOOK']['MinFacebookFriendsRequired']) {
                    $checkError[] = str_replace('$s', $GLOBALS['global']['FACEBOOK']['MinFacebookFriendsRequired'], language_translate('member_fb_friend_request_error'));
                }
                if ($ci->facebookmodel->countPictures() < $GLOBALS['global']['FACEBOOK']['MinFacebookPhotosRequired']) {
                    $checkError[] = str_replace('$s', $GLOBALS['global']['FACEBOOK']['MinFacebookPhotosRequired'], language_translate('member_fb_photo_request_error'));
                }
                if (empty($checkError)) {
                    $data['userid'] = getAccountUserId();
                    $data['facebookid'] = $facebookid;
                    $data['add_date'] = mysqlDate();
                    $data['ip'] = $ci->geo_lib->getIpAddress();
                    $data['invitedfriends'] = 0;
                    $data['access_token'] = $ci->facebookmodel->getUserAccessToken();
                    $ci->facebookconnect_io_m->insert_map($data);
                    $postFB = true;
                    $ci->facebookmodel->getProfilePicture(getAccountUserId());
                    $FirstStatusMessage = $GLOBALS['global']['FACEBOOK']['FirstStatusMessage'];
                    $FirstStatusDescription = $GLOBALS['global']['FACEBOOK']['FirstStatusDescription'];
                    $invite_url = $ci->user_io_m->getInviteUrl($userdataobj->username);
                    //$this->facebookmodel->postOnWall($FirstStatusMessage,$FirstStatusDescription,$invite_url);
                    $ci->facebookconnect_io_m->postOnUserWall($userdataobj->id_user, $FirstStatusMessage, $FirstStatusDescription, $invite_url);
                } else {
                    $ci->facebookmodel->logout();
                }
            }
        }
    }
    if (isTwitterLogin()) {
        $twitterid = $ci->twittermodel->getTwitterId();
        $twitterconnectdataobj = $ci->mod_io_m->init('twitterid', $twitterid, TBL_TWITTER_CONNECT);
        $availabelTwitterConnectObj = $ci->mod_io_m->init('userid', getAccountUserId(), TBL_TWITTER_CONNECT);
        if ($twitterconnectdataobj and $twitterconnectdataobj->userid != getAccountUserId()) {
            $ci->user_io_m->userLogout();
            reloadJS_url("member/login");
        } else {
            if (!$twitterconnectdataobj and !$availabelTwitterConnectObj) {
                if ($ci->twittermodel->getTotalFollowers() < $GLOBALS['global']['TWITTER']['MinFollowersRequired']) {
                    $checkError[] = str_replace('$s', $GLOBALS['global']['TWITTER']['MinFollowersRequired'], language_translate('member_tt_followers_request_error'));
                }
                if ($ci->twittermodel->getTotalTweets() < $GLOBALS['global']['TWITTER']['MinTweetsRequired']) {
                    $checkError[] = str_replace('$s', $GLOBALS['global']['TWITTER']['MinTweetsRequired'], language_translate('member_tt_mintweet_request_error'));
                }
                if ($ci->twittermodel->accountCreatedDaysBefore() < $GLOBALS['global']['TWITTER']['MinDaysOldAccountRequired']) {
                    $checkError[] = str_replace('$s', $GLOBALS['global']['TWITTER']['MinDaysOldAccountRequired'], language_translate('member_tt_mindays_request_error'));
                }
                if (empty($checkError)) {
                    $data['userid'] = getAccountUserId();
                    $data['twitterid'] = $twitterid;
                    $data['add_date'] = mysqlDate();
                    $data['ip'] = $ci->geo_lib->getIpAddress();
                    $data['session_data'] = $_SESSION['twwiterTokenInfo'];
                    $ci->mod_io_m->insert_map($data, TBL_TWITTER_CONNECT);
                    $ci->twittermodel->changeProfileImage(getAccountUserId(), $ci->twittermodel->savePictureToJuz(getAccountUserId()));
                    $invite_url = $ci->user_io_m->getInviteUrl($userdataobj->username);
                    $ci->twittermodel->postInviteStatus($invite_url);
                } else {
                    unset($_SESSION['twitterconnection']);
                }
            }
        }
    }
    return $checkError;
}
Example #7
0
 function postItemOnFbTt($id_wall, $context = '')
 {
     $this->load->model('user/wall_m');
     $this->load->model('mod_io/timeline_setting_io_m');
     $timeline_setting = $this->timeline_setting_io_m->init(getAccountUserId());
     $sql = $this->wall_m->get_all_post($result = '', $friend = '', $city = '', $limit = '', $my_chat = "", $country = '', $id_wall);
     $walldataarr = $this->db->query($sql)->result();
     $walldata = $this->wall_m->commentAccordingType($walldataarr[0]);
     $walldata = stripAllLinks($walldata);
     $userdataobj = getAccountUserDataObject();
     if (isFacebookLogin()) {
         //$this->facebookmodel->postOnWall($walldata ,$walldata ,$url=$this->user_io_m->getInviteUrl($userdataobj->username));
         if ($context) {
             if ($context == TIMELINE_BACKSTAGE_PHOTO and $timeline_setting->fb_backstage_photo == 1) {
                 $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_BACKSTAGE_PHOTO post on FACEBOOK wall :' . $walldata);
             }
             if ($context == TIMELINE_AKSME_ANSWER and $timeline_setting->fb_askme_answer == 1) {
                 $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_AKSME_ANSWER post on FACEBOOK wall :' . $walldata);
             }
             if ($context == TIMELINE_STATUS_UPDATE and $timeline_setting->fb_status_update == 1) {
                 $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_STATUS_UPDATE post on FACEBOOK wall :' . $walldata);
             }
             if ($context == TIMELINE_BUY_PET and $timeline_setting->fb_buy_pet == 1) {
                 $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_BUY_PET post on FACEBOOK wall :' . $walldata);
             }
             if ($context == TIMELINE_LOCKPET and $timeline_setting->fb_lock_pet == 1) {
                 $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_LOCKPET post on FACEBOOK wall :' . $walldata);
             }
             if ($context == TIMELINE_RATE_VIDEO and $timeline_setting->fb_rate_video == 1) {
                 $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_RATE_VIDEO post on FACEBOOK wall :' . $walldata);
             }
         } else {
             $this->facebookconnect_io_m->postOnUserWall($id_user = getAccountUserId(), $walldata, $walldata, $this->user_io_m->getInviteUrl($userdataobj->username));
             debug(' post on FACEBOOK wall :' . $walldata);
         }
     }
     if (isTwitterLogin()) {
         if ($context) {
             if ($context == TIMELINE_BACKSTAGE_PHOTO and $timeline_setting->tt_backstage_photo == 1) {
                 $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_BACKSTAGE_PHOTO post on TWITTER wall :' . $walldata);
             }
             if ($context == TIMELINE_AKSME_ANSWER and $timeline_setting->tt_askme_answer == 1) {
                 $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_AKSME_ANSWER post on TWITTER wall :' . $walldata);
             }
             if ($context == TIMELINE_STATUS_UPDATE and $timeline_setting->tt_status_update == 1) {
                 $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_STATUS_UPDATE post on TWITTER wall :' . $walldata);
             }
             if ($context == TIMELINE_BUY_PET and $timeline_setting->tt_buy_pet == 1) {
                 $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_BUY_PET post on TWITTER wall :' . $walldata);
             }
             if ($context == TIMELINE_LOCKPET and $timeline_setting->tt_lock_pet == 1) {
                 $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_LOCKPET post on TWITTER wall :' . $walldata);
             }
             if ($context == TIMELINE_RATE_VIDEO and $timeline_setting->tt_rate_video == 1) {
                 $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
                 debug('TIMELINE_RATE_VIDEO post on TWITTER wall :' . $walldata);
             }
         } else {
             $this->twittermodel->postOnWall($walldata, $url = $this->user_io_m->getInviteUrl($userdataobj->username));
             debug('post on TWITTER wall :' . $walldata);
         }
     }
 }