1
incama
Login block merged into theme.html
  • 2004/9/8 8:40

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


I want to merge the login block into the theme.html.
I have created two files:
theme_blocklogin.html
<{if $xoops_isuser}>
<
div style="font:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; text-align: right; padding-right: 55px; padding-top: 10px;">
&
nbsp;&nbsp;Hello&nbsp;<a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a><img src="<{$xoops_upload_url}><{$user.avatar}>"><br />!
</
div>    
<{else}>
<
form style="margin-top: 4px; margin-bottom: 0px" action="<{$xoops_url}>/user.php" method="post">
  
Username<br>
  <
input style="border: 1px solid #73807F;" name="uname" type="text" size="12" />
  <
br>
  
Password<br>
  <
input style="border: 1px solid #73807F;" name="pass" type="password" size="12" />
  <
br>
  <
input type="hidden" name="op" value="login" /> 
              <
input class="button" style="border: 1px solid #73807F;" name="submit" type="submit" value="Login" /> 
          </
form
<{/if}>


and
theme_blockjoin.html
<{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}> 
<
div style="font:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; "><a href="<{$xoops_url}>/user.php#lost">Lost Password?</a>        
<
a href="<{$xoops_url}>/register.php">Join us</a>
</
div>
<{/if}>

Both files are linked into the theme.html.
All works perfect I must say (thanks to the person provide my with this hack, don't know your name though)

What I really want is when people login not only the name is displayed (which works) but also the avatar!
As you can see in the first file I've made a attempt in doing this (attempt number 100). But somehow it doesn't work. Does anyone have an answer??

2
karuna
Re: Login block merged into theme.html
  • 2004/9/8 9:02

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


hi it's somehow like this ~

https://xoops.org/modules/newbb/viewtopic.php?topic_id=18808&forum=20

maybe you can assign this smarty variable in header.php

3
incama
Re: Login block merged into theme.html
  • 2004/9/8 10:38

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


That didn't do the job:(,.,.,.

After altering some files, I'm a step further now. I've managed to get the avatar, but it's only displayed when I'm in the userinfo section. Do I have to include something else in my theme.html???

4
sbkiller
Re: Login block merged into theme.html
  • 2004/9/8 12:58

  • sbkiller

  • Just can't stay away

  • Posts: 461

  • Since: 2004/6/9 2


O, this is exatly mine one, I think you just took it or maybe not.

O well it's all good this is a open source Xoops.

You have the same file name and the script looks similar.

5
incama
Re: Login block merged into theme.html
  • 2004/9/8 13:09

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


Then finally I may thank you in person

Btw, the avatar problem is solved, follow this link.

the only thing is, as a theme designer, i can't ask people who are using my theme, that they must edit their header.php file..is there another option which could be triggert via the theme.html, so the avatar shows up?

and sbkiller, thank you

greetings

6
karuna
Re: Login block merged into theme.html
  • 2004/9/8 13:24

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


hi maybe you can use
<{php}>
(php script to get avatar)
<{/php}> in theme.html

7
incama
Re: Login block merged into theme.html
  • 2004/9/8 16:41

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


Nope, I'm getting the one after the other parse error, and ending with the message:
Call to a member function on a non-object.

Here ends my php knowledge

8
incama
Re: Login block merged into theme.html
  • 2004/9/8 17:03

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


Ok,,because it still bothers me I turn to the php guru's...
Could some one merge these two code's?

theme.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!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" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="Keywords" content="<{$xoops_meta_keywords}>" />
<meta name="Description" content="<{$xoops_meta_description}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="XOOPS" />
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />
<script type="text/javascript">
<!--
<{$xoops_js}>
//-->
</script>
<style type="text/css">
</style>
</head>

<body>

<div align="center">
  <table width="650" height="150" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="right" valign="top" id="login" background="<{$xoops_imageurl}>images/logo.jpg">
            <{include file="flower/theme_blocklogin.html"}>
          <{include file="flower/theme_blockjoin.html"}>
                              </td>
    </tr>
  </table>
  <table width="650" border="0" cellpadding="0" cellspacing="0" background="<{$xoops_imageurl}>images/newsbg.gif" bgcolor="#FFFFFF">
    <tr>
      <td><table width="650" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="518" valign="top"><table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td id="content" valign="top"><{$xoops_contents}> </td>
                </tr>
              </table></td>
            <td width="132" valign="top"> 
              <div ><{foreach item=block from=$xoops_lblocks}></div>
              <div align="left"> 
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr> 
                    <td class="blockTitleright"><{$block.title}></td>
                  </tr>
                  <tr> 
                    <td class="blockContentright"><{$block.content}></td>
                  </tr>
                  <tr> 
                    <td class="blockFoot"></td>
                  </tr>
                </table>
                <{/foreach}> </div> </td>
          </tr>
        </table></td>
    </tr>
  </table>
<table width="650" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="50" background="<{$xoops_imageurl}>images/newsunder.gif">&nbsp;</td>
    </tr>
  </table>
</div>
</body>
</html>


with this heaper.php hack
if (is_object($xoopsUser)) {
    
$NeoPlug_avatar $xoopsUser->getVar('user_avatar');
    if (
file_exists(XOOPS_ROOT_PATH.'/uploads/'.$NeoPlug_avatar)) { 
        
$NeoPlug_avatar '<img
        src="'
.XOOPS_URL.'/uploads/'.$NeoPlug_avatar.'" alt="avatar" />';
    } else {
        
$NeoPlug_avatar '';
    }
} else {
    
$NeoPlug_avatar '<img src="'.XOOPS_URL.'/upload/guest.gif" alt="avatar" />';
}

$xoopsTpl->assign('NeoPlug_avatar'$NeoPlug_avatar);


I have tried different ways, don't even know what I have done.

So pleazzze,.help me

9
sbkiller
Re: Login block merged into theme.html
  • 2004/9/8 17:21

  • sbkiller

  • Just can't stay away

  • Posts: 461

  • Since: 2004/6/9 2


I could but you have to tell me where you want the things to be appear in the theme.

10
incama
Re: Login block merged into theme.html
  • 2004/9/8 17:34

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


Here's my favorite hack maker

Well before the <{include file="flower/theme_blocklogin.html"}>
line I guess,,,,,,
Already tried in different ways, with no luck, it's a hack which normally sit's in the header.php, but I want to distibute this theme to the community without user having to alter their heaper.php file.
It's a remake of my Flower theme
If you are curious you could have a peek here!

Thanks in advanced (again)

Incama

Login

Who's Online

168 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 168


more...

Donat-O-Meter

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

Latest GitHub Commits