地摊革命 发表于 2009-9-15 19:24:32

全贴字体大小调整 FOR PW7.3.2

template/wind/read.htm
文件开头
复制代码 <!--<?php print <<<EOT --> <style type="text/css">

替换为:
复制代码 <!--<?php $tpc_content_size = isset($_COOKIE['fontSize']) ? $_COOKIE['fontSize'] : 14; print <<<EOT --> <!--全贴字号JS--> <SCRIPT language=JavaScript> _defaultFontSize = 16; function setFontSize(cmd) { SC = document.body.getElementsByTagName("DIV"); if (cmd=="+"||cmd=="-") {     for (var i=0; i<SC.length; i++) {       if (SC.className == "tpc_content1" || SC.className == "big" || SC.className == "middle" || SC.className == "small") {           size = SC.style.fontSize.length==0 ? _defaultFontSize : parseInt(SC.style.fontSize.replace(/[^0-9]/g,''));           break;       }     }     size += cmd=="+"? 1 : -1; } else {     size = cmd=="big" ? 20 : (cmd=="middle" ? 16 : 12); } for (var i=0; i<SC.length; i++) {     if (SC.className == "tpc_content1" || SC.className == "big" || SC.className == "middle" || SC.className == "small") {       SC.style.fontSize = size+"px";     } } var expdate = new Date(); expdate.setTime(expdate.getTime() + (3600*1000*24*365)); document.cookie = "fontSize=" + size + "; expires=" + expdate.toGMTString() + "; path=/"; } </script> <!--全贴字号JSEND--> <style type="text/css"> .tpc_content1{font-size:{$tpc_content_size}px;font-family:Arial;padding:0 2% 0 0.5%;margin:0 0 2%}

找:
复制代码 <td class="tar h"><div class="fr w">

下加:
复制代码 <!--全贴字体大小--> 【全帖:<input type="button" class="s3" style="background-color:transparent;border:0px;cursor:pointer;width:16px;height:16px;padding:0px;*margin-bottom:-4px;font-size:14px;font-weight:bold;" onclick="setFontSize('+');" onmousewheel="setFontSize('+');" title="单击或滚动鼠轮(向上)放大字体" value="+"> <b style="cursor:pointer" onclick="setFontSize('big')" title="放大字体(20px)">大</b> <b style="cursor:pointer" onclick="setFontSize('middle')" title="默认字体大小(16px)">中</b> <b style="cursor:pointer" onclick="setFontSize('small')" title="缩小字体(12px)">小</b> <input type="button" class="s3" style="background-color:transparent;border:0px;cursor:pointer;width:16px;height:16px;padding:0px;*margin-bottom:-4px;font-size:14px;font-weight:bold;" onclick="setFontSize('-')" onmousewheel="setFontSize('-');" title="单击或滚动鼠轮(向上)缩小字体" value="-"> 】 <!--全贴字体大小-->

找:
复制代码 <div class="f14" id="read_$read">$read</div>

替换为:
复制代码 <div class="tpc_content1" id="read_$read">$read</div>

地摊革命 发表于 2009-9-15 19:29:25

教程用处:自由改变read页面帖子内容字体大小,楼层之间不互影响 [应该比较适合在线小说型论坛]
对于版本:pw6.0以及以后的版本(当然到目前为止~)
文档作者:plaodj
编写日期:2008年07月02日

昨晚看到有人找修改read页面帖子内容字体大小那默认大中小的问题,现在献丑一下吧。之前好像发过,但不是以这样形式发 应该沉到大海底了,现在默认安装的论坛read页面帖子那处改字体大小的太狭小了,最大也还是那么小,................不说废话了

更改template\\wind文件夹里面的read.htm以6.3为例
查找 复制代码 <span class="fr" style="margin:0 0 0 1em"><a style="cursor:pointer" onclick="fontsize('small','$read')">小</a> <a style="cursor:pointer" onclick="fontsize('middle','$read')">中</a> <a style="cursor:pointer" onclick="fontsize('big','$read')">大</a></span>
而6.0的貌似是 复制代码 <span class="fr"><a style="cursor:pointer" onclick="fontsize('small','$read')">小</a> <a style="cursor:pointer" onclick="fontsize('middle','$read')">中</a> <a style="cursor:pointer" onclick="fontsize('big','$read')">大</a></span>其间少了style="margin:0 0 0 1em"

