News:

Wondering if this will always be free?  See why free is better.

Main Menu

Social Login

Started by Claude, OneAll, February 01, 2013, 03:57:31 PM

Previous topic - Next topic

Mick.

News area, you mean the news box up top?


Mick.

The news box used use html but for some reason now it uses bbc.

Add this to where you added the other script above the body closing tag.


<script type="text/javascript">
oneall.api.plugins.social_login.build("social_login_container", {
"providers" :  ["facebook", "twitter"],
  "callback_uri":"INSERT YOUR CALLBACK URI HERE"
});
</script>


(It shouldnt break. I cleaned the code.)

And add this either above or below the news code in the index.template
<div id="social_login_container"></div>

Mick.

Like this:
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '</form>';

        echo '

                 <div id="social_login_container"></div>';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';

echo '
</div>
</div>
<br class="clear" />';



Or like this:
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '</form>';


// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';

        echo '

                 <div id="social_login_container"></div>';

echo '
</div>
</div>
<br class="clear" />';

Mick.

lol..... or try adding this to the news?

[html]<div id="social_login_container"></div>[/html]

ApplianceJunk

Ok, all the above seems to work fine, thanks!

I see too where I had problems with the original code and how you cleaned it up by replacing the ' with " Thanks!

Now that I (you) got it working on my test site I can play around some more with the location in the template before putting in on our main sit.

Thanks again!

Do you or anyone else happen to know how quickly the Social Insights \ Summary page updates on the OneAll.com site?

I keep looking at it after I get a new member to see if it shows anything, but have not seen any stats for today yet.

Mick.

Quote from: ApplianceJunk on May 09, 2013, 11:26:45 AM
Ok, all the above seems to work fine, thanks!

I see too where I had problems with the original code and how you cleaned it up by replacing the ' with " Thanks!

Now that I (you) got it working on my test site I can play around some more with the location in the template before putting in on our main sit.

Thanks again!


Awesome.  Yes, on javascripts that uses ' needs to be replaced with " or put a \ in front of the ' like this \'

ApplianceJunk


ApplianceJunk

Mike, could you share with me where I would place the code so the buttons show up under the login info at the top left of the default theme?

I think it would be ideal for the social login buttons to show if they are guest only, if that makes sense. Unless there is a better idea.

Thanks,

Mick.

Quote from: ApplianceJunk on May 09, 2013, 11:53:31 AM
Mike, could you share with me where I would place the code so the buttons show up under the login info at the top left of the default theme?

I think it would be ideal for the social login buttons to show if they are guest only, if that makes sense. Unless there is a better idea.

Thanks,

above, under or between the:
Welcome, Guest. Please login or register.
Did you miss your activation email?

ApplianceJunk

I was thinking of adding the text...

QuoteOr simply login or register using your social network account

and under that adding the buttons as I tried to show in the attachment.

Thanks,


Mick.

Hmmm, it seems to me that Claude has them to display in the center when you want it float:left;

Im thinking you may have to add a css to the code and see if it moves?

Maybe something like this:

.slogin {
     float: left;
}


...and wrap the code with:

<div class="slogin">the code</div>


Not sure tho.

ApplianceJunk

#132
I should note that in the attachment I posted the social login icons are still in my News Area.

I just left theme there so I could point where I wanted them well I made the attachment.

So at this point I need to be pointed where in the index.template.php file I even go to add them under the login area like I'm looking to do.

Thanks,

Mick.


Mick.

After this:
<div class="info">', $txt['quick_login_dec'], '</div>

ApplianceJunk

Awesome!

One last question...

In this code.

<script type="text/javascript">
oneall.api.plugins.social_login.build("social_login_container", {
"providers" :  ["facebook", "twitter", "google", "yahoo", "openid"],
  "callback_uri":"INSERT YOUR CALLBACK URI HERE"
});
</script>


Do I need to enter my CALLBACK URI?
Where do I get my callback URI?

Thanks a million

Mick.

Quote from: ApplianceJunk on May 09, 2013, 01:16:57 PM
Awesome!

One last question...

In this code.

<script type="text/javascript">
oneall.api.plugins.social_login.build("social_login_container", {
"providers" :  ["facebook", "twitter", "google", "yahoo", "openid"],
  "callback_uri":"INSERT YOUR CALLBACK URI HERE"
});
</script>


Do I need to enter my CALLBACK URI?
Where do I get my callback URI?

Thanks a million

That i dont know man since i dont use those custom codes.

ApplianceJunk

I must not have something right yet, as when I try and login using the twitter button I placed under the login area I get redirect to a blank white page that has this one it.

Quote
{"response":{"request":{"date":"Thu, 09 May 2013 19:33:45 +0200","resource":"\/socialize\/INSERT%20YOUR%20CALLBACK%20URI%20HERE","status":{"flag":"error","code":404,"info":"The specified resource does not exist: http:\/\/docs.oneall.com\/"}}}}

Thought I was so close, lol...

Mick.

Looks like you do need the call back id

ApplianceJunk

#139
Ok, I used the Social Login Wizard steps at OneAll.com

I put this code where I want the social login buttons to display under the user login at the top left of the SMF default theme.



echo'
<div id="social_login_container"></div>

<script type="text/javascript">
oneall.api.plugins.social_login.build("social_login_container", {
  "providers" :  ["facebook", "twitter", "google", "yahoo", "openid"],
  "callback_uri": "http://appliancejunk.com"
});
</script>';


I put it just after...


<div class="info">', $txt['quick_login_dec'], '</div>';


Then I put this code it gives me just before the closing head tag as it says to do.


<script type="text/javascript">
var oneall_js_protocol = (("https:" == document.location.protocol) ? "https" : "http");
document.write(unescape("%3Cscript src="" + oneall_js_protocol + "://appliancejunk.api.oneall.com/socialize/library.js" type="text/javascript"%3E%3C/script%3E"));
</script>


Everything looks good on the site, like I want it to and it seems as if it's going to work as I can click the facebook or twitter and I get the message that I'm logging in using twitter, but then it just takes me back to our site without being logged in.

Edited to add: The social buttons on the regular login and register pages seem to work perfect.
Just not the ones I put in the location under the user login area.


Advertisement: