change bitly and google to buttons for oauth log on

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Dlan
Registered User
Posts: 17
Joined: Tue Apr 17, 2018 1:25 pm

change bitly and google to buttons for oauth log on

Post by Dlan » Sat Apr 28, 2018 9:01 pm

Trying to get this Oauth log on working correctly.

By clearing the cache and restarting my computer, I'm getting something showing up.
Image

Is there some way to change these to an image that would be more helpful to users.

I'm using the style rain_forest

http://ohioeuchre.com/forum/

User avatar
Lumpy Burgertushie
Registered User
Posts: 64485
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: change bitly and google to buttons for oauth log on

Post by Lumpy Burgertushie » Sat Apr 28, 2018 11:01 pm

not sure what you are trying to do.

do you know what bitly is?
it is just a url shortening service. there is no way to login using bitly, that is not what it is.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

Dlan
Registered User
Posts: 17
Joined: Tue Apr 17, 2018 1:25 pm

Re: change bitly and google to buttons for oauth log on

Post by Dlan » Sat Apr 28, 2018 11:21 pm

Yes I know what bitly is.

It is an option in the ACP authentication menu

Here's more info on bitly if you need it

https://dev.bitly.com/authentication.html

I just need a way to add more info or add an image to tell others they can log on by clicking it.

User avatar
Lumpy Burgertushie
Registered User
Posts: 64485
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: change bitly and google to buttons for oauth log on

Post by Lumpy Burgertushie » Sat Apr 28, 2018 11:42 pm

well, look at that. I have never even seen that option. duh.
also, I had no idea that bitly had branched out into this thing. as far as I knew they were still just a url shortening service.


ok, if you want to add an image and/or some text, open login_body_oauth.html
add whatever you need to that file.

upload it back to the rainforest template folder and purge the cache from the admin panel.

by the way, your google button you have there is not working properly.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

Dlan
Registered User
Posts: 17
Joined: Tue Apr 17, 2018 1:25 pm

Re: change bitly and google to buttons for oauth log on

Post by Dlan » Sun Apr 29, 2018 12:35 am

I know the google link is broke. I used the wrong url when I signed up for the oauth id's. Once I get the rest fixed I'lll go back and change that.

I had looked at that file.
I've tried using the info I found here
https://stackoverflow.com/questions/359 ... l-template

Here is the format it suggests

Code: Select all

<div class="content">
    <!-- BEGIN oauth -->
    <dl>
        <dt>&nbsp;</dt>
                <dd><a href="{oauth.REDIRECT_URL}" class="social_login" title="Login with {oauth.SERVICE_NAME}">
                        <!-- IF oauth.SERVICE_NAME=='Facebook' --><img src="{T_THEME_PATH}/images/login_fb.gif" width="238" height="43" alt="facebook">
                        <!-- ELSEIF oauth.SERVICE_NAME=='Google' --><img src="{T_THEME_PATH}/images/login_google.gif" width="238" height="43" alt="google">
                        <!-- ELSE -->{oauth.SERVICE_NAME}
                        <!-- ENDIF -->
                </a></dd>
    </dl>
    <!-- END oauth -->
</div>
I'll be the first to admit my programming skills are limited but I tried every way I know to make it work.
All I could get is some of the text from above to show up.

I've deleted everything now. but it would show something like

Code: Select all

 "google({oauth.SERVICE_NAME}=='Google') echo '<img src="google.png">';"
 "bitly({oauth.SERVICE_NAME}=='Google') echo '<img src="google.png">';"
I've been playing with this for a day and a half.
I allready made images to use for buttons. They match the links above.
I just can't get them to show up

If you could point me in the right direction I'd be greatful

Thanks, Don...

User avatar
Lumpy Burgertushie
Registered User
Posts: 64485
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: change bitly and google to buttons for oauth log on

Post by Lumpy Burgertushie » Sun Apr 29, 2018 1:02 am

ok, open that login_body_oauth.html file in a text editor.
delete everything from that file and replace it with this:

Code: Select all

<div class="content">
<!-- BEGIN oauth -->
<dl>
<dt>&nbsp;</dt>
<dd><a href="{oauth.REDIRECT_URL}" class="social_login" title="Login with {oauth.SERVICE_NAME}">
<!-- IF oauth.SERVICE_NAME=='Facebook' --><img src="{T_THEME_PATH}/images/login_fb.gif" width="238" height="43" alt="facebook">
<!-- ELSEIF oauth.SERVICE_NAME=='Google' --><img src="{T_THEME_PATH}/images/login_google.gif" width="238" height="43" alt="google">
<!-- ELSE -->{oauth.SERVICE_NAME}
<!-- ENDIF -->
</a></dd>
</dl>
<!-- END oauth -->
</div>
save the file, upload it back to the serverr.
purge the cache from the admin panel and refresh your browser. you must do these two things to be able to see the changes.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

User avatar
3Di
Registered User
Posts: 12557
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: change bitly and google to buttons for oauth log on

Post by 3Di » Sun Apr 29, 2018 1:30 am

The bitly OAuth is present and implemented by phpBB since 3.1.xx.
https://www.phpbb.com/support/docs/en/3 ... ral_client

