| 这样就划一了许多,这时你是不是察觉少了点东西?没错,图片没有显视出来。下面我们先将背景图(也就是CSS文件中引入的图片)显现出来。翻开css_append.htm文件,找到一切你引入图片的中央,将途径交流为“{STYLEIMGDIR}”。例如:这里有一句: #footer{padding:1em 0;background:url(images/footer_bg.gif) } 将它改为: #footer{padding:1em 0;background:url({STYLEIMGDIR}/footer_bg.gif) repeat-x top;} {STYLEIMGDIR}实践上是discuz的一个变量,当模板被解释时,就会用一个值来交流这个变量,这个变量的值能够在后台设置。进入后台后点击“界面——> 风格管理”呈现下图:
(图9) 找到你正在制造的test风格,点击“编辑”按钮,呈现下图:
(图10) 看到了吧,当模板被解释时,就会用上面所填的途径来交流这个变量。 好了,往常更新缓存再看一下效果:
(图11) 哈哈,和原来设计的效果图一样了,能否有一种胜利的喜悦?固然,到这里曾经迈出了胜利的一步,但反动尚未胜利,同志仍需努力!往常制造的模版是静态的,也就是说就算你发贴了,里面的内容也不会改动的,以至你点个衔接都会出错的。 下面我们就来让它“动”起来。 一、修正头部文件header.htm 1、 翻开正在制造的模板header.htm文件(以下简称header.htm),以及默许模板templates\default 的header.htm文件(以下简称“默许header.htm”)。 2、 将header.htm文件的标题用 $navtitle $bbname $seotitle 来替代。例如:我这里是:“<title> 搜球论坛 </title>”改后就变成了“<title> $navtitle $bbname $seotitle </title>” 3、 看header.htm里能否有相似“<meta name="keywords" content="" />”这样的语句,有就删除。然后,将默许header.htm里的以下语句: <meta name="keywords" content="{$metakeywords}$seokeywords" /> <meta name="description" content="$metadescription $bbname $seodescription - Discuz! Board" /> <meta name="generator" content="Discuz! $version" /> <meta name="author" content="Discuz! Team and Comsenz UI Team" /> <meta name="copyright" content="2001-2009 Comsenz Inc." /> <meta name="MSSmartTagsPreventParsing" content="True" /> <meta http-equiv="MSThemeCompatible" content="Yes" /> <meta http-equiv="x-ua-compatible" content="ie=7" /> 复制粘贴到header.htm文件相应的位置(注这些对界面没什么影响,但对seo优化有辅佐) 4、 将默许header.htm里的以下语句: <script type="text/javascript">var STYLEID = '{STYLEID}', IMGDIR = '{IMGDIR}', VERHASH = '{VERHASH}', charset = '$charset', discuz_uid = $discuz_uid, cookiedomain = '$cookiedomain', cookiepath = '$cookiepath', attackevasive = '$attackevasive', allowfloatwin = '$allowfloatwin', creditnotice = '{if $creditnotice}$creditnames{/if}', {if in_array(CURSCRIPT, array('viewthread', 'forumdisplay'))}gid = parseInt('$thisgid'){elseif CURSCRIPT == 'index'}gid = parseInt('$gid'){else}gid = 0{/if}, fid = parseInt('$fid'), tid = parseInt('$tid')</script> <script type="text/javascript" src="include/js/common.js?{VERHASH}"></script> 复制粘贴到header.htm文件相应的位置(至于这些有什么作用,自己查一下吧) 5、 将头部的logo“动”起来
(图12) 找到显现logo的中央,我这里是: <div class="logo"><a href="index.php">搜球论坛</a></div> 将“index.php”和“搜球论坛”分别用$indexname和$bbname替代($indexname 是首页文件名的变量,$bbname是论坛称号变量,其它相同的中央都能够用这两个变量作交流,以增加模版的顺应性。) 6、 让登陆状态“动”起来
(图13) <div id="umenu"> <ul> <li> <span class="quicklink_login">欢送回来,<a href="space.php?uid=1" class="noborder">zncai</a>| <span id="loginstatus"><a href="member.php?action=switchstatus" title="我要隐身">在线</a></span>| <a href="logging.php?action=logout&formhash=7edab246">退出</a></span>| <a href="pm.php" id="pm_ntc" target="_blank">短音讯</a> <a id="task_ntc" href="task.php" target="_blank">论坛任务</a>| <a href="http://127.0.0.1/UCenter_Home/space.php?uid=1" target="_blank">空间</a> <a href="memcp.php">个人中心</a>| <a href="admincp.php" target="_blank">系统设置</a> </li> </ul> </div> 上面是我设计的效果图和相应的代码,这是登陆时的显现状态,当然我还希望没登陆的时分这样显现:
(图14) 在默许header.htm文件中找到: <a href="space.php?uid=$discuz_uid" class="noborder">$discuz_userss</a><!--{if $allowinvisible}--><span id="loginstatus"><!--{if !empty($invisible)}--><a href="member.php?action=switchstatus">{lang login_invisible_mode}</a><!--{else}--><a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}">{lang login_normal_mode}</a><!--{/if}--></span><!--{/if}--></cite> <span class="pipe">|</span> <a href="my.php?item=threads{if $forum}&srchfid=$forum[fid]{/if}">{lang my_posts}</a> <!--{if $ucappopen['UCHOME']}--> <a href="{$uchomeurl}/space.php?uid=$discuz_uid" target="_blank">{lang space_short}</a> <!--{elseif $ucappopen['XSPACE']}--> <a href="{$xspaceurl}/?uid-$discuz_uid" target="_blank">{lang space_short}</a> <!--{/if}--> <a href="pm.php" id="pm_ntc"<!--{if $newpm && $_DCOOKIE['pmnum']}--> class="new" title="{lang pm_new}"<!--{/if}--> target="_blank">{lang pm}<!--{if $newpm && $_DCOOKIE['pmnum']}--><span>($_DCOOKIE[pmnum])</span><!--{/if}--></a> <!--{if $taskon}--> <a id="task_ntc" {if $doingtask}href="task.php?item=doing" class="new" title="{lang task_unfinish}"{else}href="task.php"{/if} target="_blank">{lang task}</a> <!--{/if}--> <span class="pipe">|</span> <a href="memcp.php">{lang user_center}</a> <!--{if $discuz_uid && $adminid > 1}--><a href="modcp.php?fid=$fid" target="_blank">{lang modcp}</a><!--{/if}--> <!--{if $discuz_uid && $adminid == 1}--><a href="admincp.php" target="_blank">{lang admincp}</a><!--{/if}--> <a href="logging.php?action=logout&formhash={FORMHASH}">{lang logout}</a> <!--{elseif !empty($_DCOOKIE['loginuser'])}--> <cite><a id="loginuser" class="noborder">$_DCOOKIE['loginuser']</a></cite> <a href="logging.php?action=login">{lang activation}</a> <a href="logging.php?action=logout&formhash={FORMHASH}">{lang logout}</a> <!--{else}--> <a href="$regname" class="noborder">$reglinkname</a> <a href="logging.php?action=login">{lang login}</a> <!--{/if}--> 用这一段代码交流上面红色黑体部份,并在 <div id="umenu"> <ul> <li> 的后面加上这一句:<!--{if $discuz_uid}--> 还是那句话,想知到上面代码细致的意义,只能你自己去查找,我不可能一个一个的来解释。 |
手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )
GMT-8, 2025-12-13 12:11 , Processed in 0.011120 second(s), 17 queries .
Supported by Best Deal Online X3.5
© 2001-2025 Discuz! Team.