MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
A2Hosting
Moderators: Moderators
Forum RSS feedReply
User Block in header
AuthorText
Taex
Just arrived
Taex

Posts: 5
Contributes: 9

Gender: _MALE_
Online: No

Languages: Polish
Country: Poland
Date: 18/12/2011 14:31
User Block in header
#post25270
HiSmile

I make my own template and I'd like to have user block in header. I paste this code to header:

code
<?php
    Function ShowUserBlock($showavatar=1) {


        Define('_PMPL_', 'Prywatne Wiadomo&#347;ci');
       
        global $dblink,$visitorInfo,$admin,$user;
       
        if (isUser($user)) {
                $rowuser = $dblink->get_row("SELECT avatar FROM memht_utenti WHERE user='$user'");
                $avatar = outCode($rowuser['avatar']);
               
                echo "<div>"._HI_." <b>$user</b>";
               
                echo "<br/>";
             
               
                if ($showavatar==1) {
                if ($avatar=="") { $avatar = "blank.png"; }
                echo "<img src='images/avatar/$avatar' border='0' title='$user' alt='Avatar' />\n";
                }
               
                echo "<div class='small'><a href='http://memht.pl/pvtmsg.html' title='"._PMPL_."'>"._PMPL_."</a></div>";
               
                $pmnew = $dblink->get_num("SELECT id FROM memht_pvtmsg WHERE recipient='$user' AND new=1");
                if ($pmnew>0) { echo "<div class='small'><a href='pvtmsg.html' title='"._NEWMESSAGES_."'><b>"._NEWMESSAGES_."</b></a>: $pmnew</div>"; }
               
                echo "<br/>";
               
               
                echo "<div class='small'><a href='users_edit.html' title='"._MODIFYPROFILE_."'>"._MODIFYPROFILE_."</a></div>\n";
                echo "<div class='small'><a href='users_logout.html' title='"._LOGOUT_."'>"._LOGOUT_."</a></div>\n";
               
        } else {
               
                $numatp = $dblink->get_num("SELECT ip FROM memht_login_flood WHERE ip='".$visitorInfo['ip']."' AND attempts>=5");
                if ($numatp==0) {
                        echo "<form name='userlogin' method='post' action='index.php?page=users'>\n";
                        echo "<table width='100%' align='center' border='0' class='login2'>\n";
                                echo "<tr><td align='right'><input type='text' name='post_username' class='text'></td></tr>\n";
                                echo "<tr><td align='right'><input type='password' name='post_password' class='text2' ></td></tr>\n";
                                echo "<tr><td><input type='submit' name='Submit' value='Zaloguj'></td><td class='small'><a href='users_register.html' title='"._REGISTER_."'>"._REGISTER_."</a></td></tr>\n";
                                echo "<tr><td> </td><td class='small'><a href='users_lostpassword.html' title='"._LOSTPASS_."'>"._LOSTPASS_."</a></td></tr>";
                        echo "</table>\n";
                        echo "<input type='hidden' name='login' value='true'>";
                        echo "</form>\n";
                } else {
                        echo "<div align='center'><b>"._YOUMUSTWAITTOLOGINAGAIN_."</b></div>\n";
                }
        }
}

ShowUserBlock(1);
?>


And I don't know how can i change background in input username and password. I add to css:

code
.text{
    background-color: #201f1f;
    color: white;
    border: none;
}


but i doesn't work. It's work when I delete name="post_username" but then if i click login button it move me to page=users (index.php?page=users).

---
Sorry for my bad englishSmile
Edited: 18/12/2011 14:36
Delete Edit Quote
 
Taex
Just arrived
Taex

Posts: 5
Contributes: 9

Gender: _MALE_
Online: No

Languages: Polish
Country: Poland
Date: 18/12/2011 17:39
Re: User Block in header
#post25271
Ok I do it Smile
Delete Edit Quote
 
rudykaka
Exalted Member

Posts: 574
Contributes: 677

Gender: _MALE_
Online: No

Country: Espaņa
Languages: English, Espaņol
Version: waiting for 5
Date: 07/01/2012 00:12
Re: User Block in header
#post25295
provide your website link so people can help you!
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

mem

Posts: 7255
Contributes: 4816

Gender: _MALE_
Online: No

Languages: English, Italiano, Македонски, Српски
Date: 15/01/2012 21:37
Re: User Block in header
#post25304
quote
rudykaka:
provide your website link so people can help you!

*
Follow me on twitter if you want to be updated on the MemHT 5 development.
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.233

Username
Password
MemHT Wiki
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo