Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Forum: Plugins
    In reply to: How Can I Create Auto-Links
    Thread Starter olci

    (@olci)

    ow..
    thanks a lot.
    it’s OK.

    i forgot to link to url.
    it’s working fine.
    thanks 🙂

    Forum: Plugins
    In reply to: How Can I Create Auto-Links
    Thread Starter olci

    (@olci)

    have you got any idea ?
    🙁

    Forum: Plugins
    In reply to: How Can I Create Auto-Links
    Thread Starter olci

    (@olci)

    yes i see that.
    i am sure it’s enough long.

    i captured a screenshot for my problem.
    please look :

    http://img146.imageshack.us/img146/4656/18482182xb4.png

    (at comment, everything OK, but at content it is not working.)
    WP Version : 2.3.3.
    The codes are the same of top what you say.

    Forum: Plugins
    In reply to: How Can I Create Auto-Links
    Thread Starter olci

    (@olci)

    i am using,
    2.3.3. version ?
    what about yours ?
    it’s not working brada.. 🙁

    Forum: Plugins
    In reply to: How Can I Create Auto-Links
    Thread Starter olci

    (@olci)

    is nobody help me 🙁
    please brada..
    it’s very important.

    Forum: Plugins
    In reply to: How Can I Create Auto-Links
    Thread Starter olci

    (@olci)

    i added this line but it’s not work on my content pages.
    it’s just working on comments yet.

    any mistake ?

    <?php
    /*
    Plugin Name: Comment URL Compacter
    Plugin URI: #
    Description: When long URLs are left in a comment, they can break a theme and be obnoxious.  This plugin shortens them so they look much nicer.
    Version: 0.1
    Author: Trevor Fitzgerald
    Author URI: http://www.trevorfitzgerald.com/
    */
    
    function compact_urls($link) {
    	if ( strlen($link) > 50 ) {
    		$link = preg_replace('/(https*:\/\/)*(www.)*/', '', $link);
    		$link = substr($link, 0, 18) . '&hellip;' . substr($link, -20);
    	}
    	return $link;
    }
    
    function compact_comment_urls($comment) {
    	$pattern = '/<a(.*)>(.*)<\/a>/ei';
    	$replace = '"<a$1>" . compact_urls("$2") . "</a>"';
    	$comment = preg_replace($pattern, $replace, $comment);
    	return $comment;
    }
    
    add_filter('comment_text', 'compact_comment_urls');
    add_filter('the_content', 'compact_comment_urls');
    
    ?>
Viewing 6 replies - 1 through 6 (of 6 total)