public static function step2()
 {
     $oSession = new Session();
     if (!$oSession->exists('mail_step1')) {
         Framework\Url\Header::redirect(Uri::get('user', 'signup', 'step1'));
     } elseif ($oSession->exists('mail_step2')) {
         Header::redirect(Uri::get('user', 'signup', 'step3'));
     }
     unset($oSession);
     if (isset($_POST['submit_join_user2'])) {
         if (\PFBC\Form::isValid($_POST['submit_join_user2'])) {
             (new JoinFormProcess())->step2();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_join_user2');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_join_user2', 'form_join_user2'));
     $oForm->addElement(new \PFBC\Element\Token('join2'));
     $oForm->addElement(new \PFBC\Element\Radio(t('Gender:'), 'sex', array('female' => t('Female') . ' ♀', 'male' => t('Male') . ' ♂', 'couple' => t('Couple')), array('value' => 'female', 'title' => t('Please specify your gender.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Checkbox(t('Interested in:'), 'match_sex', array('male' => t('Male') . ' ♂', 'female' => t('Female') . ' ♀', 'couple' => t('Couple')), array('value' => 'male', 'title' => t('Please specify whom you are looking for'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Date(t('Your Date of birth:'), 'birth_date', array('placeholder' => t('Month/Day/Year'), 'id' => 'birth_date', 'title' => t('Please specify your birth date using the calendar or with this format: Month/Day/Year.'), 'onblur' => 'CValid(this.value, this.id)', 'validation' => new \PFBC\Validation\BirthDate(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error birth_date"></span>'));
     $oForm->addElement(new \PFBC\Element\Country(t('Your Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode(), 'title' => t('Select the country where you live.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your City:'), 'city', array('id' => 'str_city', 'value' => Geo::getCity(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify the city where you live.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_city"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your State or Province:'), 'state', array('id' => 'str_state', 'value' => Geo::getState(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify your state.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_state"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code', 'value' => Geo::getZipCode(), 'onblur' => 'CValid(this.value,this.id,2,15)', 'title' => t('Enter your post code (Zip).'), 'validation' => new \PFBC\Validation\Str(2, 15), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_zip_code"></span>'));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script><script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_add_user'])) {
         if (\PFBC\Form::isValid($_POST['submit_add_user'])) {
             new AddUserFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_add_user', 550);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_add_user', 'form_add_user'));
     $oForm->addElement(new \PFBC\Element\Token('add_user'));
     $oForm->addElement(new \PFBC\Element\Username(t('Username:'******'username', array('required' => 1, 'validation' => new \PFBC\Validation\Username())));
     $oForm->addElement(new \PFBC\Element\Email(t('Login Email:'), 'mail', array('required' => 1, 'validation' => new \PFBC\Validation\CEmail('guest'))));
     $oForm->addElement(new \PFBC\Element\Password(t('Password:'******'password', array('required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('First Name:'), 'first_name', array('required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Last Name:'), 'last_name', array('required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Middle Name:'), 'middle_name', array('validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Radio(t('Sex:'), 'sex', array('female' => t('Female'), 'male' => t('Male'), 'couple' => t('Couple')), array('value' => 'female', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Checkbox(t('Match Sex:'), 'match_sex', array('male' => t('Male'), 'female' => t('Female'), 'couple' => t('Couple')), array('value' => 'male', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Date(t('Date of birth:'), 'birth_date', array('placeholder' => t('Month/Day/Year'), 'title' => t('Please specify the birth date using the calendar or with this format: Month/Day/Year.'), 'validation' => new \PFBC\Validation\BirthDate(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Country(t('Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('City:'), 'city', array('id' => 'str_city', 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('State:'), 'state', array('id' => 'str_state', 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code', 'validation' => new \PFBC\Validation\Str(2, 15), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\CKEditor(t('Description:'), 'description', array('validation' => new \PFBC\Validation\Str(10, 2000), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\File(t('Avatar'), 'avatar', array('accept' => 'image/*')));
     $oForm->addElement(new \PFBC\Element\Url(t('Your Website:'), 'website'));
     $oForm->addElement(new \PFBC\Element\Url(t('Social Network Site:'), 'social_network_site', array('description' => t('The url of your profile Facebook, Twitter, Google+, etc.'))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_add_aff'])) {
         if (\PFBC\Form::isValid($_POST['submit_add_aff'])) {
             new AddAffiliateFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_add_aff', 550);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_add_aff', 'form_add_aff'));
     $oForm->addElement(new \PFBC\Element\Token('add_aff'));
     $oForm->addElement(new \PFBC\Element\Username(t('Username:'******'username', array('required' => 1, 'validation' => new \PFBC\Validation\Username('Affiliates'))));
     $oForm->addElement(new \PFBC\Element\Email(t('Login Email:'), 'mail', array('required' => 1, 'validation' => new \PFBC\Validation\CEmail('guest', 'Affiliates'))));
     $oForm->addElement(new \PFBC\Element\Password(t('Password:'******'password', array('required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('First Name:'), 'first_name', array('required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Last Name:'), 'last_name', array('required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Middle Name:'), 'middle_name', array('validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Radio(t('Sex:'), 'sex', array('female' => t('Female'), 'male' => t('Male'), 'couple' => t('Couple')), array('value' => 'female', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Date(t('Date of birth:'), 'birth_date', array('placeholder' => t('Month/Day/Year'), 'title' => t('Please specify the birth date using the calendar or with this format: Month/Day/Year.'), 'required' => 1, 'validation' => new \PFBC\Validation\BirthDate())));
     $oForm->addElement(new \PFBC\Element\Country(t('Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('City:'), 'city', array('id' => 'str_city', 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('State:'), 'state', array('id' => 'str_state', 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code', 'validation' => new \PFBC\Validation\Str(2, 15), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Phone(t('Phone Number:'), 'phone', array('description' => t('Enter full phone number with area code.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\CKEditor(t('Description:'), 'description', array('description' => t("Description of the affiliate's site(s)."), 'validation' => new \PFBC\Validation\Str(10, 2000), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Url(t('Website:'), 'website', array('description' => t('Main website where the affiliate is the owner.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Email(t('Bank Account:'), 'bank_account', array('description' => t('Bank Account (PayPal Email Address).'), 'validation' => new \PFBC\Validation\BankAccount(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 /**
  * @param array $aProfile
  * @param object \PH7\UserCoreModel $oUserModel
  * @return void
  */
 public function add(array $aProfile, UserCoreModel $oUserModel)
 {
     $sBirthDate = !empty($aProfile['birthday']) ? $aProfile['birthday'] : date('m/d/Y', strtotime('-30 year'));
     $sSex = $aProfile['gender'] != 'male' && $aProfile['gender'] != 'female' && $aProfile['gender'] != 'couple' ? 'female' : $aProfile['gender'];
     // Default 'female'
     $sMatchSex = $sSex == 'male' ? 'female' : ($sSex == 'female' ? 'male' : 'couple');
     $this->_sUsername = (new UserCore())->findUsername($aProfile['given_name'], $aProfile['name'], $aProfile['family_name']);
     $this->_aUserInfo = ['email' => $aProfile['email'], 'username' => $this->_sUsername, 'password' => Various::genRndWord(8, 30), 'first_name' => !empty($aProfile['given_name']) ? $aProfile['given_name'] : '', 'last_name' => !empty($aProfile['family_name']) ? $aProfile['family_name'] : '', 'sex' => $sSex, 'match_sex' => array($sMatchSex), 'birth_date' => (new CDateTime())->get($sBirthDate)->date('Y-m-d'), 'country' => Geo::getCountryCode(), 'city' => Geo::getCity(), 'state' => Geo::getState(), 'zip_code' => Geo::getZipCode(), 'description' => !empty($aProfile['bio']) ? $aProfile['bio'] : '', 'website' => '', 'social_network_site' => $aProfile['link'], 'ip' => Ip::get(), 'prefix_salt' => Various::genRnd(), 'suffix_salt' => Various::genRnd(), 'hash_validation' => Various::genRnd(), 'is_active' => DbConfig::getSetting('userActivationType')];
     $this->_iProfileId = $oUserModel->add($this->_aUserInfo);
 }
Example #5
0
 /**
  * @param object $oProfile
  * @param object \PH7\UserCoreModel $oUserModel
  * @return void
  */
 public function add($oProfile, UserCoreModel $oUserModel)
 {
     $sBirthDate = isset($oProfile->birth_month, $oProfile->birth_day, $oProfile->birth_year) ? $oProfile->birth_month . '/' . $oProfile->birth_day . '/' . $oProfile->birth_year : date('m/d/Y', strtotime('-30 year'));
     $sSex = $oProfile->gender != 'male' && $oProfile->gender != 'female' && $oProfile->gender != 'couple' ? 'female' : $oProfile->gender;
     // Default 'female'
     $sMatchSex = $sSex == 'male' ? 'female' : ($sSex == 'female' ? 'male' : 'couple');
     $this->_sUsername = (new UserCore())->findUsername($oProfile->name, $oProfile->first_name, $oProfile->last_name);
     $this->_aUserInfo = ['email' => $oProfile->emails->account, 'username' => $this->_sUsername, 'password' => Various::genRndWord(8, 30), 'first_name' => !empty($oProfile->first_name) ? $oProfile->first_name : '', 'last_name' => !empty($oProfile->last_name) ? $oProfile->last_name : '', 'sex' => $sSex, 'match_sex' => array($sMatchSex), 'birth_date' => (new CDateTime())->get($sBirthDate)->date('Y-m-d'), 'country' => Geo::getCountryCode(), 'city' => Geo::getCity(), 'state' => Geo::getState(), 'zip_code' => Geo::getZipCode(), 'description' => '', 'website' => '', 'social_network_site' => '', 'ip' => Ip::get(), 'prefix_salt' => Various::genRnd(), 'suffix_salt' => Various::genRnd(), 'hash_validation' => Various::genRnd(), 'is_active' => DbConfig::getSetting('userActivationType')];
     $this->_iProfileId = $oUserModel->add($this->_aUserInfo);
 }
 /**
  * @param array $aProfile
  * @param object \PH7\UserCoreModel $oUserModel
  * @return void
  */
 public function add(array $aProfile, UserCoreModel $oUserModel)
 {
     $oUser = new UserCore();
     $sBirthDate = !empty($aProfile['birthday']) ? $aProfile['birthday'] : date('m/d/Y', strtotime('-30 year'));
     $sLocation = !empty($aProfile['location']['name']) ? $aProfile['location']['name'] : (!empty($aProfile['hometown']['name']) ? $aProfile['hometown']['name'] : '');
     $aLocation = @explode(',', $sLocation);
     $sSex = $aProfile['gender'] != 'male' && $aProfile['gender'] != 'female' && $aProfile['gender'] != 'couple' ? 'female' : $aProfile['gender'];
     // Default 'female'
     $sMatchSex = $oUser->getMatchSex($sSex);
     $this->_sUsername = $oUser->findUsername($aProfile['username'], $aProfile['first_name'], $aProfile['last_name']);
     $sSite = !empty($aProfile['link']) ? explode(' ', $aProfile['link'])[0] : '';
     $sSocialNetworkSite = !empty($aProfile['username']) ? 'http://facebook.com/' . $aProfile['username'] : '';
     unset($oUser);
     $this->_aUserInfo = ['email' => $aProfile['email'], 'username' => $this->_sUsername, 'password' => Various::genRndWord(8, 30), 'first_name' => !empty($aProfile['first_name']) ? $aProfile['first_name'] : '', 'last_name' => !empty($aProfile['last_name']) ? $aProfile['last_name'] : '', 'middle_name' => !empty($aProfile['middle_name']) ? $aProfile['middle_name'] : '', 'sex' => $sSex, 'match_sex' => array($sMatchSex), 'birth_date' => (new CDateTime())->get($sBirthDate)->date('Y-m-d'), 'country' => !empty($aLocation[1]) ? trim($aLocation[1]) : Geo::getCountryCode(), 'city' => !empty($aLocation[0]) ? trim($aLocation[0]) : Geo::getCity(), 'state' => !empty($aProfile['locale']) ? $aProfile['locale'] : Geo::getState(), 'zip_code' => !empty($aProfile['hometown_location']['zip']) ? $aProfile['hometown_location']['zip'] : Geo::getZipCode(), 'description' => !empty($aProfile['bio']) ? $aProfile['bio'] : '', 'website' => $sSite, 'social_network_site' => $sSocialNetworkSite, 'ip' => Ip::get(), 'prefix_salt' => Various::genRnd(), 'suffix_salt' => Various::genRnd(), 'hash_validation' => Various::genRnd(), 'is_active' => DbConfig::getSetting('userActivationType')];
     $this->_iProfileId = $oUserModel->add($this->_aUserInfo);
 }
 public static function step1()
 {
     if (isset($_POST['submit_join_aff'])) {
         if (\PFBC\Form::isValid($_POST['submit_join_aff'])) {
             (new JoinFormProcess())->step1();
         }
         Header::redirect();
     }
     $oForm = new \PFBC\Form('form_join_aff', 400);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_join_aff', 'form_join_aff'));
     $oForm->addElement(new \PFBC\Element\Token('join'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your First Name:'), 'first_name', array('id' => 'str_first_name', 'onblur' => 'CValid(this.value,this.id,2,20)', 'title' => t('Enter your first name.'), 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_first_name"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your Last Name:'), 'last_name', array('id' => 'str_last_name', 'onblur' => 'CValid(this.value, this.id,2,20)', 'title' => t('Enter your last name.'), 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_last_name"></span>'));
     $oForm->addElement(new \PFBC\Element\Username(t('Username:'******'username', array('id' => 'username', 'onkeyup' => 'CValid(this.value, this.id,\'Affiliates\')', 'title' => t('Your username will be your unique ID reference for advertisements.'), 'required' => 1, 'validation' => new \PFBC\Validation\Username('Affiliates'))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error username"></span>'));
     $oForm->addElement(new \PFBC\Element\Email(t('Your Email:'), 'mail', array('id' => 'email', 'onblur' => 'CValid(this.value, this.id,\'guest\',\'Affiliates\')', 'title' => t('Enter your valid email address.'), 'required' => 1, 'validation' => new \PFBC\Validation\CEmail('guest', 'Affiliates'))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error email"></span>'));
     $oForm->addElement(new \PFBC\Element\Password(t('Your Password:'******'password', array('id' => 'password', 'onkeyup' => 'checkPassword(this.value)', 'onblur' => 'CValid(this.value, this.id)', 'title' => t('Your password. It will be used for logging in to the site. This storage is secure, because we are using an encrypted format.'), 'required' => 1, 'validation' => new \PFBC\Validation\Password())));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error password"></span>'));
     $oForm->addElement(new \PFBC\Element\Radio(t('Your Sex:'), 'sex', array('male' => t('Male'), 'female' => t('Female')), array('value' => 'male', 'title' => t('Please specify your gender.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Date(t('Your Date of birth:'), 'birth_date', array('placeholder' => t('Month/Day/Year'), 'id' => 'birth_date', 'title' => t('Please specify your birth date using the calendar or with this format: Month/Day/Year.'), 'onblur' => 'CValid(this.value, this.id)', 'required' => 1, 'validation' => new \PFBC\Validation\BirthDate())));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error birth_date"></span>'));
     $oForm->addElement(new \PFBC\Element\Country(t('Your Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode(), 'title' => t('Select the country where you live.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your City:'), 'city', array('id' => 'str_city', 'value' => Geo::getCity(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify the city where you live.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_city"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your State:'), 'state', array('id' => 'str_state', 'value' => Geo::getState(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify your state.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_state"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code', 'value' => Geo::getZipCode(), 'onblur' => 'CValid(this.value,this.id,2,15)', 'title' => t('Enter your post code (Zip).'), 'validation' => new \PFBC\Validation\Str(2, 15), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_zip_code"></span>'));
     if (DbConfig::getSetting('isCaptchaAffiliateSignup')) {
         $oForm->addElement(new \PFBC\Element\CCaptcha(t('Captcha:'), 'captcha', array('id' => 'ccaptcha', 'onkeyup' => 'CValid(this.value, this.id)', 'description' => t('Enter the code above:'))));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error ccaptcha"></span>'));
     }
     $oForm->addElement(new \PFBC\Element\Checkbox(t('Terms of Service'), 'terms', array(1 => '<em>' . t('I have read and agree to the %0%.', '<a href="' . Uri::get('page', 'main', 'affiliateterms') . '" rel="nofollow" target="_blank">' . t('Terms of Service') . '</a>') . '</em>'), array('id' => 'terms', 'onblur' => 'CValid(this.checked, this.id)', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error terms-0"></span>'));
     $oForm->addElement(new \PFBC\Element\Button(t('Become an Affiliate!'), 'submit', array('icon' => 'cart')));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script><script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->render();
 }
 public function __construct()
 {
     parent::__construct();
     $this->_ddosProtection();
     /***** Assign the values for Registry Class *****/
     // URL
     $this->registry->site_url = PH7_URL_ROOT;
     $this->registry->url_relative = PH7_RELATIVE;
     $this->registry->page_ext = PH7_PAGE_EXT;
     // Site Name
     $this->registry->site_name = M\DbConfig::getSetting('siteName');
     /***** Internationalization *****/
     // Default path language
     $this->lang->load('global', PH7_PATH_APP_LANG);
     /***** PH7Tpl Template Engine initialization *****/
     /*** Assign the global variables ***/
     /*** Objects ***/
     $this->view->config = $this->config;
     $this->view->design = $this->design;
     /***** Info *****/
     $oInfo = M\DbConfig::getMetaMain(PH7_LANG_NAME);
     $aMetaVars = ['site_name' => $this->registry->site_name, 'page_title' => $oInfo->pageTitle, 'slogan' => $oInfo->slogan, 'meta_description' => $oInfo->metaDescription, 'meta_keywords' => $oInfo->metaKeywords, 'meta_author' => $oInfo->metaAuthor, 'meta_robots' => $oInfo->metaRobots, 'meta_copyright' => $oInfo->metaCopyright, 'meta_rating' => $oInfo->metaRating, 'meta_distribution' => $oInfo->metaDistribution, 'meta_category' => $oInfo->metaCategory, 'header' => 0, 'is_disclaimer' => (bool) M\DbConfig::getSetting('disclaimer'), 'is_cookie_consent_bar' => (bool) M\DbConfig::getSetting('cookieConsentBar'), 'country' => Geo::getCountry(), 'city' => Geo::getCity()];
     $this->view->assigns($aMetaVars);
     $aModsEnabled = ['is_connect_enabled' => SysMod::isEnabled('connect'), 'is_affiliate_enabled' => SysMod::isEnabled('affiliate'), 'is_game_enabled' => SysMod::isEnabled('game'), 'is_chat_enabled' => SysMod::isEnabled('chat'), 'is_chatroulette_enabled' => SysMod::isEnabled('chatroulette'), 'is_picture_enabled' => SysMod::isEnabled('picture'), 'is_video_enabled' => SysMod::isEnabled('video'), 'is_hotornot_enabled' => SysMod::isEnabled('hotornot'), 'is_forum_enabled' => SysMod::isEnabled('forum'), 'is_note_enabled' => SysMod::isEnabled('note'), 'is_blog_enabled' => SysMod::isEnabled('blog'), 'is_newsletter_enabled' => SysMod::isEnabled('newsletter'), 'is_invite_enabled' => SysMod::isEnabled('invite'), 'is_webcam_enabled' => SysMod::isEnabled('webcam')];
     $this->view->assigns($aModsEnabled);
     unset($oInfo, $aMetaVars, $aModsEnabled);
     /**
      * This below PHP condition is not necessary because if there is no session,
      * the get() method of the \PH7\Framework\Session\Session object an empty value and revisit this avoids having undefined variables in some modules (such as the "connect" module).
      */
     //if (\PH7\UserCore::auth()) {
     $this->view->count_unread_mail = \PH7\MailCoreModel::countUnreadMsg($this->session->get('member_id'));
     $this->view->count_pen_friend_request = \PH7\FriendCoreModel::getPending($this->session->get('member_id'));
     //}
     /***** Display *****/
     $this->view->setTemplateDir($this->registry->path_module_views . PH7_TPL_MOD_NAME);
     /***** End Template Engine PH7Tpl *****/
     $this->_checkPerms();
     $this->_checkModStatus();
     $this->_checkBanStatus();
     $this->_checkSiteStatus();
 }
 public static function advanced($iWidth = 500)
 {
     // Generate the Advanced Search form
     $oForm = new \PFBC\Form('form_search', $iWidth);
     $oForm->configure(array('action' => Uri::get('user', 'browse', 'index') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_search', 'form_search'));
     $oForm->addElement(new \PFBC\Element\Select(t('I am a:'), 'match_sex', array('male' => t('Male'), 'female' => t('Woman'), 'couple' => t('Couple')), array('value' => static::getGenderValues()['sex_user'], 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Checkbox(t('Looking for:'), 'sex', array('female' => t('Woman'), 'male' => t('Male'), 'couple' => t('Couple')), array('value' => static::getGenderValues()['match_sex'], 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Age());
     $oForm->addElement(new \PFBC\Element\Country(t('Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode())));
     $oForm->addElement(new \PFBC\Element\Textbox(t('City:'), 'city', array('id' => 'str_city')));
     $oForm->addElement(new \PFBC\Element\Textbox(t('State or Province:'), 'state', array('id' => 'str_state')));
     $oForm->addElement(new \PFBC\Element\Textbox(t('ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code')));
     $oForm->addElement(new \PFBC\Element\Email(t('Email Address:'), 'mail'));
     $oForm->addElement(new \PFBC\Element\Checkbox('', 'avatar', array('1' => '<span class="bold">' . t('Only with Avatar') . '</span>')));
     $oForm->addElement(new \PFBC\Element\Checkbox('', 'online', array('1' => '<span class="bold green2">' . t('Only Online') . '</span>')));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::LATEST => t('Latest Members'), SearchCoreModel::LAST_ACTIVITY => t('Last Activity'), SearchCoreModel::VIEWS => t('Most Popular'), SearchCoreModel::RATING => t('Top Rated'), SearchCoreModel::USERNAME => t('Username'), SearchCoreModel::FIRST_NAME => t('First Name'), SearchCoreModel::LAST_NAME => t('Last Name'), SearchCoreModel::EMAIL => t('Email'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::DESC => t('Descending'), SearchCoreModel::ASC => t('Ascending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->render();
 }
 /**
  * Set the default values for the fields in search forms.
  *
  * @param return void
  */
 protected static function setAttrVals()
 {
     $oSession = new Session();
     $oUserModel = new UserCoreModel();
     self::$aSexOption += ['value' => static::getGenderVals($oUserModel, $oSession)['user_sex']];
     self::$aMatchSexOption += ['value' => static::getGenderVals($oUserModel, $oSession)['match_sex']];
     self::$aAgeOption = ['value' => static::getAgeVals($oUserModel, $oSession)];
     self::$aCountryOption += ['value' => Geo::getCountryCode()];
     self::$aCityOption += ['value' => Geo::getCity()];
     self::$aStateOption += ['value' => Geo::getState()];
 }
Example #11
0
 /**
  * Show the geolocation of the user.
  *
  * @param boolean $bPrint Print or return the HTML code. Default TRUE
  * @return mixed (string | void)
  */
 public function geoIp($bPrint = true)
 {
     $sCountry = Geo::getCountry();
     $sCountryLang = t(str_replace('GB', 'UK', Geo::getCountryCode()));
     // Country name translated into the user language.
     $sCity = Geo::getCity();
     $sHtml = '<a href="' . Uri::get('user', 'country', 'index', $sCountry . PH7_SH . $sCity) . '" title="' . t('Meet New People on %0%, %1% with %site_name%!', $sCountryLang, $sCity) . '">' . $sCountryLang . ', ' . $sCity . '</a>';
     if ($bPrint) {
         echo $sHtml;
     } else {
         return $sHtml;
     }
 }