Стилизирана логин форма [phpBB3]

Всякакви модификации за форумната система phpBB.
Потребителски аватар
xvi
Senior Member
Мнения: 513
Регистриран: пет яну 15, 2016 6:20 am
Баланс: Locked

нед фев 21, 2016 1:24 pm

Демо:
Изображение Изображение

CSS:

Код: Трябва да си влязъл в системата, за да можеш да виждаш линковете

*,
*:after,
*:before {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    -o-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

.form-2 {
    /* Size and position */
    width: 340px;
    margin: 60px auto 30px;
    padding: 15px;
    position: relative;

    /* Styles */
    background: #fffaf6;
    border-radius: 4px;
    color: #7e7975;
    box-shadow:
        0 2px 2px rgba(0,0,0,0.2),        
        0 1px 5px rgba(0,0,0,0.2),        
        0 0 0 12px rgba(255,255,255,0.4); 
}

.form-2 h1 {
    font-size: 15px;
    font-weight: bold;
    color: #bdb5aa;
    padding-bottom: 8px;
    border-bottom: 1px solid #EBE6E2;
    text-shadow: 0 2px 0 rgba(255,255,255,0.8);
    box-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.form-2 h1 .log-in,
.form-2 h1 .sign-up {
    display: inline-block;
    text-transform: uppercase;
}

.form-2 h1 .log-in {
    color: #6c6763;
    padding-right: 2px;
}

.form-2 h1 .sign-up {
    color: #ffb347;
    padding-left: 2px;
}

.form-2 .float {
    width: 50%;
    float: left;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,1);
}

.form-2 .float:first-of-type {
    padding-right: 5px;
}

.form-2 .float:last-of-type {
    padding-left: 5px;
}

.form-2 label {
    display: block;
    padding: 0 0 5px 2px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 400;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    font-size: 11px;
}

.form-2 label i {
    margin-right: 5px; /* Gap between icon and text */
    display: inline-block;
    width: 10px;
}

.form-2 input[type=text],
.form-2 input[type=password] {
    font-family: 'Lato', Calibri, Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    display: block;
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
    border: 3px solid #ebe6e2;
    border-radius: 5px;
    -webkit-transition: all 0.3s ease-out;
    -moz-transition: all 0.3s ease-out;
    -ms-transition: all 0.3s ease-out;
    -o-transition: all 0.3s ease-out;
    transition: all 0.3s ease-out;
}

.form-2 input[type=text]:hover,
.form-2 input[type=password]:hover {
    border-color: #CCC;
}

.form-2 label:hover ~ input {
    border-color: #CCC;
}

.form-2 input[type=text]:focus,
.form-2 input[type=password]:focus {
    border-color: #BBB;
    outline: none; /* Remove Chrome's outline */
}


.form-2 input[type=submit],
.form-2 .log-twitter {
    /* Size and position */
    width: 49%;
    height: 38px;
    float: left;
    position: relative;

    /* Styles */
    box-shadow: inset 0 1px rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;

    /* Font styles */
    font-family: 'Lato', Calibri, Arial, sans-serif;
    font-size: 14px;
    line-height: 38px; /* Same as height */
    text-align: center;
    font-weight: bold;
}

.form-2 input[type=submit] {
    margin-left: 1%;
    background: #fbd568; /* Fallback */
    background: -moz-linear-gradient(#fbd568, #ffb347);
    background: -ms-linear-gradient(#fbd568, #ffb347);
    background: -o-linear-gradient(#fbd568, #ffb347);
    background: -webkit-gradient(linear, 0 0, 0 100%, from(#fbd568), to(#ffb347));
    background: -webkit-linear-gradient(#fbd568, #ffb347);
    background: linear-gradient(#fbd568, #ffb347);
    border: 1px solid #f4ab4c;
    color: #996319;
    text-shadow: 0 1px rgba(255,255,255,0.3);
}


.form-2 .log-twitter {
    margin-right: 1%;
    background: #34a5cf; /* Fallback */
    background: -moz-linear-gradient(#34a5cf, #2a8ac4);
    background: -ms-linear-gradient(#34a5cf, #2a8ac4);
    background: -o-linear-gradient(#34a5cf, #2a8ac4);
    background: -webkit-gradient(linear, 0 0, 0 100%, from(#34a5cf), to(#2a8ac4));
    background: -webkit-linear-gradient(#34a5cf, #2a8ac4);
    background: linear-gradient(#34a5cf, #2a8ac4);
    border: 1px solid #2b8bc7;
    color: #ffffff;
    text-shadow: 0 -1px rgba(0,0,0,0.3);
    text-decoration: none;
}

.form-2 input[type=submit]:hover,
.form-2 .log-twitter:hover {
    box-shadow: 
        inset 0 1px rgba(255,255,255,0.3), 
        inset 0 20px 40px rgba(255,255,255,0.15);
}

.form-2 input[type=submit]:active,
.form-2 .log-twitter:active{
    top: 1px;
}

/* Fallback fro broswers that don't support box shadows */
.no-boxshadow .form-2 input[type=submit]:hover {
    background: #ffb347;
}

.no-boxshadow .form-2 .log-twitter:hover {
    background: #2a8ac4;
}

.form-2 p:last-of-type {
    clear: both;    
}

.form-2 .opt {
    text-align: right;
    margin-right: 3px;
}

.form-2 label[for=showPassword] {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 400;
    text-transform: capitalize;
}

.form-2 input[type=checkbox] {
    vertical-align: middle;
    margin: -1px 5px 0 1px;
}
HTML/PHP/JS:

Код: Трябва да си влязъл в системата, за да можеш да виждаш линковете

<!DOCTYPE html>
<html lang="en">
    <head>
      <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
      <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <title>BG-Scripting</title>
        <link rel="stylesheet" type="text/css" href="style1.css" />
        <!--[if lte IE 7]><style>.main{display:none;} .support-note .note-ie{display:block;}</style><![endif]-->
<style>
body {
   background:#d3d3d3;
}
</style>
    </head>
    <body>
     
      
   
         
    


<?php

if ($user->data['user_id'] == ANONYMOUS)
{
echo"

            <form class='form-2' action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login', true, $user->session_id) . "\" method=\"post\">
            <input type=\"hidden\" name=\"mode\" value=\"login\"  />
               <h1><span class='log-in'>Вход</span> или <span class='sign-up'><a style='color:skyblue;text-decoration:none' href='forums/ucp.php?mode=sendpassword'>Забравена парола</a></span></h1>
               <p class='float'>
                  <label for='login'><img src='http://i.imgur.com/k5B0g5Q.gif'/> Потребител</label>
                  <input type='text' name='username' placeholder='Потребител'>
               </p>
               <p class='float'>
                  <label for='password'><img src='http://i.imgur.com/rGKhwT5.png' /> Парола</label>
                  <input type='password' name='password' placeholder='Парола' class='showpassword'>
               </p>
               <p class='clearfix'> 
                  <a href='forums/ucp.php?mode=register' class='log-twitter'>Регистрация</a>    
                  <input type=\"hidden\" name=\"autologin\" value=\"1\" />
                  <input type='submit' name='login' value='Вход'>
                        <input type=\"hidden\" name=\"redirect\"  value=\"../index.$phpEx\" />
               </p>
            </form>??
            
";
}
else {
}
if($user->data['is_registered'])
{
   
$avatar_img = get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], 70, 70);
$date = date("d.m.y h:i:s",$user->data['user_lastvisit']);
echo"
            <form class='form-2' action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id) . "\" method=\"post\">
            
               <h1><span class='log-in'>Успешен вход!</span><br/> Логнат сте като <a href='forum/ucp.php'><span style='color:#".$user->data['user_colour']."'>".$user->data['username']."</span></a></h1>
            
      
   Мнения:  <b>" . $user->data['user_posts'] . "</b>

  Нови ЛС-та:  <b>" . $user->data['user_new_privmsg'] . "</b>

  <span style='float:right;margin-top:-32px;border:1px solid skyblue'>".$avatar_img."</span>
  Последна визита:<br/> <b>$date</b>
               <p class='clearfix'> 
               
                  <input type=\"hidden\" name=\"mode\" value=\"logout\"  />
                  <input type='submit'  name='logout' value='Изход'>
               </p>
            </form>??
";
            


}
else{  
}
?>

      <!-- jQuery if needed -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
      <script type="text/javascript">
         $(function(){
             $(".showpassword").each(function(index,input) {
                 var $input = $(input);
                 $("<p class='opt'/>").append(
                     $("<input type='checkbox' class='showpasswordcheckbox' id='showPassword' />").click(function() {
                         var change = $(this).is(":checked") ? "text" : "password";
                         var rep = $("<input placeholder='Password' type='" + change + "' />")
                             .attr("id", $input.attr("id"))
                             .attr("name", $input.attr("name"))
                             .attr('class', $input.attr('class'))
                             .val($input.val())
                             .insertBefore($input);
                         $input.remove();
                         $input = rep;
                      })
                 ).append($("<label for='showPassword'/>").text("Show password")).insertAfter($input.parent());
             });

             $('#showPassword').click(function(){
               if($("#showPassword").is(":checked")) {
                  $('.icon-lock').addClass('icon-unlock');
                  $('.icon-unlock').removeClass('icon-lock');    
               } else {
                  $('.icon-unlock').addClass('icon-lock');
                  $('.icon-lock').removeClass('icon-unlock');
               }
             });
         });
      </script>   
      
</body>
</html>
Използвани сесии:

Код: Трябва да си влязъл в системата, за да можеш да виждаш линковете

<?php 
define('IN_PHPBB', true); 
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'forum/'; 
$phpEx = substr(strrchr(__FILE__, '.'), 1); 
include($phpbb_root_path . 'common.' . $phpEx); 
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include("$phpbb_root_path/includes/functions_user.php");
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewtopic');

?>
[/b]
Titan

Отговори

Върни се в “Modifications”

  • Информация
  • Кой е на линия

    Потребители, разглеждащи този форум: Няма регистрирани потребители и 0 госта