The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Nov 26, 2006 3:28 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Aug 18, 2006 9:57 am
Posts: 99
Scott,

I am happy to help, but I've posted the answer here to save (me) some time.

Details concerning my solution discussed here: http://forum.joomla.org/index.php/topic,90742.0.html

We first need to create a conditional module position within the template file. Insert the following code inside the appropriate div or table cell within your template's index.php file:

id == '0') mosLoadModules ( 'GuestOnly', -2 ); ?>

Use the Template Manager to define a 'GuestOnly' position, and then use the Module Manager to set the position of the login module.

At this point the login module disappears after login.

To complete the design, we next add a direct logout link to the usermenu. From the menu editor...


Name:Logout
Link:index.php?option=logout
Access:Registered


As you can see, the solution for my application was ridiculously easy. Enjoy!

- SD

_________________
Science • Education • Programming


Top
 Profile  
 
PostPosted: Wed May 16, 2007 7:53 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Apr 06, 2007 4:59 pm
Posts: 22
I am sorry but I know nothing about HTML so please forgive me. Can you show me exactly where I would place this section of code and how??

Thanks,
James

Code:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_styleswitcher.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--BEGIN SMOOTHGALLERY HEAD CODE-->
<link rel="stylesheet" href="<?php echo $mosConfig_live_site;?>/modules/mod_js_smoothgallery/css/jd.gallery.css" type="text/css" media="screen" charset="utf-8" />
<script src="<?php echo $mosConfig_live_site;?>/modules/mod_js_smoothgallery/mootools.js" type="text/javascript"></script>
<script src="<?php echo $mosConfig_live_site;?>/modules/mod_js_smoothgallery/jd.gallery.js" type="text/javascript"></script>
<!--END SMOOTHGALLERY HEAD CODE-->
<head>
<?php
if ( $my->id ) :
   initEditor();
endif;
mosShowHead();

// *************************************************
// Change this variable blow to switch color-schemes
//
// If you have any issues, check out the forum at
// http://www.rockettheme.com
//
// *************************************************

$default_style = "style1";         // style1 | style2 | style3
$topmenu_name = "topmenu";         // topmenu by default, can be any Joomla menu name
$menu_name = "mainmenu";            // mainmenu by default, can be any Joomla menu name
$menu_type = "splitmenu2";            // splitmenu2 | splitmenu | suckerfish | module
$default_font = "default";      // smaller | default | larger
$show_pathway = "true";            // true | false
$search_text = "keywords...";   // text to use in search box
// *************************************************

require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_styleloader.php");

// menu initialization code
$topnav = false;
$cssmenu = false;
$tabmenu = false;

if ($menu_type=="splitmenu2") :
   require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_splitmenu2.php");
   
   if (isset($topmenu_name)) $tabmenu = rtShowHorizMenu($topmenu_name);
   $topnav = rtShowHorizMenu($menu_name);
   $subnav = rtSubMenu($menu_name, 1);
   $sidenav = rtSubMenu($menu_name, 2);
   $cssmenu = "splitmenu";
elseif ($menu_type=="splitmenu") :
   require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_splitmenu.php");
   if (isset($topmenu_name)) $tabmenu = rtShowHorizMenu($topmenu_name);
   $subnav = rtShowHorizMenu($menu_name);
   $sidenav = rtShowSubMenu($menu_name);
   $cssmenu = "splitmenu";
elseif ($menu_type=="suckerfish") :
   if (isset($topmenu_name)) {
      require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_splitmenu2.php");
      $tabmenu = rtShowHorizMenu($topmenu_name);
   }
   require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_suckerfish.php");
   $cssmenu = "suckerfish";
   $sidenav = false;
endif;

// make sure sidenav is empty
if (strlen($sidenav) < 10) $sidenav = false;

//Are we in edit mode
$editmode = false;
if (  !empty( $_REQUEST['task'])  && $_REQUEST['task'] == 'edit'  ) :
   $editmode = true;
endif;


// *************************************************
?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php if($cssmenu) :?>
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/css/<?php echo $cssmenu; ?>.css" rel="stylesheet" type="text/css" />
<?php endif; ?>
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/litebox/lightbox.css" rel="stylesheet" type="text/css" media="screen" />
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/css/template_css.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/css/<?php echo $tstyle; ?>.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/css/template_ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if lte IE 6]>
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/css/template_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->

