自动连接-AutoLinker

8月 15th, 2004 by Antonio

http://www.huddledmasses.org/ 制作发布。

使用:

CODE:
  1. if( empty($autolinker_array) ) { 
  2.       $autolinker_array = array(

下照模式添加需要加自动连接的地址。

PHP:
  1. <?php 
  2. /*
  3. Plugin Name: AutoLinker 
  4. Version: 1.3 
  5. Plugin URI: http://www.huddledmasses.org/ 
  6. Description: Makes links from predefined text 
  7. Author: Joel Bennett 
  8. Author URI: http://www.HuddledMasses.org 
  9. Copyright (c) 2003 
  10. Released under the GPL license 
  11. http://www.gnu.org/licenses/gpl.txt 
  12.     This file is part of WordPress. 
  13.     WordPress is free software; you can redistribute it and/or modify 
  14.     it under the terms of the GNU General Public License as published by 
  15.     the Free Software Foundation; either version 2 of the License, or 
  16.     (at your option) any later version. 
  17.     This program is distributed in the hope that it will be useful, 
  18.     but WITHOUT ANY WARRANTY; without even the implied warranty of 
  19.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  20.     GNU General Public License for more details. 
  21.     You should have received a copy of the GNU General Public License 
  22.     along with this program; if not, write to the Free Software 
  23.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  24. */ 
  25.  
  26.  
  27.  
  28.  
  29.  
  30. function autolinker($text) { 
  31.    // First, we define all the things we're going to replace: 
  32.    // and we name it weird so nobody will mistakenly use it 
  33.    // each definition is in the form: // "text" => "url", 
  34.    // ESPECIALLY note that they all end with commas EXCEPT the last one 
  35.    global $autolinker_array
  36.  
  37.    if( empty($autolinker_array) ) { 
  38.       $autolinker_array = array( 
  39.          "my site" => "http://www.antonio.hostonnet.com/"
  40.          "Geo Docs" => "http://docs.GeoShell.org/"
  41.          "GeoShell" => "http://www.GeoShell.org/"
  42.          "W3C" => "http://www.w3.org",
  43.           "google" => "http://www.google.com",
  44.         "sohu" => "http://www.sohu.com",
  45.       )
  46.  
  47.    } 
  48.  
  49.    $text = " $text "
  50.    foreach($autolinker_array as $match => $url) { 
  51.    /*    For advanced users, there are several possible regular expressions here.... 
  52.    *    The safest, "default" one is at the top ... 
  53.    *    You (or I) may choose to use one of the others! 
  54.    *    Pick whichever you want, and make SURE there is only one that isn't preceded by slashes: // 
  55.    */ 
  56.    // DEFAULT 
  57.  
  58.  $text = preg_replace("|([^./]b)$match(b[^:])|msU" , "$1<a href="$url">$match</a>$2" , $text)
  59.  $text = preg_replace("|(<[A-Za-z]* [^>]*)<a href="$url">$match</a>([^<]*>)|msU" , "$1$match$2" , $text)
  60.  
  61.    // SAFER ALTERNATIVE: requires square brackets which will be stripped off matched text 
  62.  
  63.    // SAFER ALTERNATIVE: [GeoShell] would become <a href="http://www.geoshell.org/">GeoShell</a> 
  64.  
  65.    //    $text = preg_replace("|[$match]|msU" , "<a href="$url">$match</a>" , $text); 
  66.  
  67.    } 
  68.  
  69. return trim($text)
  70.  
  71. }
  72.  
  73. add_filter('the_content', 'autolinker', 7)
  74.  
  75. add_filter('comment_text', 'autolinker', 7)
  76.  
  77. ?>


终于把分页做好了

8月 15th, 2004 by Antonio

在wp的网站上翻来覆去的找,终于把分页的搞定。不过到后面几页,页面出错了,可能是图片太大了,以后有时间再处理。:-)

奥运金牌榜

8月 14th, 2004 by Antonio

sohu那copy过来的。

HTML:
  1. <embed src="http://2004.sports.sohu.com/upload/olympic/rank/box2.swf" quality="high" bgcolor="#000000" width="192" height="122" name="box2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>

HTML:
  1. <embed src="http://2004.sports.sohu.com/upload/olympic/rank/box3.swf" quality="high" bgcolor="#000000" width="192" height="145" name="box3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>

路一定要坚持往下走

8月 14th, 2004 by Antonio

奥运刚开赛一天中国就拿了2块金牌,王义夫已经参加6届奥运了,88年就拿了块铜牌。96年差0.1环丢了金牌,这次终于拿到金牌了。
相比之下我却没有勇气坚持走自己的路。大二下学期,想休学回家,自己学点东西,暑假就被老爸狠狠教训了一顿赶回了学校。去年年末和学校的人一起搞创业,寒假回家又被教训,再加上创业之路太难,又放弃了。
这个暑假学php程序,老在网上乱下代码,最后一个没编成。力往一处使才会大。我到底应该坚持哪条路走下去呢?

新做了个banner

8月 14th, 2004 by Antonio

用以前做的图片,加点字就是自己的banner了^_^。基本完工了,后期还有些小东西处理下就差不多了。

美化了下界面

8月 14th, 2004 by Antonio

参照myxiaoxiao.com的风格美化了一下,借用了他的css。美化下来感觉不错了,现在已经很晚了,banner来不及换了,明天再做一个吧,部分以后还待修改。该睡觉了,不然老婆又要发火了。

加了个plugins

8月 13th, 2004 by Antonio

美化了php,css等,效果如下:

PHP:
  1. <?php phpinfo()?>

以后贴代码出来就好看多了

想把ipb2汉化下

8月 13th, 2004 by Antonio

ipb2免费的只是trial版本,不知道为什么国人都喜欢用trial.,好象ipb2.0是收费的版本,trial是为了让客户使用满意以后再付款,是只防君子不防小人的,可惜国人都喜欢做小人,我汉化的ipb1.3.1的后台没人感兴趣,现在只对ipb2.0的汉化有兴趣.可悲啊.

Blogtimes image

Page 82 of 88« First...«8081828384»...Last »