找到之后 替换为 复制代码 <span class="fr" style="margin:0 0 0 1em"><select style="vertical-align: middle;" onchange="javascript:document.getElementById('read_$read').style.fontSize=this.value;"> <option value="9pt">字号</option> <option value="9pt">9</option> <option value="10pt">10</option> <option value="11pt">11</option> <option value="12pt">12</option> <option value="14pt">14</option> <option value="15pt">15</option> <option value="16pt">16</option> <option value="18pt">18</option> <option value="20pt">20</option> <option value="25pt">25</option> <option value="30pt">30</option> <option value="50pt">50</option> </select></span>当然里面的你可以做些适合你的修改上传就OK了刷新下论坛 OK~

效果图如下:

http://img.img1001.net/attachout/thumb/Mon_0807/56_445972_5b0836e6ac981ee.jpg
这是不选择字体,打开read.htm页面的画面更平常一样~


http://img.img1001.net/attachout/thumb/Mon_0807/56_445972_a0fe16c83ec940f.jpg
这是选择字号大小为 9 pt 的


http://img.img1001.net/attachout/thumb/Mon_0807/56_445972_9b4dcd812b07085.jpg
这是选择字号大小为50pt

地摊革命 发表于 2009-9-15 19:53:20

后台 风格模板 下面这段代码
.tpc_content{font-size:14px;line-height:24px;font-family:Arial;padding:0 2% 0 0.5%;margin:0 0 2%}
其中size:14px就是字的大小 height:24px;是我自己加上去的 是行间距

地摊革命 发表于 2009-9-15 19:55:01

