Ok folks here is the Mod for Steam Login:
Name: Steam Login Option Mod
What does it do: It allows admin to select weather to show or not to show the steam login link on the login form. This is done by means of selection the option in admin panel - web panel settings - features. If the item is checked the steam signon will show, if it is not checked it will not. And the steam page has been locked down from direct public execution
only while the selection is off.
See the image attached to show you the location of the new item setting.
Be sure you always use ONLY either notepad, progarmmers notepad, or notepad++ to edit code files. Normal word processing software's have hidden codes which will mess up your code files.
Of course the dev of this plugin is welcome to add this to the core production release if they choose.
I have included the zip file with the files you need. Please refer to the files for changes even though i will go over this below in detail.
Also remember that all mods will be removed whenever you update the main plugin and the mods will have to be replaced.
Ok lets go:
Lets do the template files first.
Open
themes/<theme name>/page_admin_settings_features.tpl
Code:
<!-- added for steam login option mod -->
<tr>
<td valign="top"><div class="rowdesc">{help_icon title="Enable Steam Login" message="Check this box, if you want to enable the Steam login button on the login form."}Enable Steam Login</div></td>
<td>
<div align="left">
<input type="checkbox" name="enable_steamlogin" id="enable_steamlogin" />
</div>
<div id="enable_steamlogin.msg" class="badentry"></div>
</td>
</tr>
<!-- end steam login option mod -->
open themes/<theme_name>/page_login.tpl
old code
Code:
<center><a href="steamopenid.php"><img src="images/steamlogin.png"></a></center>
new code
Code:
-{if $steamlogin_show == 1}-
<center><a href="steamopenid.php"><img src="images/steamlogin.png"></a></center>
-{/if}-
open pages/admin.settings.php
3 changes in this file
PHP Code:
//added for steam login option mod
$steamloginopt = (isset($_POST['enable_steamlogin']) && $_POST['enable_steamlogin'] == "on" ? 1 : 0);
// end steam login option mod
you dont have to copy the //NEW CODE that is just for your reference
however do include the //modified comment above your change
PHP Code:
//modified for steam login option mod
//ORIGINAL CODE
(" . (int)$adminrehash . ", 'config.enableadminrehashing')");
//NEW CODE
(" . (int)$adminrehash . ", 'config.enableadminrehashing'),
(" . (int)$steamloginopt . ", 'config.enablesteamlogin')");
now all the way toward the bottom of the file is this last addition
PHP Code:
/* added for steam login option mod */
$('enable_steamlogin').checked = <?php echo $GLOBALS['config']['config.enablesteamlogin']?>;
/* end steam login option mod */
open includes/user-functions.php
PHP Code:
/**
* added for the steam login option mod
* checks the value of the config setting
* called by steamopenid.php
* called by pages/pages.login.php
* @param int 1 or 0
* @return int
*/
function get_steamenabled_conf($value)
{
$settingvalue = "config.enablesteamlogin";
$query = $GLOBALS['db']->GetRow("SELECT `value` FROM `" . DB_PREFIX . "_settings` WHERE `setting` = '$settingvalue'");
$value = intval($query['value']);
return $value;
}
open steamopenid.php
two additions in this file
PHP Code:
// added for steam login option mod
include_once('includes/user-functions.php');
$steam_conf_value = get_steamenabled_conf($confvalue);
if($steam_conf_value > 0)
{
//end steam login option mod
all the way to the bottom of the file
PHP Code:
//added for steam login option mod
//else if the steam config is 0
}else{
header("location: ./");
exit;
}//close else
//end steam login option mod
Database
manual insert into sb_settings
setting = config.enablesteamlogin
value = 1
or run this sql (fill in your db info in the sql
INSERT INTO `YOURDBPREFIX_YOURDBNAME`.`sb_settings` (`setting`, `value`) VALUES ('config.enablesteamlogin', '1');
refresh your cache from admin and your all set, try it out and let me know if you have any issues.
Thanks dave
attached files
features_ss.jpg (shows the new feature item in settings)
steam_signon_mod.zip (modified files)