Skip to content

Instantly share code, notes, and snippets.

View nathanpitman's full-sized avatar
💭
I may be slow to respond.

Nathan Pitman nathanpitman

💭
I may be slow to respond.
View GitHub Profile
@nathanpitman
nathanpitman / child-cat-count-ee
Last active January 3, 2016 09:59 — forked from zgordon/child-cat-count-ee
Modified to use category IDs instead of category URLs
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'Child Category Count',
'pi_version' =>'1.0',
'pi_author' =>'Nathan Pitman',
'pi_author_url' => 'http://ninefour.co.uk/labs',
'pi_description' => 'Returns number of child categories given a parent category ID',
(function($){
$(function(){
var $form = $('#search'), // Search form
$target = $('#results'), // Results container
$rp = 'search/ajax-results'; // Template for results only
// Function to execute on success
var success = function(data, status, xhr) {
$target.html(data);
};
// Returns true or false if flash installed or not. Tested with IE8 on Windows 7 and Chrome on Win7 and Mac.
(function() { var ie_flash; try { ie_flash = (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false) } catch(err) { ie_flash = false; } var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || ie_flash); return _flash_installed; })()