锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久亚洲国产精品成人AV秋霞,亚洲色无码专区一区,亚洲成a人片7777http://www.tkk7.com/chengang/archive/2017/12/29/432993.html闄堝垰闄堝垰Fri, 29 Dec 2017 07:37:00 GMThttp://www.tkk7.com/chengang/archive/2017/12/29/432993.htmlhttp://www.tkk7.com/chengang/comments/432993.htmlhttp://www.tkk7.com/chengang/archive/2017/12/29/432993.html#Feedback0http://www.tkk7.com/chengang/comments/commentRss/432993.htmlhttp://www.tkk7.com/chengang/services/trackbacks/432993.html鎴戠殑鏂板崥瀹㈠湴鍧錛?nbsp;yowob.cn

涔︾殑杞歡鍜屼唬鐮佹斁鍦ㄧ櫨搴︾綉鐩橈細https://pan.baidu.com/s/1kVb31aR




闄堝垰 2017-12-29 15:37 鍙戣〃璇勮
]]>
浜岀駭鍩熷悕鐨刯ava瀹炵幇http://www.tkk7.com/chengang/archive/2010/12/29/341939.html闄堝垰闄堝垰Wed, 29 Dec 2010 15:19:00 GMThttp://www.tkk7.com/chengang/archive/2010/12/29/341939.htmlhttp://www.tkk7.com/chengang/comments/341939.htmlhttp://www.tkk7.com/chengang/archive/2010/12/29/341939.html#Feedback0http://www.tkk7.com/chengang/comments/commentRss/341939.htmlhttp://www.tkk7.com/chengang/services/trackbacks/341939.htmlhttp://www.yowob.com )錛屽叾浠栨秹鍙婂埌涓虹敤鎴鋒彁渚涗竴涓簩綰у煙鍚嶅姛鑳斤紝瀹炵幇鏂規硶濡備笅錛?br />
(1)棣栧厛瑕佸湪鍩熷悕鏈嶅姟鍟嗙鍋氫竴涓硾鍩熷悕瑙f瀽. 鎴戠敤鐨勬槸godaddy.com,灝辨柊寤轟竴涓狝璁板綍(host=*,point to鎸囧悜鎴戠殑鏈嶅姟鍣ㄧ殑ip),榪欐牱鎵鏈変簩綰у煙鍚嶉兘浼氳漿鍒版垜鐨勬湇鍔″櫒鏉ヤ簡

(2)鎺ョ潃鍦╳eb.xml閰嶄竴涓嚜宸插啓鐨勫煙鍚嶈繃婊ゅ櫒,

    <filter>
        <filter-name>URLFilter</filter-name>
        <filter-class>com.yowob.commons.URLFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>URLFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

榪囨護鍣ㄧ殑浠g爜濡備笅銆傝繖閲屽厛灝嗕簩綰у煙鍚嶅拰鍏ㄧ悆鍩熷悕鍜岀敤鎴稩D鐨勬槧灝?淇濆瓨鍦ㄤ竴涓暟鎹〃閲? 鐒跺悗璁塊棶榪涙潵鏃跺鍦板潃鍋氫竴涓垽鏂? 鍐嶅彇鍑哄搴旂殑鐢ㄦ埛ID. 鍐嶈漿涓涓嬪氨琛屼簡. 鎴戠殑闈欐佹枃浠墮兘鍦╯tatic鐩綍錛屾墍浠ヨ繕鍔犱簡涓涓猻tatic鐨勫垽鏂?br /> 姣斿: http://time.you.com/board/21 鐢╰ime瀵瑰簲鐢ㄦ埛ID涓?,鍒欒闂晥鏋滄湁 http://www.you.com/6/board/21鐩稿悓, 涓嶈繃鍦板潃鏍忚繕鏄樉紺?a >http://time.you.com/board/21銆?br /> 鍐嶆瘮濡傦細htttp://www.userdomain.com/board/21錛岃繖涓槸鐢ㄦ埛ID涓?鐨勫叏鐞冨煙鍚嶏紝璁塊棶鏁堟灉涔熷拰涓婇潰涓鏍楓?br />
package com.yowob.commons;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.yowob.Constants;
import com.yowob.dao.SiteDAO;
import com.yowob.dto.SiteDTO;

public class URLFilter implements Filter {
    
private static final Log log = LogFactory.getLog(URLFilter.class);
    
private static final String DOMAIN_END = "." + Constants.DOMAIN; //.you.com
    private static final Map<String, Long> NAME_MAP = new HashMap<String, Long>();
    
private static final Map<String, Long> DOMAIN_MAP = new HashMap<String, Long>();

    @Override
    
public void init(FilterConfig filterConfig) throws ServletException {
        log.info(
"------------------------------init");
        SiteDAO siteDAO 
= new SiteDAO();
        List
<SiteDTO> list = siteDAO.getAll();
        
for (SiteDTO siteDTO : list) {
            String name 
= siteDTO.getName();
            
if (StringUtils.isNotEmpty(name)) {
                NAME_MAP.put(name, siteDTO.getId());
            }
            String domain 
= siteDTO.getDomain();
            
if (StringUtils.isNotEmpty(domain)) {
                DOMAIN_MAP.put(domain, siteDTO.getId());
            }
        }
    }

    
public static void updateName(String oldValue, String newValue, Long siteId) {
        
if (StringUtils.equals(oldValue, newValue)) {
            
return;
        }
        
if (StringUtils.isNotEmpty(oldValue)) {
            NAME_MAP.remove(oldValue);
        }
        
if (StringUtils.isNotEmpty(newValue)) {
            NAME_MAP.put(newValue, siteId);
        }
    }

    
public static void updateDomain(String oldValue, String newValue, Long siteId) {
        
if (StringUtils.equals(oldValue, newValue)) {
            
return;
        }
        
if (StringUtils.isNotEmpty(oldValue)) {
            DOMAIN_MAP.remove(oldValue);
        }
        
if (StringUtils.isNotEmpty(newValue)) {
            DOMAIN_MAP.put(newValue, siteId);
        }
    }

    @Override
    
public void destroy() {
        log.info(
"------------------------------destroy");
    }

    @Override
    
public void doFilter(ServletRequest servletRequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request 
= (HttpServletRequest) servletRequest;
        String requestURI 
= request.getRequestURI();
        String serverName 
= request.getServerName().toLowerCase();
        String realURI 
= getRealRequestURI(serverName, requestURI);
        request.getRequestDispatcher(realURI).forward(request, response);
    }

    
private String getRealRequestURI(String serverName, String requestURI) {
        
if (Constants.WWW_DOMAIN.equals(serverName) || requestURI.startsWith("/static/"|| Constants.DOMAIN.equals(serverName)) {
            
return requestURI;
        }
        
if (serverName.endsWith(DOMAIN_END)) {
            String secondDomain 
= serverName.substring(0, serverName.indexOf("."));
            
//緗戠珯id
            if (NumberUtils.isNumber(secondDomain))
                
return getURI(secondDomain, requestURI);
            
//緗戠珯鑻辨枃鍚?/span>
            Long siteId = NAME_MAP.get(secondDomain);
            
if (siteId == null) {
                
//淇濈暀鐨勪簩綰у煙鍚?/span>
                if (Constants.isPrivateSecondDomain(secondDomain)) {
                    
return requestURI;
                }
                
return "/message?msg=涓嶅瓨鍦ㄤ簩綰у煙鍚?/span>" + secondDomain;
                
//                throw new RuntimeException("do not exist second domain: " + secondDomain);
            }
            
return getURI(siteId + "", requestURI);
        }
        
//鍩熷悕
        Long siteId = DOMAIN_MAP.get(serverName);
        
if (siteId == null) {
            
return requestURI;
        } 
else {
            
return getURI(siteId + "", requestURI);
        }
    }

    
private static String getURI(String siteId, String requestURI) {
        
if (requestURI.equals("/")) {
            
return "/" + siteId;
        } 
else {
            
return "/" + siteId + requestURI;
        }
    }

}


鍏朵粬涓浜涘皬鎶宸э細
錛堬紤錛変負浜嗕究浜庢湰鏈烘祴璇曪紝鍙互淇敼windows 鐨刪osts鏂囦歡銆傛垜鐨勫涓嬶細
127.0.0.1       localhost
127.0.0.1       you.com
127.0.0.1       www.you.com
127.0.0.1       time1.you.com
127.0.0.1       time2.you.com
127.0.0.1       6.you.com
127.0.0.1       www.bobo.com

錛堬紥錛墂eb欏電殑鍚勭鍦板潃鍒欒娉ㄦ剰鐩稿璺緞鐨勯棶棰樸備富瑕佽冭檻
棣栧厛璁劇疆<base />錛屾垨<base />鍏朵腑鍦板潃鏈鍚庤鍔犱竴涓?
鐒跺悗欏甸潰涓叾浠栧湴鍧鍓嶉潰涓嶅姞/錛屽氨鏄浉瀵瑰湴鍧錛堜互鍦板潃鏍忎負鍩虹錛夈傚姞涓?錛屽垯鏄粷瀵瑰湴鍧銆?br />

闄堝垰 2010-12-29 23:19 鍙戣〃璇勮
]]>
VIM鐨勫父鐢ㄦ彃浠?閰嶇疆鏂囦歡+璧勬枡http://www.tkk7.com/chengang/archive/2007/10/18/153970.html闄堝垰闄堝垰Thu, 18 Oct 2007 10:15:00 GMThttp://www.tkk7.com/chengang/archive/2007/10/18/153970.htmlhttp://www.tkk7.com/chengang/comments/153970.htmlhttp://www.tkk7.com/chengang/archive/2007/10/18/153970.html#Feedback7http://www.tkk7.com/chengang/comments/commentRss/153970.htmlhttp://www.tkk7.com/chengang/services/trackbacks/153970.html 鎴戞妸VIM鐨勫父鐢ㄦ彃浠訛紝鑷繁鐢ㄧ殑閰嶇疆鏂囦歡錛屾敹緗楃殑涓浜涜祫鏂欎竴騫舵墦鍖呬簡錛岀渷寰楀垵鐢╒IM鐨勪漢鎵炬潵鎵懼幓嫻垂鏃墮棿銆?br />
http://www.tkk7.com/Files/chengang/myvim.zip



