Welcome, Guest
Please Login or Register.    Lost Password?

Integrating with JomSocial
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Integrating with JomSocial
#44
Integrating with JomSocial 1 Year, 5 Months ago Karma: 0
Hello

I have just installed WM Pro 1.7.1. I don't have CB. I do have JomSocial (standard). I want to set the site up to be a social network by invitation only so this is perfect for me if I can get it all to work.

1) I've set up the menu links for inviting and recommends in the User menu, which only displays for registered users (no JomSocial functionality), but whenever I click on them I get taken to the "Registration only with valid invitation" page. I don't know why. (I've started debugging - the default view in the the JController constructor seems to be correct - wmessengerpro rather than inviteonly - and the default task is display, so I'm guessing something odd on the redirect but haven't found it yet). The only way you can get to the WMPro menu link is by logging on as a registered user so this is a bit strange. Any ideas would be gratefully received as I am still finding my way around in the code. So far I can't find a place where it checks the user logged on status. User registration is currently disabled in site config if that makes any difference.

2) I want to rewrite the plugin as a JomSocial plugin or just as a straight user registration plugin (I've bypassed the JomSocial registration currently and might leave it like this as it works for me) and am theorizing that this should be quite easy provided I can trap the relevant events. I haven't installed the plugin as I don't have CB installed and would presumably be missing the cbTabHandler class. Could this have any impact on the problem above? (I can't see how). Is anybody else working on this/interested?

many thanks

Caroline
carolineb
carolineb
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#45
Re:Integrating with JomSocial 1 Year, 5 Months ago Karma: 0
Fixed it - it was an SEF rewrite that was causing the trouble. When I bypassed JoomSEF for WM Pro it all started behaving.

Now all I have to do is rewrite the plugin......
carolineb
carolineb
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#52
Re:Integrating with JomSocial 1 Year, 4 Months ago Karma: 0
I'm very happy to say that Daniel rewrote the plugin - thanks, Daniel!! - so I didn't have to, and v1.8 now allows native Joomla use of the invitation-only system.

For info for anyone wanting to use this with JomSocial, I've implemented this with JomSocial as follows, primarily by bypassing JomSocial registration and using native Joomla registration:


1) Add a menu item pointing to Jomsocial – Home (the main activity page for Jomsocial)
Set the menu item access level to registered (using Joomla ACL)

2) Use this as the redirect page for the Joomla login module if you want, so they are taken straight to the community page on login.

This means – users who are not logged in will not in general be able to reach the JomSocial front page (which has a big Register button for guests) via the menus.

They will have to use the native Joomla registration and login functionality and will then be redirected into JomSocial, which will become visible on the menu only after login (which changes the behaviour of the login module as it does in Joomla) so the registration button goes away.

There is a security exposure if someone browses directly to the JomSocial register URL (www.yourdomain.com/?option=com_community&view=register). I’ve done a quick-and-dirty and trapped this in the Joomla plugin (file wmtracking.php) with a check for $option == com_community. I had to do this in two places – the if statement in function onAfterRoute() and then again in checkInviteCode().

In function onAfterRoute():
Change this:

$view = JRequest::getCmd('view');
if ( ($invitesonly == 1) && ($allowUserRegistration == 1) && ($option =='com_user') && ($view == 'register') ) //do Joomla registration processing

{
$this->checkInviteCode();
}



to this:

$view = JRequest::getCmd('view');
//change to show invite only if Jomsocial registration accessed via //direct url - Caroline 2010-09-05
if ( ($invitesonly == 1) && ($allowUserRegistration == 1) && ($option =='com_community') && ($view == 'register') ) //check for JomSocial direct url access
{
$this->checkInviteCode();
}
if ( ($invitesonly == 1) && ($allowUserRegistration == 1) && ($option =='com_user') && ($view == 'register') ) //do Joomla registration processing

{
$this->checkInviteCode();
}

and then in function checkInviteCode()

change this:

//Check for Option, Task, View and Parameter
if( !( $option=='com_user' && $view=='register' ) || ($user->get('id')) )

to this:

//Check for Option, Task, View and Parameter
if( !( ($option=='com_user' || $option=='com_community') && $view=='register' ) || ($user->get('id')) )


I think this means in theory that if someone a) gets an invitation and b) then registers by navigating directly to this link, they will be able to use JomSocial registration, which will then presumably break the tracking because it won’t trigger the code which handles the invitation, so I need to investigate this a bit further, and either find a way to switch JomSocial registration off completely or do a version of the plugin which handles the JomSocial events. But for now it’ll stop the trolls which is the main thing.

There may be other urls from which JomSocial registration can be accessed - I haven't exploited it that much yet so will no doubt come across more and will post on this thread as I find them. But this seems to be a good start.

It's quite easy to point the Jomsocial Invite Friends links at WM as follows:

Edit yourdomain.com/components/com_community/views/friends/view.html.php

function addSubMenu()

and change these lines:

$this->addSubmenuItem('index.php?option=com_community&view=search&task=advancesearch', JText::_('CC CUSTOM SEARCH'));
$this->addSubmenuItem('index.php?option=com_community&view=friends&task=invite', JText::_('CC INVITE FRIENDS'));

to this (make sure the Itemid corresponds to the menu item on your site or leave it out):
$this->addSubmenuItem('index.php?option=com_community&view=search&task=advancesearch', JText::_('CC CUSTOM SEARCH'));
//modify this to point to wmessenger
$this->addSubmenuItem('index.php?option=com_wmessengerpro&Itemid=76&view=wmessengerpro', JText::_('CC INVITE FRIENDS'));
//$this->addSubmenuItem('index.php?option=com_community&view=friends&task=invite', JText::_('CC INVITE FRIENDS'));

Then edit yourdomain.com/components/com_community/libraries/toolbar.php starting at about line 128 and change these lines:

$defaultCoreMenuArray['FRIEND_INVITE_FRIENDS'] = $this->_addDefaultItem( JText::_('CC INVITE FRIENDS'),
CRoute::_('index.php?option=com_community&view=friends&task=invite')
);


to this:

//removed to disable inviting friends via JomSocial
//$defaultCoreMenuArray['FRIEND_INVITE_FRIENDS'] = $this->_addDefaultItem(
// JText::_('CC INVITE FRIENDS'),
//CRoute::_('index.php?option=com_community&view=friends&task=invite')
//);
/* Change to route this to WMessenger Pro instead */
//removed to disable inviting friends via JomSocial
$defaultCoreMenuArray['FRIEND_INVITE_FRIENDS'] = $this->_addDefaultItem(
JText::_('CC INVITE FRIENDS'),
CRoute::_('index.php?option=com_wmessengerpro&Itemid=76&view=wmessengerpro')
);
/* end of change */

regards

Caroline
carolineb
carolineb
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/09/12 21:25 By carolineb.Reason: add instructions to link from Jomsocial
The administrator has disabled public write access.
 
#53
Aw: Re:Integrating with JomSocial 1 Year, 4 Months ago Karma: 0
Hello Caroline,

thank you very much for your suggestions and testing the new version of Winged Messenger Pro. You helped me a lot to imprve the component.

Best Regards
Daniel
Winged Messenger
Winged Messenger
Moderator
Posts: 32
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Winged Messenger
Joomla Templates by Joomlashack