This is the archived version of my b2evolution code blog.
If you require any help regarding b2evolution then
visit it's support forums
You can find my current blogs here
Code : {@link : WafflesOn}
Personal : {@link : InnerVisions}
Posted on 16th Aug 2007 in : Plugins & Widgets
Hi %name%, yer gonna be really impressed with me, I just wrote a new post called "%title%"
This post won't come as much of a revelation for those of you who have the AstonishMe Bopit plugin installed, because you'll have seen it in the list of plugins on the admin tooltab, but it's worth reading anyway ..... honest ![]()
Although most people who actually use blogs know about that wonderful little thing called RSS which allows you to follow a blogs post or comment feeds without having to actually visit the "Pastel Palace" in question, some of them still use InterDebt Exploiter ( or *shudder* AOL ) and wouldn't know a feed if you hit them over the head with a meal voucher. So, this plugin allows them to subscribe to your wondrous examples of literary excellence via email.
Well, in a totally Pimp-A-Plugin fashion, the only place to currently get it is by installing the AstonishMe Bopit plugin and clicking on the download link .... Install is the normal shit : unzip, upload, click install ... you're probably gonna want to wander over to the settings and amend stuff, there's a full list of what they are and what they do in the readme ..... and, erm, well, that's it really .... don't forget that it's still under development though, if it melts your servers cpu or harasses people then don't blame me huh?
As always, let me know if it screws up
¥
Posted on 1st Aug 2007 in : Plugins & Widgets
We've had this plugin lying around for so long that we've already updated it twice and still haven't managed to do a public release ...... oooops
Anyway welcome to the AstonishMe Custom Plugin, this plugin allows you to add all sorts of custom stuff directly from your posts giving you far more control over your blog than ever.
Whilst b2evolution is a great little blogging platform, it does have a few drawbacks, one of which is the static keywords and descriptions for each blog. As you probably know, the evil google bot prefers to see keywords and description that are relevant to the content on the page at any given moment. Now you can have custom keywords and description on a per post basis, you can also control the title and even add more meta tags if you want. The title & description of the post are used when you're in single post mode ( it defaults to the stock ones if you don't have one for a post ). The keywords are used whenever the post is being viewed archives/categories/front page etc, only the unique ones are shown so you shouldn't get any duplicates.
Apparently some people like to make their posts look like a tarts boudoir which, up until now, has meant that you either needed a huuuuuuuuuuuuuuge stylesheet or *shudder* you had to restrict yourself to just a few boring styles!! Now you have the ability to add post specific baubles to your blog with no fear of excessive bloat. To make things easier you can target each post specifically simply by using %post% in your class/id names. This will be replaced by am_custom_post_##_ so you can avoid conflicting classnames.
If you happen to be one of those people who are forever adding all sorts of javascript gimmicks so that you can amaze your visitor with some stunning new effect, assuming they have javascript enabled of course, then you're probably going to want to meander through the plugins code and change a 0 to a 1
. This will then allow you to either add your script in <head> or directly inside the post at the spot you type it. Fair warning though, enabling this option will allow any user with posting rights to post javascript, so be think before you enable it huh?
I suppose it's time to tell you how to use all these new found powers huh? First off all you need to do all the usual stuff like, download the plugin, unzip it, upload it, wander into admin and install it. Unlike most of our plugins, this one also involves you ripping a couple of bits out of your skins _main.php. Don't worry though, it's fairly painless and the worst you could do is melt down your server if you delete the wrong bit huh? So, now that you're reassured, crack open your skins _main.php and delete the red bits ![]()
PHP:
<span style="color:red"><title><?php </span> | |
<span style="color:red">$Blog->disp('name', 'htmlhead'); </span> | |
<span style="color:red">request_title( ' - ', '', ' - ', 'htmlhead' ); </span> | |
<span style="color:red">?></title> </span> | |
<base href="<?php skinbase(); /* Base URL for this skin. You need this to fix relative links! */ ?>" /> | |
<span style="color:red"> <meta name="description" content="<?php $Blog->disp( 'shortdesc', 'htmlattr' );?>" /> </span> | |
<span style="color:red"><meta name="keywords" content="<?php $Blog->disp( 'keywords', 'htmlattr' );?>" /> </span> |
From now on, whenever you make a post you have the ability to customise it in all the ways mentioned above by using the following tags. For css and javascript %post% will be replaced with .am_custom_post_##_. For those of you who have been using this plugin for a bit, don't worry, all old style tags still work as well ![]()
Html:
<!--title title to use --> | |
The title to use will be used as the pages html title in single post mode. | |
<!--description post description --> | |
The post description will be used as the pages description in single post mode | |
<!--keywords keywords to add --> | |
The keywords to add will be appended to the pages keywords. The plugin also ensures that there are no duplicate keywords | |
<!--meta meta tag data --> | |
This will add a meta tag <meta meta tag data /> | |
<!--css custom css for post --> | |
The custom css for post will be output between <style> tags | |
<!--script javascript to add --> | |
The javascript to add will be output inside <head> between <script> tags | |
<!--js javascript to add --> | |
The javascript to add will be output inside your post between <script> tags | |
WARNING : This will allow any user with posting rights to post javascript, it's disabled by default. To enable javascript you need to manually change the setting in the plugin code. |
So, now you can decorate your posts to your hearts content, let me know if you have any problems huh?
¥
Posted on 4th May 2007 in : Plugins & Widgets
I finally managed to get the time to play with my Link-a-Word plugin, which at least one person has been waiting a fair smidge for, and I think it's done! If any of you want a pre-release play with it then you can grab it from here unzip/upload/install it and then meander over to the tools tab for a shiny new Link-a-Word tab. It *should* work with all 1.8.x, 1.9.x & 1.10x b2evolution blogs
Well, if you'd meandered over to the shiny new tab you would have seen a form for adding words and the url you wish to link them to, plus a few other boxes for stuff like the hover title, classname and whether the words are case sensitive or not. You'll also have seen a bloglist, as the words are blog specific, and a table containing any current words for the blog you're on, with options to delete or edit the entries.
The first thing to do is to start defining a few words and their links for whichever blog you test this on. When you've done enough then go visit the front page of the blog and magically all of the words you defined will be linked ..... how cool is that? ..... It gets a tad cooler actually. First off you will have noticed that it only linked a single occurrence of each word and if you have a case-sensative version and a case-insensite version of the same word, then it will have linked a single occurence of each. Other stuff it does is, it won't link words that are already part of a link, the w3c sorta frown on that, and it won't link words that are part of a tag ( title, class, alt text etc ), because that's another thing the w3c tend to frown on ![]()
One of the things I haven't coded in is the ability to add a rel="nofollow" to any of the links, for starters why link to somewhere in your post and then remove the power of the link? The other reason is, why the hell should I bow to Googles will and do their job for them, they've more than enough money to pay a coder to sort out their algorythms huh? .... mind you, they can't differentiate between www and the root domain, so maybe they do need the help ![]()
As always if you find any bugs, or have any feedback, then feel free to leave a comment,
¥
Posted on 23rd Apr 2007 in : Plugins & Widgets
Yay I got a Zeitgeist ........ whatever the hell one of them is .... personally I call it a search cloud, it's far easier to spell
In the true spirit of OpenSourceSoftware I stole the idea off Whoo and decided to see how easy it would be to create a b2evolution plugin that did the same thing. It's probably taken me longer to write this post than it took to code it ![]()
It's pretty simple really, the plugin scurries through your hitlog and finds all of the hits that have been flagged as coming from a search engine. It takes all these hits and meanders off to count them, grabs a beer and a smoke and then ambles back with a cloud ready to be slapped on your blog. If it's enabled then you should see a cloud below the first post on the first page of my blog, the font-size indicates how often that search term was used to find my tacky lil pad ![]()
If any of you fancy having a pre-release play with it then you can steal it from here (we've now released version 1.0 of the plugin on Sourceforge ), unzip/upload/install it and then add the following skintag to your skins _main.php
Code:
$Plugins->call_by_code( 'am_srchcloud', array() ); |
You can pretty much throw that anywhere in your skins main, even inside your post loop as it defaults to only showing once per page. There's a couple of parameters you can use :
If you want to play with the styling then just take a root around in the plugins source and you'll see all the classnames it uses, you can even play with the html it produces to bend it to your will. The chances are that most of that bit will become params by the time the release version comes out.
That's pretty much it really. As always if you find any bugs or want to send me the odd million quid then feel free to leave a comment
¥
*edit* 29th April
This plugin has how been released on Sourceforge, unfortunately we forgot all about the help file so here's a quick rundown of all the parameters
*edit*4th May
We've now released version 1.1, which actually has a semi-useful helpfile
... you can read all about it on AstonishMe
Posted on 11th Mar 2007 in : Plugins & Widgets
I finally found the time to finish off the nested comments plugin. If you fancy having a pre-release play with it you can find it here. Please note : it has a known problem - when you preview a comment it "forgets" which comment it's a reply to. This is caused by the fact that the core redirects through htsrv when creating a preview and doesn't pass on the plugins parameter. I'm working on it
*solved : zip file update 12th March*
Unlike most of our plugins this one also involves some code in your skins _feedback.php, not a lot though so don't worry. First find this segment of code and add the new bit :-
PHP:
<?php | |
$CommentList = & new CommentList( 0, implode(',', $type_list), array('published'), $Item->ID, '', 'ASC' ); | |
<span style="color:red">// Nested comments part 1 of 3</span> | |
<span style="color:red">$Plugins->call_by_code( 'amNestCmnt', array() );</span> |
The next piece of code can go anywhere in the comment loop and will spit out a "reply to this comment" link
PHP:
<?php | |
// Nested comments part 2 of 3 | |
if ( $Item->can_comment( NULL ) ) | |
{ | |
echo '<p class="replyTo"><a href="'.url_add_param( $Item->get_permanent_url(), 'am_nestCmnt_reply_to='.$Comment->ID ).'#bComment_form_id_'.$Item->ID.'">Reply to <span>comment '.$Comment->ID.' by </span>'.$Comment->get_author_name().'</a></p>'; | |
} | |
?> |
The final bit of code is just a demonstration of how to use the comment depth to indent your comments
PHP:
// Nested comments part 3 of 3 | |
<div class="bComment"<span style="color:red"><?php echo ( isset( $Comment->depth ) ? ' style="margin-left:'.( $Comment->depth * 2).'em"' : '' );?></span>> |
And that's pretty much it. The plugin should work in all 1.8.x and 1.9.x versions, let me know if you manage to break it ![]()
¥
Posted on 23rd Feb 2007 in : Plugins & Widgets
I finally decided to have a play with nested comments for b2evo, which is something Scott asked me about a fair tad ago and, barring a few bits and bobs, I've now got a plugin that achieves this.
At the moment it's not available for download as it still needs work to add the depth to each of the comments so that they can be styled easily, and I still need to work out what to do with child comments if you decide to delete their parent. The basic choices are to change their parent to the grandparent, remove the parent completely and return them to their date order position, or to delete them along with their parent. Of course the ideal solution would be to offer all three choices and leave it to you to decide when you delete a comment, but I haven't even begun to look into how achievable that would be.
Once I've sorted out all of that I'll make another post and attach the plugin, along with basic instructions for installing and using it.
¥
Page archived : 11th Nov 2009