鍦╱buntu7.10涓殑gvim鍑虹幇涔辯爜錛岃繖鏃墮渶瑕佸湪涓葷洰褰曚笅鐨勨?vimrc鈥濇枃浠朵腑鍔犱笂瀹氫箟瀛椾綋鐨勪竴鍙ャ傛垜鐢ㄧ殑鏄滃井杞泤榛戔濆瓧浣撴墍浠ユ鍙ヤ負錛?br />
set聽guifont=YaHei\聽Consolas\聽Hybrid\聽10
娉ㄦ剰錛氬瓧浣撳悕涓湁絀烘牸鐨勶紝鐢ㄦ枩鏉犲垎寮錛岃屼笖鏂滄潬鍚庨潰涓瀹氳鏈変竴涓┖鏍箋?0鏄瓧浣撳ぇ灝忥紝鍓嶉潰鏈変竴涓┖鏍箋?br />

闄堝垰 2007-10-18 18:15 鍙戣〃璇勮
]]>
涓у寲欏甸潰甯冨眬鐨勮璁℃濊冧笌Rails鍒濇瀹炵幇http://www.tkk7.com/chengang/archive/2007/10/11/151900.html闄堝垰闄堝垰Wed, 10 Oct 2007 16:00:00 GMThttp://www.tkk7.com/chengang/archive/2007/10/11/151900.htmlhttp://www.tkk7.com/chengang/comments/151900.htmlhttp://www.tkk7.com/chengang/archive/2007/10/11/151900.html#Feedback0http://www.tkk7.com/chengang/comments/commentRss/151900.htmlhttp://www.tkk7.com/chengang/services/trackbacks/151900.html
榪欎釜璁捐鍏跺疄寰堢畝鍗曪紝灝辨槸鈥滃紩鎿?閰嶇疆鈥?-涓諱綋欏甸潰鍙畾涔変竴涓猺thml錛屽彲浠ユ妸瀹冪湅鍋氶〉闈㈠紩鎿庯紝鐒跺悗鐢ㄤ竴涓厤緗枃浠舵寚瀹氫簡欏甸潰鎵搴斿叿鏈夌殑妯″潡鍜屾暟鎹? 欏甸潰妯″潡灝辮薄涓涓釜瑁呮湁鏁版嵁鐨勭洅瀛愶紝閫氳繃鈥滈〉闈㈠紩鎿?+ 閰嶇疆鏂囦歡鈥濇妸榪欎簺鐩掑瓙緇勫悎璧鋒潵錛岃薄鎼Н鏈ㄤ竴鏍楓傞〉闈㈠紩鎿庢槸鍚勭敤鎴峰叡鐢ㄧ殑錛岄厤緗枃浠舵槸鍚勭敤鎴風嫭鏈夌殑錛岃繖鏍蜂竴瑁呴厤璧鋒潵錛屽氨褰㈡垚浜嗙敤鎴風殑涓у寲欏甸潰銆?br />
鍓╀笅鐨勯噸鐐瑰氨鏄庝箞瀹氫箟閰嶇疆鏂囦歡銆傞鍏堟槸瑕佸垝娓呴厤緗枃浠剁殑璐d換鐣岀嚎----瀹冨彧璐熻矗瀹氫箟鐩掑瓙閲岀殑鏁版嵁錛岃繕鏈夌洅瀛愮殑宓屽鍏崇郴錛岃屽ぇ灝忓拰浣嶇疆絳夊竷灞鏂歸潰鍒欏叏閮ㄤ氦緇機SS鍘昏礋璐c?br />
涓婇潰鏄垵姝ユ兂娉曪紝涓嬮潰鐪嬬湅鍏蜂綋瀹炵幇錛屼唬鐮佷粎渚涘弬鑰?br />
浠ヤ笅鏄煇涓敤鎴風殑閰嶇疆鏂囦歡錛堟垜娌$敤XML錛岃屾槸鐢╕AML錛夈俠oard_1鏄寚ID=1榪欎釜鏍忕洰鎵鐢ㄧ殑閰嶇疆瀹氫箟銆倀opContent鏄竴涓?div><div>鐨刬d鍊鹼紝鎴戞妸姣忎釜鏍忕洰鐨勯〉闈㈠垎鎴?span>topContent欏躲乻ideContent杈癸紙宸︽垨鍙崇敱CSS鍐沖畾錛夈?/span>primaryContent 涓昏銆乥ottomContent搴曘倀opic鏄寚娣誨姞涓涓ā鍧楋紙鐩掑瓙錛夛紝鏄劇ず涓涓富棰樺唴瀹廣傚拰topic綾諱技鏄繕鏈夋樉紺哄浘鍍忕殑image銆佹樉紺轟富棰樺垪 琛ㄧ殑topics銆佹樉紺哄垎綾誨垪琛ㄧ殑categories絳夌瓑絳夌瓑銆傚畠浠悇鏈変笉鍚岀殑灞炴у鹼紝姣斿topic妯″潡錛屽畠闇瑕佸畾鎸囧畠鐨勪富棰榠d錛屼互鍙婂畠鎵鐢ㄧ殑 view(topics/_show_hot.rhtml聽 or聽 topics/_show.rhtml絳夌瓑)銆?br />
錛堣櫧鐒惰繖涓厤緗枃浠舵娊璞″緱榪樹笉澶燂紝浣嗚繖鏍峰瓙宸茬粡鍙互瑙e喅鎴戠殑闇瑕佷簡錛岄偅
灝?/span>鏆傛椂榪欐牱鍏堜簡銆傦級

template.yml
  1. board_2:聽聽
  2. 聽聽
  3. board_1:聽聽
  4. -聽topContent:聽聽
  5. 聽聽-聽topic:聽聽
  6. 聽聽聽聽聽聽topic_id:聽7聽聽
  7. 聽聽聽聽聽聽view:聽topics/show_hot聽聽
  8. -聽sideContent:聽聽
  9. 聽聽-聽image:聽聽
  10. 聽聽聽聽聽聽url:聽/images/news.jpg聽聽
  11. 聽聽-聽categories:聽聽
  12. 聽聽聽聽聽聽board:聽5聽聽
  13. 聽聽聽聽聽聽view:聽tree聽聽
  14. 聽聽-聽topics:聽聽
  15. 聽聽聽聽聽聽board:聽5聽聽
  16. 聽聽聽聽聽聽per_page:聽4聽聽
  17. 聽聽聽聽聽聽view:聽index_simple聽聽
  18. 聽聽-聽topics:聽聽
  19. 聽聽聽聽聽聽board:聽6聽聽
  20. -聽primaryContent:聽聽
  21. 聽聽-聽topics:聽聽
  22. 聽聽聽聽聽聽board:聽4聽聽
  23. 聽聽聽聽聽聽view:聽index聽聽
  24. 聽聽-聽topic:聽聽
  25. 聽聽聽聽聽聽topic_id:聽7聽聽
  26. 聽聽聽聽聽聽view:聽util/box聽聽
  27. 聽聽
  28. board_3:聽聽

鐒跺悗鍦╟ontroller閲屾妸閰嶇疆鏂囦歡璇誨叆錛屽啀杞寲鎴愭ā鍨嬬被銆傛垜鎶婂悇涓晫闈㈡ā鍧楃湅鍋氫竴涓釜鐩掑瓙Box
榪欐槸瀹冪殑欏剁駭Box
ruby 浠g爜
  1. class聽Box聽聽
  2. 聽聽attr_accessor聽:html_id,聽:view,聽:boxes聽聽
  3. 聽聽def聽initialize
  4. 聽聽聽聽@boxes=[]聽聽
  5. 聽聽end聽聽
  6. end聽聽

榪欐槸topic妯″潡鐨?br />
ruby 浠g爜
  1. class聽TopicBox聽<聽Box聽聽
  2. 聽聽attr_accessor聽:topic_id聽聽
  3. end聽聽

榪欐槸Image妯″潡鐨?br />
ruby 浠g爜
  1. class聽ImageBox聽<聽Box聽聽
  2. 聽聽attr_accessor聽:url聽聽
  3. end聽聽聽聽

.....絳?絳夛紝 鍏朵粬鐨凚ox瀛愮被澶у悓灝忓紓

