Search Results for 'code'
-
Search Results
-
Topic: Code_trick made pluggable
Request: functions-fomatting.php code-trick() to be made pluggable.
Reason: So parsers such as ASCIIMath can do their replacements on things in backticks. Then I can make a plugin for MathML support
Topic: Plugin: Say My Name
Hi, this is my first post on bbPress, and it will deal with my new plugin.
First of all I have to say that it is based on the great work by Thomas Klaiber on Post Notify plugin.
But now let’s talk about Say My Name ( smn for friends ), this plugin will look at each post that will be posted for your nickname, and if it will find it, it will notify you by mail.
I made this plugin because many times i saw people calling someone inside a post, and due to the dimension of the forum, the huge amount of post per day, and going on… the people called doesn’t see it.
I have only to add that, as Thomas plugin, this one is activable by your profile, so if you have too common name like “and” “or” and going on, is better if you keep it off
So that’s all, i have only to add the download link: http://www.ellequadro.net/wp-content/plugins/downloads-manager/download.php?id=6
I hope that this plugin could be useful.
Being both a web nerd and Physics student, I decided it was time for BBpress to meet up with MathML.
Here’s the steps I took to get it crankin’:
- Made a copy of the default ‘kakumei’ template, then renamed the folder ‘physics’, my new template name. I then put a copy of ASCIImath.js in there. This does all the hard work.
- Changed the physics/header.php from:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php bb_language_attributes( '1.1' ); ?>>to:
<?xml version='1.0' encoding='iso-8859-1'?>
<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en"
xmlns:pref="http://www.w3.org/2002/Math/preference"
pref:renderer="css">It’d probably still work if you didn’t bother with this step, but seeing as BBpress is making XML we may as well.
- Added
<script type="text/javascript" src="<?php echo bb_path_to_url( dirname(__FILE__) . '/ASCIIMathML.js'); ?>">
to physics/header.php – this loads the ASCIIMathML.js javascript and does a majority of the MathML magic. - Opened bb-includes/formattingfunctions.php and edited this:
function code_trick( $text ) {
$text = str_replace(array("rn", "r"), "n", $text);
// $text = preg_replace("|<code>(.*?)</code>|e", "'<code>' . encodeit('$1') . '</code>'", $text);
// $text = preg_replace("|n<code>(.*?)</code>|se", "'<pre><code>' . encodeit('$1') . '</code></pre>'", $text);
return $text;
}To turn off the backtick code replacement – this is what ASCIIMath.js does!
That was it. I’ll zip it all up then post it up here. Ideally, it’d be better to not comment out any of the bb-include/ files – if anyone has any suggestions, let me know.
Topic: Include code in posts