Chomper Stomping jQuery/JavaScript/CSS 3/HTML 5, Java/PHP/Python/ActionScript, Git, Chrome/Firefox Extensions, Wordpress/Game/iPhone App Development and other random techie tidbits I've collected

30Dec/110

WP phpBB Bridge: Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given

mysqlerror

Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in wp-content/plugins/wp-phpbb-bridge/inc/widgets/wpbb_topics_widget.php on line 149

This is an error caused by the fact that the WP phpBB Bridge plugin is naively written in places.

For instance, in this case the plugin authors don't expect you to be using a socket instead of a port. Looking at the documentation for mysql-pconnect you see that you can either use combination of hostname:port or hostname:socket. Since they are pulling the setup info straight from the phpBB config file, you have little to no control over the values there (especially if already configured).

What they ought to do is check to see if $port isset() && !empt() and only then append the ":" . $port. But instead, they tag on ":" to your db host EVERY TIME. This breaks your setup if you host is defined in phpBB with a socket. Most of what I just said sort of sounds like gibberish even to me, so, basically, if you are getting this error, the problem is actually line 147. Replace the current line 147 with this:

14Dec/115

Events Calendar Pro Nav Formatting Messed up on Empty Calendar

The Events Calendar Pro (from http://tri.be/) has a few problems.

If you are trying to figure out why a calendar with no events in that month has completely screwed up header navigation, just put this line of code inside of table.php in the top of the display_day function (put it directly before the for loop):

$thisisherebecausethispluginSUCKSdontremoveit = has_excerpt() ? TribeEvents::truncate($post->post_excerpt) : TribeEvents::truncate(get_the_content(), 30);

This basically just runs some "truncate" function on the "TribeEvents" object. For some reason this truncate function magically fixes the header nav display issues.

22Oct/110

Teaser of things to come…

custom_ratings

Lots going on at ChomperStomp right now.

I've been up to my eyeballs in work and in babies (3 month old and 2.5 year old).

Here's a little teaser for something big I'm working on:
User Ratings!
User Ratings, hearts AND stars!
User Ratings, OPTIONS!!!!
User Ratings!

That's right, custom user ratings in Continuum Coming November 1st! (will require either Continuum 1.9 or Continuum Refactor 11.1101, both coming 11/01/11)

Haven't settled on the price yet, probably between $50 and $100 depending on how much longer it takes...

15Jan/100

Diagonal Accordion with jQuery

diagonalAccordion is a jQuery plugin that allows for accordion functionality, but in a diagonal angle of your choice!

I forked Charles Marshall's diagonal-accordion- plugin (on github) which allowed for a 45 degree angle accordion and hacked it to allow for any angle.

Use it like:

$("#someElement").diagonalaccordion({
acc_width:500,
acc_height:300,
bar_size:45,
speed:'slow',
accordion:'.accordion',
coverage:4,
diagAdjust: 3
});

Or even just:

$("#someElement").diagonalaccordion({
diagAdjust: 5
});

The only difference between using my plugin and his is the diagAdjust parameter. This parameter allows for incremental adjustments away from 45 degree angles. The bigger number you provide, the shallower the angle gets, until at number 11 it is effectively no angle. then after 11 it starts angling the other way.

Here's the official demo for the original plugin. Like I said, mine works exactly the same way, it just has an extra param to use.

17Dec/090

Exploring jQuery getScript, or “How I created the jQuery getScriptLite plugin”!

I set out to discover how the getScript function in jQuery works today. Here is what I found. This post sort of illustrates just how easy it is to dig into the jQuery source and really learn the library.

The first thing I did is hop over to github and pop open the source for the 1.3.2 release:

http://github.com/jquery/jquery/tree/1.3.2/src

Since getScript() is an AJAX function, I naturally clicked on "ajax.js". On line 109 I found:

Oh wow! It's just a convenience method! It doesn't do anything magical at ALL. It simply calls $.get().

Now, I could have stopped there, but for fun, let's go deeper. On line 93 I found the get() function:

Ok, so get() is really just a convenience method for ajax(), so let's look for that. Line 25, the ajax() function:

Wait, that's not the one! I don't really know how this works, but that can't be the one because it strips out the script tags. I find another one later on on line 170 that goes all the way to line 451. Way down on line 253 it seems to handle the actual script loading:

Aha! Clever. Creates a script tag and sets it's source to the one we specified and then on line 278 appends it to the head of the document, I'm assuming at that point running the script because two lines later it returns out of the function:

So, there you have it! It would almost seem that you could do the same thing by:

In fact, that seems to work just fine. Hrm... Fork me on github and/or get the plugin!