2013-07-19 68 views
1

我知道这不是一个正确的问题,但我不知道要去哪里,火箭论坛不会接受客人: 我跟着教程了解如何添加一个弹出式登录,除了当我单击登录按钮时,一切都可以工作,然后什么也没有发生,它只在URL上显示一个“#”,login.php包含这个语法代码:href =“#” 我可能错过了一些东西,但我不知道是什么?Popup登录Joomla Rockettheme

代码的login.php

<?php 
defined('JPATH_BASE') or die(); 
gantry_import('core.gantryfeature'); 
class GantryFeatureLogin extends GantryFeature { 
    var $_feature_name = 'login'; 
    function render($position="") { 
     ob_start(); 
     $user =& JFactory::getUser(); 
     ?> 
     <div class="rt-block"> 
      <div class="rt-popupmodule-button"> 
      <?php if ($user->guest) : ?> 
       <a href="#" class="buttontext button" rel="rokbox[355 385][module=rt-popuplogin]"> 
        <span class="desc"><?php echo $this->get('text'); ?></span> 
       </a> 
      <?php else : ?> 
       <a href="#" class="buttontext button" rel="rokbox[355 385][module=rt-popuplogin]"> 
        <span class="desc"><?php echo $this->get('logouttext'); ?> <?php echo JText::sprintf($user->get('username')); ?></span> 
       </a> 
      <?php endif; ?> 
      </div> 
     </div> 
     <?php 
     return ob_get_clean(); 
    } 
} 

<?php 

文档:http://gantry-framework.org/documentation/joomla/tutorials/creating_popup_login.md

回答

1

我知道这是一个老问题,但问题仍然相关,因为许多RocketTheme模板包含一个带有旧语法的登录按钮。下面是相同的代码上面,但随着新RokBox 2语法的链接(<a href="#" class="readon buttontext" rel="rokbox[385 160][module=rt-popuplogin]">

的RokBox兼容性设置可能给您的网站的性能损失。

<?php 
defined('JPATH_BASE') or die(); 
gantry_import('core.gantryfeature'); 
class GantryFeatureLogin extends GantryFeature { 
    var $_feature_name = 'login'; 
    function render($position="") { 
     ob_start(); 
     $user =& JFactory::getUser(); 
     ?> 
     <div class="rt-block"> 
      <div class="rt-popupmodule-button"> 
      <?php if ($user->guest) : ?> 
       <a href="#" class="buttontext button" data-rokbox data-rokbox-element="#rt-popuplogin" data-rokbox-size="385 160"> 
        <span class="desc"><?php echo $this->get('text'); ?></span> 
       </a> 
      <?php else : ?> 
       <a href="#" class="buttontext button" data-rokbox data-rokbox-element="#rt-popuplogin" data-rokbox-size="385 160"> 
        <span class="desc"><?php echo $this->get('logouttext'); ?> <?php echo JText::sprintf($user->get('username')); ?></span> 
       </a> 
      <?php endif; ?> 
      </div> 
     </div> 
     <?php 
     return ob_get_clean(); 
    } 
}