首页 > CMS > PhpCMS > 正文

PhpCms模板风格:模板制作

2024-09-10 07:18:09
字体:
来源:转载
供稿:网友
默认模板存放在 ./templates/default/phpcms/ 目录里。
header.html、index.html、footer.html 三个模板文件。这可是模板的灵魂啊!完整页面模板就是header index footer了.

打开header.html如下:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
  5. <title>{$head[title]}</title>
  6. <meta content="{$head[keywords]}" name="keywords" />
  7. <meta content="{$head[description]}" name="description" />
  8. <base href="{SITE_URL}" />
  9. <link href="favicon.ico" rel="shortcut icon" />
  10. <link href="{SKIN_PATH}{$mod}.css" rel="stylesheet" type="text/css" />
  11. <script language="JavaScript" src="data/config.js"></script>
  12. <script language="JavaScript" src="images/js/jquery.min.js"></script>
  13. <script language="JavaScript" src="images/js/css.js"></script>
  14. <script language="JavaScript" src="images/js/common.js"></script>
  15. <script language="JavaScript" src="images/js/login.js"></script>
  16. <script language="JavaScript" src="images/js/validator.js"></script>
  17. </head>
  18. <body onload="menu_selected('{php echo $catid ? $catid : $mod;}')">
  19. <div id="top">
  20. {if isset($MODULE['search'])}
  21. {php $types = include PHPCMS_ROOT.$MODULE['search']['path'].'include/type.inc.php';}
  22. <div class="f_r">
  23. <form name="site_search" action="{$MODULE[search][url]}" target="_blank">
  24. <input type="hidden" name="type" value="all"/>
  25. <input type="text" name="q" size="20"/>
  26. <select>
  27. <option value="all">全部</option>
  28. {loop $types $k $name}
  29. <option value="{$k}">{$name}</option>
  30. {/loop}
  31. </select>
  32. <input type="submit" name="s" id="button" value="搜索" />
  33. </form>
  34. </div>
  35. {/if}
  36. <div class="f_l">
  37. <div id="div_login" style="display:block">
  38. <form action="{$MODULE[member][url]}login.php" method="post" name="login" onsubmit="return loginSubmit(this, {$PHPCMS[uc]});">
  39. 用户名:<input type="text" name="username" size="12"/>
  40. 密码:<input type="password" name="password" size="12"/>
  41. <input type="submit" name="dosubmit" value="登录" />
  42. <input type="button" name="register" value="注册" onclick="redirect('{$MODULE[member][url]}register.php')"/>
  43. <input type="hidden" name="cookietime" value="0"/>
  44. </form>
  45. </div>
  46. <div id="div_logined" style="display:none">
  47. <span id="logined_username" class="b"></span>,<a href="{$MODULE[member][url]}">会员中心</a> |
  48. <a href="{if $PHPCMS['uc']}{$MODULE[member][url]}logout.php{else}javascript:logout('{$MODULE[member][url]}logout.php?action=ajax');{/if}">退出登录</a>
  49. </div>
  50. </div>
  51. </div>
  52. <div id="head">
  53. <div id="logo">
  54. <a href="{SITE_URL}"><img src="images/logo.gif" alt="{$PHPCMS[sitename]}" /></a>
  55. <a href="{SITE_URL}rss.php" target="_blank"><img src="images/rss.jpg" alt="rss信息聚合" /></a></div>
  56. <div class="ad" id="topbanner"><script language="javascript" src="data/js.php?id=1"></script></div>
  57. </div>
  58. <div id="menu">
  59. <ul>
  60. <li><a href="" id="menu_phpcms"><span>首页</span></a></li>
  61. {tag_一级栏目}
  62. <li><a href="{$MODULE[special][url]}" id="menu_special"><span>专题</span></a></li>
  63. <li><a href="{$MODULE[ask][url]}" id="menu_ask"><span>问吧</span></a></li>
  64. <li><a href="{$MODULE[search][url]}" id="menu_search"><span>搜索</span></a></li>
  65. </ul>
  66. </div>
打开index.html如下:
  1. <!--begin main-->
  2. <div id="main">
  3. <!--begin left-->
  4. <div id="main_l">
  5. <!--begin 焦点图片,新闻-->
  6. ******************************中间部分代码太长 此处省略处理******************************
  7. <!--begin 全站搜索-->
  8. <!--{if isset($MODULE['search'])}-->
  9. <script type="text/javascript">
  10. function set_type(type)
  11. {
  12. $('#type').val(type);
  13. $('#search_tag>span').removeClass('selected');
  14. $('#type_' type).addClass('selected');
  15. }
  16. </script>
  17. <form name="search" action="{$MODULE[search][url]}" target="_blank">
  18. <div class="search_tag_top mar_10">
  19. <p id="search_tag"> <span id="type_all" class="selected" onclick="set_type('all')">全部</span> {php $types = include PHPCMS_ROOT.$MODULE['search']['path'].'include/type.inc.php';}
  20. {loop $types $type $name} <span id="type_{$type}" onclick="set_type('{$type}')">{$name}</span> {/loop} </p>
  21. </div>
  22. <div class="cribox_bdr_1">
  23. <input type="hidden" name="type" value="all" id="type"/>
  24. <input type="text" name="q" size="50"/>
  25. <input type="submit" name="s" id="button" value="搜索" />
  26. </div>
  27. </form>
  28. <div class="cribox_btm"></div>
  29. <!--{/if}-->
  30. ******************************中间部分代码太长 此处省略处理******************************
  31. <!--{if isset($MODULE['link'])}-->
  32. <h4><a href="{$MODULE[link][url]}"><img src="images/more.gif" alt="更多" /></a>友情链接</h4>
  33. <div class="pic_txt_list_1"> {tag_logo链接} </div>
  34. <div class="pic_txt_list_1"> {tag_文字链接} </div>
  35. <!--{/if}-->
  36. </div>
  37. <!--end right-->
  38. </div>
  39. <!--end main-->
打开footer.html如下:
  1. <div id="foot">
  2. <a href="">网站首页</a>{tag_关于我们}<br />
  3. <strong>{$PHPCMS['copyright']}</strong><br />
  4. <a href="http://www.miibeian.gov.cn/" target="_blank">{$PHPCMS[icpno]}</a>
  5. <a href="http://www.phpcms.cn/" class="copyright" target="_blank">Powered by Phpcms 2008</a>
  6. </div>
  7. </body>
  8. </html>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表