QuoteAug 12, 2010 11:3011 likesLike
 

Many people have asked me how to put a facebook connect button in the logon box instead of the drop down list like i have it setup on my site for my own version of facebook connect. This code is provided as part of my facebook connect module. I am posting the button portion of it here for others to use with other facebook connect modules.

The source below in is two pieces. The first change is to remove the dropdown selector. The second adds the button.

First you need a button image. Get one in PNG format and name it fbconnectbut.png and upload to your site in templates/base/images/


To add a facebook connect button open inc/design.inc.php

Part 1. Removing the drop down menu. Look for the following at about line 477

'inputs' => array(
$aAuthTypes,
'nickname' => array(
'type' => 'text',
'name' => 'ID',
'caption' => _t('_NickName'),
),

Comment out $aAuthTypes,. Make it look like this.
This mod removes the auth type drop down list. This is optional.

'inputs' => array(
//$aAuthTypes,
'nickname' => array(
'type' => 'text',
'name' => 'ID',
'caption' => _t('_NickName'),
),

Part 2. Adding the button. Now near the end of the file at line 525 look for this.

$oForm = new BxTemplFormView($aForm);

bx_import('BxDolAlerts');
$sCustomHtmlBefore = '';
$sCustomHtmlAfter = '';
$oAlert = new BxDolAlerts('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
$oAlert->alert();

$sFormCode = $oForm->getCode();

Make it look like this.
This mod adds the facebook connect button.

$oForm = new BxTemplFormView($aForm);

bx_import('BxDolAlerts');
$sCustomHtmlBefore = '';
$sCustomHtmlAfter = '';
$oAlert = new BxDolAlerts('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
$oAlert->alert();

$sFormCode = '<div style="text-align: center; margin-top: 8px;"><a href="modules/?r=facebook_connect/login_form"><img border="0" src="' . BX_DOL_URL_ROOT . 'templates/base/images/fbconnectbut.png"></a></div>' . $oForm->getCode();


NOTE: This has been setup for the boonex facebook connect. To use this code with a different module, change the href link.
Also note: This code is for Dolphin 7.0.2. The code in older versions of dolphin is different and will not work as written above.

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteAug 12, 2010 13:031 likesLike
 

Thanks Deano. This is nice to see. Great for people to add. Boonex should send out a weekly newsletter with Top 10 Codes to improve your site and this should definitley be on the list.

QuoteAug 12, 2010 14:350 likesLike
 

point for DEANO, I think your mod is fantastic!

QuoteAug 23, 2010 06:290 likesLike
 

i think in 7.0.3 they should remove the combo box and just have the button. And also add Facebook connect to Join page and member page (to link accounts)

~~Mike
QuoteAug 23, 2010 06:331 likesLike
 

There is a reason for the drop down box.

Dolphin was designed to handle more than one alternate auth module. Thus in cases such as that the drop down box is appropriate.

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteAug 29, 2010 00:220 likesLike
 

Thanx,

This helped alot.

Free the Dolphin...
QuoteAug 29, 2010 14:280 likesLike
 

I need a  Facebook Disconect Button.

 

 

LOL

Post Reply - if you going to help - No for - bla bla bla bla
QuoteAug 29, 2010 16:010 likesLike
 

 

I need a  Facebook Disconect Button.

 

 

LOL


Why?

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteAug 29, 2010 18:080 likesLike
 

Because many people are using the facebook conenct button and they don't know how to log out

so I want to add my own facebook disconnect button so they will log out with out getting lost

 

 

I need a  Facebook Disconect Button.

 

 

LOL


Why?

 

Post Reply - if you going to help - No for - bla bla bla bla
QuoteAug 29, 2010 18:150 likesLike
 

My facebook connect mod logs them out of facebook when they log out of the site.

So, if they can't use the logout button on the site, what makes you think they will use a facebook logout button.

You could always try a bigger, more visible site logout button.



Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteAug 29, 2010 18:400 likesLike
 

I know that man

but the log out is to small and some memebrs are blaine

My facebook connect mod logs them out of facebook when they log out of the site.

So, if they can't use the logout button on the site, what makes you think they will use a facebook logout button.

You could always try a bigger, more visible site logout button.



 

Post Reply - if you going to help - No for - bla bla bla bla
QuoteAug 29, 2010 18:431 likesLike
 

Thats why i also said. "You could always try a bigger, more visible site logout button."

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteOct 04, 2010 13:390 likesLike
 

Thanks Deano!

QuoteDec 18, 2010 11:520 likesLike
 

Thx for this

QuoteDec 18, 2010 13:500 likesLike
 

I love the idea of a Facebook connect but still haven't found one that works for me. Maybe I am looking at it wrong. The problem I have is my join form has required fields that get ignored when someone joins my site using the facebook connect. Does anyone have any ideas how this can be solved?

My site has banner ads here!
QuoteDec 20, 2010 02:520 likesLike
 

 

I love the idea of a Facebook connect but still haven't found one that works for me. Maybe I am looking at it wrong. The problem I have is my join form has required fields that get ignored when someone joins my site using the facebook connect. Does anyone have any ideas how this can be solved?

wait before 7.0.5 is coming.  New facebook version contain redirect option. That allow you select you needed page after first sign in (avatar, join, pedit.....)

PS: If possible do not write me personally, please try to ask on the forum first
QuoteFeb 19, 2011 14:520 likesLike
 

Is there a simple way to to change login Username to Email

I've gone through D7's builder and can't find anything to change to that preference it would be a great help if anyone can help.

Common sense is usually on common!
QuoteFeb 19, 2011 14:530 likesLike
 

Is there a simple way to to change login Username to Email

I've gone through D7's builder and can't find anything to change to that preference it would be a great help if anyone can help.

Common sense is usually on common!
QuoteFeb 20, 2011 15:060 likesLike
 

Great! Thanks Deano.

QuoteFeb 22, 2011 06:000 likesLike
 

is this code working on 7.0.5 ???????????

c'mon improve it more :)
QuoteFeb 22, 2011 07:400 likesLike
 

The line numbers are slightly different, but yes. It works.


Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteFeb 22, 2011 08:340 likesLike
 

hello deano sorry to trouble you i have done as you said, but the button still only shows in the popup login box but not in the login box or the sign up page ?

QuoteFeb 22, 2011 09:160 likesLike
 

If it shows in one, it will show in the other.

The same code affects both boxes so if one works the other should also.

Make sure your cache gets cleared.

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteFeb 22, 2011 10:370 likesLike
 

please except my apology i cleared the cache i checked in IE9 AND buttons are there for some reason it took 3 hours for the buttons to resolve in firefox despite the fact that i cleared comp/browser cache  sorry to have troubled you ... does look very nice with your button it is ok to use ? i found it in you other fbook post ..

 

once again thank you for sharing

QuoteMar 09, 2011 11:170 likesLike
 

Thanks deano ... you always have what I need.

QuoteMar 13, 2011 06:370 likesLike
 

What line is Dolphin 7.0.5?

QuoteMar 13, 2011 10:050 likesLike
 

Exact line numbers are sometimes useless. If other mods exists, or your editor double spaces the lines, it will be inaccurate.

Do not rely on line numbers when editing code. Find the code useing your eyes or search for parts of the code that have been specified to look for.

If you use the search function in your editor and search for $sFormCode = $oForm->getCode(); it will take you right to it.

Again, never rely on the accuracy of line numbers, always verify you have the correct location with your eyes by matching the code that the instructions tell you to look for.



Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteMar 15, 2011 07:290 likesLike
 
Hey Deano, First I would like to say thanks for your work and help. I enterednthe facebook button code as above and it seems to work. Then a member, who is also a friend, said when he tried to use it, he was logged in as me. Now I set it up on my home home computer, so I know it's not a cookie problem. Whenever, someone goesmto sign up with the facebook connect, they login in as me. I have the boonex facebook connect and I am running 7.0.5. Any thoughts, or shouldni just buy yours,haha.
QuoteMar 15, 2011 09:060 likesLike
 

 

Hey Deano, First I would like to say thanks for your work and help. I enterednthe facebook button code as above and it seems to work. Then a member, who is also a friend, said when he tried to use it, he was logged in as me. Now I set it up on my home home computer, so I know it's not a cookie problem. Whenever, someone goesmto sign up with the facebook connect, they login in as me. I have the boonex facebook connect and I am running 7.0.5. Any thoughts, or shouldni just buy yours,haha.

The button is just an image with a link to the Facebook connect logon form. It does not do anything more than that, nor can it cause that issue.

Search the forums for Facebook connect. You will see there are others that have had that issue as well as other issues. If you can't find them, start a new topic. Your issue is unrelated to the button and therefore is not within this topic and should not be discussed here.



Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteMar 15, 2011 09:370 likesLike
 

In fact, someone else just posted a new topic with the same problem. http://www.boonex.com/unity/forums/topic/SERIUS-facebook-connect-issue.htm

But you will find others if your search for Facebook Connect here. http://www.boonex.com/unity/forums/#action=goto&search=1

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteMar 15, 2011 15:590 likesLike
 
Thanks deano92964! That was a great help...fixed in no time.
QuoteMar 18, 2011 16:420 likesLike
 

I have the button working but when some new connect they connect with the last person in formation take a look at qchevere.net

QuoteMar 18, 2011 20:060 likesLike
 

Has nothing to do with the button code. Same issue as last person who posted here. You need to update your facebook connect.

Search the forums for facebook connect. You will see other issues as well.

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteAug 12, 2011 08:400 likesLike
 

Does it support 7.0.6? Tried this but I don´t understand what you mean in this part? (a href="modules/?r=facebook_connect/login_form").

 

Please help. Thanks.

QuoteAug 12, 2011 08:510 likesLike
 

Yes it does.

And what your referencing that you don't understand is a STANDARD HTML LINK. Links to your facebook connect logon page. In this example that link if to the default boonex version of facebook connect.

More information on links. http://w3schools.com/html/html_links.asp

If this does not work for you then it was not applied correctly. HINT. Don't take the line numbers in examples as 100% accurate. Each version of dolphin will vary with the line numbers. Use the section of code as a visual aid to find the EXACT location.

And if your new to dolphin, then you may not be aware that your cache will most likely have to be cleared. Caching should be OFF while you site is being worked on.


Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteAug 12, 2011 13:220 likesLike
 

I know html well, I got it to work now. I forgot to clear cache before that is why it did show up.

 

Thank you for this mod.

QuoteOct 27, 2011 15:480 likesLike
 

what page do i edit this code is it the index.php...... ill check im new to this but great solution

QuoteOct 27, 2011 16:170 likesLike
 

my bad thanks again and good work totally helps

QuoteOct 27, 2011 17:430 likesLike
 

I made the changes to the code and its not working if you can take alook at http://www.razorwear.com/life i would totally appreciate the help if you have 2 mins thanks again

QuoteOct 27, 2011 18:000 likesLike
 

It's not like i am going to be able to tell what was done wrong just by looking at the site.

If the code was put in properly then it will work. If not done properly then it will not work.

HINT: do not use line numbers as a reference. Use the code itself. Line numbers change between dolphin versions, so are unreliable to use as a reference point. For example. $aAuthTypes appears in several locations througout that file, so you must make sure you are at the proper one. Use the rest of the code example i provide as a visual reference.

When done, clear your dolphin cache. I noticed it is turned on. If caching in dolphin is on, then clearing the cache is a must do.

So. Restore the backup you should have made of inc/design.inc.php and try again.



Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteJan 10, 2012 15:560 likesLike
 

Is there possibly a different way this has to be done for 7.0.8?

I've done it a few times now, haven't gone by line numbers, used exactly the code provided by cut and paste, made sure my png is named correctly and in the right file, yet nothing. 

Commenting out the drop down works but I have no indication of a button.  Caches off but still cleared, refreshed the page several times and in several browsers with no luck.

Help!

 

 

QuoteJan 10, 2012 18:110 likesLike
 

Nope. Should work in 7.0.8

Make sure button file is named fbconnectbut.png and must be placed in templates/base/images/


Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteJan 11, 2012 15:540 likesLike
 

Check.  Right name, right location.  I must have done something somewhere else that is affecting this.

QuoteJan 11, 2012 16:030 likesLike
 

I do not know what you did wrong. Code has been tested and works fine.

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteJan 12, 2012 12:170 likesLike
 

I've no question about your code Deano, I am sure it is something I've gotten wrong, just can't figure out what.  Not a big worry, even the mods I have installed don't work correctly and their creators can't explain that either.

I've been thinking of scraping it out and reinstalling the whole site again.

QuoteJan 12, 2012 18:390 likesLike
 

Hi, Deano, How can I put the  facebook connect button on the splash Join page? I have tried to paste code on the root/splash.php but did not show up the facebook connect button all it only showed a question mark "?".  Do you have any clue how I can make it work.

Thanks

QuoteJan 12, 2012 18:461 likesLike
 

No. Each splash page is different. You will need to contact spash page author for help putting a button on it. It is just a image with a hyperlink.

Dolphin Mods - http://www.boonex.com/market/posts/deano92964
QuoteJan 13, 2012 16:010 likesLike
 

Thank you for taking the time to find the error that I made on your free module.

QuoteJan 28, 2012 22:450 likesLike
 

oh my dear Deano, every day you grow up in my eyes Kiss

Qui ne fait pas quand il peut ne fait pas quand il veut.
QuoteJan 28, 2012 23:560 likesLike
 

Hi Deano,

work fine also on D7.0.9, thank for this tip!

I understand why Dolphin use the drop menu for the login, i have also the Yahoo mod. But if i whant to have the Facebook loggin button AND the Yahoo login Button instead of the drop menu, how i can do?

I try to put both line :

$sFormCode = '<div style="text-align: center; margin-top: 8px;"><a href="modules/?r=facebook_connect/login_form"><img border="0" src="' . BX_DOL_URL_ROOT . 'templates/base/images/fbconnectbut.png"></a></div>' . $oForm->getCode();

and

$sFormCode = '<div style="text-align: center; margin-top: 8px;"><a href="modules/?r=yahoo_connect/login_form"><img border="0" src="' . BX_DOL_URL_ROOT . 'templates/base/images/yhconnectbut.png"></a></div>' . $oForm->getCode();

 

But doesn't work...

 

Thank

...