鐒跺悗鍦ㄤ竴涓猚ontroller閲屾妸榪欎簺閰嶇疆淇℃伅杞垚Box妯″瀷綾?br />
ruby 浠g爜
  1. templates聽=聽 YAML::load(File.read("public/uploads/#{user_id}/config/template.yml"))
  2. template聽=聽templates.find{|o|聽o[0]=="board_#{@board.id}"聽}聽聽
  3. args聽=聽template[1]聽聽
  4. 聽聽
  5. @boxes聽=聽[]聽聽
  6. args.eachdo|arg1_hash|聽聽
  7. 聽聽arg1_hash.eachdo|key1,聽value1|聽聽
  8. 聽聽聽聽board_box聽=聽BoardBox.new聽聽
  9. 聽聽聽聽board_box.html_id聽=聽key1聽聽
  10. 聽聽聽聽@boxes聽<<聽board_box聽聽
  11. 聽聽聽聽value1.eachdo|arg2_hash|聽聽
  12. 聽聽聽聽聽聽arg2_hash.eachdo|key2,聽value2|聽聽
  13. 聽聽聽聽聽聽聽聽case聽key2聽聽
  14. 聽聽聽聽聽聽聽聽when聽'topics'聽聽
  15. 聽聽聽聽聽聽聽聽聽聽box聽=聽TopicsBox.new聽聽
  16. 聽聽聽聽聽聽聽聽聽聽box.board_id聽=聽value2['board']聽聽
  17. 聽聽聽聽聽聽聽聽聽聽box.per_page聽=聽value2['per_page']||2聽聽
  18. 聽聽聽聽聽聽聽聽聽聽box.view聽=聽value2['view']||'index_simple'聽聽
  19. 聽聽聽聽聽聽聽聽聽聽board_box.boxes聽<<聽box聽聽聽
  20. 聽聽聽聽聽聽聽聽when聽'categories'聽聽
  21. 聽聽聽聽聽聽聽聽聽聽box聽=聽CategoriesBox.new聽聽
  22. 聽聽聽聽聽聽聽聽聽聽box.board_id聽=聽value2['board']聽聽
  23. 聽聽聽聽聽聽聽聽聽聽box.view聽=聽value2['view']||'list'聽聽
  24. 聽聽聽聽聽聽聽聽聽聽board_box.boxes聽<<聽box聽聽聽
  25. 聽聽聽聽聽聽聽聽when聽'image'聽聽
  26. 聽聽聽聽聽聽聽聽聽聽box聽=聽ImageBox.new聽聽
  27. 聽聽聽聽聽聽聽聽聽聽box.url聽=聽value2['url']聽聽
  28. 聽聽聽聽聽聽聽聽聽聽board_box.boxes聽<<聽box聽聽聽
  29. 聽聽聽聽聽聽聽聽when聽'topic'聽聽
  30. 聽聽聽聽聽聽聽聽聽聽box聽=聽TopicBox.new聽聽
  31. 聽聽聽聽聽聽聽聽聽聽box.topic_id聽=聽value2['topic_id']聽聽
  32. 聽聽聽聽聽聽聽聽聽聽box.view聽=聽value2['view']||'util/box'聽聽
  33. 聽聽聽聽聽聽聽聽聽聽board_box.boxes聽<<聽box聽聽聽
  34. 聽聽聽聽聽聽聽聽end聽聽
  35. 聽聽聽聽聽聽end聽聽
  36. 聽聽聽聽end聽聽
  37. 聽聽end聽聽
  38. end

鏈鍚庢槸瀹冮〉闈㈠紩鎿庯紙閫昏緫浠g爜鍜岄〉闈唬鐮佹販鍦ㄤ竴璧鳳紝姣旇緝涓戦檵錛?
ruby 浠g爜
  1. <%聽@boxes.eachdo|box1|聽%>聽聽
  2. "<%=box1.html_id%>">聽聽/span>
  3. 聽聽<%聽box1.boxes.eachdo|box2|聽聽
  4. 聽聽聽聽聽聽聽p1聽box2.class.to_s聽聽
  5. 聽聽
  6. 聽聽聽聽聽聽case聽box2.class.to_s聽聽
  7. 聽聽聽聽聽聽when聽'TopicsBox'聽聽
  8. 聽聽聽聽聽聽聽聽board_id聽=聽box2.board_id聽聽
  9. 聽聽聽聽聽聽聽聽if聽board_id聽聽
  10. 聽聽聽聽聽聽聽聽聽聽board聽=聽Board.find(board_id)聽聽
  11. 聽聽聽聽聽聽聽聽聽聽topics聽=聽Topic.by_board_id(board_id,聽:per_page聽=>聽box2.per_page)聽聽聽
  12. 聽聽聽聽聽聽聽聽聽聽%>聽聽
  13. 聽聽聽聽聽聽聽聽聽聽<%=聽render(:partial聽=>聽"topics/#{box2.view}",聽:locals聽=>聽{:title聽=>board.title,聽:topics聽=>聽topics聽})%>聽聽
  14. 聽聽聽聽聽聽聽聽<%end聽聽
  15. 聽聽聽聽聽聽when聽'CategoriesBox'聽聽
  16. 聽聽聽聽聽聽聽聽board_id聽=聽box2.board_id聽聽
  17. 聽聽聽聽聽聽聽聽if聽board_id聽聽
  18. 聽聽聽聽聽聽聽聽聽聽board聽=聽Board.find(board_id)聽聽
  19. 聽聽聽聽聽聽聽聽聽聽categories聽=聽board.categories聽聽
  20. 聽聽聽聽聽聽聽聽聽聽%>聽聽
  21. 聽聽聽聽聽聽聽聽聽聽<%=聽render聽:partial聽=>聽"categories/#{box2.view}",聽:locals聽=>聽{:board聽=>board,聽:categories聽=>聽categories聽}聽%>聽聽
  22. 聽聽聽聽聽聽聽聽<%end%>聽聽
  23. 聽聽聽聽聽聽<%when聽'ImageBox'%>聽聽
  24. 聽聽聽聽聽聽聽聽<%=聽box_tag聽:header=>false%>聽聽
  25. 聽聽聽聽聽聽聽聽聽聽<%=image_tag(box2.url,聽:border聽=>聽0)聽%>聽聽
  26. 聽聽聽聽聽聽聽聽<%=聽end_box_tag聽%>聽聽
  27. 聽聽聽聽聽聽<%when聽'TopicBox'聽聽
  28. 聽聽聽聽聽聽聽聽topic聽=聽Topic.find(box2.topic_id)聽%>聽聽
  29. 聽聽聽聽聽聽聽聽<%=render(:partial聽=>聽"#{box2.view}",聽:locals聽=>聽{:title聽=>topic.title,聽:content聽=>聽topic.content,聽:topic聽=>聽topic聽})%>聽聽
  30. 聽聽聽聽聽聽<%end聽聽
  31. 聽聽end%>聽


榪欐牱錛屼互鍚庢兂鍦ㄩ〉闈笂澧炲姞鍒犻櫎浠涔堟ā鍧楋紝淇敼閰嶇疆鏂囦歡灝辮浜嗐傚綋鐒剁粰鐢ㄦ埛鐢紝榪樺繀欏誨緱鐢ˋJAX鏉ュ啓涓狦UI鐣岄潰錛屾諱笉鑳借鐢ㄦ埛鎵嬪伐鍘繪敼閰嶇疆鏂囦歡鍚с?br />

