Module instead of login / registration.

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sat Oct 11, 2014 9:20 pm
Reply with quote
Report this post
I want to insert a module instead of login / registration. How to do it? Now the field completely empty - it looks terrible ...
http://diary.travel/
User avatar
Expert Boarder

teitbite
Sun Oct 12, 2014 7:25 pm
Reply with quote
Report this post
Hi

You need to edit file /layout/default.php and replace login code with a module position. Here You will find more details: https://www.gavick.com/documentation/jo ... -position/
User avatar
Moderator

GK User
Mon Oct 13, 2014 12:41 pm
Reply with quote
Report this post
Hi.
Cant find what I need to replace. Can you help me with this?
file /layout/default.php:
Code: Select all
// No direct access.
defined('_JEXEC') or die;
//
$app = JFactory::getApplication();
$user = JFactory::getUser();
// getting User ID
$userID = $user->get('id');
// getting params
$option = JRequest::getCmd('option', '');
$view = JRequest::getCmd('view', '');
// defines if com_users
define('GK_COM_USERS', $option == 'com_users' && ($view == 'login' || $view == 'registration'));
// other variables
$btn_login_text = ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT');
$tpl_page_suffix = $this->page_suffix != '' ? ' class="'.$this->page_suffix.'"' : '';

?>
<!DOCTYPE html>
<html lang="<?php echo $this->APITPL->language; ?>" <?php echo $tpl_page_suffix; ?>>
<head>
   <?php if($this->browser->get('browser') == 'ie8' || $this->browser->get('browser') == 'ie7' || $this->browser->get('browser') == 'ie6') : ?>
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <?php endif; ?>
    <?php if($this->API->get("chrome_frame_support", '0') == '1' && ($this->browser->get('browser') == 'ie8' || $this->browser->get('browser') == 'ie7' || $this->browser->get('browser') == 'ie6')) : ?>
    <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
    <?php endif; ?>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2.0">
    <jdoc:include type="head" />
    <?php $this->layout->loadBlock('head'); ?>
   <?php $this->layout->loadBlock('cookielaw'); ?>
