1
ruggierigm
custom blocks based on sign in
  • 2004/7/27 23:41

  • ruggierigm

  • Just popping in

  • Posts: 34

  • Since: 2004/6/19


I have tried to add a custom welcome block for when someone comes to my site, but no matter how I add out the block it only shows to registered users. I tried to have a generic welcome block for anonymous users, then a different one for when they signed in but no matter what I do it only adds them out under the registered users blocks.

TIA for any suggestions on what I am doing wrong.

Gabriel

2
Dave_L
Re: custom blocks based on sign in
  • 2004/7/28 0:50

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7



3
sbkiller
Re: custom blocks based on sign in
  • 2004/7/28 0:53

  • sbkiller

  • Just can't stay away

  • Posts: 461

  • Since: 2004/6/9 2


Here, I hope it will help you.

1. Make an html in your theme folder.
(Make sure you file 100% is blank without codes)

theme_blocklogin.html


2. Copy & Paste this into theme_blocklogin.html
<{if $xoops_isuser}>
            <
div style="font:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; text-align:left ">
                 &
nbsp;&nbsp;Hello&nbsp;<a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a>!
            </
div>
    <{else}>               
          <
form onkeyup="highlight(event)" onclick="highlight(event)" style="margin-top: 2px; margin-bottom: 0px" action="<{$xoops_url}>/user.php" method="post"
              &
nbsp;&nbsp;<input class="form" name="uname" onblur="if(this.value=='') this.value='Username';" onfocus="if(this.value=='Username') this.value='';" type="text" value="Username" size="10" /> 
              <
input class="form" onblur="if(this.value=='') this.value='Password';" onfocus="if(this.value=='Password') this.value='';" value="Password" name="pass" type="password" size="10" /> 
              <
input type="hidden" name="op" value="login" /> 
              <
input class="button" name="submit" type="submit" value="Login" /> 
          </
form
<{/if}>


3. Make another blank html in your theme folder

theme_blockjoin.html

4. Put this in
<{if $xoops_isuser}>
            <
div style="font:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; ">
                 <
a href="<{$xoops_url}>/user.php?op=logout">Logout</a>
            </
div>
<{else}> 
            <
form style="margin-top: 2px; margin-bottom: 0px" action="<{$xoops_url}>/register.php" method="post"
              <
input class="button" name="submit" type="submit" value=" Join " /> 
            </
form
<{/if}>


5. Save them

6. Open the theme.html

7. Make a table and cells

8. Use this code for the Login Box
<{include file="themeFOLDER/theme_blocklogin.html"}>


9. Use this for the Join button $ logout
<{include file="themeFOLDER/theme_blockjoin.html"}>


10. Save them and upload it.

Info:

Before user login or guest will only see the login box such as username and pass, login button and the join button.

After user logged in they see the welcome message and the logout button.

Before:
------------------------------
| User | Pass [login] [join] |
------------------------------

After:
------------------------------
| Welcome, username [logout] |
------------------------------

You can make this script into a block mode or into your theme.

You can also customize the welcome msg in the theme_blocklogin.html


The real example:

http://test.maxmzone.com


4
ruggierigm
Re: custom blocks based on sign in
  • 2004/7/29 3:31

  • ruggierigm

  • Just popping in

  • Posts: 34

  • Since: 2004/6/19


Thanks this did what I needed. I feel stupid for not realizing this myself.

Login

Who's Online

252 user(s) are online (165 user(s) are browsing Support Forums)


Members: 0


Guests: 252


more...

Donat-O-Meter

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

Latest GitHub Commits