闄堝垰 2007-10-11 00:00 鍙戣〃璇勮
]]>
鎶藉彇FCKEditor鐨勬祻瑙堝浘鐗囧姛鑳?/title><link>http://www.tkk7.com/chengang/archive/2007/09/26/148412.html</link><dc:creator>闄堝垰</dc:creator><author>闄堝垰</author><pubDate>Wed, 26 Sep 2007 10:49:00 GMT</pubDate><guid>http://www.tkk7.com/chengang/archive/2007/09/26/148412.html</guid><wfw:comment>http://www.tkk7.com/chengang/comments/148412.html</wfw:comment><comments>http://www.tkk7.com/chengang/archive/2007/09/26/148412.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/chengang/comments/commentRss/148412.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/chengang/services/trackbacks/148412.html</trackback:ping><description><![CDATA[榪囧幓錛屾垜浠笂浼犲浘鐗囷紝涓鑸兘鏄竴涓枃鏈鍔犱竴涓滄祻瑙堚濇寜閽紝閫氳繃嫻忚鎸夐挳閫夊彇鏈湴鐨勫浘鐗囷紝鐒跺悗鍦ㄦ彁浜よ〃鍗曞悗鐨勯昏緫涓皢鍥劇墖涓婁紶鑷蟲湇鍔″櫒銆傜幇鍦紝鎴戜滑宸茬粡鎶奆CKEditor搴旂敤鍦ㄤ簡鎴戜滑鐨勭郴緇熼噷錛岃孎CKEditor涓甫浜嗘湁浜嗗浘鐗囦笂浼犲拰嫻忚鍔熻兘銆傛墍浠ユ垜灝辨兂璁╄繖涓滄祻瑙堚濇寜閽笉鏄粠鏈湴閫夊彇鍥劇墖錛岃屾槸浠嶧CKEditor浼犲埌鏈嶅姟鍣ㄤ笂鐨勫浘鐗囦腑鏉ラ変婦銆備篃灝辨槸鎶奆CKEditor鐨勨滄祻瑙堚濇寜閽紝鎶藉彇鍑烘潵銆?br /><div align="center">鏂?闄堝垰 <a title="http://www.tkk7.com/chengang/archive/2007/09/26/148114.html" href="/chengang/archive/2007/09/26/148114.html">www.chengang.com.cn</a> 杞澆璇蜂繚鐣欏嚭澶?br /></div>鍦ㄩ槄璇籉CKEditor鐨勬簮鐮佷箣鍚庯紝鍋氬涓嬪鐞嗐?br /><br />1. 鏂板涓や釜javascript鍑芥暟銆?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);">聽currentImageTextID;<br /><br /></span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">FCKEditor鐨勬枃浠舵祻瑙堢獥鍏抽棴鍚庯紝浼氳皟鐢ㄦ鍑芥暟錛屽茍鎶婃墍閫夊浘鐗囩殑url浼犲叆銆?/span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">聽SetUrl(url){<br />聽聽document.getElementById(currentImageTextID).value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">url;<br />}<br /><br /></span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">imageTextID:聽鍥劇墖鏂囨湰妗嗙殑ID鍊?/span><span style="color: rgb(0, 128, 0);"><br />//</span><span style="color: rgb(0, 128, 0);">uploadPath:聽鏈嶅姟鍣ㄧ殑鍥劇墖鐩綍</span><span style="color: rgb(0, 128, 0);"><br />//</span><span style="color: rgb(0, 128, 0);">type:聽嫻忚綾誨瀷錛屽煎彲涓篒mage/Flash/File/Media錛屽鏋滀負絀哄瓧涓詫紝鍒欒〃紺烘祻瑙堟墍鏈夌被鍨嬬殑鏂囦歡</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">聽OpenImageBrowser(imageTextID,聽uploadPath,聽type聽)聽{<br />聽聽currentImageTextID聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽imageTextID;<br />聽聽window.open('</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">javascripts</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">fckeditor</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">editor</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">filemanager</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">browser</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 255);">default</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">browser.html</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">uploaded</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">uploadPath</span><span style="color: rgb(0, 0, 0);"> +</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">&</span><span style="color: rgb(0, 0, 0);">Type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">type</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">&</span><span style="color: rgb(0, 0, 0);">Connector</span><span style="color: rgb(0, 0, 0);">=/</span><span style="color: rgb(0, 0, 0);">fckeditor</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">command','Browse</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">Upload聽Images','toolbar</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">no,status</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">no, resizable</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">yes,dependent</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">yes, scrollbars</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">yes,width</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">600</span><span style="color: rgb(0, 0, 0);">,height</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">400</span><span style="color: rgb(0, 0, 0);">')<br />}<br /></span></div><br />2.鍦╒iew涓繖鏍蜂嬌鐢?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);">鏍囧織鍥劇墖:</span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"><br /><</span><span style="color: rgb(0, 0, 0);">input聽id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">topic_image</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">topic[image]</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽size</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">30</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">text</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">><br /><</span><span style="color: rgb(0, 0, 0);">input聽value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">嫻忚鏈嶅姟鍣?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽onclick</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">OpenImageBrowser('topic_image',聽'/uploads/s<%= params[:user_id]%>',聽'Image')</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">button</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"><br /></span></div><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"></span><br /><br /><img src ="http://www.tkk7.com/chengang/aggbug/148412.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/chengang/" target="_blank">闄堝垰</a> 2007-09-26 18:49 <a href="http://www.tkk7.com/chengang/archive/2007/09/26/148412.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璁㏑ails鐗堢殑FCKEditor鏀寔鍔ㄦ佽緗笂浼犵洰褰?/title><link>http://www.tkk7.com/chengang/archive/2007/09/26/148114.html</link><dc:creator>闄堝垰</dc:creator><author>闄堝垰</author><pubDate>Wed, 26 Sep 2007 02:13:00 GMT</pubDate><guid>http://www.tkk7.com/chengang/archive/2007/09/26/148114.html</guid><wfw:comment>http://www.tkk7.com/chengang/comments/148114.html</wfw:comment><comments>http://www.tkk7.com/chengang/archive/2007/09/26/148114.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.tkk7.com/chengang/comments/commentRss/148114.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/chengang/services/trackbacks/148114.html</trackback:ping><description><![CDATA[涓涓鐢ㄦ埛鐨勭郴緇燂紝涓婁紶鍥懼儚鏂囦歡絳夛紝甯屾湜涓嶅悓鐢ㄦ埛鐨勫浘鍍忎笂浼犲埌瀹冧笓鏈夌殑鐩綍閲屻傛垜鏈鍒濇煡鍒板湪PHP鐗堢殑FCKEditor鏄氳繃璁劇疆$Config('UserFilesPath')鏉ュ疄鐜幫紝浣哛ails鐗堢殑FCKEditor娌℃湁姝ら」璁劇疆錛堟悳绱serFilesPath鍏抽敭瀛楀悗鍋氬嚭姝ゅ垽鏂級銆傛帴鐫錛屾垜鏌ョ湅浜咶CKEditor鍏抽敭鐨刦ckeditor_controller.rb鐨勬簮浠g爜錛屼技涔庡畠騫朵笉鏀寔姝ら」璁劇疆銆傚啀鐪媕avaeye鏄庝箞鐢‵CKEditor鐨勶紝鍙戠幇瀹冩斁寮冧簡FCKEditor鐨勪笂浼犲姛鑳姐俫oogle浜嗗崐澶╋紝闄や簡閭d簺杞潵杞幓鐨勭浉鍚屽唴瀹圭殑甯栧瓙涔嬪錛堟悶涓嶆噦鏈変簡google涔嬪悗錛屾庝箞榪樹細鏈変漢璐瑰姴鍘昏漿甯栧埆浜虹殑鏂囩珷錛夛紝涓鐐硅惀鍏諱篃娌℃湁銆傚湪JavaEye鍙戜簡涓眰鍔╁笘錛屾病浜虹悊 :-( 銆?浼犺涓珮鎵嬩簯闆嗙殑JavaEye錛屽叾Rails鐗堝潡鐪熸槸鍐鋒竻錛岀粰浜洪槾椋曢鐨勬劅瑙夈傛病鍔炴硶錛岃嚜宸辨敼婧愪唬鐮佸惂銆?br /><div align="center">鏂?闄堝垰 <a title="http://www.tkk7.com/chengang/archive/2007/09/26/148114.html" href="/chengang/archive/2007/09/26/148114.html">www.chengang.com.cn</a> 杞澆璇蜂繚鐣欏嚭澶?br /></div>1.淇敼fckeditor_controller.rb錛屾妸瀹冮偅鍑犱釜private鏂規硶淇敼濡備笅錛?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">聽聽<br />聽聽</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"><br />聽聽def聽current_directory_path<br />聽聽聽聽base_dir聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{RAILS_ROOT}/public</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br /><br />聽聽聽聽#TODO聽鍦ㄥ垱寤虹敤鎴鋒椂錛屽氨寤虹珛濂界洰褰曘傝繖鏃跺彲浠ュ幓鎺夎繖閮ㄤ喚浠g爜錛屾彁楂樿繍琛屾晥鐜囥?br />聽聽聽聽(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{params[:uploaded]||UPLOADED}/#{params[:Type]}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).split(</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">).each聽</span><span style="color: rgb(0, 0, 255);">do</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);">s</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽next聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽s</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">''</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽聽聽base_dir聽</span><span style="color: rgb(0, 0, 0);">+=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽s<br />聽聽聽聽聽聽聽聽Dir.mkdir(base_dir,</span><span style="color: rgb(0, 0, 0);">0775</span><span style="color: rgb(0, 0, 0);">)聽unless聽File.exists</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">(base_dir)<br />聽聽聽聽end<br />聽聽聽聽<br />聽聽聽聽check_path(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{base_dir}#{params[:CurrentFolder]}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)<br />聽聽end<br />聽聽<br />聽聽def聽upload_directory_path<br />聽聽聽聽uploaded聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽@request.relative_url_root.to_s</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{params[:uploaded]||UPLOADED}/#{params[:Type]}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{uploaded}#{params[:CurrentFolder]}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br />聽聽end<br />聽聽<br />聽聽def聽check_file(file)<br />聽聽聽聽#聽check聽that聽the聽file聽is聽a聽tempfile聽object<br />聽聽聽聽unless聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{file.class}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Tempfile</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">#{file.class}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">StringIO</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽@errorNumber聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">403</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽Exception.</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽end<br />聽聽聽聽file<br />聽聽end<br />聽聽<br />聽聽def聽check_path(path)<br />聽聽聽聽exp_path聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽File.expand_path聽path<br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽exp_path聽</span><span style="color: rgb(0, 0, 0);">!~</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">r[</span><span style="color: rgb(0, 0, 0);">^</span><span style="color: rgb(0, 0, 0);">#{File.expand_path(RAILS_ROOT)}</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">#{params[:uploaded]</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">UPLOADED}]<br />聽聽聽聽聽聽@errorNumber聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">403</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">聽Exception.</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽end<br />聽聽聽聽path<br />聽聽end</span></div><br />鍙﹀錛屽畠鍓嶉潰鐨勫父閲廢PLOADED_ROOT涔熸病鐢ㄤ簡錛屽彲浠ュ垹鎺夈?br /><br /><br />2. 鍦ㄤ笂闈㈢殑浠g爜涓?span style="color: rgb(0, 0, 0);">params[:uploaded]鏄叧閿紝瀹冨氨鏄垜浠姩鎬佸畾涔夌殑涓婁紶鐩綍銆傝鍊兼潵鑷簬FCKEditor鐨勪竴浜沨tml欏甸潰錛屽畠鏄氳繃get鍙傛暟浼犲叆鐨勩備慨鏀筨rowser.html鏂囦歡錛堝涓嬬矖浣撻儴浠斤級錛屽湪瀹冪殑url璇鋒眰涓妸鎴戜滑瀹氫箟鐩綍鍔犲叆鍒癵et鍙傛暟鍒椾腑錛岃繖鏍峰畠灝卞彲浠ヤ紶鍒?/span>fckeditor_controller.rb閲屼簡<span style="color: rgb(0, 0, 0);">銆?br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><br />var聽sServerPath聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽GetUrlParam(聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">ServerPath</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽)聽;<br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(聽sServerPath.length聽</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">聽)<br />聽聽聽聽oConnector.ConnectorUrl聽</span><span style="color: rgb(0, 0, 0);">+=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">ServerPath=</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽escape(聽sServerPath聽)聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">&</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽;<br /><br /><b>var聽sUploaded聽</b></span><b><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽GetUrlParam(聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">uploaded</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽)聽;<br /></span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(聽sUploaded.length聽</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">聽)<br />聽聽聽聽oConnector.ConnectorUrl聽</span><span style="color: rgb(0, 0, 0);">+=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">uploaded=</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽escape(聽sUploaded聽)聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">&</span><span style="color: rgb(0, 0, 0);">'</span></b><span style="color: rgb(0, 0, 0);"><b>聽;</b><br /><br />oConnector.ResourceType聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽GetUrlParam(聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">Type</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽)聽;<br />oConnector.ShowAllTypes聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(聽oConnector.ResourceType.length聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">聽)聽;<br /><br /></span></div><br />3.聽 涓婇潰</span>鐨凣etUrlParam(聽'uploaded'聽) 鐨勫兼潵鑷簬fckcustom.js銆備慨鏀筬ckcustom.js錛堝涓嬬矖浣撻儴浠斤級錛屾妸uploaded鍔犲叆鍒癵et鍙傛暟鍒椾腑銆?br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">//</span><span style="color: rgb(0, 0, 0);">聽CHANGE聽FOR聽APPS聽HOSTED聽IN聽SUBDIRECTORY<br />FCKRelativePath聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">''</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 0);">//</span><span style="color: rgb(0, 0, 0);">聽DON</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">T聽CHANGE聽THESE</span><span style="color: rgb(128, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);">FCKConfig.LinkBrowserURL聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKConfig.BasePath聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">filemanager/browser/default/browser.html?Connector=</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">FCKRelativePath</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/fckeditor/command</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br />FCKConfig.ImageBrowserURL聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKConfig.BasePath聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">filemanager/browser/default/browser.html?<b>uploaded=</b></span><b><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">FCKConfig.uploaded</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span></b><span style="color: rgb(128, 0, 0);"><b>&</b>Type=Image&Connector=</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">FCKRelativePath</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/fckeditor/command</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br />FCKConfig.FlashBrowserURL聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKConfig.BasePath聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">filemanager/browser/default/browser.html?<b>uploaded=</b></span><b><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">FCKConfig.uploaded</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span></b><span style="color: rgb(128, 0, 0);"><b>&</b>Type=Flash&Connector=</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">FCKRelativePath</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/fckeditor/command</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br /><br />FCKConfig.LinkUploadURL聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKRelativePath</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/fckeditor/upload</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br />FCKConfig.ImageUploadURL聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKRelativePath</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/fckeditor/upload?Type=Image<b>&uploaded=</b></span><b><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span></b><span style="color: rgb(0, 0, 0);"><b>FCKConfig.uploaded</b>;<br />FCKConfig.FlashUploadURL聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKRelativePath</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/fckeditor/upload?Type=Flash<b>&uploaded=</b></span><b><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">+</span></b><span style="color: rgb(0, 0, 0);"><b>FCKConfig.uploaded</b>;<br />FCKConfig.AllowQueryStringDebug聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽false;<br />FCKConfig.SpellChecker聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">SpellerPages</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br /><br /></span><span style="color: rgb(0, 0, 0);">//</span><span style="color: rgb(0, 0, 0);">聽ONLY聽CHANGE聽BELOW聽HERE<br />FCKConfig.SkinPath聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽FCKConfig.BasePath聽</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">skins/silver/</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br />FCKConfig.AutoDetectLanguage聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽false聽;<br />FCKConfig.DefaultLanguage聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">zh-cn</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽;<br />FCKConfig.FontNames聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">寰蔣闆呴粦;瀹嬩綋;榛戜綋;闅朵功;妤蜂綋_GB2312;Arial;Comic聽Sans聽MS;Courier聽New;Tahoma;Times聽New聽Roman;Verdana</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">聽;<br /><br />FCKConfig.ToolbarSets[</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">Simple</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">]聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽[<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Source</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">-</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">FitWindow</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Preview</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">-</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Templates</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">PasteText</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">PasteWord</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Undo</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Redo</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Find</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Replace</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">RemoveFormat</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Bold</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Italic</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Underline</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">StrikeThrough</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">OrderedList</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">UnorderedList</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Outdent</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Indent</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">JustifyLeft</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">JustifyCenter</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">JustifyRight</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">JustifyFull</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">TextColor</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">BGColor</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Link</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Unlink</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Anchor</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Image</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Flash</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Table</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Rule</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Smiley</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">],<br />聽聽聽聽</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">/</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,<br />聽聽聽聽[</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">Style</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">FontFormat</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">FontName</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(128, 0, 0);">FontSize</span><span style="color: rgb(128, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">]<br />]聽;<br /></span></div><br />4. 涓婇潰FCKConfig.uploaded鐨勫兼潵鑷簬fckeditor.rb銆傚湪fckeditor.rb涓姞鍏ヤ竴鍙ワ紙濡備笅綺椾綋鎵紺猴級銆?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽javascript_tag(聽</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">var聽oFCKeditor聽=聽new聽FCKeditor('#{id}',聽'#{width}',聽'#{height}',聽'#{toolbarSet}');\n</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">oFCKeditor.BasePath聽=聽\</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 128, 0);">#</span><span style="color: rgb(0, 128, 0);">{base_path}\"\n"+</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">oFCKeditor.Config['CustomConfigurationsPath']聽=聽'../../fckcustom.js';\n</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"><br /><b>聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</b></span><b><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">oFCKeditor.Config['uploaded']聽=聽'#{options[:path]}';\n</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span></b><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">oFCKeditor.ReplaceTextarea();\n</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<br /></span></div><br />5.<b><span style="color: rgb(0, 0, 0);"></span></b>涓嶈繃涓婇潰oFCKeditor.Config['uploaded']鐨勫艱浼犲埌fckcustom.js鐨凢CKConfig.uploaded閲岋紝榪橀渶瑕佷慨鏀筬ckeditorcode_gecko.js鍜宖ckeditorcode_ie.js錛堣繖涓や釜鏂囦歡瀵筳avascript榪涜浜嗗帇緙╁鐞嗭紝淇敼璧鋒潵杈冮毦鎿嶄綔錛夈傛垜鏄弬鑰冧簡oFCKeditor.Config['CustomConfigurationsPath'] 榪欎釜鍙傛暟鐨勮澆鍏ュ疄鐜幫紝鎵嶆壘鍒拌繖縐嶉笩涓嶇敓铔嬬殑鍦版柟銆傛悳绱㈣繖涓や釜鏂囦歡鐨勫叧閿瓧<span style="color: rgb(0, 0, 0);">CustomConfigurationsPath</span>錛屾壘鍒板涓嬩竴琛岋紝鐒跺悗鍔犲叆涓涓猠lse if鍒ゆ柇(濡備笅綺椾綋鎵紺猴級銆?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(D</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">CustomConfigurationsPath</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">)聽FCKConfig[D]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">E;</span><b><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(D</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">uploaded</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">)聽FCKConfig[D]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">E;</span></b><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">聽(E.toLowerCase()</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">true</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)聽</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.PageConfig[D]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;</span></div><br /><span style="color: rgb(0, 0, 0);"></span><br />6.鏈鍚庡湪fckeditor.rb閲岀殑#{options[:path]}鏉ヨ嚜浜庢垜浠墠鍙扮殑view浜嗐傚涓嬬矖浣撴墍紺猴紝鎶婃爣鍑嗙殑fckedit<span style="color: rgb(0, 0, 0);">or_textarea鏂板鍔犱簡涓涓弬鏁幫紝鍏朵腑</span><span style="color: rgb(0, 0, 0);">params[:user_id]鏄妸</span><span style="color: rgb(0, 0, 0);">鐢ㄦ埛鐨処D鍊煎仛涓?/span><span style="color: rgb(0, 0, 0);">鐩綍鍚嶃傝繖鏍峰氨瀹炵幇浜嗗姩鎬佹敼鍙楩CKEditor鐨勪笂浼犵洰褰曘?/span><br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><%=</span><span style="color: rgb(0, 0, 0);">fckeditor_textarea(:topic,聽:content,聽:ajax聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">,聽:toolbarSet聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">Simple</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,聽:height聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">400px</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">,聽 :path聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/uploads/#{params[:user_id]}</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)聽</span><span style="color: rgb(0, 0, 0);">%></span></div><br /><br />淇敼瀹屽悗闇瑕侀噸鍚疻EB鏈嶅姟錛屾渶鍚庡埆蹇樿鎶妏ublic/javascripts/fckeditor鍜寁endor/plugins/fckeditor/public/javascripts鍚屾涓涓嬶紝鍘熷洜瑙乭ttp://www.tkk7.com/chengang/archive/2007/09/24/147867.html<span style="color: rgb(0, 0, 0);"><b><br /></b></span><img src ="http://www.tkk7.com/chengang/aggbug/148114.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/chengang/" target="_blank">闄堝垰</a> 2007-09-26 10:13 <a href="http://www.tkk7.com/chengang/archive/2007/09/26/148114.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀹氬埗FCKEditor錛屼互鍙婁嬌鍏朵腑鏂囧寲http://www.tkk7.com/chengang/archive/2007/09/24/147867.html闄堝垰闄堝垰Mon, 24 Sep 2007 10:24:00 GMThttp://www.tkk7.com/chengang/archive/2007/09/24/147867.htmlhttp://www.tkk7.com/chengang/comments/147867.htmlhttp://www.tkk7.com/chengang/archive/2007/09/24/147867.html#Feedback0http://www.tkk7.com/chengang/comments/commentRss/147867.htmlhttp://www.tkk7.com/chengang/services/trackbacks/147867.html
鏂?闄堝垰聽 www.chengang.com.cn
棣栧厛錛屾垜浠潵鐪嬬湅FCKEditor鍦≧ails涓殑榪愯鐗規э紝鍏舵彃浠朵富瑕佹槸瀹夎鍦╲endor/plugins/fckeditor銆備富瑕佺殑浠g爜鍦╲endor/plugins/fckeditor/public/javascripts錛屽叾涓璮ckcustom.js鏄厤緗枃浠訛紝鍙﹀鏇存繁涓灞傜殑瀛愮洰褰昮ckeditor涓繕鏈変竴涓猣ckconfig.js涔熸槸閰嶇疆鏂囦歡銆俧ckcustom.js閰嶇疆鐨勪紭鍏堥『搴忓ぇ浜巉ckconfig.js錛屽洜姝や竴鑸慨鏀筬ckcustom.js灝卞彲浠ヤ簡錛屼笉蹇呭幓鍔╢ckconfig.js銆?br />
鍦ㄥ惎鍔╓EBrick( ruby script/server)鏃訛紝浼氳嚜鍔ㄦ妸vendor/plugins/fckeditor/public/javascripts鐨勫唴瀹瑰鍒跺埌public/javascripts鐩綍銆傚洜姝ゅ鏋滀綘淇敼浜咶CKEditor鐨勯厤緗枃浠朵箣鍚庯紝闇瑕佹妸澶嶅埗鍒皃ublic/javascripts鐩綍鐨凢CKEditor鐩稿叧鏂囦歡鍒犻櫎鎺夛紝鐒跺悗鍐嶉噸鍚疻EBrick銆傚綋鐒訛紝浣犱篃鍙互鐩存帴淇敼public/javascripts鐩綍鐨凢CKEditor鐨勭紦瀛樼殑閰嶇疆鏂囦歡錛岃繖鏍蜂笉蹇呴噸鍚疻EBrick錛屽氨鍙互绔嬪嵆鐪嬪埌淇敼鏁堟灉銆備笉榪囧緩璁綘鍦ㄥ畬鎴愪慨鏀瑰悗錛屽悓鏃朵篃瑕佹洿鏂皏endor/plugins/fckeditor/public/javascripts涓嬬殑閰嶇疆鏂囦歡錛屾瘯绔焢ublic/javascripts閲岀殑搴旇綆楁槸涓存椂鏂囦歡銆?br />

