Change register links

Responsive Joomla template for Entertainment and Music purpose with clean and lightweight design.
GK User
Tue Dec 13, 2011 6:18 pm
Hi all, I was hoping someone could point me to the right file and line of code to change the following.

Right now the gk_register module in the top right of the site here: http://demo.gavick.com/joomla16/nov2011/ points to the joomla register in a popup. I would like this not to popup and just link to this area: http://demo.gavick.com/joomla16/nov2011 ... l/register

Also the Login popup - I would like to keep this but again on this popup there is a register button and it opens the k2 registration which again I would like to redirect to here: http://demo.gavick.com/joomla16/nov2011 ... l/register

Any ideas where to make these changes and obviously the user will want to registraiton on jomsocial and not joomla and k2. Thanks in advance.
User avatar
Gold Boarder

GK User
Wed Dec 14, 2011 8:06 am
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&amp;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&amp;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&amp;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&amp;view=register&amp;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&amp;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&amp;view=register&amp;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&amp;view=register&amp;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...
User avatar
Platinum Boarder

GK User
Thu Dec 15, 2011 2:34 am
Hi Norman, is it possible to have / what would be the edits to leave all the same, but point to the K2 registration module?

Looking for a way around the K2 users group issue (when the quickstart registration is implemented, the K2 users' group is not populated)

If all could stay the same with the pop-ups, but just execute different component would be great!
User avatar
Junior Boarder

GK User
Thu Dec 15, 2011 8:53 am
Since K2 v2.5 K2 login is not used anymore and from v2.6 it will be absolute and will be totally removed from K2 extension package. Currently K2 uses K2 user module which is an enhanced version of normal joomla login module and therefore registration links are same as original joomla.

I am afraid you have to manually add your users to your assigned user groups if that is what you wanted to achieve.

See you around...
User avatar
Platinum Boarder


cron