× Joomla Facebook Connect support forum

Topic-icon Only FB button login module

Active Subscriptions:

None
14 years 2 months ago #2996 by johnnydement
Hi,

I have phpbb PM configured with CB, and it can show in CB login module new PMS, but is not doing in JFB login...

would be possible to have a "lite" JFB login module just for the FB login? and handle usual joomla domain with other modules? I feel it would be a lot more flexible for who wants it...

That, or list the modifications to add it to whatever module we want to use ;)

Regards
The topic has been locked.
Support Specialist
14 years 2 months ago #3010 by alzander
I'm not sure exactly what you are asking for, but if you can explain it more, I will try to help.

If you post a link or screenshots of what you currently have, that might help me understand.

Thanks!
The topic has been locked.
Active Subscriptions:

None
14 years 2 months ago #3019 by johnnydement
Hehe, sorry, I'm specially good on making a mess of myself ;)

I'm using Blogomunity p8pbb bridge to integrate forums and site, and JFBConnecy to integrate it also with Facebook, and both are working great.

Th issue is I'm using phpBB3 PM system as PMS system for the site, and one of the features of p8pbb bridge read as follows:

Community Builder basic support (users created and deleted in the forum are created and deleted in Community Builder) + advanced integration (avatars, profile fields and connections synchronization, PM links in CB profile and login module, phpBB signature field type, posts count and rank image in CB status area), user's forum posts tab


I've tested all this with success, except the PM links in login module, as I'm not using CB login module, but JFBConnect one, and that one doesn't show the message count...

So, I think best would be to have a "lite" JFBConnect module, to just handle the FB logins, and the usual joomla logins handled by CB login... also this will allow for better styling, placing the connect with FB button at the top of site...

Sorry I can't capture any screenshot now, although I don't think it would be too helpful.

Thanks

The topic has been locked.
Support Specialist
14 years 2 months ago #3033 by alzander
I just checked the version of JFBCLogin on our demo site and there is a "Show Login Form" parameter that looks like it might do what you want. Can you try changing that to No and let me know if it does what you want?

If not, let me know what it isn't doing right and we will look into adding a parameter for you.

Thanks
The topic has been locked.
Active Subscriptions:

None
14 years 2 months ago #3036 by johnnydement
Nearly ;)

As normal login may be controlled by usual CB login, I would like to act like the FBconnect button only, that's it, if you're logged in fb, hiding, and appearing if not...

Right now, it shows the logout button and the welcome message...

I'm not sure how does it work, as doesn't need any extra module nor similar, simply, p8phh bridge can inform CB login (as uddeIM and so) if there are new PMs, and show a link on it, if "CB Plugins integration" in CB login is set to yes, so, it must be p8pbb CB plugin doing the job ;)
The topic has been locked.
Support Specialist
14 years 2 months ago #3043 by alzander
This is what I see in the module's code:
.../modules/mod_jfbclogin/tmpl/default.php
<?php } ###################### end login form #####################################
else
{	# show logout
?>
	<?php
	# Show their FB avatar (if desired), or give them the option to link accounts
	if ($fbClient->user)
	{
		if($params->get("enableProfilePic")) 
		{ 
			$picHeightParam = $params->get("profileHeight");
			$picWidthParam = $params->get("profileWidth");
			$picHeight = $picHeightParam != "" ? 'height="'.$picHeightParam.'px"' &#58; "";
			$picWidth = $picWidthParam != "" ? 'width="'.$picWidthParam.'px"' &#58; "";
			$linked = ($params->get("linkProfile") == 1)?"true"&#58;"false";
			$fbLogo = ($params->get("facebookLogo") == 1)?"true"&#58;"false"; 
			$fbUid = $fbClient->user;
			?>
			<div id="profile-pic">
				<fb&#58;profile-pic uid="<?php echo $fbUid;?>"
					size="<?php echo $params->get('picQuality'); ?>"
					<?php echo $picHeight;?>
					<?php echo $picWidth;?>
					linked="<?php echo $linked;?>" 
					facebook-logo="<?php echo $fbLogo;?>"
				/>
			</div>
	<?php 
		}
	} 
	?>
	<div>
	<?php echo JText&#58;&#58;_("Welcome")." ".$user->get('name') ?>
	</div>
	<input type="submit" name="Submit" class="button" value="<?php echo JText&#58;&#58;_('Logout') ?>" onclick="javascript&#058;logout_button_click()" />
	<?php
	if (!$fbClient->user) # show facebook connect button to join accounts
	{ ?>
		<div class="fb_connect_user"><?php echo JText&#58;&#58;_('Connect User'); ?></div>	
		<fb&#58;login-button onlogin="javascript&#058;fb_login_button_click();"></fb&#58;login-button>
	<?php }
	?>

<?php
} # end logout

