deano92964
•
Premium
•
5165 posts Quote
•
Aug 12, 2010 11:30
•
11 likes
•
 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 |
delmarcash
•
Advanced
•
65 posts Quote
•
Aug 12, 2010 13:03
•
1 likes
•
 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. |
newton27
•
Advanced
•
2074 posts Quote
•
Aug 12, 2010 14:35
•
0 likes
•
 point for DEANO, I think your mod is fantastic! ☺ |
Darkcloud4491
•
Premium
•
32 posts Quote
•
Aug 23, 2010 06:29
•
0 likes
•
 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 |
deano92964
•
Premium
•
5165 posts Quote
•
Aug 23, 2010 06:33
•
1 likes
•
 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 |
ZedFaces
•
Advanced
•
149 posts Quote
•
Aug 29, 2010 00:22
•
0 likes
•
 Free the Dolphin... |
UFO360
•
Moderator
•
1714 posts Quote
•
Aug 29, 2010 14:28
•
0 likes
•
 I need a Facebook Disconect Button.
LOL Post Reply - if you going to help - No for - bla bla bla bla |
deano92964
•
Premium
•
5165 posts Quote
•
Aug 29, 2010 16:01
•
0 likes
•

I need a Facebook Disconect Button.
LOL
Why?
Dolphin Mods - http://www.boonex.com/market/posts/deano92964 |
UFO360
•
Moderator
•
1714 posts Quote
•
Aug 29, 2010 18:08
•
0 likes
•
 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 |
deano92964
•
Premium
•
5165 posts Quote
•
Aug 29, 2010 18:15
•
0 likes
•
 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 |
UFO360
•
Moderator
•
1714 posts Quote
•
Aug 29, 2010 18:40
•
0 likes
•
 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 |
deano92964
•
Premium
•
5165 posts Quote
•
Aug 29, 2010 18:43
•
1 likes
•
 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 |
nuccca
•
Advanced
•
34 posts Quote
•
Oct 04, 2010 13:39
•
0 likes
•
 |
chronoshift
•
Advanced
•
14 posts Quote
•
Dec 18, 2010 11:52
•
0 likes
•
 |
SkyForum
•
Premium
•
2498 posts Quote
•
Dec 18, 2010 13:50
•
0 likes
•
 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! |
SashaE
•
Administrator
•
2858 posts Quote
•
Dec 20, 2010 02:52
•
0 likes
•

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 |
andreh2jm
•
Advanced
•
6 posts Quote
•
Feb 19, 2011 14:52
•
0 likes
•

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! |
andreh2jm
•
Advanced
•
6 posts Quote
•
Feb 19, 2011 14:53
•
0 likes
•

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! |
JoeWa
•
Advanced
•
602 posts Quote
•
Feb 20, 2011 15:06
•
0 likes
•
 |
saurav121
•
Advanced
•
347 posts Quote
•
Feb 22, 2011 06:00
•
0 likes
•
 is this code working on 7.0.5 ??????????? c'mon improve it more :) |
deano92964
•
Premium
•
5165 posts Quote
•
Feb 22, 2011 07:40
•
0 likes
•
 The line numbers are slightly different, but yes. It works.
Dolphin Mods - http://www.boonex.com/market/posts/deano92964 |
mingle
•
Advanced
•
209 posts Quote
•
Feb 22, 2011 08:34
•
0 likes
•
 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 ? |
deano92964
•
Premium
•
5165 posts Quote
•
Feb 22, 2011 09:16
•
0 likes
•
 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 |
mingle
•
Advanced
•
209 posts Quote
•
Feb 22, 2011 10:37
•
0 likes
•
 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 |
mzronny
•
Advanced
•
12 posts Quote
•
Mar 09, 2011 11:17
•
0 likes
•
 Thanks deano ... you always have what I need. |
DarkWarder
•
Advanced
•
67 posts Quote
•
Mar 13, 2011 06:37
•
0 likes
•
 What line is Dolphin 7.0.5? |
deano92964
•
Premium
•
5165 posts Quote
•
Mar 13, 2011 10:05
•
0 likes
•
 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 |
m8trix18
•
Advanced
•
8 posts Quote
•
Mar 15, 2011 07:29
•
0 likes
•
 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. |
deano92964
•
Premium
•
5165 posts Quote
•
Mar 15, 2011 09:06
•
0 likes
•

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 |
deano92964
•
Premium
•
5165 posts Quote
•
Mar 15, 2011 09:37
•
0 likes
•
 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 |
m8trix18
•
Advanced
•
8 posts Quote
•
Mar 15, 2011 15:59
•
0 likes
•
 Thanks deano92964! That was a great help...fixed in no time. |
thenewglider
•
Advanced
•
7 posts Quote
•
Mar 18, 2011 16:42
•
0 likes
•
 I have the button working but when some new connect they connect with the last person in formation take a look at qchevere.net |
deano92964
•
Premium
•
5165 posts Quote
•
Mar 18, 2011 20:06
•
0 likes
•
 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 |
goldhunter14
•
Starter
•
9 posts Quote
•
Aug 12, 2011 08:40
•
0 likes
•
 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. |
deano92964
•
Premium
•
5165 posts Quote
•
Aug 12, 2011 08:51
•
0 likes
•
 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 |
goldhunter14
•
Starter
•
9 posts Quote
•
Aug 12, 2011 13:22
•
0 likes
•
 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. |
Razor Wear
•
Advanced
•
3 posts Quote
•
Oct 27, 2011 15:48
•
0 likes
•
 what page do i edit this code is it the index.php...... ill check im new to this but great solution |
Razor Wear
•
Advanced
•
3 posts Quote
•
Oct 27, 2011 16:17
•
0 likes
•
 my bad thanks again and good work totally helps |
Razor Wear
•
Advanced
•
3 posts Quote
•
Oct 27, 2011 17:43
•
0 likes
•
 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 |
deano92964
•
Premium
•
5165 posts Quote
•
Oct 27, 2011 18:00
•
0 likes
•
 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 |
Paulflak
•
Advanced
•
23 posts Quote
•
Jan 10, 2012 15:56
•
0 likes
•
 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!
|
deano92964
•
Premium
•
5165 posts Quote
•
Jan 10, 2012 18:11
•
0 likes
•
 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 |
Paulflak
•
Advanced
•
23 posts Quote
•
Jan 11, 2012 15:54
•
0 likes
•
 Check. Right name, right location. I must have done something somewhere else that is affecting this. |
deano92964
•
Premium
•
5165 posts Quote
•
Jan 11, 2012 16:03
•
0 likes
•
 I do not know what you did wrong. Code has been tested and works fine.
Dolphin Mods - http://www.boonex.com/market/posts/deano92964 |
Paulflak
•
Advanced
•
23 posts Quote
•
Jan 12, 2012 12:17
•
0 likes
•
 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. |
BoucheTalk
•
Advanced
•
3 posts Quote
•
Jan 12, 2012 18:39
•
0 likes
•
 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 |
deano92964
•
Premium
•
5165 posts Quote
•
Jan 12, 2012 18:46
•
1 likes
•
 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 |
Paulflak
•
Advanced
•
23 posts Quote
•
Jan 13, 2012 16:01
•
0 likes
•
 Thank you for taking the time to find the error that I made on your free module. |
tuniserv
•
Starter
•
13 posts Quote
•
Jan 28, 2012 22:45
•
0 likes
•
 oh my dear Deano, every day you grow up in my eyes  Qui ne fait pas quand il peut ne fait pas quand il veut. |
stedracu
•
Advanced
•
273 posts Quote
•
Jan 28, 2012 23:56
•
0 likes
•
 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 ... |