Recent Topics

1 Dec 13, 2005 13:15    

When I started using b2evolution (my first blog ever), I soon discovered I was missing the possibility to give in-depth explanation, etc. on some of the words/expressions I use when I blog (I blog in Norwegian about e.g. french politics, and some things might not be known to all the readers). I did not want the the in-depth stuff to be visible for all readers by default, so I hacked together something I've called explainboxes. It's basically a box that's displayed when the cursor is put on a word (or phrase) that might require background information, etc. I have written about it [url=http://www.gausland.com/blogs/index.php/momo/2005/12/13/explainboxes]here[/url] for those that are interrested. I'm not even sure if it would be possible to write this as a plugin, since at some point there's some javascript addet to the article-text. Would appreciate some comments on whether it might be possible to implement it as a plug-in, so that I get less hassle when upgrading.

2 Dec 13, 2005 13:44

Non javascript method, crack open plugins/_bbcode.plugin.php find and add the red bits:-

var $search = array(
'#\(.+?)\#is', // Formatting tags
'#\[explain](.+?)\[meaning](.+?)\[/explain]#is', // Formatting tags

.....
.....

/**
* HTML replace array
*
* @access private
*/
var $replace = array(
'<strong>$1</strong>', // Formatting tags
'<span title="$2" class="explain">$1</span>',

To use in your post :-
[explain]What to explain[meaning]The explanation[/explain]

¥

3 Dec 14, 2005 18:59

What was wrong with using:


Breif Description
<!--more-->
In depth story

All this type of stuff is explained in the default posts when b2evo is installed.

4 Dec 14, 2005 19:32

I think you're missing the point. I'm not complaining about b2 evolution, I just wanted to share... Who knows, someone might even think it's a good idea. For those who don't: well thats fine as well. :)

5 Dec 14, 2005 19:41

Oh my bad, thought you were trying to put the 'read more' stuff inside one your explainboxes ;)

I'm pretty sure a plugin wouldnt be able to do this yet.
As you would need the plugin to insert code inside the skin and the write section for a post.

You can have a plugin run in the write section, but can't get them to run inside the skin without manually performing a call to the plugin (like the archive plugin).

I have no experience with plugins, i prefer hard coding it in.

But to help you out i would recomend:


[explain text="Detailed Description goes here"]Dowhacky[/explain]

Which gets converted to:


<a onmousedown="this.style.cursor='question'; ShowExplainBox(this);">DoWhacky</a>

And just throw in a call to ur plugin inside the header for the skin which includes the javascript that is called to display the explain box.

Or however you do it, if i was to do it, ill do something like that.

6 Dec 15, 2005 00:12

This is pretty cool! Kinda like an advanced version of the [url=http://forums.b2evolution.net/viewtopic.php?t=1655]auto-acronym[/url] plugin? I found limits with that plugin. First, it required hacking the plugin file each time you wanted to add a new acronym. Second, and most annoyingly to me, different browsers would trunctate longer acronyms so you had to have little 'sound bites' for your "explain box". Plus they were just mouseover tool tips...

I think I'll have a go with yabba's non-javascript version and see where I can go with it in pluginland for phoenix 8|


Form is loading...