コード例 #1
0
 public function actionTextdetails()
 {
     $dates = date('Y-m-d H:i:s');
     $connection = yii::app()->db;
     // for bad wordwrap
     $words = str_word_count($_POST['text'], 1);
     $lastWord = array_pop($words);
     $lastSpacePosition = strrpos($_POST['text'], ' ');
     $textWithoutLastWord = $_POST['text'];
     $tiles = FnProfanityWords::model()->findAll();
     foreach ($tiles as $tiles) {
         if (strtolower($lastWord) == strtolower($tiles->badword)) {
             $textWithoutLastWord = substr($_POST['text'], 0, $lastSpacePosition);
             $textWithoutLastWord .= ' **** ';
         }
     }
     $sql = "UPDATE  fn_uploaddetails SET upload_text = '" . $textWithoutLastWord . "',updateddate='" . $dates . "',updateddate='" . $dates . "'  WHERE uploaddetail_id=" . $_POST['uploadedid'];
     $command = $connection->createCommand($sql);
     $command->execute();
 }
コード例 #2
0
ファイル: SiteController.php プロジェクト: gopi158/Sample
    public function actionEasylogin()
    {
        // print_r($_POST);exit;
        $type = $_POST['type'];
        $finaomesg = $_POST['finaomsg'];
        $fname = $_POST['name'];
        $email = $_POST['email'];
        $phonenumber = $_POST['mobile'];
        $pwd = md5($_POST['password']);
        if ($type == 'video') {
            $user = User::model()->findByAttributes(array('email' => $email));
            $model = new User();
            if ($user['email'] != '' && $user['password'] != $pwd) {
                echo "0";
            } else {
                $user = User::model()->findByAttributes(array('email' => $email, 'password' => $pwd, 'status' => 1));
                if ($user['email'] != '') {
                    $login = array();
                    $login["id"] = $user['userid'];
                    $login["username"] = $user['fname'];
                    $login["socialnetworkid"] = $user['socialnetworkid'];
                    $login["trackid"] = $user['trackid'];
                    $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $user['userid']));
                    $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
                    $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
                    Yii::app()->session['login'] = $login;
                    echo 'video-false-' . $_POST['utype'];
                    if (isset($_POST['sourceid']) != '') {
                        //
                        $vote = $this->registervote($_POST['voteduser'], $_POST['sourceid']);
                        echo $vote;
                    }
                } else {
                    //echo 'video-true';
                    $model = new User();
                    $model->fname = $fname;
                    $model->email = $email;
                    $model->password = $pwd;
                    $model->usertypeid = 1;
                    $model->createtime = date('Y-m-d G:i:s');
                    $model->socialnetworkid = 0;
                    $model->status = 1;
                    $model->trackid = 66;
                    /* $mageid = $this->processshopreg($firstname,'',$email,$_POST['pwd']);
                       
                       if(!empty($mageid))
                       
                       {
                       
                       $model->mageid = $mageid;
                       
                       }*/
                    if ($model->save(false)) {
                        $userid = $model->userid;
                        //echo $userid;
                        $newuserprofile = new UserProfile();
                        $newuserprofile->user_id = $userid;
                        $newuserprofile->createdby = $userid;
                        $newuserprofile->createddate = date('Y-m-d G:i:s');
                        $newuserprofile->updatedby = $userid;
                        $newuserprofile->updateddate = date('Y-m-d G:i:s');
                        $newuserprofile->IsCompleted = "";
                        if ($newuserprofile->save(false)) {
                            $email = $email;
                            $usercheck = User::model()->findByAttributes(array('email' => $email, 'status' => 1));
                            $password = md5($usercheck->password);
                            if ($usercheck) {
                                $activkey = md5(uniqid(rand(), true));
                                $forgoturl = $this->createAbsoluteUrl('/site/changepswdpopup', array("activkey" => $activkey, "email" => $usercheck->email));
                                $subj = "Reset Password";
                                $mesg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Registration Confirmation</title>

</head>



<body>



	<div style="width:670px; margin:0px auto; padding:0px; background:#FFF; border-left:solid 20px #dddddd; border-right:solid 20px #dddddd;">

	<div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Email_Header.png" style="padding:0; margin:0; border:0;" /></div>

    <div style="width:650px; padding:10px; margin:0px; font-family:Geneva, Arial, Helvetica, sans-serif;"><br />

    	<div style="color:rgb(244, 123, 32); font-weight:bold; font-size:16px; padding-bottom:5px;">Hi ' . ucfirst($usercheck->fname) . ' ,</div>

        

        

     <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;">

	 

	  Thank you for Joining FINAO Nation.<br /> <br />

      Please set your password and validate your account within next 24 hours by clicking on the link given below to login to the site in future.

 <br />' . $forgoturl . '<br /> <br /> If the link doesn\'t work, please copy and paste the URL into your browser instead.<br /> <br />

</div>

        <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;"> </div>

        

        <div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Signature.png" style="border:0; padding:0; margin:0;" /></div>

        

    </div>

	<div style="width:650px; margin:0px auto; text-align:right">

    	<ul style="list-style:none; margin:0px; padding:0px;">

            <a target="_blank" href="https://www.facebook.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) 0 -38px; width:13px; height:29px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

             <a target="_blank" href="http://pinterest.com/finaonation/"><li style="background:url(http://finaonation.com/images/soc-icons.png) -80px -38px; width:24px; height:30px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

            <a target="_blank" href="http://www.linkedin.com/company/2253999"><li style="background:url(http://finaonation.com/images/soc-icons.png) -21px -38px; width:26px; height:27px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

            <a target="_blank" href="https://twitter.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) -53px -38px; width:20px; height:26px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

       </ul>

    </div>

    <div style="background:#000; width:670px; font-size:11px; color:rgb(153, 153, 153); text-align:center; padding:10px 0; font-family:Geneva, Arial, Helvetica, sans-serif;">

        <div style="padding-bottom:5px;">This message was mailed to <span style="color:rgb(244, 123, 32)!important;">' . $email . '</span> by FINAO Nation.</div>

        <div style="padding-bottom:5px;">

            <a href="http://' . $_SERVER['HTTP_HOST'] . '" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">FINAO</a> | 

            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/contactus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Contact Us</a> | 

            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/aboutus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">About FINAO</a> | 

            <a href="mailto:unsubscribe@finaonation.com?Subject=Hello%20again" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Unsubscribe</a>

            

            

        </div>

        <div>

			<div style="padding:0px!important; margin:0px!important; line-height:18px;">To unsubscribe, click the link above, or send an email to: <a href="#" style="color:rgb(153, 153, 153)!important; text-decoration:none; cursor:default;">unsubscribe@finaonation.com</a>. Do not reply to this email address.</div> 

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">It is a notification only address and is not monitored for incoming email. </div>

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">Use of the FINAO Nation website and mobile app constitutes acceptance of our Terms of Use and Privacy Policy.</div>

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">&copy; ' . date("Y") . ' FINAO Nation, 13024 Beverly Park Rd, Mukilteo, WA 98275, U.S.A.</div>

        </div>

    </div>

</div>



</body>

</html>';
                                $headers = "MIME-Version: 1.0" . "\r\n";
                                $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
                                $headers .= "From: do-not-reply@finaonation.com";
                                mail($usercheck->email, $subj, $mesg, $headers);
                                $usercheck->activkey = $activkey;
                                $usercheck->save(FALSE);
                            }
                            $login = array();
                            $login["id"] = $userid;
                            $login["username"] = $model->fname;
                            $login["socialnetworkid"] = $model->socialnetworkid;
                            $login["trackid"] = $user['trackid'];
                            $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $userid));
                            $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
                            $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
                            Yii::app()->session['login'] = $login;
                            echo 'video-true-' . $_POST['utype'];
                        }
                    }
                }
            }
        } else {
            if ($type == 'easy') {
                $user = User::model()->findByAttributes(array('email' => $email));
                $model = new User();
                if ($user['email'] != '' && $user['password'] != $pwd) {
                    echo "0";
                } else {
                    //echo 1;
                    $user = User::model()->findByAttributes(array('email' => $email, 'password' => $pwd, 'status' => 1));
                    if ($user['email'] != '') {
                        $login = array();
                        $login["id"] = $user['userid'];
                        $login["username"] = $user['fname'];
                        $login["socialnetworkid"] = $user['socialnetworkid'];
                        $login["trackid"] = $user['trackid'];
                        $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $user['userid']));
                        $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
                        $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
                        Yii::app()->session['login'] = $login;
                        echo 'easy-false';
                        if (isset($_POST['sourceid']) != '') {
                            //
                            $vote = $this->registervote($_POST['voteduser'], $_POST['sourceid']);
                            echo $vote;
                        }
                    } else {
                        if (empty($fname)) {
                            echo '22';
                        } else {
                            //echo 'video-true';
                            $model = new User();
                            $model->fname = $fname;
                            $model->email = $email;
                            $model->password = $pwd;
                            $model->usertypeid = 1;
                            $model->createtime = date('Y-m-d G:i:s');
                            $model->socialnetworkid = 0;
                            $model->status = 1;
                            $model->trackid = 66;
                            /* $mageid = $this->processshopreg($firstname,'',$email,$_POST['pwd']);
                               
                               if(!empty($mageid))
                               
                               {
                               
                               $model->mageid = $mageid;
                               
                               }*/
                            if ($model->save(false)) {
                                $userid = $model->userid;
                                //echo $userid;
                                $newuserprofile = new UserProfile();
                                $newuserprofile->user_id = $userid;
                                $newuserprofile->createdby = $userid;
                                $newuserprofile->createddate = date('Y-m-d G:i:s');
                                $newuserprofile->updatedby = $userid;
                                $newuserprofile->updateddate = date('Y-m-d G:i:s');
                                $newuserprofile->IsCompleted = "";
                                if ($newuserprofile->save(false)) {
                                    $email = $email;
                                    $usercheck = User::model()->findByAttributes(array('email' => $email, 'status' => 1));
                                    $password = md5($usercheck->password);
                                    if ($usercheck) {
                                        $activkey = md5(uniqid(rand(), true));
                                        $forgoturl = $this->createAbsoluteUrl('/site/changepswdpopup', array("activkey" => $activkey, "email" => $usercheck->email));
                                        $subj = "Reset Password";
                                        $mesg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Registration Confirmation</title>

</head>



<body>



	<div style="width:670px; margin:0px auto; padding:0px; background:#FFF; border-left:solid 20px #dddddd; border-right:solid 20px #dddddd;">

	<div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Email_Header.png" style="padding:0; margin:0; border:0;" /></div>

    <div style="width:650px; padding:10px; margin:0px; font-family:Geneva, Arial, Helvetica, sans-serif;"><br />

    	<div style="color:rgb(244, 123, 32); font-weight:bold; font-size:16px; padding-bottom:5px;">Hi ' . ucfirst($usercheck->fname) . ' ,</div>

        

        

     <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;">

	 

	  Thank you for Joining FINAO Nation.<br /> <br />

      Please set your password and validate your account within next 24 hours by clicking on the link given below to login to the site in future.

 <br />' . $forgoturl . '<br /> <br /> If the link doesn\'t work, please copy and paste the URL into your browser instead.<br /> <br />

</div>

        <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;"> </div>

        

        <div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Signature.png" style="border:0; padding:0; margin:0;" /></div>

        

    </div>

	<div style="width:650px; margin:0px auto; text-align:right">

    	<ul style="list-style:none; margin:0px; padding:0px;">

            <a target="_blank" href="https://www.facebook.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) 0 -38px; width:13px; height:29px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

             <a target="_blank" href="http://pinterest.com/finaonation/"><li style="background:url(http://finaonation.com/images/soc-icons.png) -80px -38px; width:24px; height:30px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

            <a target="_blank" href="http://www.linkedin.com/company/2253999"><li style="background:url(http://finaonation.com/images/soc-icons.png) -21px -38px; width:26px; height:27px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

            <a target="_blank" href="https://twitter.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) -53px -38px; width:20px; height:26px; display:inline-block; list-style:none; margin:0 4px;"></li></a>

       </ul>

    </div>

    <div style="background:#000; width:670px; font-size:11px; color:rgb(153, 153, 153); text-align:center; padding:10px 0; font-family:Geneva, Arial, Helvetica, sans-serif;">

        <div style="padding-bottom:5px;">This message was mailed to <span style="color:rgb(244, 123, 32)!important;">' . $email . '</span> by FINAO Nation.</div>

        <div style="padding-bottom:5px;">

            <a href="http://' . $_SERVER['HTTP_HOST'] . '" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">FINAO</a> | 

            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/contactus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Contact Us</a> | 

            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/aboutus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">About FINAO</a> | 

            <a href="mailto:unsubscribe@finaonation.com?Subject=Hello%20again" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Unsubscribe</a>

            

            

        </div>

        <div>

			<div style="padding:0px!important; margin:0px!important; line-height:18px;">To unsubscribe, click the link above, or send an email to: <a href="#" style="color:rgb(153, 153, 153)!important; text-decoration:none; cursor:default;">unsubscribe@finaonation.com</a>. Do not reply to this email address.</div> 

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">It is a notification only address and is not monitored for incoming email. </div>

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">Use of the FINAO Nation website and mobile app constitutes acceptance of our Terms of Use and Privacy Policy.</div>

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">&copy; ' . date("Y") . ' FINAO Nation, 13024 Beverly Park Rd, Mukilteo, WA 98275, U.S.A.</div>

        </div>

    </div>

</div>



</body>

</html>';
                                        $headers = "MIME-Version: 1.0" . "\r\n";
                                        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
                                        $headers .= "From: do-not-reply@finaonation.com";
                                        mail($usercheck->email, $subj, $mesg, $headers);
                                        $usercheck->activkey = $activkey;
                                        $usercheck->save(FALSE);
                                    }
                                    $login = array();
                                    $login["id"] = $userid;
                                    $login["username"] = $model->fname;
                                    $login["socialnetworkid"] = $model->socialnetworkid;
                                    $login["trackid"] = $user['trackid'];
                                    $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $userid));
                                    $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
                                    $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
                                    Yii::app()->session['login'] = $login;
                                    echo 'easy-true';
                                }
                            }
                        }
                    }
                }
            } else {
                //echo $type;exit;
                //print_r($_POST);exit;
                $tile = $_POST['tilename'];
                $pieces = explode("-", $tile);
                $tilename = trim(ucfirst($pieces[0]) . ' ' . $pieces[1]);
                // piece2
                //echo $tilename;
                $sql = "SELECT *  FROM `fn_lookups` WHERE `lookup_name` = '" . $tilename . "'";
                $connection = Yii::app()->db;
                $command = $connection->createCommand($sql);
                $tileids = $command->queryAll();
                foreach ($tileids as $newtile) {
                    $tileid = $newtile["lookup_id"];
                }
                $tileimage = strtolower($pieces[0] . $pieces[1]);
                // echo $tileimage;
                //echo $tileid;
                // exit;
                //echo $pwd;exit;
                $user = User::model()->findByAttributes(array('email' => $email, 'password' => $pwd, 'status' => 1));
                $model = new User();
                // $user['email'];exit;
                if ($_POST['email'] == '') {
                    echo 0;
                } else {
                    if (!empty($user)) {
                        if ($user['email'] != '') {
                            $userid = $user['userid'];
                            $newfinao = new UserFinao();
                            // for badword
                            $words = str_word_count($_POST['finaomsg'], 1);
                            $lastWord = array_pop($words);
                            $lastSpacePosition = strrpos($_POST['finaomsg'], ' ');
                            $textWithoutLastWord = $_POST['finaomsg'];
                            $tiles = FnProfanityWords::model()->findAll();
                            foreach ($tiles as $tiles) {
                                if (strtolower($lastWord) == strtolower($tiles->badword)) {
                                    $textWithoutLastWord = substr($_POST['finaomsg'], 0, $lastSpacePosition);
                                    $textWithoutLastWord .= ' **** ';
                                }
                            }
                            if (isset($_POST['finaomsg']) && $_POST['finaomsg'] != "") {
                                $newfinao->finao_msg = $textWithoutLastWord;
                            }
                            $public = 1;
                            $newfinao->finao_status_Ispublic = $public;
                            $newfinao->userid = $userid;
                            $newfinao->createddate = new CDbExpression('NOW()');
                            $newfinao->updatedby = $userid;
                            $newfinao->updateddate = new CDbExpression('NOW()');
                            $newfinao->finao_status = 38;
                            if ($newfinao->save(false)) {
                                $finao_id = $newfinao->user_finao_id;
                                $newtile = new UserFinaoTile();
                                $newtile->tile_id = $tileid;
                                $newtile->tile_name = $tilename;
                                $newtile->finao_id = $newfinao->user_finao_id;
                                $tileimgurl = '' . $tileimage . '.jpg';
                                $newtile->tile_profileImagurl = $tileimgurl;
                                $newtile->userid = $userid;
                                $newtile->status = 1;
                                $newtile->createddate = new CDbExpression('NOW()');
                                $newtile->createdby = $userid;
                                $newtile->updateddate = new CDbExpression('NOW()');
                                $newtile->updatedby = $userid;
                                if ($newtile->save(false)) {
                                    $tilename = $tilename;
                                    $istileinfo = TilesInfo::model()->findByAttributes(array('tilename' => $tilename, 'createdby' => $userid));
                                    if (!isset($istileinfo) && empty($istileinfo)) {
                                        $tileinfo = new TilesInfo();
                                        $tileinfo->tile_id = $tileid;
                                        $tileinfo->tilename = $tilename;
                                        $tileinfo->tile_imageurl = $tileimgurl;
                                        $tileinfo->status = 1;
                                        $tileinfo->createdby = $userid;
                                        $tileinfo->createddate = new CDbExpression('NOW()');
                                        $tileinfo->updateddate = new CDbExpression('NOW()');
                                        $tileinfo->updatedby = $userid;
                                        $tileinfo->save(false);
                                    }
                                }
                                $login = array();
                                $login["id"] = $userid;
                                $login["username"] = $model->fname;
                                $login["socialnetworkid"] = $model->socialnetworkid;
                                $login["trackid"] = $user['trackid'];
                                $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $userid));
                                $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
                                $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
                                Yii::app()->session['login'] = $login;
                                echo '2-' . $tileid;
                            } else {
                                echo "0";
                                //Enter fields
                            }
                        } else {
                            echo "1";
                            //You are already subscribed or your account may not be activated
                        }
                    } else {
                        //echo 'u r in';
                        $model = new User();
                        $model->fname = $fname;
                        $model->email = $email;
                        $model->password = md5($email);
                        $model->usertypeid = 1;
                        $model->createtime = date('Y-m-d G:i:s');
                        $model->socialnetworkid = 0;
                        $model->trackid = $tileid;
                        $model->status = 1;
                        $mageid = $this->processshopreg($fname, '', $email, $_POST['pwd']);
                        if ($mageid != '') {
                            $model->mageid = $mageid;
                        }
                        if ($model->save(false)) {
                            $userid = $model->userid;
                            //echo $userid;
                            $newuserprofile = new UserProfile();
                            $newuserprofile->user_id = $userid;
                            $newuserprofile->createdby = $userid;
                            $newuserprofile->createddate = date('Y-m-d G:i:s');
                            $newuserprofile->updatedby = $userid;
                            $newuserprofile->updateddate = date('Y-m-d G:i:s');
                            $newuserprofile->IsCompleted = "";
                            if ($newuserprofile->save(false)) {
                                $email = $email;
                                $usercheck = User::model()->findByAttributes(array('email' => $email, 'status' => 1));
                                $password = md5($usercheck->password);
                                if ($usercheck) {
                                    $activkey = md5(uniqid(rand(), true));
                                    $forgoturl = $this->createAbsoluteUrl('/site/changepswdpopup', array("activkey" => $activkey, "email" => $usercheck->email));
                                    //$subj = "Reset Password";
                                    $subj = $_POST['finaomsg'];
                                    $mesg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Registration Confirmation</title>

</head>



<body>



	<div style="width:670px; margin:0px auto; padding:0px; background:#FFF; border-left:solid 20px #dddddd; border-right:solid 20px #dddddd;">

	<div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Email_Header.png" style="padding:0; margin:0; border:0;" /></div>

    <div style="width:650px; padding:10px; margin:0px; font-family:Geneva, Arial, Helvetica, sans-serif;"><br />

    	<div style="color:rgb(244, 123, 32); font-weight:bold; font-size:16px; padding-bottom:5px;">Hi ' . ucfirst($usercheck->fname) . ' ,</div>

        

        

     <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;">

	 

	  <p> What a great FINAO!   Thank you for sharing.  You are now a part of a national movement to make it fun and cool to live a goal oriented life.  Click on the link below and begin.  Our mission is to support yours by helping you accomplish your dreams.</p>



<p>Finao will allow you to follow others, and be exposed to content that will allow you to connect with like minded people.  Victory is in the Pursuit.  Let the Journey begin.

.</p><br /> <br />

      Please set your password and validate your account within next 24 hours by clicking on the link given below to login to the site in future.

 <br />' . $forgoturl . '<br /> <br /> If the link doesn\'t work, please copy and paste the URL into your browser instead.<br /> <br />

</div>

        <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;"> </div>

        

        <div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Signature.png" style="border:0; padding:0; margin:0;" /></div>

        

    </div>

	<div style="width:650px; margin:0px auto; text-align:right; padding-bottom:5px;">

     <ul style="list-style:none; margin:0px; padding:0px;">

            <a href="https://www.facebook.com/FINAONation" target="_blank" title="facebook"><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/mail-icons/icon-facebook.png" style="border:0; padding:0; margin-right:4px!important;" /></a>

			<a href="http://www.linkedin.com/company/2253999" target="_blank" title="linkedin"><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/mail-icons/icon-linkedin.png" style="border:0; padding:0; margin-right:4px!important;" /></a>

             <a href="http://pinterest.com/finaonation/" target="_blank" title="pinterest"><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/mail-icons/icon-pinterest.png" style="border:0; padding:0; margin-right:4px!important;" /></a>

            <a href="https://twitter.com/FINAONation" target="_blank" title="twitter"><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/mail-icons/icon-twitter.png" style="border:0; padding:0;" /></a>

       </ul>

    </div>

    <div style="background:#000; width:670px; font-size:11px; color:rgb(153, 153, 153); text-align:center; padding:10px 0; font-family:Geneva, Arial, Helvetica, sans-serif;">

        <div style="padding-bottom:5px;">This message was mailed to <span style="color:rgb(244, 123, 32)!important;">' . $email . '</span> by FINAO Nation.</div>

        <div style="padding-bottom:5px;">

            <a href="http://' . $_SERVER['HTTP_HOST'] . '" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">FINAO</a> | 

            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/contactus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Contact Us</a> | 

            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/aboutus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">About FINAO</a> | 

            <a href="mailto:unsubscribe@finaonation.com?Subject=Hello%20again" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Unsubscribe</a>

            

            

        </div>

        <div>

			<div style="padding:0px!important; margin:0px!important; line-height:18px;">To unsubscribe, click the link above, or send an email to: <a href="#" style="color:rgb(153, 153, 153)!important; text-decoration:none; cursor:default;">unsubscribe@finaonation.com</a>. Do not reply to this email address.</div> 

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">It is a notification only address and is not monitored for incoming email. </div>

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">Use of the FINAO Nation website and mobile app constitutes acceptance of our Terms of Use and Privacy Policy.</div>

            <div style="padding:0px!important; margin:0px!important; line-height:18px;">&copy; ' . date("Y") . ' FINAO Nation, 13024 Beverly Park Rd, Mukilteo, WA 98275, U.S.A.</div>

        </div>

    </div>

</div>



</body>

</html>';
                                    $headers = "MIME-Version: 1.0" . "\r\n";
                                    $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
                                    $headers .= "From: do-not-reply@finaonation.com";
                                    mail($usercheck->email, $subj, $mesg, $headers);
                                    $usercheck->activkey = $activkey;
                                    if ($usercheck->save(FALSE)) {
                                        echo "4-";
                                    }
                                    //Succesful email
                                }
                                $newuserprofile->user_profile_id;
                                $newfinao = new UserFinao();
                                // for badword
                                $words = str_word_count($_POST['finaomsg'], 1);
                                $lastWord = array_pop($words);
                                $lastSpacePosition = strrpos($_POST['finaomsg'], ' ');
                                $textWithoutLastWord = $_POST['finaomsg'];
                                $tiles = FnProfanityWords::model()->findAll();
                                foreach ($tiles as $tiles) {
                                    if (strtolower($lastWord) == strtolower($tiles->badword)) {
                                        $textWithoutLastWord = substr($_POST['finaomsg'], 0, $lastSpacePosition);
                                        $textWithoutLastWord .= ' **** ';
                                    }
                                }
                                if (isset($_POST['finaomsg']) && $_POST['finaomsg'] != "") {
                                    $newfinao->finao_msg = $textWithoutLastWord;
                                }
                                $public = 1;
                                $newfinao->finao_status_Ispublic = $public;
                                $newfinao->userid = $userid;
                                $newfinao->createddate = new CDbExpression('NOW()');
                                $newfinao->updatedby = $userid;
                                $newfinao->updateddate = new CDbExpression('NOW()');
                                $newfinao->finao_status = 38;
                                if ($newfinao->save(false)) {
                                    $finao_id = $newfinao->user_finao_id;
                                    $newtile = new UserFinaoTile();
                                    $newtile->tile_id = $tileid;
                                    $newtile->tile_name = $tilename;
                                    $newtile->finao_id = $newfinao->user_finao_id;
                                    $tileimgurl = '' . $tileimage . '.jpg';
                                    $newtile->tile_profileImagurl = $tileimgurl;
                                    $newtile->userid = $userid;
                                    $newtile->status = 1;
                                    $newtile->createddate = new CDbExpression('NOW()');
                                    $newtile->createdby = $userid;
                                    $newtile->updateddate = new CDbExpression('NOW()');
                                    $newtile->updatedby = $userid;
                                    if ($newtile->save(false)) {
                                        $tilename = $tilename;
                                        $istileinfo = TilesInfo::model()->findByAttributes(array('tilename' => $tilename, 'createdby' => $userid));
                                        if (!isset($istileinfo) && empty($istileinfo)) {
                                            $tileinfo = new TilesInfo();
                                            $tileinfo->tile_id = $tileid;
                                            $tileinfo->tilename = $tilename;
                                            $tileinfo->tile_imageurl = $tileimgurl;
                                            $tileinfo->status = 1;
                                            $tileinfo->createdby = $userid;
                                            $tileinfo->createddate = new CDbExpression('NOW()');
                                            $tileinfo->updateddate = new CDbExpression('NOW()');
                                            $tileinfo->updatedby = $userid;
                                            $tileinfo->save(false);
                                        }
                                    }
                                    $login = array();
                                    $login["id"] = $userid;
                                    $login["username"] = $model->fname;
                                    $login["socialnetworkid"] = $model->socialnetworkid;
                                    $login["trackid"] = $user['trackid'];
                                    $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $userid));
                                    $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
                                    $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
                                    Yii::app()->session['login'] = $login;
                                    echo '2-' . $tileid;
                                } else {
                                    echo "Something went wrong";
                                }
                            }
                        }
                    }
                }
            }
        }
    }