https://area51.phpbb.com/docs/dev/3.1.x ... -providers

So try the appropriated name: bitly IF oauth.SERVICE_NAME=='bitly' etc...

As per the class

Code: Select all

/**
* Bitly OAuth service
*/
class bitly extends \phpbb\auth\provider\oauth\service\base
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Mick
Support Team Member
Support Team Member
Posts: 19368
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff
Contact:

Re: change bitly and google to buttons for oauth log on

Post by Mick » Sun Apr 29, 2018 6:17 am

Dlan wrote:
Sat Apr 28, 2018 9:01 pm
I'm using the style rain_forest
How does this look in the default prosilver? If you’re having issues with a style you should be posting in the dedicated discussion/support area for that style.
Lumpy Burgertushie wrote:
Sat Apr 28, 2018 11:42 pm
as far as I knew they were still just a url shortening service
I only just found out WP was now a “CMS” as well as a blog. It seems “CMS” is a buzz word these days - didn’t we call them menus or listings at one time?
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.
Forza Garibaldi

Dlan
Registered User
Posts: 17
Joined: Tue Apr 17, 2018 1:25 pm

Re: change bitly and google to buttons for oauth log on

Post by Dlan » Sun Apr 29, 2018 2:20 pm

Here is where I'm at;
In the file listed at ohioeuchre.com/forum/slyles/prosilver/template/login_body_oauth.html I've changed it to

Code: Select all

<!-- BEGIN oauth -->
<dl>
<dt>&nbsp;</dt>
<dd><a href="{oauth.REDIRECT_URL}" class="social_login" title="Login with {oauth.SERVICE_NAME}">
<!-- IF oauth.SERVICE_NAME=='bitly' --><img src="{T_THEME_PATH}/images/login_bitly.gif" width="238" height="43" alt="bitly">
<!-- ELSEIF oauth.SERVICE_NAME=='Google' --><img src="{T_THEME_PATH}/images/login_google.gif" width="238" height="43" alt="google">
<!-- ELSE -->{oauth.SERVICE_NAME}
<!-- ENDIF -->
</a></dd>
</dl>
<!-- END oauth -->
</div>


The matching images for buttons are in the folders,
ohioeuchre.com/forum/slyles/prosilver/theme/images
and ohioeuchre.com/forum/slyles/rain_forest/theme/images
I put them in both just to be sure

As bitly is listed in the ACP, shouldn't the files needed for this already be there? Shouldn't it be
the same as google and the others?

I tried using the default style of prosilver and that made no difference. I've purged the cache in the ACP. I've refreshed the browser while holding the shift key. I've tried different browers.

I keep getting the same little buttons with just the names, as shown above.

Can I be the only one that is having this problem? Am I missing something here?

User avatar
Lumpy Burgertushie
Registered User
Posts: 64485
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: change bitly and google to buttons for oauth log on

Post by Lumpy Burgertushie » Sun Apr 29, 2018 6:38 pm

go here:
http://ohioeuchre.com/forum/styles/rain ... google.gif

notice that the image is not there.

make sure the images are in the correct folder and that there are no typos etc.

I did this on my test board and it works just fine even if you leave the boxes empty in the admin panel for google etc.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

Dlan
Registered User
Posts: 17
Joined: Tue Apr 17, 2018 1:25 pm

Re: change bitly and google to buttons for oauth log on

Post by Dlan » Sun Apr 29, 2018 8:52 pm

I got it to work, yea

I had two things wrong.

1)I had a dash instead of an underscore in the file name. OK, yes I do feel like an idiot :oops:

2) SERVICE_NAME=='Bitly' Has to be spelled with a capital B. It looks like Google,Facebook,Twitter are the same.

Robert,
Thanks for your patience and all your help in getting this to work.

Don...

User avatar
Lumpy Burgertushie
Registered User
Posts: 64485
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: change bitly and google to buttons for oauth log on

Post by Lumpy Burgertushie » Mon Apr 30, 2018 12:21 am

good work, you are welcome.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

Dlan
Registered User
Posts: 17
Joined: Tue Apr 17, 2018 1:25 pm

Re: change bitly and google to buttons for oauth log on

Post by Dlan » Mon Apr 30, 2018 2:15 am

OK, So I'm a bit of a show-off

Image

Code: Select all

<div align="center" class="content">
<!-- BEGIN oauth -->
 <span>
 <a href="{oauth.REDIRECT_URL}" class="social_login" title="Login with {oauth.SERVICE_NAME}">
     <!-- IF oauth.SERVICE_NAME=='Bitly' --><img src="{T_THEME_PATH}/images/login_bitly.gif" width="238" height="43" alt="bitly">
</span> <span>
<!-- ELSEIF oauth.SERVICE_NAME=='Google' --><img src="{T_THEME_PATH}/images/login_google.gif" width="238" height="43" alt="google">
<!-- ELSE -->{oauth.SERVICE_NAME}
<!-- ENDIF -->
</a>
</span>
<!-- END oauth -->
</div>
Maybe someone else can use this code and the images.

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: Mick and 3 guests