flyingleaf's blog

象外行一样思考,象专家一样实践。

Firebug IE 版--- Internet Explorer Developer Toolbar

coolbean | 20 五月, 2008 18:21

下载地址:

http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038 

DIV CSS设计时IE6、IE7、FF 与兼容性有关的特性

coolbean | 20 五月, 2008 18:06

在网站设计的时候,应该注意css样式兼容不同浏览器问题,特别是对完全使用DIV CSS设计的网站,就应该更注意IE6 IE7 FF对CSS样式的兼容,不然,你的网站可能出现一些不可预知的效果!

所有浏览器 通用
height: 100px;
IE6 专用
_height: 100px;
IE6 专用
*height: 100px;
IE7 专用
*+height: 100px;
IE7、FF 共用
height: 100px !important;

 (查看全文)

"FCKeditor is not defined" on joomla frontend page[solved]

coolbean | 07 四月, 2008 17:01

Insert the following code to /components/com_content/content.html.php file:
<script src="http://xxx.xxx.xxx/mambots/editors/fckeditor/fckeditor.js" type="text/javascript"></script>

Then it's working on joomla frontend page. Good luck! 

FCKeditor 的配置和使用方法

coolbean | 07 四月, 2008 16:00

FCKeditor 是一个十分强大的网页文本编辑器,它支持多种脚本编程语言和支持多国语言。
如果你还不知道或者你知道还不会配置这个的话,请你继续往下看。

我用是FCKeditot的版本是2.1,不过现在已经有FCKeditor 2.3.2 released版本了,
你可以到他的官方网站上去下载 http://www.FCKeditor.net/

本文介绍的是关于php的配置方法,其他语言的配置方法是和它一样的。

假设网站的目录为:
www
    index.php
    inc
    FCKeditor

一、调用FCKeditor的两种方法

1、通过创建实例
  在这里只写调用它的代码了,网站的其他代码当然由你自己写了,把下面的代码加在需要编辑器的地方:
  <?php
  include_once("FCKeditor/fckeditor.php");    //引用FCKeditor.php这个文件
  $FCKeditor=new FCKeditor('welefen');        //创建FCKeditor对象的实例
  $FCKeditor->BasePath='FCKeditor/';          //FCKeditor所在的位置,这里它的位置就是'FCKeditor/';
  $FCkeditor->ToolbarSet='Default';           //工具按钮设置
  $FCKeditor->Width='100%';                   //设置它的宽度
  $FCKeditor->Height='300px';                 //设置它的高度
  $FCkeditor->Create();
  ?>
 2:通过iframe调用创建
 在你认为该加的地方加上
 <INPUT id=content style="DISPLAY: none" type=hidden name="welefen">
 <INPUT id=content___Config style="DISPLAY: none" type=hidden>
 <IFRAME id=content___Frame src="FCKeditor/editor/fckeditor.html?InstanceName=welefen&amp;Toolbar=Default" frameBorder=0 width=100% scrolling=no height=300>
 </IFRAME>

对上述两种方法的说明:

 在上述两种方法中,你都看到了字符串'welefen',你可能不知道是什么意思,现在我给你解释一下
 如果你要将文本编辑器中的内容在另外一个页面显示或者要将在它保存在数据库,你可以用
 $_POST['welefen']或者用$_GET['welefen']来获取文本编辑器中的内容,具体是用post还是用get那要看你用的是什么传递方法了
 当然你也可以把welefen改成你想要用的,如'content'.

 如果你还不知道什么是ajax,那么这一段话你就不用看了。
 当你用ajax的来获得内容的时候是不是发现得不到内容,如:
 <script>alert(document.form.content.value)</script>你会发现谈出的窗口没内容
 那么我们可以通过下面的代码来获得它的内容:
 function getContentValue()
 {
 var oEditor = FCKeditorAPI.GetInstance('content') ;
 var acontent=oEditor.GetXHTML();
 return acontent;
 }

