- How to create a BBCode that handles PHP processing
- How to enable/disable bbcode tags
- How to enable/disable MediaEmbed plugins (MediaEmbed, Pipe Tables, etc.)
- An example case for using RegisteredVars
- Template parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include '/s9e/TextFormatter/src/autoloader.php'; | |
$xml = s9e\TextFormatter\Utils::replaceAttributes( | |
'<r><MENTION id="123">@Bob</MENTION><MENTION id="345">@NotBob</MENTION></r>', | |
'MENTION', | |
function ($attributes) | |
{ | |
if ($attributes['id'] === '123') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include '/s9e/TextFormatter/src/autoloader.php'; | |
$configurator = new s9e\TextFormatter\Configurator; | |
$tagName = 'MENTION'; | |
$tag = $configurator->tags->add($tagName); | |
$tag->attributes->add('username'); | |
$tag->attributes->add('id')->filterChain->append('#uint'); | |
$tag->filterChain->prepend('mentionator::addId')->addParameterByName('mentionator'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('IN_PHPBB', true); | |
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; | |
$phpEx = substr(strrchr(__FILE__, '.'), 1); | |
include($phpbb_root_path . 'common.' . $phpEx); | |
include($phpbb_root_path . 'includes/functions_display.' . $phpEx); | |
$user->session_begin(); | |
$auth->acl($user->data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>@x00 Sure, a lot of people hate XML for whatever reasons. As far as I’m concerned, I couldn’t dream of a better format for storing parsed text and here’s why. This is all the code you need to transform the XML back to text:</p> | |
<pre><code class="">return htmlspecialchars_decode(strip_tags($xml), ENT_QUOTES);</code></pre> | |
<p>If the XML is loaded in a DOM, all you need is to read its textContent to get the same result. If I die, every copy of the library disappears and XML is outlawed by a planet-wide decree, any programmer would only need one look at the data to understand how to get the original text back.</p> | |
<p>As for the increased size due to metadata, I invite you to run your own experiment on actual data and see that this does not double. <a href="https://gist.github.com/s9e/0ee8433f5a9a779d08ef">Here’s a gist containing this post as text, XML, and HTML.</a></p> | |
<p>@Bleistivt If you want to add a column to your database schema, I recommend you do it for search. Because if you index the markup in t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>It's a Gist!</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package s9e\TextFormatter | |
* @copyright Copyright (c) 2010-2015 The s9e Authors | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License | |
*/ | |
class s9e_renderer_ce909dab57a18a593f7b8550a36d254b58350f5f extends \s9e\TextFormatter\Renderer | |
{ | |
protected $params = array('L_CODE' => '', 'L_COLON' => '', 'L_IMAGE' => '', 'L_SELECT_ALL_CODE' => '', 'L_WROTE' => '', 'S_VIEWFLASH' => '', 'S_VIEWIMG' => '', 'S_VIEWSMILIES' => '', 'T_SMILIES_PATH' => ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<stylesheet outputMethod="html"> | |
<param name="L_CODE"/> | |
<param name="L_COLON"/> | |
<param name="L_IMAGE"/> | |
<param name="L_SELECT_ALL_CODE"/> | |
<param name="L_WROTE"/> | |
<param name="S_VIEWFLASH"/> | |
<param name="S_VIEWIMG"/> | |
<param name="S_VIEWSMILIES"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="html" encoding="utf-8" indent="no"/> | |
<xsl:param name="L_CODE"/> | |
<xsl:param name="L_COLON"/> | |
<xsl:param name="L_IMAGE"/> | |
<xsl:param name="L_SELECT_ALL_CODE"/> | |
<xsl:param name="L_WROTE"/> | |
<xsl:param name="S_VIEWFLASH"/> | |
<xsl:param name="S_VIEWIMG"/> |
NewerOlder