欢迎光临
我们一直在努力

如何调用phpcms登陆框模板

用PHPCMS套网站后台时,如果想要在单页面的侧边栏调用登陆框(首页、栏目页、列表页调用方法都一样),做出如下的效果图:

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>

 

在需要调用登陆框的位置引入下面的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>

 

赞(0) 打赏
未经允许不得转载:新起点博客 » 如何调用phpcms登陆框模板


关注公众号『新起点软件管家』

获取最新网络资源及破解软件!
带你玩转各样软件...

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