TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-27-2008, 09:24 PM   #1 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default Simple Wordpress plugin for developers

Well I run a blog to talk about things php and my life and views and such things and I sometimes can't be arsed to write a hyperlink to a function on php, so I wrote a quick plugin to do it for me. Thought someone might find it useful.

PHP Code:
<?php

/*

**************************************************************************

Plugin Name:  PHPFunctionsToLinks
Version:      1.0
Description:  For developer's blogs, it turns [function]strstr()[/function] into a hyper link onto php.net's site

**************************************************************************

*/
class BBToPHPLinks
{
    
        function 
BBToPHPLinks()
        {
            
add_action'the_content', array(&$this'ParseBB') );
        }
        
        function 
ParseBB$content )
        {
            
//First check to see if there IS BBCode to parse
            
if( !(stristr($content'[function]') && stristr($content'[/function]')) )
            {
                return 
$content;
            }
            
            
//There is BBCode, parse it all out and return
            
return preg_replace('/\[function\](.*?)\[\\/function\]/si''<a href="http://php.net/$1">$1</a>'$content);
            
        }
}

$BBToPHPLinks = new BBToPHPLinks();

?>

Last edited by Enfernikus : 10-28-2008 at 01:33 AM.
Enfernikus is offline  
Reply With Quote
The Following 2 Users Say Thank You to Enfernikus For This Useful Post:
codefreek (10-30-2008), sketchMedia (10-28-2008)
Old 10-30-2008, 08:51 PM   #2 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

simple but yeah thank you ;)
codefreek is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 02:55 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design