<link rel="shortcut icon" href="<?php echo $mosConfig_live_site;?>/images/favicon.ico" />
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/js/prototype.lite.js"></script>
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/js/moo.fx.js"></script>
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/js/litebox-1.0.js"></script>
</head>
<script language="JavaScript" type="text/javascript" src="/templates/your_template/wz_tooltip.js"></script>
<body id="page-bg" class="<?php echo $fontstyle; ?> <?php echo $tstyle; ?> <?php echo $cssmenu; ?>">
   <div id="wrapper">
      <div id="mainbody">
         <div class="shad-1">
            <div class="shad-2">
               <div class="shad-3">
                  <div id="header">
                     <div id="search">
                        <span class="searchtitle"><?php echo _SEARCH_TITLE; ?></span>
                        <form action="index.php?option=com_search&Itemid=5" method="get">
                        <div class="search">
                          <input name="searchword" id="mod_search_searchword" maxlength="20" alt="search" class="inputbox" size="20" value="<?php echo $search_text; ?>" onblur="if(this.value=='') this.value='<?php echo $search_text; ?>';" onfocus="if(this.value=='<?php echo $search_text; ?>') this.value='';" type="text" />
                        </div>
                          <input name="option" value="com_search" type="hidden" />
                          <input name="Itemid" value="5" type="hidden" />
                        </form>
                     </div>
                     <div id="access">
                        <div id="buttons">
                           <a href="<?php echo $thisurl; ?>fontstyle=f-smaller" title="Decrease size" class="small"><span class="button"> </span></a>
                          <a href="<?php echo $thisurl; ?>fontstyle=f-default" title="Default size" class="default"><span class="button"> </span></a>
                           <a href="<?php echo $thisurl; ?>fontstyle=f-larger" title="Increase size" class="large"><span class="button"> </span></a>
                        </div>
                     </div>
                     <div id="tabmenu">
                        <?php echo $tabmenu; ?>
                     </div>
                     <a href="<?php echo $mosConfig_live_site;?>" class="nounder"><img src="<?php echo $mosConfig_live_site;?>/images/blank.png" border="0" alt="" id="logo" /></a>
                     <?php if($menu_type=="splitmenu2" and isset($topnav)) : ?>
                     <div id="nav-main" class="splitmenu2">
                        <?php echo $topnav; ?>
                     </div>
                     <?php else: ?>
                     <div id="nav-main">
                        <?php mosLoadModules('banner', -1); ?>
                     </div>   
                     <?php endif; ?>
                     <div id="nav-sub">
                        <?php if($menu_type == "splitmenu" or $menu_type=="splitmenu2") : ?>
                           <?php echo $subnav; ?>
                        <?php elseif($menu_type == "suckerfish") : ?>
                           <?php mosShowListMenu($menu_name);   ?>
                        <?php else: ?>
                        <?php mosLoadModules('toolbar',-1); ?>
                      <?php endif; ?>
                     </div>
                  </div>

               </div>
               <div id="content-bg">
                  <div class="border-pad border-bottom">
                        <div id="showcase">
                           <div class="clr"></div>
                           <?php if (mosCountModules('user1') or mosCountModules('user2') or mosCountModules('user3')) : ?>
                           <?php $width = (99 / ((mosCountModules('user1')?1:0) + (mosCountModules('user2')?1:0) + (mosCountModules('user3')?1:0))); ?>
                           <?php if(mosCountModules('user1')) : ?>
                           <div class="usermodule" style="width:<?php echo $width; ?>%">
                              <?php mosLoadModules('user1', -2); ?>
                           </div>
                           <?php endif; ?>
                           <?php if(mosCountModules('user2')) : ?>
                           <div class="usermodule" style="width:<?php echo $width; ?>%">
                              <?php mosLoadModules('user2', -2); ?>
                           </div>
                           <?php endif; ?>
                           <?php if(mosCountModules('user3')) : ?>
                           <div class="usermodule" style="width:<?php echo $width; ?>%">
                              <?php mosLoadModules('user3', -2); ?>
                           </div>
                           <?php endif; ?>
                           <?php endif; ?>
                           <div class="clr"></div>
                        </div>
                  </div>
                  <div id="middlecolumn" class="border-pad">
                     <?php $showcolumn = (mosCountModules('left') or $sidenav) ? 1 : 0; ?>
                     <div id="fakecolumn1" class="sc_<?php echo $showcolumn; ?>">
                        <div id="fakecolumn2">
                           <?php if(mosCountModules('left') or $sidenav) : ?>
                           <div id="leftcolumn">
                              <div id="vert-menu">
                                 <?php echo $sidenav; ?>
                              </div>
                              <?php mosLoadModules('left', -2); ?>
                           </div>
                           <?php endif; ?>

                              <div id="align-padding">
                                 <?php if(mosCountModules('inset')) : ?>
                                 <div id="inset">
                                    <?php mosLoadModules('inset', 0); ?>
                                 </div>
                                 <?php endif; ?>
                                 <?php $showcolumn = $editmode ? 0 : mosCountModules('right'); ?>
                                 <?php if(!$editmode and mosCountModules('right')) : ?>
                                 <div id="rightcolumn">
                                    <?php mosLoadModules('right', -3); ?>
                                 </div>
                                 <?php endif; ?>
                                 <div id="componentcolumn" class="sc_<?php echo $showcolumn; ?>">
                                    <div class="padding">
                                    <?php if ($show_pathway == "true") : ?>
                                    <?php mosPathway(); ?>
                                    <?php endif; ?>
                                    <table width=100%>