二:配置一些文件
 1:fckconfig.js的配置
  (1).工具按钮设置

  查找FCKConfig.ToolbarSets["Default"],这里有很多按钮,下面我们将对他们详细介绍

  EditSource 显示HTML源代码 StrikeThrough 删除线
  Save 保存 Subscript 下标
  NewPage 新建空白页面 Superscript 上标
  Preview 预览 JustifyLeft 左对齐
  Cut 剪切 JustifyCenter 居中对齐
  Copy 复制 JustifyRight 右对齐
  Paste 粘贴 JustifyFull 两端对齐
  PasteText 纯文本粘贴 InsertOrderedList 自动编号
  PasteWord 来自Word的粘贴 InsertUnorderedList 项目符号
  Print 打印 Outdent 减少缩进
  SpellCheck 拼写检查 Indent 增加缩进
  Find 查找 ShowTableBorders 显示表格线
  Replace 替换 ShowDetails 显示明细
  Undo 撤销 Form 添加Form动作
  Redo 还原 Checkbox 复选框
  SelectAll 全选 Radio 单选按钮
  RemoveFormat 去除格式 Input 单行文本框
  Link 插入/编辑 链接 Textarea 滚动文本框
  RemoveLink 去除连接 Select 下拉菜单
  Anchor 锚点 Button 按钮
  Image 插入/编辑 图片 ImageButton 图片按钮
  Table 插入/编辑 表格 Hidden 隐藏
  Rule 插入水平线 Zoom 显示比例
  SpecialChar 插入特殊字符 FontStyleAdv 系统字体
  UniversalKey 软键盘 FontStyle 字体样式
  Smiley 插入表情符号 FontFormat 字体格式
  About 关于 Font 字体
  Bold 粗体 FontSize 字体大小
  Italic 斜体 TextColor 文字颜色
  Underline 下划线 BGColor 背景色

这个默认的是包含了所有的工具按钮,不过到我们具体要用的时候,有的按钮并不需要,而且还影响速度。那么我们可以将我们不需要的按钮给删了。下面是我的配置,给大家一个参考,当然你可以根据你的喜好。
FCKconfig.ToolbarSets["Default"] = [
['EditSource','Save','NewPage','Preview','-','Cut','Copy','Paste','PasteText','-','Find','Replace','-','Undo','Redo','-','SelectAll','-','Link','RemoveLink','-','Image','Table','Rule','SpecialChar','Smiley'] ,
['Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','-','InsertOrderedList','InsertUnorderedList','-','Form','Checkbox','Radio','Input','Textarea','Select','Button','-','FontStyleAdv','TextColor'] ] ;