body{font-family:Tahoma;font-size:12px;background:#fff; color:#333}
后台风格编辑下面的css里的font-size:12px;自己调整数字

地摊革命 发表于 2009-9-15 20:24:38

<style type="text/css">
body{font-family:Tahoma;font-size:12px;background:$bgcolor;}
h1,h2,h3,h4,h5,h6,form,body{padding:0;margin:0}
td,th,div{word-break:break-all;word-wrap:break-word}
table{empty-cells:show;}
img{border:0}
h3,h2{display:inline;font-size:1.0em;}
h3{font-weight:normal}
h2 a,h3 a{color:#000}
h4{margin:20px 0 10px;font-size:1.1em}
textarea,input,select{font:12px Arial;padding:1px 3px 0 3px;vertical-align:middle;margin-bottom:1px}
.c{clear:both;height:0;font:0/0 Arial;}
.b{font-weight:bold}
.tal{text-align:left}
.tac{text-align:center}
.tar{text-align:right}
.fr{float:right}
.fl{float:left}
/*a link 基本连接颜色*/
a{text-decoration:none;color:$linkcolor}
a:hover{text-decoration:underline;}
/*字体大小*/
.f9{font-size:11px;}
.f10{font-size:11px;}
.f12{font-size:12px}
.f14{font-size:14px}
.fn,.fn a{font-weight:normal}
/*span color 数值自定义*/
.s1{color:#008000;}
.s2{color:#984B98;}
.s3{color:#FA891B;}
.s4{color:#0033FF;}
.s5{color:#659B28}
.gray{color:#818a89} /*次要文字颜色-可定义*/
/*main color 数值自定义*/
.f_one,.t_one,.r_one{background:$forumcolorone;}
.f_two,.t_two,.r_two{background:$forumcolortwo;}
/*form*/
textarea,input,select{font:12px Arial;padding:1px 3px 0 3px;vertical-align:middle;margin-bottom:1px}
select{border:solid 1px $tdcolor;}
.btn{background:$tablecolor;color:$headfontone;border-width:1px;padding-left:15px;padding-right:15px;vertical-align:middle}
.input{border:solid 1px $tablecolor;padding:2px 0px 2px 1px;font-size:1.0em;vertical-align:middle}
form{display:inline;}
textarea{border:solid 1px $tablecolor;}
/*header*/
#header{width:$mtablewidth;margin:auto}
/*toolbar*/
.toptool{border-bottom:1px solid $cbgborder;}
.toptool span{padding:1px 5px;line-height:150%}
/*banner*/
.banner{padding-right:3%}
.banner img{vertical-align:middle;}
/*guide*/
.guide{}
/*table*/
.t{border:1px solid $tablecolor;margin:0px auto 8px;}
.t table{border:1px solid #fff;margin:0 auto;width:99.98%;}
.t2{border-top:$tablecolor 1px solid;margin:0px auto 5px;}
.t3{margin:auto}
.t4{padding:1px 0 1px 1px}
/*table head*/
.h{border-bottom:4px solid $headborder;background:$headcolor;text-align:left;color:$headfontone;padding:5px 7px 3px 7px;}
.h span{font-weight:normal;}
.h h2{font-weight:bold}
.h a{font-family:Arial;color:$headfontone}
.h span a,.h span{color:$headfonttwo;}
.h a.a2{margin-left:12px;}
/*table tr1*/
.tr1 th{padding:5px 10px;text-align:left;vertical-align:top;font-weight:normal;}
.tr1 td.td1{border:1px solid $tdcolor;}
/*table tr2*/
.tr2{background:$cbgcolor;color:$cbgfont;}
.tr2 td,.tr2 th{line-height:21px;border-bottom:1px solid $cbgborder;padding:0px 6px 0px;border-top:1px solid $tablecolor;}
.tr2 a{color:$cbgfont;margin:2px}
/*table tr3*/
.tr3 td,.tr3 th{border-bottom:1px solid $tdcolor;padding:5px 8px}
.tr3 th{text-align:left;font-weight:normal;}
.tr4{background:$headcolor;color:$headfontone;}
.tr4 td{padding:4px 10px;}
.tr td,.tr th{padding:2px}
/*topic content tips*/
.tpc_content{font-size:14px;font-family:Arial;padding:0 2% 0 0.5%;margin:0 0 2%}
.tips{background:$forumcolortwo;border:$tdcolor 1px solid;padding:5px;margin:0 1% 1% 0;float:left;text-align:center;}
.tiptop{border-bottom:1px solid $tdcolor;padding:0 0 5px 0;vertical-align:middle;}
.tipad{border-top:1px solid $tdcolor;margin:10px 0 0;padding:5px 0 0;}
.quote{font-size:70%;color:$headfontone;margin:2px;padding:0}
blockquote{width:92%;font-size:85%;color:#81888c;border:1px solid $tdcolor;border-left-width:3px;padding:5px;margin:0 0 1%}
/*menu*/
.menu{position:absolute;background:#fff;border:1px solid $tablecolor;}
.menu td, .menu li,.menu ul{background:$headcolor;padding:0; margin:0}
.menu li{list-style:none;}
.menu a{display:block;padding:3px 15px 3px 15px}
.menu a:hover{background:$linkcolor;text-decoration:none;color:#fff;}
.menu ul.ul1 li a{display:inline;padding:0}
/*pages*/
.pages{margin:3px 0;font:11px/12px Tahoma}
.pages *{vertical-align:middle;}
.pages a{padding:1px 4px 1px;border:1px solid $tablecolor;margin:0 1px 0 0;text-align:center;text-decoration:none;font:normal 12px/14px verdana;}
.pages a:hover{border:$cbgfont 1px solid;background:$cbgcolor;text-decoration:none;color:$headfontone}
.pages input{margin-bottom:0px;border:1px solid $cbgfont;height:15px;font:bold 12px/15px Verdana;padding-bottom:1px;padding-left:1px;margin-right:1px;color:$cbgfont;}
/*footer*/
#footer{width:$mtablewidth;text-align:right;border-top:2px solid $headborder;margin:auto;padding:5px 0;border-bottom:$cbgcolor 12px solid}
#main{width:$tablewidth;margin:auto}
</style>
页: [1]
查看完整版本: 全贴字体大小调整 FOR PW7.3.2