?>

You can try changing the code so it never executes the logout code by either commenting it out or changing the else like this:
<?php } ###################### end login form #####################################
else if(false)
{	# show logout

If you want to use the module with the logout button on a different part of your site, you will have to make a copy of it and change it slightly. Let me know if you need help with that.

I will talk to Alex about adding a parameter to not show the Logout button for you in a future release.

Let me know if this does not do what you want.

Thanks
The topic has been locked.
Active Subscriptions:

None
14 years 2 months ago #3073 by johnnydement
I got these instructions from the author to add phpbb PM checking when using the bridge to JFBlogin:
// get new PMs count
$total_pms = 0;
$fuser = $mainframe->getUserState('jmrphpbb_user');
$last_updated = $mainframe->getUserState('jmrphpbb_user_updated');

if (!isset($fuser&#91;'user_new_privmsg'&#93;) || ((time() - @$last_updated) > $this->params->get('show_pms_update_time')*60)) {
// load phpBB user
require_once(JPATH_SITE.DS.'components'.DS.'com_jmrphpbb'.DS.'helper.php');
$this->fdb =& JmrphpbbHelper&#58;&#58;getForumDB();
$query = 'SELECT * FROM `#__users` WHERE `username_clean` = '.$this->fdb->quote(JString&#58;&#58;strtolower(JFactory&#58;&#58;getUser()->username));
$this->fdb->setQuery($query);
$fuser = $this->fdb->loadAssoc();
JmrphpbbHelper&#58;&#58;_restoreDB('j');
// prevent next loadings of user absent in forum
if (!isset($fuser&#91;'user_id'&#93;)) {
$fuser = array('user_new_privmsg' => '0');
}
$mainframe->setUserState('jmrphpbb_user', $fuser);
$mainframe->setUserState('jmrphpbb_user_updated', time());
}
$total_pms = $fuser&#91;'user_new_privmsg'&#93;;

// show data
$link = JRoute&#58;&#58;_('index.php?option=com_jmrphpbb&jview=user&i=pm&folder=inbox&Itemid='.$this->params->get('Itemid'));

Gonna try if it works tomorrow ;)
The topic has been locked.
Support Specialist
14 years 2 months ago #3074 by alzander
Cool. Thanks for posting that for others. If you need any help from us, just let us know.
The topic has been locked.
Active Subscriptions:

None
14 years 2 months ago #3116 by johnnydement
Added the code to the end of jfcblogin.php and default.php getting errors with both :(

Fatal error: Call to a member function get() on a non-object in /home/multivers/www/www/modules/mod_jfbclogin/mod_jfbclogin.php on line 53
Fatal error: Call to a member function get() on a non-object in /home/multivers/www/www/modules/mod_jfbclogin/tmpl/default.php on line 132

I'm looking at it with the author, will post when further news ;)
The topic has been locked.
Support Specialist
14 years 2 months ago #3149 by alzander
I'm guessing this is the offending code:
$this->params->get('show_pms_update_time')

The login module will not know about that parameter. I would suggest just replacing it with a hard coded value.

Let me know where you get with it. I can help if you have more issues.
The topic has been locked.