I was wondering how I could have EasySocial redirect to a page other than my dashboard after a user registers?
if ($profile->id = 1) {
//do redirection url here
}
if ($profile->id = 2) {
//do another redirection url here
}
if ($profile->id = 1) {
//index.php/en/thank-you-1
}
if ($profile->id = 2) {
//index.php/en/thank-you-1
}
if ($profile->id = 1) {
http://www.myurl.com/index.php/en/thank-you-1
}
if ($profile->id = 2) {
http://www.myurl.com/index.php/en/thank-you-1
}
if ($profile->id = 1 {
$url = 'http://www.myurl.com/index.php/en/thank-you-1'
return $this->redirect($url);
}
Ezrul Fazwan wrote:
Hello Justin,
You need to use the redirection function in order for it to work. Here is an example,
if ($profile->id = 1 {
$url = 'http://www.myurl.com/index.php/en/thank-you-1'
return $this->redirect($url);
}
if ($profile->id = 1 {
$url = 'http://www.myurl.com/index.php/en/thank-you'
return $this->redirect($url);
}
if ($profile->id = 2 {
$url = 'http://www.myurl.com/index.php/en/thank-you-2'
return $this->redirect($url);
}
if ($profile->id = 3 {
$url = 'http://www.myurl.com/index.php/en/thank-you-3'
return $this->redirect($url);
}
if ($profile->id = 4 {
$url = 'http://www.myurl.com/index.php/en/thank-you-4'
return $this->redirect($url);
}
if ($profile->id = 5 {
$url = 'http://www.myurl.com/index.php/en/thank-you-5'
return $this->redirect($url);
}
if ($profile->id = 6 {
$url = 'http://www.myurl.com/index.php/en/thank-you-6'
return $this->redirect($url);
}
if ($profile->id = 1) {
$url = 'http://www.myurl.com/index.php/en/thank-you-1';
return $this->redirect($url);
}
if ($profile->id = 3) {
$url = 'http://www.myurl.com/welcome/';
return $this->redirect($url);
}
<?php
$app = JFactory::getApplication();
$document = &JFactory::getDocument();
// Easysocial Login Modul
$renderer = $document->loadRenderer('modules');
$position = 'easyloginshop';
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
// Easysocial Miniregistration Modul
$renderer = $document->loadRenderer('modules');
$position = 'easyregistrationshop';
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
// Set rewrite URL Cookie
$jinput = $app->input;
$jcookie = $jinput->cookie;
$jcookie->set('easysocialloginurl', JURI::current(), 0);
?>
<?php
$app = JFactory::getApplication();
$cookie_name = 'easysocialloginurl';
$jinput = $app->input;
$jcookie = $jinput->cookie;
$cookie_value = $jcookie->get($cookie_name, NULL);
if ($cookie_value) {
// Cookie delete
$jcookie->set($cookie_name, NULL, time() - 1);
// set rewrite url
$url = $cookie_value;
}