|
|
发表于 2014-7-10 00:23:27
|
显示全部楼层
如果你想在你的网页模板中加入想默认风格一样的登陆表单。你只需要在所在页面先加入如下代码:
<script language=JavaScript >
rr=Math.random();
document.write("<script src='{$N_path}index_tpl.php?java="+rr+"'><\/script>");
</script>
然后,在你需要的位置加入登陆代码:
<form name=form1 action={$N_path}login.php method=post>
<script>
if(lfjid!=''){
document.write(' ◎ 欢 迎你:<b><font color="#FF0000">'+lfjid+'</font></b> 回来!');
document.write(' <a href="{$N_path}myinfo.php" target=_blank>个人管理中心</a>');
if(newpm=='1'){
document.write('<bgsou nd src={$N_path}images/default/msg.wav loop=1>');
document.write(' <a href="{$N_path}pm.php?job=receivebox" target=_blank><font color=red>你有新的消息</font></a>');
}else{
document.write(' <a href="{$N_path}pm.php?job=write" target=_blank>短信中心</a>');
}
document.write(' <a href="{$N_path}search.php">高级搜索</a>');
document.write(' <a href="{$N_path}login.php?action=quit">安全退出</a>');
}else{
document.write(' <a href="{$N_path}register.php">免费注册</a>');
document.write(' <a href="{$N_path}login.php" target=_blank>会员登录</a>');
document.write(' 用户 名:<input class=button size=12 name=loginuser>');
document.write(' 密码: <input class=button type=password size=12 name=loginpwd>');
document.write(' <input class=button type=submit value=通行证 name=login22>');
document.write('<input type="hidden" name="step" value="2">');
}
</script>
</form>
即可。如果你希望做个导航菜单,加入以下代码:
导航菜单的代码如下:
<a href="{$N_path}" class=headmenu>网站首页</a> {$logo_word}
以上的一些代码你可以研究一下默认模板的代码,直接从默认模板里面取得。是比较简单的。
更为复杂的逻辑符,稍后进行介绍。
另外,你的静态网页里面可能包含css样式表。你可以直接复制放到css.htm文件里面。(你制作的css.htm可以直接复制默认模板的css.htm文件,添加相关css样式就可以了。)
***********************************************************
附:官方风格教程:
一个模板的制作分五步曲
=================== ================第一步(插标签)============
向静态网页中适当的位置,就是你要显示内容的位置,插入标签 $label[abc]
其中abc是举例,只能是任何纯英文或英文+数字,不允许数字+英文,值得注意的是每个标签都不能雷同的
======================第二步(加入头尾标志符)================
用记事本打开静态网页,比如index.htm
在第一行即是头部插入如下代码
<!--
<?
print <<<EOT
-->
再往尾部即是结尾插入如下代码
<!--
EOT
?>
-->
===================================第二步(替换文字)==============
比如原来的图片目录是 mypic
现在把index.htm里边的 mypic/
全部替换成 $usr_style/
====================第四步(定义风格英文标名称)===================
这一步为这个模板定义一下英文标志,比如 mystyle
把当前的图片目录mypic改名为mystyle放在整站images/目录下
在template目录下建一个目录名mystyle
把index.htm放在template/mystyle/目录下
在php168/style/目录里创建一个mystyle.php的文件,就是风格配置文件,
里边插入如代码(其中aritc代表是文章系统专用风格,$stylefile='mystyle';这是风格标志,一定要写,不能搞错)
<?
$stylefile='mystyle';
$stylename='示例模板';
$style_web='artic';
?>
好了,保存起来,一个最简单的模板就做好了,然后在整站后台为这个模板显示设置相关参数,
===================================第五步(设置显示参数)=============
进入后台,
风格/模板设置-》模板标签设置
选择你的风格模板,往里边设置参数
要启用,请
系统操作-->主页专用风格:
选出你做的风格设置为主页专用风格
=========================================================== |
|