Eric @ EricBess WebHome

一味思考而不行动,将在不知不觉中变得无意义

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H

WP-CODEBOX Plugin (代码高亮插件)

Author:Eric.Wang
Plugin URL:http://wordpress.org/extend/plugins/wp-codebox/
Tags: syntax highlighting, syntax, highlight, code, formatting
Requires at least: 2.0
Tested up to: 2.5.1
Stable tag: 1.3.1
Download

Donate for this plugin development, Thanks!

== Description ==

WP-CODEBOX代码高亮插件,支持多种语言、代码下载、复制到剪贴板、代码框收放及后台默认属性设置。本插件还在持续开发中,欢迎使用及报告bugs.
Wp-CodeBox provides clean syntax highlighting and advanced feature for embedding source code within pages or posts. It support a wide range of popular languages highlighting with line numbers, code download, Copy to clipboard, collapse codebox, automatic keywords link to API manual and maintains formatting while copying snippets of code from the browser.

It's provide simple background configuration for highlighter style/formatting customization.
Since the plugin is developing, in the future it will support more options.(CSS option,Keyword display style,Auto Caps/Nocaps,Case Sensitivity etc. )

== Basic Usage ==

Wrap code blocks with `<pre lang="LANGUAGE" line="1" file="download.txt" colla="+">` and `</pre>`

Possible Parameters:

`LANGUAGE` is a [GeSHi] supported language syntax;
`file` will create a code downloading attribute.;
`line="n"` will hide the single codebox;
`colla="+/-"` will expand/collapse the codebox.
`line,file,colla` is optional.

== Installation ==

