How to call up new user's profile after register?

15 years 6 months ago #77050 by sfraise
I've posted for this before but I might not have been real clear in it.

How can I place a call to a new user's profile right after that person registers?

The reason I need the user's profile to be called up right after registration is because I use sh404sef to rewrite the url to a short url such as www.oohya.net/user/ but if someone tries to use the short url before that profile has been called then it returns a 404 error as sh404sef has not yet been able to write the profile to the database.

This is especially an issue from my chat applet as it has to call a profile by username and not userid. With sh404sef on the only format that works from chat is "www.oohya.net/%user%/. Before I started using sh404sef I used www.oohya.net/index.php?option=com_comprofiler&task=userProfile&user='%USER%' but that no longer works with sef on.

I've talked with the creator of sh404sef and here is what he said:

"Actually, they don't even need to display the sef url. They just have to
place a call to the sef function like so :

$dummyURl = sefRelToabs('www.oohya.net/index.php?option=com_comprofiler&task=userProfile&user='%USER%')
(replace sefRelToAbs() by Jroute::_() for Joomla 1.5)....
in the right place in community builder, just after creation of user happens, is enough. The url is created when the sefRelToAbs() function is created....
It should be placed just after cb has created the user in the database. I don't know cb, but the author should be able to tell you very easily."

So first would this string actually do the job? And second, what file should it be placed in and where?
I've tried it in a few spots in the cb.core as well as the comprofiler.php files but nothing I do seems to work.

Does anyone in here know how to do this correctly?

Post edited by: sfraise, at: 2008/10/12 00:22

Please Log in to join the conversation.

15 years 6 months ago #77068 by Rapunzl
I can point you to the file to look in. Check comprofiler.php. Even if you aren't a coder, you should be able to figure out where the user is created and try the new code (after you've backed up the file of course) with a test user.

:)

Jamie (Rapunzl)
Community Builder Team Member

Before posting on forums: Read all CB Articles | Specially the FAQ | Help us help you
CB links: Subscribe to CB documentation | [url=http://www.joomlapolis.com/content/view/7363/37/
]Our templates[/url] | [url=http://www.joomlapolis.com/content/blogcategory/61/74/
]Paid Subscriptions[/url] | Get Hosting | Our Forge
Visit my CB Profile

My personal site Rapunzl's Reality always under reconstruction

Please Log in to join the conversation.

15 years 6 months ago #77080 by nant
sfraise wrote:

I've posted for this before but I might not have been real clear in it.

How can I place a call to a new user's profile right after that person registers?

The reason I need the user's profile to be called up right after registration is because I use sh404sef to rewrite the url to a short url such as www.oohya.net/user/ but if someone tries to use the short url before that profile has been called then it returns a 404 error as sh404sef has not yet been able to write the profile to the database.

This is especially an issue from my chat applet as it has to call a profile by username and not userid. With sh404sef on the only format that works from chat is "www.oohya.net/%user%/. Before I started using sh404sef I used www.oohya.net/index.php?option=com_comprofiler&task=userProfile&user='%USER%' but that no longer works with sef on.

I've talked with the creator of sh404sef and here is what he said:

"Actually, they don't even need to display the sef url. They just have to
place a call to the sef function like so :

$dummyURl = sefRelToabs('www.oohya.net/index.php?option=com_comprofiler&task=userProfile&user='%USER%')
(replace sefRelToAbs() by Jroute::_() for Joomla 1.5)....
in the right place in community builder, just after creation of user happens, is enough. The url is created when the sefRelToAbs() function is created....
It should be placed just after cb has created the user in the database. I don't know cb, but the author should be able to tell you very easily."

So first would this string actually do the job? And second, what file should it be placed in and where?
I've tried it in a few spots in the cb.core as well as the comprofiler.php files but nothing I do seems to work.

Does anyone in here know how to do this correctly?

Post edited by: sfraise, at: 2008/10/12 00:22


Sounds like a simple CB plugin can be created with this specific call.

The plugin must trigger off of a CB after registration event (most likely an event after registration approval - not sure of the exact event - would have to look in API doc).

Please Log in to join the conversation.

15 years 6 months ago #77357 by sfraise
Thanks nant.

I just made a joomla module to start off with.

I used the following code:
<?php
/**
* @version 1.0 $
* @package cbprofilecall
* @copyright (C) 2008 OohYa Chat
* @license www.gnu.org/copyleft/gpl.html GNU/GPL
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$dummyURl = sefRelToabs("index.php?option=com_comprofiler&amp;task=userProfile&amp;user=$row->userid");
?>

I'm going to place this as a registered module on the front page so when ever someone logs in it will call the user's cb profile, this should accomplish what I need.

I don't get any errors with it, but it doesn't seem to be working either.

Do you see any problems with it?

Post edited by: sfraise, at: 2008/10/15 03:54

Post edited by: sfraise, at: 2008/10/15 04:01

Please Log in to join the conversation.

15 years 6 months ago #77358 by sfraise
I couldn't get it to work so I just basically copied the cbonline module and left off the echo result. It will do what I need it to but still will end up slowing down the load time pulling all of the online users instead of just the one user.

Post edited by: sfraise, at: 2008/10/15 05:13

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.242 seconds

Facebook Twitter LinkedIn