FancyBox for WordPress plugin not working

I just spent some time figuring out why fancybox wasn’t working tonight (image thumbnails were just linking to the large image…not loading the overlay as they should). It now seems obvious after the fact but as far as I can see it’s NOT in the fancybox docs.

When you insert your gallery from the media section of a page in wp-admin, you HAVE to choose “Image File”, not “Attachment Page”. That’s it!

Annoyingly if you set the option to “Image File”, save and exit…the next time you edit the page WordPress doesn’t remember your decision and instead checks the “Attachment Page” radio option.

Hope this helps some people :)

wordpress gallery settings

1 Comment

FarCry twitter plugin

I spent a couple of hours on a FarCry plugin for twitter yesterday based off their official API.

What?
This plugin basically wraps up the options that the offical twitter API gives you including:

  • Twitter username
  • Showing avatars, timestamps, hashtags etc
  • Theme appearance (colours for background and text etc
  • Dimensions of widget

For more, visit the project page, download it and have a play.

Why?
Although the twitter API is super simple to implement, it’s always handy to have things wrapped up as a plugin so we can easily create as many widgets as we need and handle caching etc. Caching is important as the API is rate limited to 150 requests per hour, using FarCry’s object broker will get around this.

Plus it makes it simple for non techy people to get going with the goodness of twitter.

Where?
The project is currently hosted at GitHub…where else?
farcrytwitter project page

Requirements?
FarCry 6+ (although I think it’ll work on 5+ I haven’t tested)
Railo 3.x / ColdFusion 8+
MySQL / MSSQL (or whatever database your version of FarCry supports)

No Comments

MySQL alternative to MSSQL’s isNull()

I was looking for a way to do isNull() in MySQL the other day, for those that don’t know this means you can do something like:

SELECT isNull(mycolumn, 'blah') FROM myTable;

If the value in mycolumn is NULL, then ‘blah’ is returned, this can of course be any string literal/numeric value you want. MySQL doesn’t have isNull() but it does have ifNull() which is basically the same.

SELECT ifNull(mycolumn, 'blah') FROM myTable;
3 Comments

SQL for finding duplicate values

Quick post to remind me how to check a table column for duplicate values next time I’m looking for it (when my memory fails!)

SELECT id, count(id)
FROM mytable
GROUP BY id
HAVING count(id) > 1
2 Comments

Checking for correct case-sensitive tables in FarCry

We run several FarCry projects at Learnosity and all of them run on Linux. We have occasionally come across issues where the FarCry codebase will refer to a MySQL table in the wrong “case”.

E.g. referring to “dmhtml” where the actual table name is “dmHTML”.

This is course fails in any case sensitive environment. Note that we also run our Macs as case sensitive in development to help find these issues before deploying to a stage/production server.

Anyway, I wrote a small test script to introspect the FarCry codebase for types and rules etc to compare that with a local MySQL database to attempt to find (and fix) any case sensitive issues that might occur.

We already have a custom area under the “Admin” tab in the webtop, I added the file there.

webtop

If you’re interesting in having a look, download diff.cfm and put inside your projects “customAdmin” folder and link to it from customadmin.xml e.g.

	<section mergeType="merge" id="admin" sequence="4100" permission="MainNavAdminTab" label="Admin" icon="config" description="administration/utility tasks">
		<subsection id="learnosity" sequence="10000" label="Table Name Check" permission="AdminGeneralTab">
			<menu sequence="10" id="intranetmenu" label="Utility Tasks" labelType="value">
				<menuitem id="diff" sequence="1" label="FarCry/MySQL Diff" link="/admin/customadmin.cfm?module=diff.cfm" />
			</menu>
		</subsection>
	</section>

Hope it helps!

No Comments