I'd like to display "Connect with" and then some of the networks in my big purple menu at the top of the page. Can you please help me achieve this? It would be great if the mod included it near the board index login, I could just cut the code then and move it where I want it .
Hi, A somewhat hackish way to do that is to find where you want to add the icons (a file). In your case, perhaps index.template.php. First, add the function code below [1] to the file. Then, at the place where you want to display the icons, add oneall_social_login_icons(); The place will be within an existing function, such as: function template_body_above() for the top of the page.
[1] Function code to insert: // OneAll Social Login (https://docs.oneall.com/plugins/)
function oneall_social_login_icons()
{
global $txt, $modSettings, $boardurl;
if (!empty ($modSettings['oasl_api_key']) && !empty ($modSettings['oasl_enabled_providers']))
{
// Extract the chosen providers.
$providers = explode (',', trim ($modSettings['oasl_enabled_providers']));
// Create Random integer to prevent id collision.
$rand = mt_rand (99999, 9999999);
// Separe from the traditional login.
echo '<hr />';
// Display error messages if there are any.
if ( isset ($_REQUEST['oasl_err']))
{
switch ($_REQUEST['oasl_err'])
{
case 'user_does_not_exist':
echo '<p class="error">'.$txt['oasl_user_does_not_exist'].'</p>';
break;
case 'user_require_activation':
echo '<p class="error">'.$txt['oasl_user_require_activation'].'</p>';
break;
case 'user_registration_disabled':
echo '<p class="error">'.$txt['oasl_user_may_not_register'].'</p>';
break;
}
}
if ( ! empty ($modSettings['oasl_settings_login_caption']))
{
echo '
<p style="text-align:left;">
<strong>', $modSettings['oasl_settings_login_caption'], '</strong>
</p>';
}
echo '
<p style="text-align:left;">
<div class="oneall_social_login_providers" id="oneall_social_login_providers_', $rand, '"></div>
<script type="text/javascript">
oneall.api.plugins.social_login.build("oneall_social_login_providers_', $rand, '", {
"providers": [\'', implode ("', '", $providers), '\'],
"callback_uri": \'', $boardurl, '/index.php?action=oasl_callback;oasl_source=login\',
});
</script>
<!-- OneAll.com / Social Login for SMF -->
</p>';
}
}
Answers
A somewhat hackish way to do that is to find where you want to add the icons (a file).
In your case, perhaps index.template.php.
First, add the function code below [1] to the file.
Then, at the place where you want to display the icons, add
oneall_social_login_icons();
The place will be within an existing function, such as: function template_body_above() for the top of the page.[1] Function code to insert:
// OneAll Social Login (https://docs.oneall.com/plugins/) function oneall_social_login_icons() { global $txt, $modSettings, $boardurl; if (!empty ($modSettings['oasl_api_key']) && !empty ($modSettings['oasl_enabled_providers'])) { // Extract the chosen providers. $providers = explode (',', trim ($modSettings['oasl_enabled_providers'])); // Create Random integer to prevent id collision. $rand = mt_rand (99999, 9999999); // Separe from the traditional login. echo '<hr />'; // Display error messages if there are any. if ( isset ($_REQUEST['oasl_err'])) { switch ($_REQUEST['oasl_err']) { case 'user_does_not_exist': echo '<p class="error">'.$txt['oasl_user_does_not_exist'].'</p>'; break; case 'user_require_activation': echo '<p class="error">'.$txt['oasl_user_require_activation'].'</p>'; break; case 'user_registration_disabled': echo '<p class="error">'.$txt['oasl_user_may_not_register'].'</p>'; break; } } if ( ! empty ($modSettings['oasl_settings_login_caption'])) { echo ' <p style="text-align:left;"> <strong>', $modSettings['oasl_settings_login_caption'], '</strong> </p>'; } echo ' <p style="text-align:left;"> <div class="oneall_social_login_providers" id="oneall_social_login_providers_', $rand, '"></div> <script type="text/javascript"> oneall.api.plugins.social_login.build("oneall_social_login_providers_', $rand, '", { "providers": [\'', implode ("', '", $providers), '\'], "callback_uri": \'', $boardurl, '/index.php?action=oasl_callback;oasl_source=login\', }); </script> <!-- OneAll.com / Social Login for SMF --> </p>'; } }
I think until I figure out how to display just FB and Twitter I'll put them in my little welcome message, but thank you so so much! That helps a lot!!