Skip to:
Content

bbPress.org

Changeset 20


Ignore:
Timestamp:
12/28/2004 08:26:19 PM (17 years ago)
Author:
matt
Message:

Autolink-links.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-config-sample.php

    r17 r20  
    77
    88// Change the prefix if you want to have multiple forums in a single database.
    9 $table_prefix  = 'minibb_';
     9$table_prefix  = 'bb_';
    1010
    1111$bb->domain = 'http://bbpress.example.com';
  • trunk/bb-includes/default-filters.php

    r18 r20  
    1717bb_add_filter('pre_post', 'bb_autop', 60);
    1818
     19bb_add_filter('post_text', 'bb_make_clickable');
     20
    1921bb_add_filter('total_posts', 'number_format');
    2022bb_add_filter('total_users', 'number_format');
  • trunk/bb-includes/formatting-functions.php

    r17 r20  
    125125}
    126126
     127function bb_make_clickable($ret) {
     128    $ret = ' ' . $ret . ' ';
     129    $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3'>$2://$3</a>", $ret);
     130    $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4'>www.$2.$3$4</a>", $ret);
     131    $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
     132    $ret = trim($ret);
     133    return $ret;
     134}
     135
    127136?>
Note: See TracChangeset for help on using the changeset viewer.