1. Upload WP-CodeBox.zip to your Wordpress plugins directory, usually `wp-content/plugins/` and unzip the file.  It will create a `wp-content/plugins/WP-CodeBox/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to Option->Wp-CodeBox set default setting.
4. Create a post/page that contains a code snippet following the [proper usage syntax]

== Frequently Asked Questions ==

When activate the plugin, popup the error: "Fatal error: Cannot redeclare class GeSHi in ##/wp-content/plugins/wp-codebox/geshi/geshi.php on line 158"?
Answer:disactivate other Gashi based syntax highlighter plugin first.

== Screenshots ==

1. PHP, no line numbers.

<div id="foo">
<?php
  function foo() {
    echo "Hello World!\\n";
  }
  for (\$i = 0; \$i < 10 $i++) {
    foo();
  }
?>
</div>

2. Java, with line numbers, collapse codebox.

1
2
3
4
5
public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

3. Ruby, with line numbers starting at 18,downloading feature.

?Download ruby.txt
18
19
20
21
22
class Example
     def example(arg1)
    return "Hello: " + arg1.to_s
  end
end

4. Administration interface in WordPress 2.
screenshot-1.gif

== Usage ==

**Example 1: PHP, no line numbers**
    <pre lang="php" line="n">
    <div id="foo">
    <?php
      function foo() {
        echo "Hello World!\\n";
      }
      for (\$i = 0; \$i < 10 $i++) {
        foo();
      }
    ?>
    </div>
    </pre>
**Example 2: Java, with line numbers, collapse codebox**
    <pre lang="java" colla="-">
    public class Hello {
      public static void main(String[] args) {
        System.out.println("Hello World!");
      }
    }
    </pre>
**Example 3: Ruby, with line numbers starting at 18, code downloading(ruby.txt)**
    <pre lang="ruby" line="18" file="ruby.txt">
    class Example
      def example(arg1)
        return "Hello: " + arg1.to_s
      end
    end
    </pre>

== Supported Languages ==

The following languages are supported in the `lang` attribute:

Actionscript,ADA,Apache Log,AppleScript,ASM,ASP,AutoIT,Backus-Naur form,Bash,BlitzBasic,C,C for Macs,C#,C++,CAD DCL,CadLisp,CFDG,CFDG,ColdFusion,CSS,Delphi,DIV,DOS,Eiffel,Fortran,Fortran,FreeBasic,GML,Groovy,HTML,Inno,IO,Java,Java 5,Javascript,LaTeX,Lisp,Lua,Microprocessor ASM,mIRC,MySQL,NSIS,Objective C,OCaml,OpenOffice BASIC,Oracle 8 SQL,Pascal,Perl,PHP,PL/SQL,Python,Q(uick)BASIC,robots.txt,Ruby,SAS,Scheme,SDLBasic,Smalltalk,Smarty,SQL,T-SQL,TCL,thinBasic,Uno IDL,VB.NET,Visual BASIC,Visual Fox Pro,Winbatch,X++,XML,Z80 ASM

==Release Notes==

**1.0** : First internal release; Uses GeSHi v1.0.7.20;
**1.0.1** : Add View Code AJAX feature;
**1.1** : Add simple background configuration for highlighter style/formatting customization;
**1.2** : css tuning and option i18n compatible;
**1.2.1** : Uses GeSHi v1.0.7.21;
**1.2.2** : WP 2.5 compatible;
**1.2.2.1** : Correct small bugs;Improve the css layout to stick the code header; Contributor:YiXia.
**1.2.3** : Uses GeSHi v1.0.7.22, add the keywords link to API manual option.

== Donate ==

== Future Feature==

It will provide backgroud option for highlighter style customization(CSS option,keyword display style,Auto Caps/Nocaps,Case Sensitivity etc.) in the future version.

1 Star2 Stars3 Stars4 Stars5 Stars (26 votes, average: 4.69 out of 5)
Loading ... Loading ...
-欢迎为本文评级

相关日志

本文读者也关心以下内容:

  • N/A

03月 3rd, 2008 作者: eric | WordPress | Trackback ? | 111 评论| Email This Post Print This Post | 14,593 views

Add a Comment

Leave a reply

Hide Post Comments
  1. hugo5688 posted the following on 2008-12-08 at 5:39 pm.

    您好,安裝plugin後,無意間要export出blog資料時發生了一些錯誤,如下
    Warning: include_once(../../../wp-config.php) [function.include-once]: failed to open stream: No such file or directory in /plugins/wp-codebox/wp-codebox.php on line 32 Warning: include_once() [function.include]: Failed opening '../../../wp-config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /plugins/wp-codebox/wp-codebox.php on line 32 Warning: include_once(../../../wp-settings.php) [function.include-once]: failed to open stream: No such file or directory in /plugins/wp-codebox/wp-codebox.php on line 33 Warning: include_once() [function.include]: Failed opening '../../../wp-settings.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /plugins/wp-codebox/wp-codebox.php on line 33
    可否煩請您查看一下,感謝

    Reply
  2. pete posted the following on 2008-12-07 at 9:14 pm.

    When I try to write bare HTML my attributes are delete after I save. I'm using wordpress mu. I guess thats the reason it does not trigger the box.BTW, your site encoding is broken badly. It looks like asians encoding errors although your wordpress anounces UTF8. I even can't read the button texts. Just guessing...

    Reply
  3. 9shell posted the following on 2008-11-28 at 5:16 pm.

    你好,感谢你的插件,我今天比较了好几个code的插件,你这个是最好的。但是。提一个小问题:
    file="Hello.java"却显示的文件名是hello.java。这样存下来的java文件是不能编译的,请想办法解决一下,java大小写敏感。

    Reply
    1. eric posted the following on 2008-11-28 at 8:30 pm.

      改了下,没有改版本号,你重新下载安装一下,

      Reply
  4. funbsd posted the following on 2008-11-13 at 11:19 am.

    在ff和opera里不能显示“Copy to Clipboard”

    Reply
    1. eric posted the following on 2008-11-13 at 2:59 pm.

      恭喜你答对了,你可以参与改进。

      Reply
  5. funbsd posted the following on 2008-11-11 at 2:42 pm.

    好了,原来是option.php的问题

    Reply
  6. funbsd posted the following on 2008-11-11 at 2:15 pm.

    升级之后到1.3.3之后,不能改main.php里的View Code和Copy to Clipboard为中文了,改成中文后,页面就乱七八糟的了,原来的版本没有这个问题

    Reply
  7. lavermil posted the following on 2008-11-08 at 6:03 am.

    I am have a bit of trouble getting this line to work correctly once I have changed it. I want to support both <code> and <pre> statements. I can make it support one or the other but I want it to support both. Any suggestion on the regex of how to make this work without breaking it?
    function wp_codebox_before_filter($content)
    {
      return preg_replace_callback(
          "/\s*<(code|pre)}(?:lang=[\"']([\w-]*)[\"']|file=[\"']([\w-]*\.?[\w-]*)[\"']|colla=[\"']([\+\-])[\"']|line=[\"'](\d*|n)[\"']|\s)+>(.*)<\/(code|pre)>\s*/siU",
          "wp_codebox_substitute",
          $content
      );

    Reply
  8. tom posted the following on 2008-11-05 at 9:10 pm.

    Just had the following error while clicking on ruby.txt :
     
    http://www.ericbess.com/ericblog/wp-content/plugins/wp-codebox/wp-codebox.php?p=134&download=ruby.txt

    Reply
    1. eric posted the following on 2008-11-06 at 10:25 am.

      fixed

      Reply
  9. Chrislabricole posted the following on 2008-10-29 at 7:06 pm.

    Hi,
    Thanks for your plugin but it have 2 bugs :
    1) the numbers of lines are shifted over the code :s
     
    And 2) at the admin dashboard, for edit settings of you plugin, I get this :
    You are not a LEVEL 8 or above USER & hence you cannot configure WP-CodeBox. If you are a LEVEL 8 or above USER, then please Logout & Login again.
     
    Thanks by advance for your reply and if need, correct theses bugs... :)

    Reply
    1. eric posted the following on 2008-11-06 at 10:26 am.

      fixed in new version.

      Reply
  10. funbsd posted the following on 2008-10-19 at 1:34 am.

    刚才说的有误,第二步中应该像Werbeagentur-Wissen说的那样,只注释'&' => '&amp;'就行了,如果都注释了,别的地方就有问题了。第三步对于javascript来说是必须的,其它语言视情况而定。暂时没有发现其它问题。

    Reply
  11. funbsd posted the following on 2008-10-19 at 12:53 am.

    终于找到解决办法了。一是发布的时候必须写到源代码里,代码中如果有<,其后必须是空格,不能是其它任何字符,否则返回可视化编辑器修改时会被认为非法html标签,其后内容会被删除。二是修改wp-codebox/geshi/geshi.php,将function hsc里的'&' => '&amp;','"' => '&quot;','<' => '&lt;', '>' => '&gt;',注释掉,前面留言的Werbeagentur-Wissen已经提到了。三是修改wp-codebox/geshi/geshi/javascript.php,将'SYMBOLS' => array中的&去掉或者改成&&,这根据你要发布的语言种类不同而不同

    Reply
  12. funbsd posted the following on 2008-10-18 at 2:32 pm.

    又研究了一下,发现如果直接粘贴到源代码里,紧挨着<后边有字符的话,返回可视化编辑器时,可视化编辑器就认为这是html标签,而这个标签不是有效的话,后边的内容就会被删除。如果直接粘贴到可视化编辑器里,可视化编辑器会对粘贴的代码重新进行编排,加些<br>之类的标签,再从wp-codebox输出时,就肯定不正确了。所以只能粘贴到源代码里,且不能有被可视化编辑器认为是html标签的字符串。这样粘贴之后,从源代码返回可视化编辑器时,可视化编辑器不会对代码重新进行编排,只是将特殊字符<>"&等变成&lt;&gt;&quot;&amp;。按说这样就应该可以了,可是我的wp-codebox不能把这些特殊字符变回原样,还是显示&lt;&gt;&quot;&amp;,不知道什么原因。请帮帮忙,给点提示。

    Reply
  13. funbsd posted the following on 2008-10-18 at 12:49 pm.

    郁闷啊,折腾半天了,<和>问题还是搞不定。一碰到<或者>,返回可视化编辑器里就被截断了,<>后边啥都没有了。除非发布出来不修改了,否则回来修改又啥都没了。要是直接在可视化编辑器里粘贴代码,发布出来就全是html代码。我用的是javascript,里边有个<号就不行了,到底该咋办啊?看了半天也没看明白后边评论里有啥有效的好办法

    Reply
  14. hightflty posted the following on 2008-09-29 at 5:54 pm.

    Fatal error: Cannot redeclare class geshi in /home/content/h/i/g/hightfly/html/blog/wp-content/plugins/wp-codebox/geshi/geshi.php on line 243

    Reply
  15. DaB. posted the following on 2008-09-18 at 10:20 pm.

    @kyle:
    I had the same problem: I just comment the line out - it seems to work here.
    Sincerly,
    DaB.

    Reply
  16. Werbeagentur-Wissen posted the following on 2008-09-16 at 5:30 am.

    for everyone with problems like EcApS - just open /wp-codebox/geshi/geshi.php, look where the function hsc is defined and outcomment the first escape- array element("&"). different wp users, different usages ;)

    Reply
  17. midou posted the following on 2008-09-13 at 12:25 pm.

    I have just insttaled it.. the html code doesn't get colored unfortunately, but it's quite great thank you!

    Reply
  18. ez posted the following on 2008-09-11 at 2:32 am.

    Hi,Is there a way to set the "height" of the codebox? For example, I would like to set the height to 15 lines, and if my code is longer, it just adds a vertical scrollbar.Thanks! 

    Reply
  19. 沙渺 posted the following on 2008-06-05 at 2:56 pm.

    &gt ; 的意思是说pre标签中出现><号必须使用&gt ;和&lt ;。本来在pre标签中使用&gt ;和&lt ;是能正确显示的,但加上GESHI之后就不能正确解析。这个问题是GESHI的问题,不是插件的问题。但的确希望作者能尽量修正。在pre标签中直接使用><可以解决这个问题,并且在ie67和ff中都正确。但造成的后果是不能通过xhtml1.0验证。我想这虽然可行,但不是件好事。

    Reply
    1. bochgoch posted the following on 2008-06-11 at 12:12 am.

      Excellent plugin - I need to override some CSS to tidy things up, but excellent - thanks!

      Reply
  20. Ender Xie posted the following on 2008-05-16 at 10:04 pm.

    I finnaly get it worked in my WP blog.We are supposed to edit the code in "Code" view, not in "Visual", then everything works fine.Nice work, pal.

    Reply
  21. yixia posted the following on 2008-05-16 at 11:19 am.

    $hHead .= "<!--[if IE]>\n<style type\"text/css\">\n"; $hHead .= ".wp_codebox { overflow-x: auto; overflow-y: hidden; padding-bottom: expression(this.scrollWidth > this.offsetWidth ? \"15px\" : 0); width: 100%; }\n"; $hHead .= "</style>\n<![endif]-->";
    把这个加到
    function codebox_header()
    并删掉css中的/*ie hack*/部分来通过css校验

    Reply
  22. yixia posted the following on 2008-05-16 at 9:56 am.

    再来,如果在后台settings-writing中开启了WordPress should correct invalidly nested XHTML automatically
    那么像<?php 就会变成< ?php多了一个空格,<!-会变成< !-能不能自动把这个filter跳过去 :?:

    Reply
  23. yixia posted the following on 2008-05-13 at 10:40 pm.

    重新修改了一点点代码,为了精简输出的html,去掉不需要的id地址还是在http://www.e-xia.com/2008/05/wp-codebox-122-bug-fix/不过不理解的就是为什么要放cookie呢?是不是以后想保持开关的状态?做的时候碰到一点点小问题,真是哭笑不得,平时都是onclick="javascript:function()",然后在function里就可以直接用this来获得调用这个function的object,我首页的achive list前面的[+]也是这么做的,基本上是一样的javascript,一样的html,但是在wpcd_toggle_collapse里调用this就是不对,最后只能把this当一个参数传进来了,相当郁闷,你知道是为什么吗?上次压缩包里面的js好像放错folder了,这次的也改正了,有兴趣的话就再下一次吧。还有你说的"n"不能copy没试出来,反正用你给的3个例子,都能成功copy,可能是我理解有误,也有可能是js放错的关系。

    Reply
  24. yixia posted the following on 2008-05-09 at 11:54 pm.

    不知道为什么这个插件在我的blog上就是不起作用,在active插件时不报错,更改设置也不报错,在html源文件里能看到引用了codebox的js和css
    我在html编辑状态下添加的<pre...,在可见即可得模式下也试过,都失败了,我还禁用了所有插件,同样不起作用。我直接copy了这里的示例代码,也没用
    怎样才能确切知道这个插件是不是起作用了呢,在html源文件会有什么变化?

    Reply
    1. yixia posted the following on 2008-05-10 at 12:23 am.

      原因找到,是因为下载的版本不正确引起的
      http://downloads.wordpress.org/plugin/wp-codebox.zip
      这里下载的,没敢用迅雷,右键直接下载的
      另外,报告bug一个:在main.php里的get_settings('home')请改成get_settings('siteurl'),因为我的index.php不在安装目录,如果用home的话引用js和css会报错。
      另一个bug是<和>都显示&lt;和&gt;这个不知道是不是和别的插件冲突,明天继续测试。
      谢谢提供那么好的插件

       

      Reply
      1. yixia posted the following on 2008-05-11 at 7:30 pm.

        把我前面写得留言都删掉吧,谢谢,自己都觉得太罗嗦了 :oops: 不过今天又继续抓虫,因为真的很喜欢这个插件。
        主要是copy to clipboard这个方法,因为只能在ie而且是在expand的时候才能用,所以在php代码里面加了如果不是ie隐藏这个链接,在javascript里面加了如果显示[-]的时候隐藏这个链接
        还有,现在的view和download都把代码第一行最前面的空格去掉了,不是很舒服,所以把trim都去掉了,download的正则表达式加了<pre....>.*\n(来去掉最前面的一个空行。
        发在http://www.e-xia.com/?p=58,如果有兴趣的话可以看一下。
        另外我找到了http://www.jeffothy.com/weblog/clipboard-copy/这个写了如何在firefox下实现copy to clipboard,不过因为当中要引用了一个swf,不知道怎么把这个的地址放到js里,能想到的只能是参数传递,不太舒服,所以也就没有用了。

        Reply
        1. eric posted the following on 2008-05-12 at 9:23 pm.

          感想您对WPCD的支持, 你所做的修改正是WPCD所欠缺的。我正在逐个把你做的修改做测试并加到发布版,在changlog日志中加上了贡献人信息。
          同时也向你报告你的修改文件的一个bug. line="n" 时 copy to clipboard无作用。
          &lt,&gt问题是wordpress editor hooks 在捣鬼,应该是可以解决的。

          Reply
          1. yixia posted the following on 2008-05-13 at 5:09 pm.

            没想到你真的会看哦,很感动的说,其实我从来都不用copy to clipboard也就没有好好测试,我用firefox的,对ie的测试做得不好 :redface:

            Reply
  25. Michael posted the following on 2008-05-08 at 12:47 am.

    Very nice plugin, thank you.
    This is another vote to keep the [Copy to Clipboard][+] visible at all times (with either word wrap or cleverer use of CSS)
    Thanks, I'm finding it very useful.

    Reply
  26. KimHoon posted the following on 2008-04-19 at 5:37 pm.

    Wonderful plugin ! but 1 more thing.
    How can I make word-wrap(no auto scrollbar) ?

    Reply
  27. Frank Wang posted the following on 2008-04-17 at 6:39 pm.

    can't work with wordpress 2.5
    不能在2.5版下使用哦..
    希望早日更新

    Reply
    1. eric posted the following on 2008-05-07 at 9:37 pm.

      Try it again!

      Reply
  28. Becca posted the following on 2008-03-28 at 2:07 am.

    When I wrap (without the spaces) around basic html, it breaks and doesn't work.

    Reply
    1. Jeff posted the following on 2008-04-04 at 8:12 pm.

      You need to move the 'copy to clipboard' to the left sign. I use this for SQL scripts. When they are too long (and most are), you can't see the 'copy to clipboard' unless you go to the bottom of the script and then use the scrollbar to scroll to the right. Most users don't even realize it's there as a result.

      Great plugin otherwise.

      Reply
      1. Jeff posted the following on 2008-04-04 at 8:13 pm.

        Oopss.. I meant left "side" obviously. Thx!

        Reply
  29. Chris posted the following on 2008-03-25 at 11:20 pm.

    Nice plugin but it breaks the Lightbox-2 plugin (http://wordpress.org/extend/plugins/lightbox-2/). If your WP-CODEBOX plugin is enabled at the same time as Lightbox-2, Lightbox-2 doesn't work (it just shows the images in the browser window, i.e. the Ajax calls fail).

    FYI ...

    Reply
  30. codefrenzy posted the following on 2008-03-23 at 2:43 pm.

    Hi there,

    Thanks for an awesome plugin.

    I've got it working by writing my posts in 'code' view in wordpress. However, when I edit the article, it goes back to the 'visual' view on wordpress. When I switch back to the 'code' view, the following happens:

    For php:
    1. becomes ?>
    3. ' becomes \' and each time I edit the article, another \ (slash) is added

    Do you have any idea why this might be happening or am I doing something wrong?

    Cheers and thanks for the plugin!

    Reply
    1. codefrenzy posted the following on 2008-03-23 at 2:46 pm.

      Oops! Looks like my comment didn't come through properly. I'll try again.

      1. <?php disappears
      2. ?> becomes ?& gt; (without the space between & and gt; - I just can't post that in this comment)
      3. ‘ becomes \’ and each time I edit the article, another \ (slash) is added

      Thanks again :)

      Reply
  31. EcApS posted the following on 2008-03-12 at 2:54 am.

    Does no work with ">"
    exemple:

    echo aes >> /etc/modules
    echo dm_mod >> /etc/modules
    echo dm_crypt >> /etc/modules

    shown:

    echo aes &gt;&gt; /etc/modules
    echo dm_mod &gt;&gt; /etc/modules
    echo dm_crypt &gt;&gt; /etc/modules

    Reply
    1. eric posted the following on 2008-03-12 at 9:47 am.
      1
      2
      3
      
      echo aes >> /etc/modules
      echo dm_mod >> /etc/modules
      //no problem!
      Reply
      1. Vladimir posted the following on 2008-06-02 at 2:56 am.

        If Prototype or LightBox or ProtoBox or whatever does not work with WP CodeBox, you will have to do the following:
        Open /wp-content/plugins/wp-codebox/js/codebox.js and find these lines:
        function $(id) {
        return document.getElementById(id);
        }

        Then replace it with
        if ('undefined' == typeof $) {
        function $(id)
        {
        return document.getElementById(id);
        }
        }

        Since Prototype's $ function is extented with respect to CodeBox's one, the code should work fine.
        Hope this helps.

        Reply
        1. MoebiuZ posted the following on 2008-07-07 at 3:40 am.

          That is not working on IE7

          Reply
          1. eric posted the following on 2008-07-07 at 8:53 am.

            I'am Ie 7, no problem!

            Reply
            1. MoebiuZ posted the following on 2008-07-08 at 3:29 am.

              I mean, the workaround vladimir posted (and you integrated on wp-codebox). I'm using wp-codebox with lightbox-2 and codebox breaks the lightbox-2 script. On FF works fine.Anyway, I like too much your plugin, it' the best I have seen on syntax highlighting.

              Reply
        2. Vladimir posted the following on 2008-06-02 at 3:10 am.

          Eric, there is one more bug in the code: when creating a download link, you are using htmlspecialchars() function to screen special characters. However, by default, htmspecialchars() assumes iso-8859-1 charset, which is wrong for the most of blogs. So it would be more correct to use wp_specialchars() instead.

          Reply
          1. Ralph posted the following on 2008-06-04 at 9:32 pm.

            I get:
            Warning: Invalid argument supplied for foreach() in /home/xxx/public_html/wp-content/plugins/wp-codebox/geshi/geshi.php on line 2281 Warning: Invalid argument supplied for foreach() in /home/xxx/public_html/wp-content/plugins/wp-codebox/geshi/geshi.php on line 2281 Warning: Invalid argument supplied for foreach() in /home/xxx/public_html/wp-content/plugins/wp-codebox/geshi/geshi.php on line 2281 Warning: Invalid argument supplied for foreach() in /home/xxx/public_html/wp-content/plugins/wp-codebox/geshi/geshi.php on line 2281
            Any ideas?

            Reply
      2. cc posted the following on 2008-05-28 at 12:40 am.

        还是楼上说的 <  > 问题
        我发现当在源代码模式写时,比如 <pre lang="C"> p->q ……    如果立刻发布就没有问题
        可一旦我切回可视模式后,就会被转成  <pre lang="C"> p-&gt;q …… 而这时发布就只能看到错误的形式了
        而且我试了其他几个代码高亮插件,同一个编辑器下,虽然编辑时显示的是 p-&gt;q  但发布后没有问题,可以看到 p->q
        所以应该不是编辑器的问题,希望老大解决
        还有一个就是行号这一栏有时莫名其妙的非常宽,包括您这里的几个例子也是,应该不是我浏览器的问题吧(我用的是firefox)
         

        Reply
        1. cc posted the following on 2008-05-28 at 12:41 am.

          贴个图给您看看 http://i264.photobucket.com/albums/ii169/coffeecat10/code.jpg

          Reply
      3. kyle posted the following on 2008-05-17 at 1:02 pm.

        I cannot get to work, can you help me?
         
         
        Fatal error: Call to undefined function do_action_ref_array() in /mnt/w0504/d41/s46/b02cd2c3/www/kylecai.com/flash/wp-content/plugins/wp-codebox/main.php on line 104

        Reply

Trackbacks and Pingbacks

  1. Pingback from ['Breathing'] » wordpress plugins

    [...] plugins WP-CodeBox高亮度程式碼 [...]

  2. Pingback from 升级WordPress « Owlman’s Blog

    [...] 另外作为一个程序员的Blog,肯定需要一个代码高亮显示的插件,经过一系列的比较我最终选择了wp-codebox,安装也很简单,下载之后解压到blog目录的“wp-contentplugins”目录下,然后登录管理界面->插件界面,激活它即可,很好用,下面展现几个实例: [...]

  3. Pingback from Wordpress中如何避免代码和广告重叠 | 西瓜博客

    [...] 如果要做到专业的代码显示,可以考虑用插件:WP-CodeBox,能更好地用控制代码的显示和下载。 [...]

  4. Pingback from 在WordPress中显示代码的方法 | 免费屋·免费资源·免费经验分享中心

    [...] 1. WP-CodeBox - CodeBox 代码高亮插件 [...]

  5. Pingback from 讓你的<pre></pre>能自動換行 | Leeiio™ Chaos Made.

    [...] 最近發了很多都要貼代碼的文,我貼代碼用的插件是Wp-Codebox,另外我也比對過其他的一些插件諸如WP-Syntax和SyntaxHighlighter。這些插件被解析出來後無非就是<pre></pre>。但是有個問題就是有時候貼的代碼過長,它不會自動換行,我看到很多人的blog裡面貼的代碼都是需要把滾動條拉到最右端才能看到全部代碼。其實你只要定義下pre的css就可以了(我說的是廢話)。 [...]

  6. Pingback from WordPress Plugin Releases for 11/16 » All About Technologies

    [...] WP-Codebox [...]

  7. Pingback from memory ’s blog » Blog Archive » WP-CODEBOX Plugin (

    [...] 1. Upload WP-CodeBox.zip to your Wordpress plugins directory, usually `wp-content/plugins/` and unzip the file.  It will create a `wp-content/plugins/WP-CodeBox/` directory. 2. Activate the plugin through the ‘Plugins’ menu in WordPress. 3. Go to Option->Wp-CodeBox set default setting. 4. Create a post/page that contains a code snippet following the [proper usage syntax] [...]

  8. Pingback from 15 helpful WordPress plugins for the savvy user

    [...] WP-CodeBox - also check out the basic usage and demo page [...]

  9. Pingback from Flash player a 64 bit, era ora. · Commenta la tecnologia, la telefonia, i software

    [...] come me utilizzano Arch Linux l’installazione è un gioco da ragazzi, digitate da console: ?View Code [...]

  10. Pingback from Quasi.dot

    [...] WP-CODEBOX Plugin (代码高亮插件) | Eric @ EricBess WebHome Wp-CodeBox provides clean syntax highlighting and advanced feature for embedding source code within pages or posts. It support a wide range of popular languages highlighting with line numbers, code download, Copy to clipboard, collapse codebox, automatic keywords link to API manual and maintains formatting while copying snippets of code from the browser. [...]

  11. Pingback from WP-CodeBox*コード表示のユーザビリティーをあげる | Lovelog+*

    [...] 英語ですが、WP-CodeBoxプラグインの制作者の人のサイトに使い方が掲載されています。 WP-CODEBOX Plugin (代码高亮插件) | Eric @ EricBess WebHom [...]

  12. Pingback from Some Serradinho Stats | Serradinho Blog

    [...] WP-CodeBox - Provides clean syntax highlighting and AJAX advanced features for embedding source code within pages or posts. [...]

  13. Pingback from Snippets zeigen und verwalten | Dr. Web Magazin

    [...] unterstützt säckeweise Scriptsprachen und kann jedes Snippet mit unterschiedlichsten Parametern, mit und ohne Zeilennummern, mit zusätzlichem Downloadfile, mit einer bestimmten Nummerierung and [...]

  14. Pingback from WordPress: Plugin Updates KW 45/08 | blaudenker.de

    [...] WP-CodeBox [...]

  15. Pingback from Sufyan Tsauri’s blog » WP-Codebox : Bikin Kode Enak Dibaca

    [...] WP-Codebox, merupakan salah satu plugin yang di-develop oleh ericbess.com. Plugin ini diperuntukkan bagi para blogger yang biasa menuliskan tutorial, dsb yang menyisipkan source code. Nah, agar tampilan dari kode yang disisipkan tersebut mudah dibaca dan terlihat menarik seperti pada tampilan di text-editor seperti Notepad++, Dreamweaver, dll. [...]

  16. Pingback from WordPress: Plugin Updates KW 43/08 | blaudenker.de

    [...] WP-CodeBox [...]

  17. Pingback from PHP Speedy(附带WP插件)——网站优化速度篇1 | 雨中漫步

    [...] 3. 打开config.php文件 4. 配置相关的变量值(如用户名,密码等),例如: ?View [...]

  18. Pingback from 精选插件 | CALLME8(呼我吧)网扎小折

    [...] WP-CodeBox- WP-CodeBox provides clean syntax highlighting and AJAX advanced features for embedding source code [...]

  19. Pingback from Test@ERICBESS.COM » WP-CODEBOX Plugin (代码高亮插件)

    [...] 1. Upload WP-CodeBox.zip to your Wordpress plugins directory, usually `wp-content/plugins/` and unzip the file. It will create a `wp-content/plugins/WP-CodeBox/` directory. 2. Activate the plugin through the ‘Plugins’ menu in WordPress. 3. Go to Option->Wp-CodeBox set default setting. 4. Create a post/page that contains a code snippet following the [proper usage syntax] [...]

  20. Pingback from (最新) 美化你博客的利器-WordPress 插件 | Satime

    [...] WP-CodeBox- WP-CodeBox provides clean syntax highlighting and AJAX advanced features for embedding source code [...]

  21. Pingback from www.lucasozio.it » Blog Archive » WP-CODEBOX: provato e installato

    [...] Veramente molto semplice da installare e da utilizzare. Per maggiori informazioni visitate questa pagina ?View Code PHP1 2 3 4 5 6 7 8 9 10 11 12 13 14 <p id="foo">   function [...]

  22. Pingback from 18 utili Plugin per Blogger Esperti

    [...] WP-CodeBox: permette di aumentare le funzionalità del tag pre, mettendo a disposizione l’attributo download che permette di creare in automatico un link per scaricare qualsiasi porzione di codice scritta in un articolo, e l’attributo colla che permette di espandere o minimizzare il riquadro che contiene il codice (guida su come usarlo). [...]

  23. Pingback from WordPress Plugin: WP-CodeBox Clean Syntax highlighting and Advanced AJAX Embedding | DA! DA! Wordpress

    [...] Download | Plugin Homepage [...]

  24. Pingback from wp-codebox eklentisi | Nasil bilgi.

    [...] kullandığım wordpress eklentisi wp-codebox Türkçe sürümünü buradan, orjinal eklentiyi buradan indirebilirsiniz. Örnek uygulamalar [...]

  25. Pingback from WordPress技巧 | FunBSD.net

    [...] WP-CodeBox和WP-Syntax都是基于GeSHi的语法高亮插件。 有时<>&不能正常显示,而是显示为&lt; &gt; &amp;。注意下面三点,即可解决: [...]

  26. Pingback from Clases y estilos CSS: Modulos de Joomla 1.0.X

    [...] Oct ?View Code [...]

  27. Pingback from Clases y estilos CSS: Varios de Joomla 1.0.X

    [...] Oct ?View Code [...]

  28. Pingback from 7款WordPress代码语法高亮插件 | 帕兰映像

    [...] WP-CODEBOX [...]

  29. Pingback from Ser