1.涓枃鍖?br />
鍦╢ckcustom.js閲屽姞鍏ヤ袱欏癸紙綺椾綋鏄劇ず錛?br />
FCKConfig.SkinPath聽=聽FCKConfig.BasePath聽+'skins/silver/';
FCKConfig
.AutoDetectLanguage聽=聽false聽;
FCKConfig
.DefaultLanguage聽='zh-cn'
;

2. 瀹氬埗FCKEditor鐨勫伐鍏鋒爮
淇敼fckcustom.js閲岀殑濡備笅欏圭洰錛屽鍒犳敼鑷究銆?br />
FCKConfig.ToolbarSets["Simple"]聽=聽[聽聽 銆傘傘?銆傘傘?br />

榪欓噷瑕佹敞鎰忎竴鐐癸紝鏈変簺緗戜笂鏂囩珷鎶?span style="color: rgb(0, 0, 0);">:toolbarSet鍐欐垚浜?/span>:toolbarKit錛岃繖鏄敊璇殑銆傚鏋滀綘鍙戠幇瀵瑰伐鍏鋒爮鐨勯厤緗笉璧蜂綔鐢紝閭d箞瑕佹鏌ヤ竴涓嬨傛紜殑鍐欐硶濡備笅錛?br />
<%=fckeditor_textarea(:topic,:content,:ajax聽=>聽true,:toolbarSet聽=>'Simple',:width聽=>'100%',:height聽=>'300px')聽%>








闄堝垰 2007-09-24 18:24 鍙戣〃璇勮
]]>
error_messages_for鐨勪腑鏂囧寲http://www.tkk7.com/chengang/archive/2007/09/19/146548.html闄堝垰闄堝垰Wed, 19 Sep 2007 09:35:00 GMThttp://www.tkk7.com/chengang/archive/2007/09/19/146548.htmlhttp://www.tkk7.com/chengang/comments/146548.htmlhttp://www.tkk7.com/chengang/archive/2007/09/19/146548.html#Feedback0http://www.tkk7.com/chengang/comments/commentRss/146548.htmlhttp://www.tkk7.com/chengang/services/trackbacks/146548.htmlApplicationHelper
鏂?闄堝垰聽 www.chengang.com.cn聽 杞澆璇峰0鏄庡嚭澶?/span>

