| Re: username in the home page |
| by Mithrandir on 2003/11/25 17:49:41 We generally don't advise people to edit the compiled templates, but instead change the templates through the template editor in the admin menu |
| Re: username in the home page |
| by alfredxz on 2003/11/25 17:32:26 Thanks a lot! It worked with: <?php echo $this->_tpl_vars['xoops_uname']; ?> |
| Re: username in the home page |
| by hsalazar on 2003/11/25 6:29:45 alfredxz: This code will suffice (of course, add the necessary code for the login form): <{if !$xoops_isuser}> <!-- put here the login form --> <{else}> Hello, <{$xoops_uname}> <{/if}> This code goes in the theme.html file, most probably in the header, but you can in fact use the variable anywhere. Now, if you NEED this to go in a block, please read https://xoops.org/modules/newbb/viewtopic.php?topic_id=12057&forum=14#forumpost48232 Cheers. |
| username in the home page |
| by alfredxz on 2003/11/13 15:55:01 hi, i want to include in my home page a short "Welcome back, [username]" with the username that varies depending on which user logs in. so i edited [theme]%2Ftheme.html and created a login box: <?php if (!$xoops_isuser): ?> <form action="<?php echo $this->_tpl_vars['xoops_url']; ?> /user.php" method="post"><b>User: </b> <input type='text' name='uname' value='username' size=7 maxlenght=20 onMouseOver="this.focus();" onFocus="if(this.value == 'username') this.value = '';"> <b>Pass: </b> <input type="password" size="7" maxlenght=15 name="pass"/> <input type="hidden" name="op" value="login" /> <input type="submit" value="login" /> <a href="<?php echo $this->_tpl_vars['xoops_url']; ?> /register.php"><b> Join</b></a> </form> <?php else: ?> Welcome back, <b><?php echo $this->_tpl_vars['user_realname']; ?> <?php endif; ?> Unfortunately it only works while browsing the User Page, the other pages give a "Welcome back,." with no username. What function shall i include to make it work??? |