<tr>
<td>
                                    <?php mosMainbody(); ?>
                                    </td>
</tr>
</table>
                                    </div>
                                    <?php if (mosCountModules('user4') or mosCountModules('user5')) : ?>
                                    <?php $width =(99 / ((mosCountModules('user4')?1:0) + (mosCountModules('user5')?1:0))); ?>
                                    <?php if(mosCountModules('user4')) : ?>
                                    <div class="usermodule" style="width:<?php echo $width;  ?>%">
                                       <?php mosLoadModules('user4', -3); ?>
                                    </div>
                                    <?php endif; ?>
                                    <?php if(mosCountModules('user5')) : ?>
                                    <div class="usermodule" style="width:<?php echo $width; ?>%">
                                       <?php mosLoadModules('user5', -3); ?>
                                    </div>
                                    <?php endif; ?>
                                    <?php endif; ?>
                                 </div>
                              </div>
                              <div class="clr"></div>
                           </div>
                           <div class="clr"></div>
                        </div>
                        <div class="clr"></div>
                        <?php if (mosCountModules('user6') or mosCountModules('user7') or mosCountModules('user8')) : ?>
                        <div id="footer">
                           <?php $width = (99 / ((mosCountModules('user6')?1:0) + (mosCountModules('user7')?1:0) + (mosCountModules('user8')?1:0))); ?>
                           <?php if(mosCountModules('user6')) : ?>
                           <div class="usermodule" style="width:<?php echo $width; ?>%">
                              <?php mosLoadModules('user6', -2); ?>
                           </div>
                           <?php endif; ?>
                           <?php if(mosCountModules('user7')) : ?>
                           <div class="usermodule" style="width:<?php echo $width; ?>%">
                              <?php mosLoadModules('user7', -2); ?>
                           </div>
                           <?php endif; ?>
                           <?php if(mosCountModules('user8')) : ?>
                           <div class="usermodule" style="width:<?php echo $width; ?>%">
                              <?php mosLoadModules('user8', -2); ?>
                           </div>
                           <?php endif; ?>
                           <div class="clr"></div>
                        </div>
                        <?php endif; ?>
                     </div>
                     <div class="clr"></div>
                  </div>
               </div>
            </div>
         </div>
         <div id="bottom">
            <div class="shad-1">
               <div class="shad-2">
                  <a href="http://www.rockettheme.com" title="RocketTheme Joomla Templates Club" class="nounder"><img src="<?php echo $mosConfig_live_site;?>/images/blank.png" border="0" alt="" id="rocket" /></a>
               </div>
            </div>
         </div>
      </div>

   
   
   


<?php mosLoadModules( 'debug', -1 );?>
</body>
</html>



Top
 Profile  
 
PostPosted: Thu Dec 17, 2009 12:55 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 07, 2009 12:32 am
Posts: 5
winuser wrote:
To complete the design, we next add a direct logout link to the usermenu. From the menu editor...


Name:Logout
Link:index.php?option=logout
Access:Registered


Hi SD ... i know this is a really old post and hoping your still around. I am using Joomla1.5 - tried you method for assigning a link to menu item for logout ... however it get taken to some other directory with a 404 error /component/ut/

i set the menu type to External Link? is that correct, or is there something i am missing here

hope you dont mind helping a newbie


Top
 Profile  
 
PostPosted: Thu Dec 17, 2009 1:07 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 07, 2009 12:32 am
Posts: 5
Ok - have discovered the solution through another thread for Joomla 1.5 the external link needs to be the following.

index.php?option=com_user&task=logout&return=Lw

this will logout the user and return them to the home page ...
not my solution - TR2N solution in another thread


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group