Jump to content

Search the Community

Showing results for tags 'php pastebin'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. <?php if (!defined("IN_PASTE")) die("Access denied!"); /* Plugin Name: Pastes links Plugin URI: http://php-pastebin.com/ Description: Get link of paste Version: 1.0 Author: Atmoner Author URI: http://php-pastebin.com/ */ //set plugin id as file name of plugin $plugin_id = basename(__FILE__); //some plugin data $data['name'] = "Pastes links"; $data['author'] = "Atmoner"; $data['url'] = "http://php-pastebin.com/"; //register plugin data register_plugin($plugin_id, $data); //Hook , where to execute a function homeblock() add_hook('paste_page','pasteLinks'); // Hook function function pasteLinks() { global $hook,$startUp,$smarty; // Parse code in geshi lib include_once('libs/geshi/geshi.php'); $id = (isset($_GET["id"])?$_GET["id"]:""); $p = $startUp->getPaste($id); if (!empty($p)) { // The Regular Expression filter $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; var_dump($p['paste']); // Check if there is a url in the text if(preg_match($reg_exUrl, $p['paste'], $url)) { $paste = preg_replace( '/(http|ftp)+(s)?\/\/)((\w|\.)+)(\/)?(\S+)?/i', '<br /><a href="\0" target="_BLANK">\0</a>', $p['paste'] ); $smarty->assign("result",$paste); $smarty->assign("getPaste",$p); } else { $geshi = new GeSHi(html_entity_decode(htmlspecialchars_decode($p['paste'])), $p['lang']); $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); $geshi->set_header_type(GESHI_HEADER_DIV); $geshi->set_case_keywords(GESHI_CAPS_LOWER); $geshi->set_footer_content('Parsed in <TIME> seconds'); $paste = $geshi->parse_code(); $smarty->assign("getPaste",$p); } // Update hits $startUp->updateHits($id); } $hook->remove_addcontentpaste('defaultpaste'); $hook->addcontentPaste('name_content',$paste,2); } Tho' Currently the Code creates spacing with plain text what rolls over the site Any idea on changes to make it compatible with plain text as well ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.