聽 def聽error_messages_for(*params)
聽聽聽聽
#add聽by聽glchengang
聽聽聽聽key_hash聽=聽{}
聽聽聽聽
if聽params.first.is_a?(Hash)
聽聽聽聽聽聽key_hash聽
=聽聽params.first
聽聽聽聽聽聽params
.delete_at(0)
聽聽聽聽end
聽聽聽聽
#add聽end

聽聽聽聽options聽
=聽params.last.is_a?(Hash)聽?聽params.pop.symbolize_keys聽:聽{}
聽聽聽聽objects聽
=聽params.collect聽{|object_name|聽instance_variable_get("@#{object_name}")聽}.compact
聽聽聽聽count聽聽聽
=聽objects.inject(0)聽{|sum,聽object|聽sum聽+聽object.errors.count聽}
聽聽聽聽
unless聽count.zero?
聽聽聽聽聽聽html聽
=聽{}
聽聽聽聽聽聽[
:id,:class].eachdo|key|
聽聽聽聽聽聽聽聽
if聽options.include?(key)
聽聽聽聽聽聽聽聽聽聽value聽
=聽options[key]
聽聽聽聽聽聽聽聽聽聽html[key]聽
=聽value聽unless聽value.blank?
聽聽聽聽聽聽聽聽
else
聽聽聽聽聽聽聽聽聽聽html[key]聽
='errorExplanation'
聽聽聽聽聽聽聽聽end
聽聽聽聽聽聽end
聽聽聽聽聽聽
#聽change聽by聽glchengang
聽聽聽聽聽聽header_message聽="鏈?{count}涓敊璇?/span>"
#聽聽聽聽聽聽聽header_message聽=聽"#{pluralize(count,聽'error')}聽prohibited聽this聽#{(options[:object_name]聽||聽params.first).to_s.gsub('_',聽'聽')}聽from聽being聽saved"
聽聽聽聽聽聽
聽聽聽聽聽聽#add聽by聽glchengang

聽聽聽聽聽聽error_messages聽=聽objects.mapdo|object|
聽聽聽聽聽聽聽聽temp聽
=聽[]
聽聽聽聽聽聽聽聽object
.errors.eachdo|attr,聽msg|
聽聽聽聽聽聽聽聽聽聽temp聽
<<聽content_tag(:li,聽(key_hash[attr]聽||聽attr)聽+聽msg)聽
聽聽聽聽聽聽聽聽end
聽聽聽聽聽聽聽聽temp
聽聽聽聽聽聽end
聽聽聽聽聽聽
#add聽end

#聽聽聽聽聽聽聽聽error_messages聽=聽objects.map聽{|object|聽object.errors.full_messages.map聽{|msg|聽content_tag(:li,聽msg)聽}聽}

聽聽聽聽聽聽content_tag(:div,
聽聽聽聽聽聽聽聽content_tag(options[
:header_tag]聽||:h2,聽header_message)聽<<
#聽聽聽聽聽聽聽聽聽聽聽content_tag(:p,聽'There聽were聽problems聽with聽the聽following聽fields:')聽<<
聽聽聽聽聽聽聽聽聽聽content_tag(:ul,聽error_messages),
聽聽聽聽聽聽聽聽html
聽聽聽聽聽聽)
聽聽聽聽
else
聽聽聽聽聽聽
''
聽聽聽聽end
聽聽end


浣跨敤渚濈劧鍏煎鑰佺殑鏂瑰紡錛屼綘涔熷彲浠ヤ紶鍏ヤ竴涓搱甯岃〃錛屾妸妯″瀷瀛楁鏄劇ず鎴愬搴旂殑涓枃錛岀ず渚嬪涓嬶細
<%=
h聽
=聽{'username'=>'鐢ㄦ埛鍚?/span>','password'=>'瀵嗙爜'}
error_messages_for聽h
,:user
%>

鍙﹀錛岃繕瑕佸湪environment.rb鐨勬渶鍚庢彃鍏ヤ互涓嬩唬鐮侊細