如果在前台给用户回复一写帖子的话,还是没必要要上面的,这时你可以在加一个:
FCKConfig.ToolbarSets["Basic"] = [
 ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;

这样的话,你在前台调用的时候就要用$FCKeditor->ToolbarSet='Basic',不能再为"Default"了。

 (2):语言的配置

 查找FCKConfig.DefaultLanguage将它设置为'zh-cn'.

 (3):脚本语言的设置

 查找var _FileBrowserLanguage和var _QuickUploadLanguage将他们设置为'php', 默认是'asp',如果这里不设置的话,图片将不能上传,这点很重要。当时我在用FCKeditor由于没配置这个,不能上传图片,而我同寝室的用asp 能上传图片,让我烦恼了好多天,最后终于找到是这个原因。

2:图片上传的配置

打开文件FCKeditor/editor/filemanager/browser/default/connectors/php/config.php
查找$Config['Enabled'],将它设置为'true'
查找$Config['UserFilesPath'],将它设置图片的目录,这个目录是相对于主目录的。
例如:我写了一个blog,就可以设置为/blog/upload/

打开文件FCKeditor/editor/filemanager/upload/php/config.php
查找$Config['Enabled'],将它设置为'true'
查找$Config['UseFileType'],将它设置上传文件的目录,最好与上面的图片目录相同。


好了,现在所有的配置都已经完成了,现在你要做的只是删除一些不必要的文件了。
只要包含'_'的目录名和文件名都可以删除,当然你用的是php,其他语言的一些目录也都可以删除,这样就减小了文件的大小。

 (查看全文)

Joomla & Mambo页面布局教程

coolbean | 21 三月, 2008 22:56


(图一)Mambo页面布局

1.Mambo页面布局说明

这里我们使用mambo自带的模板来举例说明,参考上图。
作为架设网站的工具mambo页面基本分为以下几个区域:
<1> 顶部:<pathway>, <user3> and <user4> 模块
<2> 左侧栏:<left>模块
<3> 中间: <banner>,<user1>, <user2> 和 <mainbody>模块
<4> 右侧栏:<right>模块
<5> 底部:<footer>模块

这些只是默认的mambo模块布局,所有模块的位置都可以通过修改模板文件index.php来定义和调整到任意位置。载入模块的php语句是:

mosLoadModules($position_name [, $style] )
例如:
mosLoadModules( “left”, -1 )


在Mambo4.5.2以前的版本中,对于$style的定义有0(默认),-1,1,-2, Mambo4.5.2.1版本新增了”-3”的定义。(见图1 (c))使用他们会有什么不同的效果呢。我们一起来看看吧!

I. $style=0 (默认)时,模块纵向单独显示,实例如下:

 <!-- Individual module -->
<table cellpadding="0" cellspacing="0" class="moduletable[suffix]">
<tr>
<th valign="top">Module Title</th>
</tr>
<tr>
<td>
Module output
</td>
</tr>
</table>
<!-- Individual module end -->

II. $style=1时,模块横向显示。每个模块显示在一个表格栏cell内。实例如下:

 <!-- Module wrapper -->
<table cellspacing="1" cellpadding="0" border="0" width="100%">
<tr>
<td align="top">
<!-- Individual module -->
<table cellpadding="0" cellspacing="0" class="moduletable[suffix]">
<tr>
<th valign="top">Module Title</th>
</tr>
<tr>
<td>
Module output
</td>
</tr>
</table>
<!-- Individual module end -->
</td>
<td align="top">
<!-- ...the next module... -->
</td>
</tr>
</table>

III. $style=-1时,模块外部没有任何边框修饰而且也没有模块标题(名称)。效果如下(本来面目):

模块1  模块2  模块3

IV. $style=-2时,模块显示格式如下:

<!-- Individual module -->
<div class="moduletable[suffix]">
<h3>Module Title</h3>
Module output
</div>
<!-- Individual module end -->

V. $style=-3时,模块全部用div来修饰,有利于给网页减肥,另外还可以实现圆角边框。

<!-- Individual module -->
<div class="module[suffix]">
<div>
<div>
<div>
<h3>Module Title</h3>
Module output
</div>
</div>
</div>
</div>
<!-- Individual module end -->
 (查看全文)

Setting Up Joomla RSS Feed

coolbean | 18 三月, 2008 17:03

How To Feed Your visitor Joomla RSS Newsfeeds

 

Limited Syndication in Joomla
The basic Joomla RSS feed possibility is Limited to the Frontpage items.
It is standard set to on, and You can Find the Configuration one Components - Syndicate.

 

Most people overlook this or are looking at the Feeds section.
In short RSS Stands for Real Simple Syndication , although there are other abbreviations.

 

The better Joomla RSS Feed Manager
As said, the basic Joomla Syndication is limited to the Frontpage, or One other Category.
To overcome this problem I suggest You install Run-Digital RSS Feed Manager

 

This lets You choose from a number of categories to put into the feed, Like Blogging, News, Newsflashes and Your basic best Categorie That Your users are most likely to subscribe to.

 

Configuration of the Joomla Syndication Component.

 

Once You installed the component and chosen the Categories to Syndicate, there are a few other things to Change.

Setting For the standard Joomla RSS feed is done through the Main Control Panel, Choose Components and from there "Sycndicaton".

These settings also apply to the standard Joomla Syndication Component.

 (查看全文)

开源软件历史十大杰出人物

coolbean | 12 三月, 2008 14:33

No.1 自然非伟大的 RMS 莫属了。Richard Stallman,GNU 的创始人,GCC 和Emacs 的作者。GPL 的发明人。



No.2 Linux Fan 的教父,Linus Torvalds,Linux 的创始人和领导者。



No.3 Apache 的作者 Brian Behlendorf。



No.4 Perl 的发明人 Larry Wall。



No.5 Miguel de Icaza,GNOME 和 Ximian 的创始人。
 


No.6 Michael Tiemann,G++(GNU C++ 编译器)的作者,Cygnus 公司创始人,RedHat CTO。
 


No.7 Python 的发明人 Guido van Rossum。
 


No.8 Samba 的作者 Andrew Tridgell。



No.9 谈到 OpenSource 就不能不提到 ESR,Eric S. Raymond,
《The Art of UNIX Programming》、《大教堂与市集》的作者,老牌 Unix 黑客,黑客道行话的收集者,OSI 的创始人,OpenSource 的鼓手。



No.10 Marc Fleury,JBoss Group 的 CEO,JBoss 项目的领头人。JBoss 商标的所有人。

 

php截取UTF-8编码的中英文字符串

coolbean | 24 元月, 2008 02:16

PHP截取UTF-8编码的中英文字符串就会出现乱码,这确定是很麻烦的事,校验页面是否符合xhtml 1.0格式的时候也会报错。

字符串里如有包含英文的单字节,用substr($strChar,$len)处理会出错?的乱码,终于用正则表达式的函数得以解决(发在自己的blog和大家分享)。

function utf8_substr($str,$from,$len){
      return preg_replace(’#^(?:[x00-x7F]|[xC0-xFF][x80-xBF]+){0,’.$from.’}’. ‘((?:[x00-x7F]|[xC0-xFF][x80-xBF]+){0,’.$len.’}).*#s’, ‘$1′,$str);
 }

令人哭笑不得的便条

coolbean | 26 十二月, 2007 16:50

给恶心的弟弟:
问你为什么要用5只手指头轮流挖鼻孔时请别回答我说:“每只手指头挖起来各有不同的感觉。”
——小鼻孔姊姊留

给伤心欲绝的老板:
公司会倒,我想跟名字也有一点关系吧?
——惠岛有限公司的员工留

给大眼:
请你不要每次都用很羡慕的口吻对我说:“眼睛小真好,上课打瞌睡都不会被老师发现!好吗?”
——不知道该可悲还是该庆幸的小眼留

给反应很快的阿婆:
那天您坐在公车上,252司机的紧急刹车,您重心不稳冲了出去,竟问司机:“找我有什么事情?”
——觉得你蛮可爱的学生留

给表达不佳的琳:
虽然你的语文能力不好,但请不要离谱地告诉我:“阿琪他爷爷有一次死掉……”
——认为人只能死一次的璇留

给从没捐过血的大牛:
当你收到捐血报告书时,请不要大声嚷嚷,它把你的血打零分(O)而我的血是A!
——被你彻底打败的捐血人小明留

DIV+CSS布局-- 关于ID和CLASS

coolbean | 13 十二月, 2007 18:34

  首先,有些东西需要说明一下。对于之前的文章,由于为了让大家更好的区分各层的关系,教程中不少地方使用了大写的CLASS或者ID,其实这样做是不推荐的,我推荐的方法是使用单词之间增加下划线,或者单词拼接的方法。因为CSS是区分大小写的。大家可以看到,我提供给大家的下载文件中全部都是使用小写来处理的。

  我们先来处理sidebar的样式,经过分析,我们可以得知,sidebar有四个部分,我们将这四个部分分为四个层:
<div id="search"></div>
<div id="login">
<div class="bar_title"></div>
<div class="bar_body"></div>
中国网管论坛

</div>
<div id="infomation">
<div class="bar_title"></div>
<div class="bar_body"></div>
</div>
<div id="standard">
<div class="bar_title"></div>
<div class="bar_body"></div>
</div> (查看全文)

div+css的浏览器兼容问题

coolbean | 11 十二月, 2007 15:57

  • 水平居中,Firefox使用margin-left: auto; margin-right: auto; IE6 使用text-align: center;
  • 垂直居中,Firefox中使用display: table-cell; vertical-align: middle;可以实现div垂直居中,而IE6中则需要借助IE6中css的特点实现垂直居中;
  • !important标记,Firefox支持!important标记,IE6忽略!important标记;

CSS:HTML结构化

coolbean | 11 十二月, 2007 15:33

你正在学习CSS布局吗?是不是还不能完全掌握纯CSS布局?通常有两种情况阻碍你的学习:

第一种可能是你还没有理解CSS处理页面的原理。在你考虑你的页面整体表现效果前,你应当先考虑内容的语义和结构,然后再针对语义、结构添加CSS。这篇文章将告诉你应该怎样把HTML结构化。

另一种原因是你对那些非常熟悉的表现层属性(例如:cellpadding,、hspace、align="left"等等)束手无策,不知道该转换成对应的什么CSS语句。当你解决了第一种问题,知道了如何结构化你的HTML,我再给出一个列表,详细列出原来的表现属性用什么CSS来代替。

 (查看全文)

纯CSS完美地解决图片在div内垂直水平居中,几乎兼容全部浏览器

coolbean | 11 十二月, 2007 15:04

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<style type="text/css">
.img_v {
 display:table-cell !important;
 display:block;
 position:static !important;
 position:relative;
 overflow:hidden;
 width:400px;
 height:400px;
 border:1px solid #000;
 vertical-align:middle;
 text-align:center;
}
.img_v p {
 display:table-cell !important;
 display:block;
 margin:0;
 position:static !important;
 position:absolute;
 top:50%;
 left:50%;
 width:400px;
 margin-left:auto;
 margin-right:auto;
}
.img_v img {
 position:static !important;
 position:relative;
 top:auto !important;
 top:-50%;
 left:auto !important;
 left:-50%;
}
</style>
</head>
<body>
<div class="img_v">
  <p><img src="
http://haoshenqi.cn/images/logo.gif"></p>
</div>
</body>
</html>

How to enable default HotSpot page of Microtik RouterOS?

coolbean | 21 十一月, 2007 22:16

1) Put information you want from the page, information that clients should see at default HotSpot login page.
2) Enable advertising and display your page after specific time, but page should be accessible from HotSpot router.

清除thumbs.db小貼士

coolbean | 08 十一月, 2007 17:46

除thumbs.db小貼士:

1 在Start>Run下打入cmd



2 進入MS-DOS之后打入cd ╲
例如C:Documents and SettingsUser>cd ╲



3 再打入del /S /A -H -R -S thumbs.db
例如C:del /S /A -H -R -S thumbs.db



等五秒,Window就会自动寻找和清除C:硬碟中所有的thumbs.db文件了。
1 2 3 4 5 6 7  下一篇»
 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb