本文整理匯總了PHP中Model_Users::sharedContentInvate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Users::sharedContentInvate方法的具體用法?PHP Model_Users::sharedContentInvate怎麽用?PHP Model_Users::sharedContentInvate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Model_Users
的用法示例。
在下文中一共展示了Model_Users::sharedContentInvate方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: indexAction
public function indexAction()
{
$request = $this->getRequest();
$this->view->invate_limit = 5;
if ($request->isPost()) {
$emails = array();
$this->view->send = array();
for ($i = 1; $i < $this->view->invate_limit; $i++) {
$this->view->send[$i] = array('success' => false, 'error' => false);
$validate = new Helper_Validate();
if ($request->getPost('email-' . $i) != $this->translate('Email Adress ' . $i)) {
$validate->_set_rules($request->getPost('email-' . $i), $this->translate('Email Adress ' . $i), 'not_empty;min_length[5];max_length[100];email');
if ($validate->_valid_form()) {
$shared_content = Model_Users::sharedContentInvate($request->getPost('email-' . $i));
if ($shared_content == 1) {
$this->view->send[$i]['error'] = $this->translate('With this email address is already registered users!');
} else {
if ($shared_content == 2) {
$this->view->send[$i]['error'] = $this->translate('To this email has been sent an invitation!');
} else {
$inser_key = Model_Users::sharedContent($request->getPost('email-' . $i));
if ($inser_key == -1) {
$this->view->send[$i]['error'] = $this->translate('There was an error. Please try again later!');
} else {
$this->view->shared_content = WM_Router::create($request->getBaseUrl() . '?controller=users&action=register&user_id=' . JO_Session::get('user[user_id]') . '&key=' . $inser_key);
$this->view->header_title = JO_Registry::get('site_name');
$this->view->self_firstname = JO_Session::get('user[firstname]');
$this->view->Recipient_message = $request->getPost('note') != $this->translate('Add a personal note') ? $request->getPost('note') : '';
$result = Model_Email::send($request->getPost('email-' . $i), JO_Registry::get('noreply_mail'), sprintf($this->translate('New invate for %s from %s'), JO_Registry::get('site_name'), JO_Session::get('user[firstname]') . ' ' . JO_Session::get('user[lastname]')), $this->view->render('send_invate', 'mail'));
if ($result) {
$this->view->send[$i]['success'] = $this->translate('The invitation was sent successfully!');
} else {
$this->view->send[$i]['error'] = $this->translate('There was an error. Please try again later!');
}
}
}
}
} else {
$this->view->send[$i]['error'] = strip_tags($validate->_get_error_messages());
}
}
}
if ($request->isXmlHttpRequest()) {
echo $this->renderScript('json');
exit;
} else {
JO_Session::set('result_from_invate', $this->view->send);
$this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=invites'));
}
}
if (JO_Session::get('result_from_invate')) {
$this->view->result_from_invate = JO_Session::get('result_from_invate');
JO_Session::clear('result_from_invate');
}
$this->view->invites = WM_Router::create($request->getBaseUrl() . '?controller=invites');
$this->view->invites_fb = WM_Router::create($request->getBaseUrl() . '?controller=invites&action=facebook');
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
示例2: indexAction
public function indexAction()
{
$request = $this->getRequest();
$this->view->invate_limit = 5;
if ($request->isPost()) {
$emails = array();
$this->view->send = array();
for ($i = 1; $i < $this->view->invate_limit; $i++) {
$this->view->send[$i] = array('success' => false, 'error' => false);
$validate = new Helper_Validate();
if ($request->getPost('email-' . $i) != $this->translate('Email Adress ' . $i)) {
$validate->_set_rules($request->getPost('email-' . $i), $this->translate('Email Adress ' . $i), 'not_empty;min_length[5];max_length[100];email');
if ($validate->_valid_form()) {
$shared_content = Model_Users::sharedContentInvate($request->getPost('email-' . $i));
if ($shared_content == 1) {
$this->view->send[$i]['error'] = $this->translate('With this email address is already registered users!');
} else {
if ($shared_content == 2) {
$this->view->send[$i]['error'] = $this->translate('To this email has been sent an invitation!');
} else {
$inser_key = Model_Users::sharedContent($request->getPost('email-' . $i));
if ($inser_key == -1) {
$this->view->send[$i]['error'] = $this->translate('There was an error. Please try again later!');
} else {
$template = Model_Notification::getTemplate('send_invate');
if ($template) {
$template_data = array('user_id' => JO_Session::get('user[user_id]'), 'user_firstname' => JO_Session::get('user[firstname]'), 'user_lastname' => JO_Session::get('user[lastname]'), 'user_fullname' => JO_Session::get('user[fullname]'), 'user_message' => $request->getPost('note') != $this->translate('Add a personal note') ? $request->getPost('note') : '', 'site_url' => $request->getBaseUrl(), 'site_name' => Helper_Config::get('site_name'), 'invate_url' => WM_Router::create($request->getBaseUrl() . '?controller=users&action=register&user_id=' . JO_Session::get('user[user_id]') . '&key=' . $inser_key), 'mail_footer' => html_entity_decode(Helper_Config::get('mail_footer'), ENT_QUOTES, 'utf-8'));
if (!$template['title']) {
$template['title'] = $this->translate('Join and create your own pinboards');
}
$title = Model_Notification::parseTemplate(html_entity_decode($template['title'], ENT_QUOTES, 'utf-8'), $template_data);
$template = Model_Notification::parseTemplate(html_entity_decode($template['template'], ENT_QUOTES, 'utf-8'), $template_data);
$result = Model_Email::send($request->getPost('email-' . $i), Helper_Config::get('noreply_mail'), $title, $template);
if ($result) {
$this->view->send[$i]['success'] = $this->translate('The invitation was sent successfully!');
} else {
$this->view->send[$i]['error'] = $this->translate('There was an error. Please try again later!');
}
} else {
$this->view->send[$i]['error'] = $this->translate('There was an error. Please try again later!');
}
}
}
}
} else {
$this->view->send[$i]['error'] = strip_tags($validate->_get_error_messages());
}
}
}
if ($request->isXmlHttpRequest()) {
echo $this->renderScript('json');
exit;
} else {
JO_Session::set('result_from_invate', $this->view->send);
$this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=invites'));
}
}
if (JO_Session::get('result_from_invate')) {
$this->view->result_from_invate = JO_Session::get('result_from_invate');
JO_Session::clear('result_from_invate');
}
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part', 'methodsforinvates' => 'invates/methodsforinvates');
}
示例3: indexAction
public function indexAction()
{
$request = $this->getRequest();
if (JO_Session::get('user[user_id]')) {
$this->redirect(WM_Router::create($this->getRequest()->getBaseUrl()));
}
if (JO_Registry::get('enable_free_registration')) {
$this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=users&action=register'));
}
if ($this->getLayout()->meta_title) {
$this->getLayout()->placeholder('title', $this->getLayout()->meta_title . ' - ' . JO_Registry::get('meta_title'));
} else {
$this->getLayout()->placeholder('title', JO_Registry::get('meta_title'));
}
if ($this->getLayout()->meta_description) {
$this->getLayout()->placeholder('description', $this->getLayout()->meta_description);
} else {
$this->getLayout()->placeholder('description', JO_Registry::get('meta_description'));
}
if ($this->getLayout()->meta_keywords) {
$this->getLayout()->placeholder('keywords', $this->getLayout()->meta_keywords);
} else {
$this->getLayout()->placeholder('keywords', JO_Registry::get('meta_keywords'));
}
$this->getLayout()->placeholder('site_name', JO_Registry::get('site_name'));
$this->view->site_name = JO_Registry::get('site_name');
$this->view->meta_title = JO_Registry::get('meta_title');
$this->getLayout()->placeholder('google_analytics', html_entity_decode(JO_Registry::get('google_analytics'), ENT_QUOTES, 'utf-8'));
$this->view->baseUrl = $request->getBaseUrl();
$this->view->site_logo = $request->getBaseUrl() . 'data/images/logo.png';
if (JO_Registry::get('site_logo') && file_exists(BASE_PATH . '/uploads' . JO_Registry::get('site_logo'))) {
$this->view->site_logo = $request->getBaseUrl() . 'uploads' . JO_Registry::get('site_logo');
}
$this->view->login = WM_Router::create($request->getBaseUrl() . '?controller=users&action=login');
if (JO_Session::get('successfu_edite')) {
$this->view->successfu_edite = true;
JO_Session::clear('successfu_edite');
}
if ($request->isPost()) {
$validate = new Helper_Validate();
$validate->_set_rules($request->getPost('email'), $this->translate('Email'), 'not_empty;min_length[5];max_length[100];email');
if ($validate->_valid_form()) {
$shared_content = Model_Users::sharedContentInvate($request->getPost('email'));
if ($shared_content == 1) {
$this->view->error = $this->translate('This e-mail address is already registered');
} else {
if ($shared_content == 2) {
$this->view->error = $this->translate('This e-mail address is already registered');
} else {
if (($key = Model_Users::addSharedContent($request->getPost('email'))) !== false) {
JO_Session::set('successfu_edite', true);
if (JO_Registry::get('not_ri')) {
Model_Email::send(JO_Registry::get('report_mail'), JO_Registry::get('noreply_mail'), $this->translate('New invitation request'), $this->translate('Hello, there is new invitation request in ') . ' ' . JO_Registry::get('site_name'));
}
$this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=landing'));
} else {
$this->view->error = $this->translate('There was an error. Please try again later!');
}
}
}
} else {
$this->view->error = $validate->_get_error_messages();
}
}
// $this->view->children = array(
// 'header_part' => 'layout/header_part',
// 'footer_part' => 'layout/footer_part'
// );
}