errors聽=聽ActiveRecord::Errors.default_error_messages
errors[
:taken]聽='宸茬粡琚嬌鐢?/span>'
errors[
:blank]聽='涓嶈兘涓虹┖'



闄堝垰 2007-09-19 17:35 鍙戣〃璇勮
]]>
璁﹚ill_paginate鐨勫垎欏墊敮鎸乤jaxhttp://www.tkk7.com/chengang/archive/2007/09/02/142077.html闄堝垰闄堝垰Sun, 02 Sep 2007 07:42:00 GMThttp://www.tkk7.com/chengang/archive/2007/09/02/142077.htmlhttp://www.tkk7.com/chengang/comments/142077.htmlhttp://www.tkk7.com/chengang/archive/2007/09/02/142077.html#Feedback14http://www.tkk7.com/chengang/comments/commentRss/142077.htmlhttp://www.tkk7.com/chengang/services/trackbacks/142077.html
鏂?闄堝垰 (www.chengang.com.cn)
浣嗕竴鐩存悳涓嶅埌瀹冩敮鎸乤jax鍒嗛潰鐨勬柟娉?錛屼簬鏄垜鍙傝冨畠鍒嗛〉鏂規硶鐨勬簮浠g爜(浣嶄簬:vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb)錛岀◢寰敼鍐欙紝鍙樻垚浜嗕竴涓敮鎸乤jax鐨勫垎欏墊柟娉曘備互涓嬩唬鐮佸鍒跺埌application_helper閲屽嵆鍙?br />

聽聽
#-----------------------------------------
聽聽#聽will_paginate鎻掍歡鐨刟jax鍒嗛〉
聽聽#-----------------------------------------
聽聽@@pagination_options聽=聽{聽:class=>'pagination',
聽聽聽聽聽聽聽聽
:prev_label聽聽聽=>'涓婁竴欏?/span>',
聽聽聽聽聽聽聽聽
:next_label聽聽聽=>'涓嬩竴欏?/span>',
聽聽聽聽聽聽聽聽
:inner_window聽=>4,#聽links聽around聽the聽current聽page
聽聽聽聽聽聽聽聽:outer_window聽=>1,#聽links聽around聽beginning聽and聽end
聽聽聽聽聽聽聽聽:separator聽聽聽聽=>'',#聽single聽space聽is聽friendly聽to聽spiders聽and聽non-graphic聽browsers
聽聽聽聽聽聽聽聽:param_name聽聽聽=>:page,
聽聽聽聽聽聽聽聽
#add聽by聽chengang
聽聽聽聽聽聽聽聽:update聽=>nil,#ajax鎵瑕佹洿鏂扮殑html鍏冪礌鐨刬d
聽聽聽聽聽聽聽聽:url_suffix聽=>''聽聽#url鐨勫悗緙錛屼富瑕佹槸涓轟簡琛ュ叏REST鎵闇瑕佺殑url
聽聽聽聽聽聽聽聽#add聽end
聽聽聽聽聽聽聽聽}
聽聽mattr_reader聽
:pagination_options

聽聽def聽will_paginate_remote(entries聽
=聽@entries,聽options聽=聽{})
聽聽聽聽total_pages聽
=聽entries.page_count

聽聽聽聽
if聽total_pages聽>1
聽聽聽聽聽聽options聽
=聽options.symbolize_keys.reverse_merge(pagination_options)
聽聽聽聽聽聽page
,聽param聽=聽entries.current_page,聽options.delete(:param_name)
聽聽聽聽聽聽
聽聽聽聽聽聽inner_window
,聽outer_window聽=聽options.delete(:inner_window).to_i,聽options.delete(:outer_window).to_i
聽聽聽聽聽聽
#add聽by聽chengang
聽聽聽聽聽聽update聽=聽聽options.delete(:update)
聽聽聽聽聽聽suffix聽
=聽聽options.delete(:url_suffix)
聽聽聽聽聽聽url聽
=聽request.env['PATH_INFO']聽
聽聽聽聽聽聽url聽
+=聽suffix聽if聽suffix
聽聽聽聽聽聽
#add聽end

聽聽聽聽聽聽
min=聽page聽-聽inner_window
聽聽聽聽聽聽
max=聽page聽+聽inner_window
聽聽聽聽聽聽
ifmax>聽total_pages聽then聽min-=max-聽total_pages
聽聽聽聽聽聽elsif聽
min<1聽聽then聽max+=1-min
聽聽聽聽聽聽
end
聽聽聽聽聽聽
聽聽聽聽聽聽
current聽聽聽=min..max
聽聽聽聽聽聽beginning聽
=1..(1+聽outer_window)
聽聽聽聽聽聽tail聽聽聽聽聽聽
=聽(total_pages聽-聽outer_window)..total_pages
聽聽聽聽聽聽visible聽聽聽
=聽[beginning,current,聽tail].map(&:to_a).flatten.sort.uniq
聽聽聽聽聽聽links
,prev=聽[],0

聽聽聽聽聽聽visible
.eachdo|n|
聽聽聽聽聽聽聽聽
nextif聽n聽<1
聽聽聽聽聽聽聽聽
breakif聽n聽>聽total_pages

聽聽聽聽聽聽聽聽unless聽n聽
-prev>1
聽聽聽聽聽聽聽聽聽聽
prev=聽n
聽聽聽聽聽聽聽聽聽聽
#change聽by聽chengang
聽聽聽聽聽聽聽聽聽聽text聽=聽(n==page聽?聽n聽:"[#{n}]")
聽聽聽聽聽聽聽聽聽聽links聽
<<聽page_link_remote_or_span((n聽!=聽page聽?聽n聽:聽nil),'current',聽text,聽param,聽update,聽url)
聽聽聽聽聽聽聽聽
else
聽聽聽聽聽聽聽聽聽聽
prev=聽n聽-1
聽聽聽聽聽聽聽聽聽聽links聽
<<''
聽聽聽聽聽聽聽聽聽聽redo
聽聽聽聽聽聽聽聽
end
聽聽聽聽聽聽
end
聽聽聽聽聽聽
聽聽聽聽聽聽
#change聽by聽chengang
聽聽聽聽聽聽links.unshift聽page_link_remote_or_span(entries.previous_page,'disabled',聽options.delete(:prev_label),聽param,聽update,聽url)
聽聽聽聽聽聽links
.push聽聽聽聽page_link_remote_or_span(entries.next_page,聽聽聽聽聽'disabled',聽options.delete(:next_label),聽param,聽update,聽url)
聽聽聽聽聽聽
#change聽end

聽聽聽聽聽聽content_tag聽
:div,聽links.join(options.delete(:separator)),聽options
聽聽聽聽
end
聽聽
end
聽聽
protected

聽聽def聽page_link_remote_or_span(page
,聽span_class,聽text,聽param,聽update,聽url)
聽聽聽聽unless聽page
聽聽聽聽聽聽content_tag聽
:span,聽text,:class=>聽span_class
聽聽聽聽
else
聽聽聽聽聽聽link_to_remote聽text
,:update聽=>聽update,:url聽=>"#{url}?#{param.to_sym}=#{page}",:method=>:get
聽聽聽聽
end
聽聽
end


鍦╲iew涓殑浣跨敤濡備笅鎵紺?
聽聽聽聽聽聽聽聽聽聽<%=will_paginate_remote聽@topics,:update聽=>'topicList',:url_suffix聽=>聽url_suffix%>




