Search Results for '+.+default+.+'
-
Search Results
-
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: Plugin: bb-Scripture-Links
Version 1.0
This plugin automatically turns scripture references into links that will take the visitor to BibleGateway.com, where they can view the verse(s). The administrator can set the default version to one of more than a dozen available versions, including ESV, NIV, KJV, NASB, The Message, and so on.
The links are created dynamically each time a topic is loaded, so the actual text of the post is left alone. This is nice because it allows you to disable/delete the plugin without having to go back through and edit your posts to remove the extra markup.
This plugin is ideal for forums that are religious/spiritual in nature, as it will save your users a lot of time from having to hard-code links to passages they reference in their posts.
This plugin is almost entirely based on a similar WordPress plugin that does the same thing to WP posts. You can view the WP plugin here:
http://dev.wp-plugins.org/wiki/Scripturizer
You can read more about the plugin, or download the latest version of bb-Scripture-Links, here:
http://blog.wittmania.com/bb-scripture-links
You can see a working demo here:
Hope this is the right place. I just installed the latest svn version on my local pc, and got the forementioned error twice (also with topic_slug field). Running mysql 5.0.
Patch:
Index: upgrade-schema.php
===================================================================
--- upgrade-schema.php (revision 805)
+++ upgrade-schema.php (working copy)
@@ -4,7 +4,7 @@
$bb_queries = "CREATE TABLE $bbdb->forums (
forum_id int(10) NOT NULL auto_increment,
forum_name varchar(150) NOT NULL default '',
- forum_slug text NOT NULL default '',
+ forum_slug text NOT NULL,
forum_desc text NOT NULL,
forum_parent int(10) NOT NULL default '0',
forum_order int(10) NOT NULL default '0',
@@ -31,7 +31,7 @@
CREATE TABLE $bbdb->topics (
topic_id bigint(20) NOT NULL auto_increment,
topic_title varchar(100) NOT NULL default '',
- topic_slug text NOT NULL default '',
+ topic_slug text NOT NULL,
topic_poster bigint(20) NOT NULL default '0',
topic_poster_name varchar(40) NOT NULL default 'Anonymous',
topic_last_poster bigint(20) NOT NULL default '0',Regards,
Topic: Hooks & Filters Docu
Rather than just keeping private notes on the hooks and filters I found, I thought it best to maybe start a list here with everyone, just as a rough working documentation of the hooks and filters.
For future ref/for people that don’t know, a hook is a means of bbPress making your plugin run every time a certain thing happens. To get that to work, put this code at the very bottom of your plugin:
add_action( 'hook_name', 'functionname' );
Filters are very similar to hooks, only it gives your plugin some data, you can then do something with the data (filter it), and then pass it back. To register for filters, put this code at the bottom of your application; remember to accept the parameters in your function and return them as appropriate.
add_filter( 'filter_name', 'functionname' );
Note that in both cases you want the name as a string and the function’s name as a string, no brackets or parameters at the end of it! An optional third parameter is the priority of your function; default is 10, so set this higher if you want it to execute last or lower if you want it to execute earlier.
Some Filters
topic_title
– this passes the topic title to your function when the threads are being listed, like on the (default) front page.bb_allowed_tags
– this is the array of HTML tags you can use in your posts. Hang a filter on this and add elements to the array if you want to allow more tags.Some Hooks
bb_head
– this is called when the HTML<head>
element is being filled, so you can add stylesheets or javascript and the like.bb_user_logout
obviously gets called when someone logs out.bb_init
when someone logs in?bb_new_user
when someone registers; passes the ID along I thinkbb_profile_menu
– haven’t figured out how it works; I think it’s to do with the tabs at the top of the profile.If you know any more hooks or filters, or find ’em, please post them here with a quick description if necessary!