</head>
<body<?php echo $tpl_page_suffix; ?><?php if($this->browser->get("tablet") == true) echo ' data-tablet="true"'; ?><?php if($this->browser->get("mobile") == true) echo ' data-mobile="true"'; ?><?php $this->layout->generateLayoutWidths(); ?> data-layout="<?php echo $this->API->get('layout_position', 'left'); ?>">   
   <?php if ($this->browser->get('browser') == 'ie7' || $this->browser->get('browser') == 'ie6') : ?>
   <!--[if lte IE 7]>
   <div id="ieToolbar"><div><?php echo JText::_('TPL_GK_LANG_IE_TOOLBAR'); ?></div></div>
   <![endif]-->
   <?php endif; ?>   
   
    <section id="gkPageTop">
       <div class="gkPage">                       
          <?php $this->layout->loadBlock('logo'); ?>
         
          <?php if($this->API->modules('bannertop')) : ?>
          <div id="gkBannerTop">
             <jdoc:include type="modules" name="bannertop" style="<?php echo $this->module_styles['bannertop']; ?>" />
          </div>
          <?php endif; ?>
         
          <?php if(($this->API->get('reg_link') == '1' && $userID == 0) || $this->API->modules('login')) : ?>
          <div id="gkUserArea">
             <?php if($this->API->modules('login')) : ?>
             <a href="<?php echo $this->API->get('login_url', 'index.php?option=com_users&view=login'); ?>" id="gkLogin"><?php echo ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT'); ?></a>
             <?php endif; ?>
             
             <?php if($this->API->get('reg_link') == '1' && $userID == 0) : ?>
             <a href="<?php echo $this->API->get('reg_url', '#'); ?>" id="gkRegister"><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></a>
             <?php endif; ?>
          </div>
          <?php endif; ?>
       </div>
    </section>

   <div id="gkPageContent" class="gkPage">
       <section id="gkContent"<?php if($this->API->get('inset_position', 'right') == 'left') : ?> class="gkColumnLeft"<?php endif; ?>>               
         <div id="gkContentWrap"<?php if($this->API->get('sidebar_position', 'right') == 'left') : ?> class="gkSidebarLeft"<?php endif; ?>>
            <?php if(count($app->getMessageQueue())) : ?>
            <section>
               <jdoc:include type="message" />
            </section>
            <?php endif; ?>
            
            <?php if($this->API->modules('top1')) : ?>
            <section id="gkTop1" class="gkCols3<?php if($this->API->modules('top1') > 1) : ?> gkNoMargin<?php endif; ?>">
               <div>
                  <jdoc:include type="modules" name="top1" style="<?php echo $this->module_styles['top1']; ?>"  modnum="<?php echo $this->API->modules('top1'); ?>" modcol="3" />
               </div>
            </section>
            <?php endif; ?>
            
            <?php if($this->API->modules('top2')) : ?>
            <section id="gkTop2" class="gkCols3<?php if($this->API->modules('top2') > 1) : ?> gkNoMargin<?php endif; ?>">
               <div>
                  <jdoc:include type="modules" name="top2" style="<?php echo $this->module_styles['top2']; ?>" modnum="<?php echo $this->API->modules('top2'); ?>" modcol="3" />
               </div>
            </section>
            <?php endif; ?>
            
            <?php if($this->API->modules('breadcrumb') || $this->getToolsOverride()) : ?>
            <section id="gkBreadcrumb">
               <?php if($this->API->modules('breadcrumb')) : ?>
               <jdoc:include type="modules" name="breadcrumb" style="<?php echo $this->module_styles['breadcrumb']; ?>" />
               <?php endif; ?>
               
               <?php if($this->getToolsOverride()) : ?>
                  <?php $this->layout->loadBlock('tools/tools'); ?>
               <?php endif; ?>
            </section>
            <?php endif; ?>
            
            <?php if($this->API->modules('mainbody_top')) : ?>
            <section id="gkMainbodyTop">
               <jdoc:include type="modules" name="mainbody_top" style="<?php echo $this->module_styles['mainbody_top']; ?>" />
            </section>
            <?php endif; ?>   
            
            <section id="gkMainbody">
               <?php if(($this->layout->isFrontpage() && !$this->API->modules('mainbody')) || !$this->layout->isFrontpage()) : ?>
                  <jdoc:include type="component" />
               <?php else : ?>
                  <jdoc:include type="modules" name="mainbody" style="<?php echo $this->module_styles['mainbody']; ?>" />
               <?php endif; ?>
            </section>
            
            <?php if($this->API->modules('mainbody_bottom')) : ?>
            <section id="gkMainbodyBottom">
               <jdoc:include type="modules" name="mainbody_bottom" style="<?php echo $this->module_styles['mainbody_bottom']; ?>" />
            </section>
            <?php endif; ?>
         </div>
         
         <?php if($this->API->modules('sidebar')) : ?>
         <aside id="gkSidebar"<?php if($this->API->modules('sidebar') == 1) : ?> class="gkOnlyOne"<?php endif; ?>>
            <div>
               <jdoc:include type="modules" name="sidebar" style="<?php echo $this->module_styles['sidebar']; ?>" />
            </div>
         </aside>
         <?php endif; ?>
       </section>
       
       <?php if($this->API->get('show_menu', 1) == '1' || $this->API->modules('inset')) : ?>
       <aside id="gkInset"<?php if($this->API->modules('inset') == 0) : ?> class="gkOnlyMenu"<?php endif; ?><?php if($this->API->modules('inset') == 1) : ?> class="gkOnlyOne"<?php endif; ?>>
          <?php if($this->API->get('show_menu', 1)) : ?>
          <div id="gkMainMenu">
             <?php
                $this->mainmenu->loadMenu($this->API->get('menu_name','mainmenu'));
                 $this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
             ?>   
          </div>
          <?php endif; ?>
       
          <jdoc:include type="modules" name="inset" style="<?php echo $this->module_styles['inset']; ?>" />
       </aside>
       <?php endif; ?>
       
       <!--[if IE 8]>
       <div class="ie8clear"></div>
       <![endif]-->
   </div>
      
   <?php if($this->API->modules('bottom1')) : ?>
   <section id="gkBottom1" class="gkCols6<?php if($this->API->modules('bottom1') > 1) : ?> gkNoMargin<?php endif; ?> gkPage">
      <div>
         <jdoc:include type="modules" name="bottom1" style="<?php echo $this->module_styles['bottom1']; ?>" modnum="<?php echo $this->API->modules('bottom1'); ?>" />
      </div>
   </section>
   <?php endif; ?>
   
    <?php if($this->API->modules('bottom2')) : ?>
    <section id="gkBottom2" class="gkCols6<?php if($this->API->modules('bottom2') > 1) : ?> gkNoMargin<?php endif; ?> gkPage">
       <div>
          <jdoc:include type="modules" name="bottom2" style="<?php echo $this->module_styles['bottom2']; ?>" modnum="<?php echo $this->API->modules('bottom2'); ?>" />
       </div>
    </section>
    <?php endif; ?>
   
    <?php if($this->API->modules('lang')) : ?>
    <section id="gkLang">
       <div class="gkPage">
            <jdoc:include type="modules" name="lang" style="<?php echo $this->module_styles['lang']; ?>" />
         </div>
    </section>
    <?php endif; ?>
   
    <?php $this->layout->loadBlock('footer'); ?>
       
    <?php $this->layout->loadBlock('tools/toolbar'); ?>
         
      <?php $this->layout->loadBlock('social'); ?>
   
   <?php $this->layout->loadBlock('tools/login'); ?>
   <div id="gkPopupOverlay"></div>
      
   <jdoc:include type="modules" name="debug" />