闄堝垰 2007-09-02 15:42 鍙戣〃璇勮
]]>
鍦≧ails涓嬌鐢‵CKeditor鎻掍歡瀹炵幇WEB瀵屾枃鏈紪杈?/title><link>http://www.tkk7.com/chengang/archive/2007/08/25/139287.html</link><dc:creator>闄堝垰</dc:creator><author>闄堝垰</author><pubDate>Sat, 25 Aug 2007 08:44:00 GMT</pubDate><guid>http://www.tkk7.com/chengang/archive/2007/08/25/139287.html</guid><wfw:comment>http://www.tkk7.com/chengang/comments/139287.html</wfw:comment><comments>http://www.tkk7.com/chengang/archive/2007/08/25/139287.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/chengang/comments/commentRss/139287.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/chengang/services/trackbacks/139287.html</trackback:ping><description><![CDATA[姣斿璞logJava榪欓噷緙栬緫鍣ㄥ氨搴旇鏄敤鐨凢CKeditor 錛孎CKeditor 鐩稿綋鏈夊悕錛屽畠鏈塒HP銆丣SP銆乺ails絳夊涓増鏈紝鏍稿績閮芥槸涓浜沯avascript浠g爜銆?br /><br /><div style="text-align: center;">鏂?闄堝垰聽 (www.chengang.com.cn)<br /></div><br />鐜錛歶buntu linux 7.0.4聽 +聽 ruby 1.8.5 + Rails 1.2.3 + FCKeditor 0.4.1 <br /><br />鐩存帴浠庡畠鐨剆ubversion搴撻噷鍙栧緱璇ails鎻掍歡銆傚厛榪涘叆鍒頒綘鐨勯」鐩牴鐩綍錛屽啀鎵ц濡備笅鍛戒護<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->ruby聽script/plugin聽install聽svn://rubyforge.org/var/svn/fckeditorp/trunk/fckeditor<br /></div><br />鍏朵粬璇存槑錛?br />(1)浣犵殑linux蹇呴』鍏堝畨瑁呬簡subversion銆傦紙ubuntu閲岀敤鏂扮珛寰楁悳subversion鍗沖緱錛?br />(2)鎶婂懡浠や腑鐨刬nstall 鏀逛負 destory錛屽彲浠ュ垹闄ゅ畨瑁呫?br />(3)鎴戝彇鍒扮殑鏄?007騫?鏈堜喚鏈鍚庢洿鏂扮殑, v 0.4.1鐗?br />(4)FCKeditor瀹夎鍦ㄩ」鐩牴鐩綍涓嬬殑vendor/plugins/fckeditor 閲岋紝<br />(5)vendor/plugins/fckeditor閲岀殑README寰堝煎緱涓璇伙紝鎴戠鍒癆jax闂錛屾煡浜嗘墍浠ョ綉涓婄殑涓枃璧勬枡閮芥病鏈夋彁鍒幫紝鍦ㄨ繖涓猂EADME鍗存湁銆?br /><br /><br />鐢ㄥ涓嬭鍙ュ湪欏甸潰閲屽惈鍏ュ畠鐨刯avascript搴?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><%=</span><span style="color: rgb(0, 0, 0);">聽javascript_include_tag聽:fckeditor聽</span><span style="color: rgb(0, 0, 0);">%></span><span style="color: rgb(0, 0, 0);">聽聽</span></div> 鎴?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><%=</span><span style="color: rgb(0, 0, 0);">聽javascript_include_tag聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">fckeditor/fckeditor</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">%></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /><br />鍦ㄩ渶瑕佸瘜鏂囨湰鐨凢orm琛ㄥ崟鐢ㄥ涓嬭鍙ョ敓鎴愪竴涓瘜鏂囦歡緙栬緫妗嗭細<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><%=</span><span style="color: rgb(0, 0, 0);">聽fckeditor_textarea(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">topic</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">content</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽:toolbarSet聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'Simple',聽:width聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'</span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">',聽:height聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'200px')聽</span><span style="color: rgb(0, 0, 0);">%></span></div><br />璇存槑錛歵opic瀵瑰簲妯″瀷瀵硅薄,content瀵瑰簲瀹冪殑瀛楁銆備篃灝辨槸瑕佹眰褰撳墠欏佃鏈堾topic榪欎釜瀹炰緥鍙橀噺銆?br /><br /><br />濡傛灉鏄敤浜哸jax錛屽垯闇瑕佸湪form_remote_tag鍔犱笂涓涓猙efore欏?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">聽聽</span><span style="color: rgb(0, 0, 0);"><%=</span><span style="color: rgb(0, 0, 0);">聽form_remote_tag(:update聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽update,<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<span style="color: red;">聽:before聽</span></span><span style="color: red;">=></span><span style="color: rgb(0, 0, 0);"><span style="color: red;">聽fckeditor_before_js('topic',聽'content'),</span><br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽:url聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽{:controller聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'topics',聽:action聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'create',聽:template聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'show'}聽)</span><span style="color: rgb(0, 0, 0);">%></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br />騫朵笖瀵屾枃浠剁紪杈戞瑕佸姞涓涓猘jax=true鐨勯夐」錛?br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><%=</span><span style="color: rgb(0, 0, 0);">聽fckeditor_textarea(:topic,聽:content,聽<span style="color: red;">:ajax聽</span></span><span style="color: red;">=>聽true</span><span style="color: rgb(0, 0, 0);"><span style="color: red;">,聽</span>:toolbarKit聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'Simple',聽:width聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'</span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">',聽:height聽</span><span style="color: rgb(0, 0, 0);">=></span><span style="color: rgb(0, 0, 0);">聽'600px')聽</span><span style="color: rgb(0, 0, 0);">%></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /><br /><br /><br /><br />鍦ㄤ嬌涓婁紶鍥劇墖鐨勫姛鑳芥椂紕板埌浜嗛敊璇傚脊鍑哄嚭alert瀵硅瘽妗嗭紝鏄劇ず錛欵rror on file upload.Error number: 403 <br /><p>鍦ㄦ棩蹇楅噷鏄劇ず濡備笅錛岃〃闈笂鐪嬪ソ璞℃槸璺敱閰嶇疆鐨勯棶棰?/p><p>ActionController::RoutingError (no route found to match "/fckblank.html" with {:method=>:get}): <br /> /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1292:in `recognize_path' <br /> /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1282:in `recognize' <br /> /var/lib/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:40:in `dispatch' <br /> /var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in `handle_dispatch' <br /> /var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in `service' <br /> /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' <br /> /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' <br /> /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' <br /> /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' <br /> /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'</p><br />鏈鍚庡湪http://blog.caronsoftware.com/articles/2006/12/03/fckeditor-0-4-0-released#comment-1745鎵懼埌浜嗙瓟妗堬紝榪欐槸涓涓狟UG <p>瑙e喅鏂規硶 錛?br /></p><p>淇敼錛歷endor/plugins/fckeditor/app/controller/fckeditor_controller.rb<br />灝嗗師鏉ョ殑<br /></p><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">unless</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0); font-weight: bold;">#{file.class}</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0); font-weight: bold;">Tempfile</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span></div><br />鏀逛負<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">unless</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0); font-weight: bold;">#{file.class}</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0); font-weight: bold;">Tempfile</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0); font-weight: bold;">#{file.class}</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span><span style="color: rgb(0, 0, 0); font-weight: bold;">StringIO</span><span style="color: rgb(0, 0, 0); font-weight: bold;">"</span></div><br /><br /><br /><img src ="http://www.tkk7.com/chengang/aggbug/139287.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/chengang/" target="_blank">闄堝垰</a> 2007-08-25 16:44 <a href="http://www.tkk7.com/chengang/archive/2007/08/25/139287.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://sdshfengji.com" target="_blank">国产1000部成人免费视频</a>| <a href="http://yuyang0752.com" target="_blank">免费一看一级毛片全播放</a>| <a href="http://81am.com" target="_blank">亚洲AV无码专区亚洲AV伊甸园 </a>| <a href="http://564ka.com" target="_blank">亚洲免费在线观看视频</a>| <a href="http://zhidianzh.com" target="_blank">无码av免费网站</a>| <a href="http://xbooktxt.com" target="_blank">亚洲一级二级三级不卡</a>| <a href="http://0939666.com" target="_blank">777成影片免费观看</a>| <a href="http://ocn888.com" target="_blank">亚洲国语在线视频手机在线</a>| <a href="http://3baimm.com" target="_blank">99在线精品免费视频九九视</a>| <a href="http://xingqiu1.com" target="_blank">日韩一级片免费观看</a>| <a href="http://zmnhssn.com" target="_blank">亚洲精品无码专区在线在线播放</a>| <a href="http://477077.com" target="_blank">免费人成激情视频在线观看冫 </a>| <a href="http://0595laser.com" target="_blank">亚洲伊人久久大香线蕉</a>| <a href="http://abc17171.com" target="_blank">国产国拍亚洲精品福利</a>| <a href="http://kingco-glaze.com" target="_blank">日本免费A级毛一片</a>| <a href="http://71caoxee.com" target="_blank">色综合久久精品亚洲国产</a>| <a href="http://ywgj50225.com" target="_blank">国产a不卡片精品免费观看</a>| <a href="http://hnshlt.com" target="_blank">国产免费高清69式视频在线观看</a>| <a href="http://416164.com" target="_blank">亚洲成A∨人片在线观看不卡</a>| <a href="http://hlyidc.com" target="_blank">免费无码毛片一区二区APP</a>| <a href="http://wenbye.com" target="_blank">亚洲AV无码一区二区三区人 </a>| <a href="http://gdfcjzx.com" target="_blank">国产亚洲国产bv网站在线</a>| <a href="http://sao350.com" target="_blank">日韩中文字幕免费</a>| <a href="http://by7258.com" target="_blank">一级毛片一级毛片免费毛片</a>| <a href="http://binz132.com" target="_blank">国产亚洲综合一区柠檬导航</a>| <a href="http://html5text.com" target="_blank">四虎永久成人免费影院域名</a>| <a href="http://ytshdiping.com" target="_blank">成人福利免费视频</a>| <a href="http://89895cc.com" target="_blank">99视频在线免费</a>| <a href="http://kssijia.com" target="_blank">免费无码又爽又刺激网站直播</a>| <a href="http://chinaedubrand.com" target="_blank">国产精品亚洲一区二区三区在线观看 </a>| <a href="http://hs718.com" target="_blank">国产色爽免费无码视频</a>| <a href="http://www-6209.com" target="_blank">黄页网站在线观看免费</a>| <a href="http://junfurui.com" target="_blank">亚洲AV日韩精品久久久久</a>| <a href="http://qqc46.com" target="_blank">久久天天躁狠狠躁夜夜免费观看</a>| <a href="http://6266tv.com" target="_blank">色屁屁在线观看视频免费</a>| <a href="http://zgdhuibao.com" target="_blank">久久亚洲最大成人网4438</a>| <a href="http://ivy-fund.com" target="_blank">久久久久亚洲AV无码观看</a>| <a href="http://saob19.com" target="_blank">国产免费av片在线无码免费看</a>| <a href="http://xbooktxt.com" target="_blank">9久9久女女免费精品视频在线观看</a>| <a href="http://gyqcy.com" target="_blank">91老湿机福利免费体验</a>| <a href="http://963315.com" target="_blank">99re热精品视频国产免费</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>