登录前
登陆后
百度了下方法,可行:
1、首先找到\phpcms\templates\default\member\mini.html这个文件
2、将其内容修改为
{php if(!HTTP_REFERER || strpos(HTTP_REFERER,'&a=login')) @header("Location: ".$_GET['forward']); } <style> body,html{background:none; padding:0; margin:0} .log{line-height:25px; height:139px; width:178px; float:left; font-size:12px; padding-top:10px; padding-left:5px;} .list { float:left; width:168px; height:30px; line-height:30px; } </style> <body style="background-color:transparent"> <div class="log">{if $_username}{L('hellow')} {get_nickname()}<br> <a href="{APP_PATH}index.php?m=member&siteid={$siteid}" target="_blank">{L('member_center')}</a> <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode($_GET['forward'])}&siteid={$siteid}" target="_top">{L('logout')}</a>{else} <form method="post" action="{APP_PATH}index.php?m=member&c=index&a=login" id="myform" name="myform" target="_top"> <input type="hidden" name="forward" id="forward" value="{if $_GET['forward']}{$_GET['forward']}{else}{HTTP_REFERER}{/if}"> <div class="list">账 号:<input type="text" id="username" name="username" size="15" class="input-text"></div> <div class="list">密 码:<input type="password" id="password" name="password" size="16" class="input-text"></div> <div class="list">验 证:<input type="text" id="code" name="code" size="4" class="input-text">{form::checkcode('code_img', '4', '14', 75, 24)}</div> <div class="list"><input type="submit" name="dosubmit" id="dosubmit" value="{L('login')}"> | <a href="{APP_PATH}index.php?m=member&c=index&a=register&siteid={$siteid}" target="_blank">{L('register')}</a></div> </form> {/if}</div> </body>3、在需要调用登陆框的位置引入下面的js:
<script type="text/javascript">document.write('<iframe src="{APP_PATH}index.php?m=member&c=index&a=mini&forward='+encodeURIComponent(location.href)+'&siteid={get_siteid()}" allowTransparency="true" width="178" height="139" frameborder="0" scrolling="no"></iframe>')</script>你也可以对上面的 mini.html 文件进行修改。当然,如果你修改了模板的名称,就要到对应的模板文件夹里面找这个文件了。