コード例 #3
0
ファイル: FinaoController.php プロジェクト: gopi158/Sample
    public function actionGetVideocontestdetail()
    {
        //print_r($_REQUEST);
        if (isset($_REQUEST["videoid"])) {
            $userid = Yii::app()->session['login']['id'];
            $videoid = $_REQUEST["videoid"];
            $vidler = Yii::app()->getComponents(false);
            $user = $vidler['vidler']['user'];
            $pass = $vidler['vidler']['pwd'];
            $api_key = $vidler['vidler']['appkey'];
            $callback_url = '/';
            $v = new Viddler_V2($api_key);
            $auth = $v->viddler_users_auth(array('user' => $user, 'password' => $pass));
            $sessionid = $auth['auth']['sessionid'];
            $results = $v->viddler_videos_getDetails(array('sessionid' => $sessionid, 'video_id' => $videoid));
            //exit;
            // print_r($results);exit;
            if (!empty($results)) {
                $finaomsg = $results['video']['description'];
                $newfinao = new UserFinao();
                // for badword
                $words = str_word_count($finaomsg, 1);
                $lastWord = array_pop($words);
                $lastSpacePosition = strrpos($finaomsg, ' ');
                $textWithoutLastWord = $finaomsg;
                $tiles = FnProfanityWords::model()->findAll();
                foreach ($tiles as $tiles) {
                    if (strtolower($lastWord) == strtolower($tiles->badword)) {
                        $textWithoutLastWord = substr($finaomsg, 0, $lastSpacePosition);
                        $textWithoutLastWord .= ' **** ';
                    }
                }
                if (isset($finaomsg) && $finaomsg != "") {
                    $newfinao->finao_msg = $textWithoutLastWord;
                }
                $public = 1;
                $newfinao->finao_status_Ispublic = $public;
                $newfinao->userid = $userid;
                $newfinao->createddate = new CDbExpression('NOW()');
                $newfinao->updatedby = $userid;
                $newfinao->updateddate = new CDbExpression('NOW()');
                $newfinao->finao_status = 38;
                if ($newfinao->save(false)) {
                    $finao_id = $newfinao->user_finao_id;
                    $tileid = 66;
                    $newtile = new UserFinaoTile();
                    $newtile->tile_id = $tileid;
                    $newtile->tile_name = 'Career Catapult';
                    $newtile->finao_id = $newfinao->user_finao_id;
                    $tileimgurl = 'careercatapult.jpg';
                    $newtile->tile_profileImagurl = $tileimgurl;
                    $newtile->userid = $userid;
                    $newtile->status = 1;
                    $newtile->createddate = new CDbExpression('NOW()');
                    $newtile->createdby = $userid;
                    $newtile->updateddate = new CDbExpression('NOW()');
                    $newtile->updatedby = $userid;
                    if ($newtile->save(false)) {
                        //echo $newtile->user_tileid;
                        $tilename = 'Career Catapult';
                        $istileinfo = TilesInfo::model()->findByAttributes(array('tilename' => $tilename, 'createdby' => $userid));
                        if (!isset($istileinfo) && empty($istileinfo)) {
                            $tileinfo = new TilesInfo();
                            $tileinfo->tile_id = $tileid;
                            $tileinfo->tilename = $tilename;
                            $tileinfo->tile_imageurl = $tileimgurl;
                            $tileinfo->status = 1;
                            $tileinfo->createdby = $userid;
                            $tileinfo->createddate = new CDbExpression('NOW()');
                            $tileinfo->updateddate = new CDbExpression('NOW()');
                            $tileinfo->updatedby = $userid;
                            $tileinfo->save(false);
                        }
                        /*echo  'FInaoid-'.$finao_id.'userid-'.$userid.'Video Id-'.$videoid;exit;*/
                        $uploadvideo = new Uploaddetails();
                        $uploadvideo->upload_sourcetype = 37;
                        $uploadvideo->uploadtype = 35;
                        $uploadvideo->upload_sourceid = $finao_id;
                        $uploadvideo->uploadedby = $userid;
                        $uploadvideo->uploadeddate = new CDbExpression('NOW()');
                        $uploadvideo->status = 0;
                        $uploadvideo->updatedby = $userid;
                        $uploadvideo->updateddate = new CDbExpression('NOW()');
                        $uploadvideo->videoid = $videoid;
                        $uploadvideo->videostatus = "not ready";
                        $uploadvideo->video_img = $results['video']['thumbnail_url'];
                        $uploadvideo->video_caption = $results['video']['title'];
                        if ($uploadvideo->save(false)) {
                            $usercheck = User::model()->findByAttributes(array('userid' => Yii::app()->session['login']['id'], 'status' => 1));
                            $aprroveurl = 'http://' . $_SERVER['HTTP_HOST'] . '/finao/AprroveVideo/userid/' . $usercheck->userid . '/uploadid/' . $uploadvideo->uploaddetail_id;
                            $mesg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration Confirmation</title>
</head>

<body>

	<div style="width:670px; margin:0px auto; padding:0px; background:#FFF; border-left:solid 20px #dddddd; border-right:solid 20px #dddddd;">
	<div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Email_Header.png" style="padding:0; margin:0; border:0;" /></div>
    <div style="width:650px; padding:10px; margin:0px; font-family:Geneva, Arial, Helvetica, sans-serif;"><br />
    	<div style="color:rgb(244, 123, 32); font-weight:bold; font-size:16px; padding-bottom:5px;">Dear Admin,</div>
        
        
     <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;">
	 
	   <p>' . ucfirst($usercheck->fname) . ' has posted a Video.</p>
	   <p>Please review the Video by clicking on the View Video button below and click on the Approve Video button to publish this video.  </p>
<p>If you happen to see the message "Video not Found" or "Encoding in Progress", Please check back later. Video encoding sometimes can take up to an hour.</p>
	   
      <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.viddler.com/v/' . $videoid . '" target="_new"><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/view-video.jpg"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <a href="' . $aprroveurl . '" target="_new" ><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/approve-video.jpg"></a><br />  <br />
       </p>
     </div>
        <div style="color:rgb(77,77,77); font-size:12px; line-height:12px; padding-bottom:10px;"> </div>
        
        <div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Signature.png" style="border:0; padding:0; margin:0;" /></div>
        
    </div>
	<div style="width:650px; margin:0px auto; text-align:right">
    	<ul style="list-style:none; margin:0px; padding:0px;">
            <a target="_blank" href="https://www.facebook.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) 0 -38px; width:13px; height:29px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
             <a target="_blank" href="http://pinterest.com/finaonation/"><li style="background:url(http://finaonation.com/images/soc-icons.png) -80px -38px; width:24px; height:30px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
            <a target="_blank" href="http://www.linkedin.com/company/2253999"><li style="background:url(http://finaonation.com/images/soc-icons.png) -21px -38px; width:26px; height:27px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
            <a target="_blank" href="https://twitter.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) -53px -38px; width:20px; height:26px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
       </ul>
    </div>
    <div style="background:#000; width:670px; font-size:11px; color:rgb(153, 153, 153); text-align:center; padding:10px 0; font-family:Geneva, Arial, Helvetica, sans-serif;">
        <div style="padding-bottom:5px;">This message was mailed to <span style="color:rgb(244, 123, 32)!important;">' . $email . '</span> by FINAO Nation.</div>
        <div style="padding-bottom:5px;">
            <a href="http://' . $_SERVER['HTTP_HOST'] . '" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">FINAO</a> | 
            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/contactus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Contact Us</a> | 
            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/aboutus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">About FINAO</a> | 
            <a href="mailto:unsubscribe@finaonation.com?Subject=Hello%20again" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Unsubscribe</a>
            
            
        </div>
        <div>
			<div style="padding:0px!important; margin:0px!important; line-height:18px;">To unsubscribe, click the link above, or send an email to: <a href="#" style="color:rgb(153, 153, 153)!important; text-decoration:none; cursor:default;">unsubscribe@finaonation.com</a>. Do not reply to this email address.</div> 
            <div style="padding:0px!important; margin:0px!important; line-height:18px;">It is a notification only address and is not monitored for incoming email. </div>
            <div style="padding:0px!important; margin:0px!important; line-height:18px;">Use of the FINAO Nation website and mobile app constitutes acceptance of our Terms of Use and Privacy Policy.</div>
            <div style="padding:0px!important; margin:0px!important; line-height:18px;">&copy; ' . date("Y") . ' FINAO Nation, 13024 Beverly Park Rd, Mukilteo, WA 98275, U.S.A.</div>
        </div>
    </div>
</div>

</body>
</html>';
                            $subj = "video Contest";
                            // To send HTML mail, the Content-type header must be set
                            $headers = 'MIME-Version: 1.0' . "\r\n";
                            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                            // Additional headers
                            $headers .= 'From:Finaonation <*****@*****.**>' . "\r\n";
                            $headers .= 'Bcc: dev@wincito.com,nagesh@wincito.com' . "\r\n";
                            $to = '*****@*****.**';
                            //$to  = 'wallace@finaonation.com,georgie@finaonation.com,robert@finaonation.com';
                            mail($to, $subj, $mesg, $headers);
                            $this->redirect(Yii::app()->createUrl('finao/Viewvideohdcu/video/true'));
                        }
                    }
                }
            }
        }
    }