</body>
</html>


P.S. And have no answer for "Bannertop" Oct 11 9:20 PM

Thanks in advance.
User avatar
Expert Boarder

teitbite
Tue Oct 14, 2014 3:29 pm
Reply with quote
Report this post
Hi

What about bannertop ? Sorry I do not understand.

This part is responsible for the userarea element:

Code: Select all
          <?php if(($this->API->get('reg_link') == '1' && $userID == 0) || $this->API->modules('login')) : ?>
          <div id="gkUserArea">
             <?php if($this->API->modules('login')) : ?>
             <a href="<?php echo $this->API->get('login_url', 'index.php?option=com_users&view=login'); ?>" id="gkLogin"><?php echo ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT'); ?></a>
             <?php endif; ?>
             
             <?php if($this->API->get('reg_link') == '1' && $userID == 0) : ?>
             <a href="<?php echo $this->API->get('reg_url', '#'); ?>" id="gkRegister"><?php echo JText::_('TPL_GK_LANG_REGISTER'); ?></a>
             <?php endif; ?>
          </div>
          <?php endif; ?>


use this instead:

Code: Select all
<jdoc:include type="modules" name="userarea" />
User avatar
Moderator

GK User
Tue Oct 14, 2014 9:37 pm
Reply with quote
Report this post
Thank you.

About "Bannertop":
I post a topic named "Bannertop" on Sat Oct 11, 2014 9:20 pm
Still have no answer on it...
User avatar
Expert Boarder

teitbite
Thu Oct 16, 2014 1:52 pm
Reply with quote
Report this post
Hi

Ok. It's not showing in moderator tool. I'll try to find it by Your username. Thanks for letting me know.
User avatar
Moderator

GK User
Tue Oct 21, 2014 11:35 am
Reply with quote
Report this post
Hi.
Teitbite, I've do what you say, BUT after that the width of whole template below logo/bannertop/login module became smaller: width of mainbody, inset and sidebar!
The images become smaller. Modules truncated. Increased the number of rows in the menu... Terrible!
http://diary.travel/
What can I do to fix it? Help please.
User avatar
Expert Boarder

teitbite
Wed Oct 22, 2014 12:24 pm
Reply with quote
Report this post
Hi

I can see that website is still using 1300px. The only thing is that this module is too long and is pushing everything below. Try using this code to position it a little better:

Code: Select all
#gkBannerTop {
    float: right;
    margin: 0;
    padding: 7px 38px 0 0;
    width: 85%;
}

#gkBannerTop a {
    display: inline-block;
    width: 12%;
}
User avatar
Moderator

GK User
Wed Oct 22, 2014 4:39 pm
Reply with quote
Report this post
Hi

No, Teitbite.
You dont understand a problem.

Before I replace userarea element by your code at /layout/default.php, mainbody width was 728px, sidebar was 250px, inset menu was just under the logo with a logo width...

And just when I replace userarea element by your code at /layout/default.php, I get this:

1. Login and registration module was disappear, and bennertop got a width till right side of template.
Its good and I get what I want. Logo/bannertop/login is OK.

2. Padding of inset and sidebar modules on the left and right sides of template was increased by about double (2x )! And the width of inset, mainbody and sidebar was decreased!
And this is very BAD because: Some inset menu items was 1 row and now 2 rows. Google map still 728px and mainbody decreased. Some modules at mainbody and sidebar now displayed incorrectly!

On the image red is shown as it was, and the arrows - which has changed

paddings and decreased.PNG


And another problem: If at /layout/default.php I replace your code and do like it was before - NOTHIN CHANGES! Padding of inset and sidebar modules on the left and right sides of template increased by about double (2x )! And the width of inset, mainbody and sidebar was decreased! Not logo width inset, not 728px mainbody, not 250px sidebar (((((((((((((((((

I cant make back like it was without your help. October 23 is ending my payment sign up and I very hope that you will help me to fix this problem...
[email protected]

Thanks in advance
User avatar
Expert Boarder

teitbite
Fri Oct 24, 2014 8:45 am
Reply with quote
Report this post
Hi

Please use my mail [email protected] . I'll help You to fix this even if Your subscription has run out. Problem is that You have destroyed html structure while making changes to the file. Send me an access to ftp please.
User avatar
Moderator

teitbite
Mon Oct 27, 2014 4:40 pm
Reply with quote
Report this post
Hi

Ok. I've seen Your mail about this being fixed with recovered file. In this case I'm closing this thread.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.