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
<?php
// Written by Leevi Graham - Technical Director - http://newism.com.au
// All the best EE extensions can be found at: http://leevigraham.com !!
/**
The function below demonstrates how to use the weblog obect
to parse your own custom module / plugin tags
Usage {exp:my_plugin:use_weblog_object} ... {exp:my_plugin:use_weblog_object}
The tag will now behave like an exp:weblog:entries tag accepting the same params
@smaida
smaida / Delete Account
Created September 27, 2011 02:49
ExpressionEngine Delete Member Account Function
public function cancel_account()
{
$this->member_id = $this->EE->TMPL->fetch_param('member_id');
$this->return = $this->EE->TMPL->fetch_param('return', 'site_index');
$this->EE->lang->loadfile('login');
/* -------------------------------------
/* No sneakiness - we'll do this in case the site administrator
@bsag
bsag / README
Created January 4, 2012 10:34
Create a WXR-format export file to export comments from ExpressionEngine and import into Disqus
I had some difficulty trying to get a format exported from ExpressionEngine which I could use to import comments into Disqus, and eventually settled on the code above after looking at Disqus' own import format (http://docs.disqus.com/developers/export/import_format/) and trawling the ExpressionEngine forums to adapt other solutions which exported to Movable Type format.
You need to start off by creating a new template group called 'export'. Inside that, you make a template called 'index' and paste in the contents of index.xml above, making sure that you replace the channel name and template group name to those appropriate for your setup. This needs to be the index for the template group. Next, create another template called 'comments' and paste the contents of comments.xml, again, replacing the channel name as appropriate.
Now visit http://yoururl.com/export and you should see the exported entries. Wait for the whole page to load which may take some time with a lot of entries. Then use your browsers 'View s
@rachelbaker
rachelbaker / EE-edit-this.html
Created October 12, 2012 17:45
ExpressionEngine snippet for edit this link
{if author_id == logged_in_member_id OR logged_in_member_group == "1"}<a href="{site_url}/admin.php?S=0&D=cp&C=content_publish&M=entry_form&channel_id={channel_id}&entry_id={entry_id}">Edit This</a>{/if}
@GDmac
GDmac / pi.debug_override.php
Created June 22, 2014 08:55
Debug Override plugin, disable ExpressionEngine template debugging from a template
<?php
$plugin_info = array(
'pi_name' => 'debug_override',
'pi_version' =>'1.0',
'pi_author' =>'GDmac',
'pi_author_url' => '',
'pi_description' => '',
'pi_usage' => '{exp:debug_override override="all|ajax"} default is override on ajax calls',
);
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
* An open source application development framework
*
* @package CodeIgniter * @author Rick Ellis
* @copyright Copyright (c) 2006, EllisLab, Inc.
* @license http://www.codeignitor.com/user_guide/license.html
* @link http://www.codeigniter.com * @since Version 1.0
*/
@JamesDunne
JamesDunne / detect_flash.js
Created July 9, 2014 12:29
Flash plugin detection javascript code; works on IE8 and Chrome
// 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; })()