1
mmusa
Adding a block under header.
  • 2008/6/15 5:47

  • mmusa

  • Just popping in

  • Posts: 2

  • Since: 2008/6/15


I want to add a small horizontal block under the header and above all else where i can place the login boxes and maybe the search box.

I have done some forums searches and have not found anything similar. Are there themes I am missing that can add this? I could swear I have done or seen this done somewhere few years ago when i was building another site.

Just wanted to check here before for an easy way before I went in and started editing and coding.

2
gediminasbyt
Re: Adding a block under header.

For search box add this inside of your theme. You'd have to add probably a table, unless you use full CSS...

<form class="search" action="<{$xoops_url}>/search.php" method="get">

              <
input class="textbox" type="text" name="query" value="" />
                          <
input type="hidden" name="action" value="results" />
              <
input class="button" type="submit" name="Submit" value="Search" />

        </
form>

3
gediminasbyt
Re: Adding a block under header.

And just noticed you wanted your login box too Well, this should work. You may need to add some images if you do not have them, however at least text should show up. Paste this in theme.html inside of your theme that you use.
<{if $xoops_isuser}>
<
td>Welcome<a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a>
           <{if 
$xoops_isadmin == 1}>
           <
a href="<{$xoops_url}>/admin.php"><img align="middle" src="<{$xoops_url}>/themes/<{$xoops_theme}>/images/admin.gif" alt="Administrators menu" title="Administrators menu" width="22px" height="22px" border="0px" /></a>
           <{/if}>
            <
a href="<{$xoops_url}>/user.php?op=logout"><img align="middle" src="<{$xoops_url}>/themes/<{$xoops_theme}>/images/logout.gif" alt="Logout" title="Logout" width="22px" height="22px" border="0px" /></a>
</
td>
</
div>

<{else}>

<
td id="leftcolumn" >
 <
form style="margin-top: 2px; margin-bottom: 0px" action="<{$xoops_url}>/user.php" method="post"><a>Username</a>
  <
input name="uname" type="text" size="16" title="Enter your username here"  /><a>Password</a>
  <
input name="pass" type="password" size="6" title="Enter your password here" />
  <
input name="submit" type="submit" value="Login" /><br />
  <
input type="hidden" name="op" value="login" />
  <
a href="<{$xoops_url}>/user.php#lost">Lost password?</a>
  <
input type="hidden" name="op" value="login" />
  <
a href="<{$xoops_url}>/register.php">Register now</a>
 </
form>
 <{/if}>

4
stefan88
Re: Adding a block under header.
  • 2008/6/15 6:19

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


here is something similar I use that also shows if the user have new PMs:

<table id="topbar">
        <
tr>
          <
td class="headerlogin">
    <{if 
$xoops_isuser}>

    <{
php}>
    GLOBAL 
$xoopsUser;
    
$pm_handler =& xoops_gethandler('privmessage');
    
$uid $xoopsUser->getVar('uid');
    
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
    
$criteria->add(new Criteria('to_userid'$uid));
    
$msgcount $pm_handler->getCount($criteria);
    
$GLOBALS['xoopsTpl']->assign('msgcount'$msgcount);
    <{/
php}>

    <{if 
$msgcount 0}>
    &
nbsp;<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_on.jpg" alt=You&nbsp;have&nbsp;<{$msgcount}>&nbsp;new&nbsp;message /></a>
    <{else}>
    &
nbsp;<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_off.jpg" alt="You have no new messages" /></a>
    <{/if}>
    &
nbsp;&nbsp;<a href="<{$xoops_url}>/user.php" align="middle"><{$xoops_uname}></a>&nbsp;&nbsp;<a href="<{$xoops_url}>/user.php?op=logout"><img src="<{$xoops_imageurl}>images/exit_small.jpg" alt="EXIT" /></a>
    <{else}>
            <
form action="<{$xoops_url}>/user.php" method="post">
              &
nbsp;<img src="<{$xoops_imageurl}>images/username_small.jpg" alt="Username" />
              <
input name="uname" type="text" value="" size="14" />
              <
img src="<{$xoops_imageurl}>images/password_small.jpg" alt="Password" />
              <
input name="pass" type="password" value="" size="12" />
              <
input name="op" type="hidden" value="login" />
              <
input name="submit" type="submit" value="<{$smarty.const._LOGIN}>" />&nbsp;
            </
form>
    <{/if}></
td>
          <
td class="headercenter">
    <{if 
$xoops_isuser}><{else}>
            <
form action="<{$xoops_url}>/register.php" method="post">
              <
input name="submit" type="submit" value="<{$smarty.const._REGISTER}>" />
            </
form>
    <{/if}></
td>
          <
td class="headersearch">
    <
form action="<{$xoops_url}>/search.php" method="post">&nbsp;&nbsp;
              <
a href="<{$xoops_url}>/search.php"><img src="<{$xoops_imageurl}>images/search_small.jpg" alt="Advanced Search" /></a>
              <
input name="query" type="text" size="15" class="button" />
              <
input name="action" type="hidden" value="results" />
              <
input name="submit" type="submit" value="<{$smarty.const._SEARCH}>" />&nbsp;&nbsp;
            </
form></td>
        </
tr>
      </
table>

you may need to change it here and there to fit your needs
..

5
mmusa
Re: Adding a block under header.
  • 2008/6/15 6:19

  • mmusa

  • Just popping in

  • Posts: 2

  • Since: 2008/6/15


Lot of helpful night owls around. :) Appreciate all the code! Thanks.

6
gediminasbyt
Re: Adding a block under header.

stefan88

hehe, I did not want to go that much in detail I use all kinds of customizations in addition to multilanguage tags, flags etc. I also immediately replace regular messaging with mpmanager therefore links change too.

Good luck mmusa, you have something to work with now.

Login

Who's Online

177 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits