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}

Photozoom 3 takes steroids

Posted on 6th Dec 2007 in : Plugins & Widgets

Introducing the PZ3IceCold plugin

We haven't really named it that, it just kinda fit with the flow of the rest of the post ... just like all the images do ;) ... So, you want it, you desire it, you love the feel of it in your hands, you want to do all sorts of cool and sexy things with it ...... you need a shrink ...... but where the hell do you get it? The short answer is here, the long answer is way longer and also involves big words .... but you've already downloaded the plugin and forgotten all about my tacky lil pad, whilst you paw over the coolness of the interface .... I understand .... sniff .....

 

for the minority that are still reading, here's the rest of the post ( including all the big words ):

We rock :D

Millions of people email us on a daily basis begging us to code a photozoom plugin that works with every version of b2evolution that we've tested it with ........ which is .... urm, whatever version I'm running, and another one, and scott may have tested it by the time I post this, in whatever version he's running, so that's three versions it may or may not run in ...... Today their dreams have become a reality ..... so stop emailing us already, just download the bloody plugin :| ...... from now on, adding a photozoomed image to your posts is as simple as clicking a button, emailing us to tell us how frickin' cool the interface looks, clicking a few more buttons here, type the odd caption there and ... just for you IE users out there ..... clicking on a radio button, and voila, or boom or blammo or whatever, instant PZ3 image in your post complete with caption, alt text, title text and some other bits of your choice ....... how cool is that!

So, how come we're cooler than a canadian snowstorm?

The short answer is "install the plugin".The long answer is much longer and includes those big words I promised : On the grounds that the b2evo admin pretty much requires javascript just to function, we decided to have a play with improving the work-flow by manipulating the DOM with some pretty persuasive code .... which is ironic really, since photozoom was specifically created to be a pure CSS solution .... without all the ie specific html shit that other solutions employ ... anyway, I digress .... so, we started to play with an interface .... ohhh, and we bent the core a tad, sorry FG .... and then we spent a fair smidge of time, courtesy of Mr Gates, with a slightly higher than normal blood preassure ... and then, finally, we stepped back and looked in awe at the wondrous mess we'd created ....... at least it proved the concept was viable :>>

So, we wandered off into a dark and lonely place and spent a few days coding up the new work-flow ... and then we spent several hours beating IE over the head with a copy of HTML for Dummies ... and finally it was done. The end result is a plugin that makes it a doddle to add photozoom images to your post, without you having to worry about all the HTML/CSS required to make all the magic work. As an added bonus the plugin actually puts the HTML into your post so even if you uninstall the plugin, as long as you include the pz3 css in your skin, your images will still work.

Is that it?

Realising that not everybody likes the black look, weirdos, we added loads of classnames and id's and stuff to all the various bits that make up the interface, so if you prefer your screen to be red just hit the relevant stylesheet and play with hex. Just don't forget to take IE to one side and slap it around until it understands your changes. Please note : this is a pre-release version, so there's still a few style glitches to work out with the interface. The actual photozoom part of it is fully finished though and won't be changed between now and the public release, so it's safe to play with it.

As always any feedback would be appreciated, even if all you want to say is "your interface sucks", of course we'd just refer you to a good shrink, but that's by the by.

¥

Internet Explorer - wasting production time worldwide

Posted on 5th Dec 2007 in : Techno Babble

Internet Explorer - wasting production time worldwide

Most people who know me will know my view of any/every version of Internet Explorer, hell most of them hold the same views. In fact, I'd imagine that pretty much every serious web developer out there would probably hold the same views. Internet Explorer is crap, and reminds us daily. Not only can it not understand the most basic HTML or CSS, but it usually can't even understand itself.

Today it hit a new level. I've been coding up a plugin for use on a clients site and, to improve the workflow, we decided to do some fancy shit with javascript seeing as the environment already required javascript to function. After a fair amount of thinking and tinkering I dived in and started coding away in a busy looking manner. After a fair amount of coding, quite a bit of which was spent beating my head against the wall with explorer and coding round it's *quirks* ... but that was expected .... I finally got the code behind the scenes done and started working on the GUI .... I wish I hadn't!

After finding some annoying little quirks ... like don't try leading/trailing whitespace in element title attributes ... ohhh and don't try and make it think to much whilst it's still trying to work out what HTML is .... I hit a deal killer. Internet Explorer couldn't add a radio button ( that worked ) via the DOM ...... a simple bloody radio button! .... if you want to try it yourself, copy paste the following code into notepad, save it as ie_is_crap.html and call it up in IE

Html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-UK" lang="en-UK">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Screen demo</title>
  </head>
  <body>
  <script type="text/javascript">
  // create an element
  function amCreateElement( elementType, elementAttributes )
  {
    // create an element of the required type
    var theElement = document.createElement( elementType );
  
    if( elementAttributes )
    { // we have attributes for this element
      var allAttributes = elementAttributes.split( '" ' );
      var numAttributes = allAttributes.length;
      for( i = 0; i < numAttributes; i++ )
      {  // step though all elements
        attributeName = allAttributes[i].slice( 0,allAttributes[i].indexOf( '=' ) );
        attributeValue = allAttributes[i].slice( attributeName.length + 2 );
        // the last attibute will still have trailing "
        if( attributeValue.charAt( attributeValue.length - 1) == '"' ) attributeValue = attributeValue.slice( 0, -1 );
        // check for onclick et al
        if( attributeName.slice( 0, 2 ) == 'on' )
        {// bugger now we need to play with explorer
          if ( window.attachEvent )
            eval('theElement.attachEvent( attributeName, function(x){ '+attributeValue+' } );' )// IE
          else
            theElement.setAttribute( attributeName, attributeValue );
        }
        else
        {  // rest of attributes
          if( attributeName == 'class' )
          { // yet another piece of explorer crap
            theElement.className = attributeValue;
          }
          else
          {  // note : in iE everything else but style will work
              theElement.setAttribute( attributeName, attributeValue, 0 );
          }
        }
      }
    }
    // return the element we just built
    return theElement;
  }
  
    theInput = amCreateElement( 'input', 'name="test" type="radio"' );
    document.body.appendChild( theInput );
  
  
    theInput = amCreateElement( 'input', 'name="test" type="radio"' );
    document.body.appendChild( theInput );
  
  
  </script>
  </body>
  </html>

Inferior Experience brought to you by Microsoft

Great huh? I won't begin to tell you how many hours I spent narrowing it down to just that. So, this problem leaves us royally screwed, if I can't solve it then we have to revert back to a crap work flow and undo 3 days worth of my time ..... I am not a happy bunny ....... as a last resort I hit google, and for once I was impressed, it's first result leads to this post ( Problem with RADIO (created by DOM) in Internet Explorer ) on a forum, and more importantly, the answer ;) .......... notice the date of the post, July 2005.

Basically it comes down to the fact that IE wouldn't allow you to add a name attribute to an element created through the DOM, because nobody would ever want to create a form object huh? The bit that really pisses me off is that their new *flagship* and *compatible* browser IE7 is just as fucked up, so web developers world wide will still have to waste hours overcoming IE's various quirks and failures ......... I dread to think of the number of hours a day that amounts to.

Thanks to the answer given by Martin Honnen, and the microdoft page that he linked to, I managed to get radio buttons working ..... hooray only 4 bloody hours wasted huh Mr Grates :| for any of you that are interested, just add the snippet below into the code you saved from above and rerun the page ;)

Html:

if( window.attachEvent && elementAttributes && elementAttributes.indexOf( 'type="radio"' ) > -1 )
    { // you REALLY have to hate IE :|
      return document.createElement('<input '+elementAttributes+'></input>' );
    }

A problem shared and all that

As you can imagine, with not being a happy bunny, I had to share my problem with Scott ...... the conversation went a tad like this :

tuxnus: it's ie6 ... it's high time to start penalizing them
yabba_hh: how the fuck do you penalise someone who's using IE6 ? they're ALREADY fucked :|
tuxnus: make it obvious to them ;)
tuxnus: most haven't a clue
yabba_hh: if they haven't noticed just from using ie then even a big red banner with flashing gif saying "Yer browsers fucked" wouldn't work :|
tuxnus: trouble is, most have nothing to compare it to
tuxnus: they think what they see, is what everyone sees
yabba_hh: there's probably a fair amount of truth in that

So ...... for all you IE users out that there that haven't a clue what we're on about, go install an alternative browser like Firefox or Opera ( google them huh ), and then go wander around the web and see what it *really* looks like. Not only will you have a better experience, and be safer because you're not using a browser that has more security flaws than MI5's headquarters, you'll also be helping web developers world wide save production time by not having to code out IE's ineptitudes.

Anyway, it's time I went and finished the GUI
¥

Playing with relations

Posted on 22nd Nov 2007 in : Plugins & Widgets

Hey cuzz :D

Of course, all the relations were of adult age and consent was given :| .... so, I've come back to a plugin that I was playing with months ago, but put on hold because I couldn't be arsed coding in all the tag stuff that it needed. However the latest version of b2evolution has tag support, so I can just do the lazy arsed bit and code the related posts component of it ;)

What does it do?

Well, apart from molesting your relations, it adds a list of related posts to each of your posts based on the tags that you've used for your posts, in a kinda "nearest cuzzin" way. This is all automated ( although I might make it a skintag thing at a later date ), so you just need to upload and install ..... and yer cuzzins are mine ;)

As always, this plugin is supplied as is .... and if it molests yer granny then .... well, hell, she deserves a tad of excitement at her age huh? ... anyway, you can download it here .... let me know if it fails huh? ;)

¥

Swift update 23rd Oct
After a tad of testing by John the plugin has had a couple of glitches ironed out. It's also had a shedload of parameters added to it so that you can play with the layout directly from admin. The zip has been updated.

Update 24th Oct ( zip updated )
The plugin has now been "widgetised" which allows you to have individual settings per blog, and a new setting has been added to the plugin settings to turn widget support on/off

Note : To use the widget abilities you need a container in your post loop where you want the related posts to appear. Obviously you also need to install the widget in the container as well ;)

Another update 24th Oct ( zip updated )
Thanks to Gary a couple of bugs with rss feeds and "only post with tags" have been cured ;)

Multi-domains on a single evo install

Posted on 11th Oct 2007 in : Techno Babble

We get lots of forum posts asking how to get multi-domain and multi-subdomain single evo installs working on a linux box, and I'm still baffled why people find it so hard ( especially if a blonde like me can achieve it huh? ), but I was running a trick windows install and had never tried on linux ......... until now, so I thought I'd document how I did it.....

Read more »

Tacky Palace 3.0

Posted on 10th Oct 2007 in : Techno Babble, Skins, b2evo 2.0

Welcome to Tacky 3

As you may have noticed, my tacky palace has just had the decorators in. What you probably haven't noticed is that it's now wrapped around b2evolution 2.0.2.alpha|summat .... how cool is that? ..... well, a tad cooler, now it's also running on a linux box as well, so no more windows hacks for clean urls. Of course this means I now have a few plugins that need tweaking and some other bits and bobs like my contact form, but what the hell, life could be far less interesting ;)

¥

Cleaning clouds

Posted on 5th Oct 2007 in : Plugins & Widgets

Prompted by a forum comment by jibberjab asking how to exclude certain word/search terms from our Search Cloud plugin, I decided to do a tad of an overhaul, as the only solution was "crack open the plugin file and add <snippet> to the code" .... not exactly user friendly ... so I decided to "crack open the plugin file" and add a setting for it ....... and then I went mad and added settings for pretty much everything you could imagine.

Announcing the new and improved Search Cloud Plugin

Not content with just adding a new setting for excluding search terms, and moving pretty much every other parameter into settings as well, I widgetised it for those of you running 2.0.x, so you can have settings based on individual skins/blogs .... how cool is that ? ...... well apparently it's not cool enough :( .... Scott woke up .... and during one of my more lax moments , I mentioned that I'd recoded the plugin ..... never a good move :P

Announcing the new and improved Search Cloud Plugin

So, after the input from the grumpy bugger, and a tad more coding, we're proudly run by wordrpess .... just kidding, have you seen the code that runs a wordpress blog? ... *shudders* ..... anyway, back on track, we have a new improved, should cover all situations ( even Scott situations ) search cloud plugin :D ..... although some enhancements require javascript :(

Anyway, if you like to live on the edge, and have a spare cpu for your server, you can download a test version of the code here. I haven't updated the helpfile yet, so you'll either have to hit the plugin settings and try and work it all out, or take a look in the source for all the available shit. If you're running 2.0.x then you should also have all the settings as widget settings ( which default to the current plugin settings .... damn this all gets complicated fast ) ..... As always, this code is supplied as is, and if it melts your server then .... urm, tough

¥

Page archived : 6th Mar 2010
 

X