Backup your files and site first.
1. Disable popup for Register Button.
Go to Joomla Admin > Extensions > Module Manager
Find mod_gk_register from list and disable it.
2. Changing codes for register button and adding SEF Support.
Find File: \templates\gk_music\layouts\blocks\logo.php
Find Line: 20 which is below
- Code: Select all
$btn_login_text = ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT');
Add below code after it
- Code: Select all
$usersConfig = JComponentHelper::getParams('com_users');
Find Lines : 46 to 58 which is below
- Code: Select all
<?php if((GK_REGISTER || GK_LOGIN) && !GK_COM_USERS) : ?>
<div id="gkButtons">
<div>
<?php if(GK_LOGIN) : ?>
<a href="<?php echo $this->URLbase(); ?>index.php?option=com_users&view=login" id="btnLogin"><span><?php echo $btn_login_text; ?></span></a>
<?php endif; ?>
<?php if(GK_REGISTER) : ?>
<a href="<?php echo $this->URLbase(); ?>index.php?option=com_users&view=registration" id="btnRegister"><span><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></span></a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
Replace them with below
- Code: Select all
<?php if((GK_REGISTER || GK_LOGIN) && !GK_COM_USERS) : ?>
<div id="gkButtons">
<div>
<?php if(GK_LOGIN) : ?>
<a href=""<?php echo JRoute::_( 'index.php?option=com_users&view=login' ); ?>" id="btnLogin"><span><?php echo $btn_login_text; ?></span></a>
<?php endif; ?>
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<a href="<?php echo JRoute::_( 'index.php?option=com_community&view=register&Itemid=417' ); ?>" id="btnRegister"><span><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></span></a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
3. Editing link in login popup.
Find File: \templates\gk_music\layouts\blocks\tools\login.php
Find Line: 8
Which is below
- Code: Select all
$userID = $user->get('id');
Add below code after it.
- Code: Select all
$usersConfig = JComponentHelper::getParams('com_users');
Find Lines: 16 to 18 which is below
- Code: Select all
<?php if($userID == 0): ?>
<small><?php echo JText::_('TPL_GK_LANG_OR'); ?><a href="<?php echo $this->URLbase(); ?>index.php?option=com_users&view=registration"><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></a></small>
<?php endif; ?>
Replace them with below
- Code: Select all
<?php if($userID == 0): ?>
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<small><?php echo JText::_('TPL_GK_LANG_OR'); ?><a href="<?php echo JRoute::_( 'index.php?option=com_community&view=register&Itemid=417' ); ?>"><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></a></small>
<?php endif; ?>
<?php endif; ?>
As you can see from link "index.php?option=com_community&view=register&Itemid=417" in my test installation itemid=417, this is important as without it on certain pages link becomes community/register etc.
To find your own itemid incase it is wrong go to Main Menu > Jomsocial and see at the end of line item id and replace 417 with your itemid.
See you around...