The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Jul 01, 2010 11:04 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Jul 30, 2009 5:33 am
Posts: 24
**Disclaimer: This post is about the JomSocial login module, HelloMe. I posted this on JomSocial's site and the crew over there says my question is not supported by their terms. So they moved my thread to another sub-forum and it has sat there for over a week, unanswered.

That said, I need some help coding up a redirect for JomSocial's HelloMe module. Out of the box, it always redirects people to their Profile page. What I would like is for the user to be redirected back the their originating page... the page they logged in from. However, there is one catch. When someone logs in for the first time, they will be logging in from a page that has an activation token in the URL. If you try to redirect back to a URL with a token in it, it will cause problems for the user... either an error message or a blank page.

I am not a PHP coder, but here's what I've got so far. Basically, I used the stripos function to find "activate-account/?activation=" in the URL. If it finds that, I want it to redirect the user to their profile. If it doesn't find that, I want the user redirected back to the originating page... make sense?

Code:
                         

function getHelloMeLoginHTML($params, $type, $user)
                 {

    $findme    = 'activate-account/?activation=';
    $mystring1 = $uri;

    $pos1 = stripos($mystring1, $findme);

    $uri   = JFactory::getURI();

    if ($pos1 === false) {

                    $uri   = $uri->toString(array('path', 'query', 'fragment'));
                    $uri   = base64_encode($uri);
       
    }


    if ($pos1 !== false) {

             $uri   = CRoute::_('index.php?option=com_community&view=profile' , false );
             $uri   = base64_encode($uri);
             $html   = '';

    }


The redirect to originating page part works fine, but it does not redirect properly from an account activation URL.

The code used to redirect the user to their profile was written by the folks at JomSocial, so I believe the problem lies with the if statement, or the stripos function.

Any help solving this would be greatly appreciated. TIA!


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 7:16 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Jul 30, 2009 5:33 am
Posts: 24
Could anybody help me out with a little PHP?


Top
 Profile  
 
PostPosted: Tue Aug 23, 2011 6:38 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Nov 02, 2006 6:35 pm
Posts: 23
Could you solve this? I am in the same situation....

regards!


Top
 Profile  
 
PostPosted: Thu Dec 29, 2011 8:35 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 20, 2011 4:27 am
Posts: 7
i using for joomla 1.7 and jomsocial 2.4 - me too want to change redirect to homepage (not to jomsocial page)


Top
 Profile  
 
PostPosted: Sat Jan 07, 2012 11:06 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Mar 02, 2011 10:28 pm
Posts: 21
I have experienced the same issue (Joomla 1.7.3, JomSocial 2.4.1). Activation links created by JomSocial to the the Joomla Login rather than the JomSocial Login. I have an open ticket with them with no response.

I did find that if you want to redirect some of the other items they have a plugin called "jomsocialredirect" that seems to work well for redirecting after Login, Logout, ... but NOT Activation.


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 4:33 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 20, 2011 4:27 am
Posts: 7
hi... i found plugin in jomsocial (its on bundle, apps_unzip_first) - its name plg_jomsocialredirect
its solve my problem,
On plugin manager, you can set landing land after Login logout and failded login to page you want to (based on menu)

screen
http://www.diigo.com/item/image/1bl83/9van


Top
 Profile  
 
PostPosted: Thu Mar 01, 2012 3:59 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Jun 17, 2010 1:49 pm
Posts: 44
Thank you agusdwi! Such a clean solution :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 



Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group