Archived : Techno Babble

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}

Search Highlight part deux

Posted on 28th Jan 2007 in : Plugins & Widgets

I've been having a play with our Search Highlight plugin. Mainly to see if it could be easily upgraded to 1.9.x or whether it'd require a rewrite. At the same time I decided to try and make it as 100% a plugin as possible, as the original involved a fair few changes to your skins _main.php, which makes upgrading a tad tougher. I'm happy to say that after a few days of beating my head against the wall that it appears to be finished :D Obviously it still requires a fair amount of testing but *touch wood* it appears to do what it should with absolutely no skin modifications at all!

If any of you fancy having a play with it then you can find it here. If you find any bugs then feel free to let me know ;)

¥

*edit 2nd Feb 2007*

I forgot to include the styles for the highlighting ..... yeah yeah, so shoot me for being blonde :| .... these have now been included and the zip has been updated. You can override the default styles in your skins stylesheet.

If you've already installed the plugin then simply uninstall it and delete am_search.plugin.php from your plugins directory. Then upload the am_search_plugin folder in the zip to your blogs plugins folder, reinstall it and all should be well :D

Relative links with B2evolution

Posted on 21st Jan 2007 in : Plugins & Widgets

I don't know about you lot, but one of the things that I dislike about b2evolution is the fact that you have to use absolute urls in your posts. This is great if your blog always remains on the same (sub)domain, but if you ever want to move it then you're screwed! Up until now your only recourse was to either hit the database and change all of the affected urls in your posts or to manually edit each of your affected posts in admin. Not exactly user-friendly and it pretty much goes against the grain of how a website should be coded in the real world.

I've always coded my websites with relative links as it makes them truly "portable" and it's a habbit that I've continued with my blogs by hacking the bbcode plugin to allow me to use http://site/ to point to my blogs $baseurl ..... which worked right up to the moment when I merged two of my blogs that reside on two totally seperate domain names ( InnerVisions and WafflesOn ). Rather than piss about with the bbcode plugin (and have to reapply the hacks on every upgrade) I created a shiny new plugin to cope with my current needs. Basically this plugin adds 3 "special urls" that I can use for my posts to keep my links as relative as possible

http://site/
This gets converted into the posts blog url, so I can now make links relative to the individual blogs folder
http://base/
This gets converted into the $baseurl, so now I can make links relative to my install folder, which in my case is the same folder, but on a less trick install these could be different.
http://media/
Spookily enough, this gets converted into $media_url, just to make it a smidge simpler for me to move my media folder if ever the occasion arises.

Hopefully a certain unamed yank will get the time before the next ice-age to do a full write-up on AstonishMe, but if you want to have a play with this plugin in the meantime then you can find it here. You can't help but notice that I've dumped it in my media folder in a demonstative kind of way ;)

Have fun
¥

*edit*

Cured a minor bug in admin, zip file updated 31st Jan

Smiley plugin v 1.9.2

Posted on 30th Dec 2006 in : Skins, Plugins & Widgets

Well, this time the skin changes are my fault :p

For those of you running 1.9.2 who are using a customised skin, you need to make the following changes to _feedback.php to make the smilies toolbar appear :-

PHP:

<span style="color:red">echo '<div class="comment_toolbars">';</span>
        <span style="color:red">// CALL PLUGINS NOW:</span>
        <span style="color:red">$Plugins->trigger_event'DisplayCommentToolbar'array() );</span>
        <span style="color:red">echo '</div>';</span>
        // Message field:
        $Form->textarea'p'$comment_content10T_('Comment text'), T_('Allowed XHTML tags').': '.htmlspecialchars(str_replace'><',', '$comment_allowed_tags)), 40'bComment' );
        <span style="color:red">// set b2evoCanvas for plugins</span>
        <span style="color:red">echo '<script type="text/javascript">var b2evoCanvas = document.getElementById( "p" );</script>';</span>

Yeah yeah, so shoot me, at least you can have a smiley toolbar and smilies in comments without hacks now though huh?

If you're running 2.0 then look out for some groovy changes comming up with the smilies plugin, don't bother looking for them yet though as I haven't uploaded the new version ;)

¥

Playing with custom pages

Posted on 29th Nov 2006 in : Plugins & Widgets

As EdB points out in this post on the forums, lots of people want custom pages and there's no "native" way to do this with evo. So, I decided to have a play and see if it was possible to do.

I've knocked together a plugin that allows you to include files in a blog post by using a comment like this :-

Code:

<!--include my_page -->

The contents of that file are :-

Code:

<?php
  // yet another hello world :D
  echo '<p style="border:1px solid #ff0;">hello world from my page ...... '.rand( 1, 100 ).' is a random number between 1 and 100 ;)</p>';
  ?>

and here's the results :-

With a tad of abuse to the linkblog you could turn this into a bunch of custom pages that are shown in your sidebar, although you then lose your linkblog, but there's ways round that as well.

In it's current form this one's definately not for public consumption, so if you want to have a play with it then you'll need to register and leave a comment, or send me a pm via the forums.

I'm probably not going to go much further with this, although I might incorporate it as part of my linkblogPlus plugin

¥

Extra Comment control

Posted on 27th Nov 2006 in : Plugins & Widgets

This plugin has now been released on AstonishMe, the download link has been amended to point to the relevant post

I decided to have a play with the comments hack I posted yesterday to see if I could make it a plugin .....

So, now you can download it here. Upload it, hit admin and install it, then mosey on over to the plugins settings page and see if they make sense to you.

This should work in all 1.8.x -> 1.9 series ..... and possibly 2.0 as well, but I haven't checked

Don't forget to undo all the hacks if you implemented them huh ;)

Currently comments have 3 options :-

  1. Open
    Everyman and his dog can read and make comments
  2. Closed
    Everyman and his dog can read comments, nobody (not even the dog) can leave comments
  3. Disabled
    What comments?

This plugin extends those options so you can specify exactly who comments are open/closed/disabled for. The choices range from anybody to nobody with several others in the middle

As soon as a certain unamed yank has done a fluffy write up this plugin will be released on AstonishMe

¥

*edit*

This should be in the 'examples'

  • comments open read (anybody): everybody can read
  • comments open write (anybody) : everybody can write
  • comments closed read (anybody) : everybody can read
  • comments closed write (registered users) : registered users can write
  • comments disabled read (registered users) : registered users can read
  • comments disabled write (blog members) : blog members can write

Topanga

*edit*

The plugin now has the following available setting levels, they should be self explanatory. The zipfile has been updated

  1. Anybody
  2. Registered users
  3. Blog members
  4. Blog editors
  5. Blog administrators
  6. Nobody

¥

Page archived : 11th Nov 2009
 

X