This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* TwitterX | |
* | |
* This package loads Twitter feeds using the new (and very annoying) Twitter | |
* 1.1 API. You will need to create a Twitter app and get the keys and tokens | |
* by creating a new app here: https://dev.twitter.com/apps/new | |
* | |
* This uses twitteroauth: https://github.com/abraham/twitteroauth | |
* | |
* TwitterX is free software; you can redistribute it and/or modify it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get user-defined source document and target parents | |
$source = intval($modx->getOption('sourceId', $scriptProperties, '')); | |
$targets = array_map('trim', explode(',', $modx->getOption('targetIds', $scriptProperties, ''))); | |
// to prevent accidents... | |
$_allowedUsers = explode(',', 'username1,username2'); | |
// check stuff, and if passed then get the source document object | |
if ( !in_array($modx->user->get('username'), $_allowedUsers) || empty($source) || $source == 0 || !is_array($targets) || empty($targets) ) return; | |
$sourceDoc = $modx->getObject('modResource', $source); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Copyright (c) YJ Tso <[email protected]> | |
* | |
* GPL2, do what you want at your own risk. No warranties whatsoever. | |
* | |
*/ | |
// Get &resources property from snippet call | |
$ids = array_map('trim', explode(',', $modx->getOption('resources', $scriptProperties, ''))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myimagerenderer = function(value, metaData, record, rowIndex, colIndex, store) { | |
if (value != '' && value != null) { | |
var baseUrl = MODx.config.collections_renderer_basepath_img; | |
if (value.indexOf('http://') === 0) { | |
baseUrl = ''; | |
} | |
return '<div class="myimagerenderer"><img src="' + baseUrl + value + '" width="100"></div>'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timestampToDatetime = function(value, metaData, record, rowIndex, colIndex, store) { | |
if (value == 0 || value == null) return ''; | |
return Ext.util.Format.date(new Date(parseInt(value) * 1000),MODx.config['collections.mgr_datetime_format']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* @author @sepiariver | |
* | |
* GPL license, no warranties, no liability, etc. | |
* | |
* USAGE EXAMPLE: | |
* [[rootResource? &toPlaceholder=`root_resource`]] | |
* //followed by something like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* @author @sepiariver | |
* | |
* GPL license, no warranties, no liability, etc. | |
* | |
* USAGE EXAMPLE: | |
* [[getCtx? &context=`othercontext` &key=`site_url`]] | |
* // outputs the "site_url" context setting from "othercontext" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* @author @sepiariver | |
* | |
* GPL, no warranties, no liability, etc. | |
* | |
* USAGE EXAMPLE: | |
* [[!FormIt? &hooks=`iContactPost`]] | |
* | |
* NOTE: using iContact's API would be a more robust approach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* MODX Plugin to sandbox Users by User Group, to a specific Resource container. | |
* | |
* @author @sepiariver | |
* GPL, no warranties, no liability, etc. | |
* | |
* Create a Plugin with the code from this gist. Enable the 'OnDocFormPrerender' event | |
* in the 'System Events' tab of the Plugin. Create a namespace, e.g. 'sandbox', and | |
* the following system settings with that namespace: 'sandbox.allow_create', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Open Graph Tags --> | |
<meta property="og:site_name" content="[[++site_name]]" /> | |
<meta property="og:type" content="article" /> | |
<meta property="og:title" content="[[*longtitle:default=`[[*pagetitle]]`]]" /> | |
<meta property="og:description" content="[[*description:default=`[[++site_description]]`]]" /> | |
<meta property="og:url" content="[[~[[*id]]? &scheme=`full`]]" /> | |
<meta property="og:image" content="[[*image:default=`[[++site_image]]`]]" /> | |
<meta property="fb:app_id" content="[[++fb_app_id]]" /> | |
<meta property="article:publisher" content="[[++fb_url]]" /> | |
<!-- Twitter Tags --> |
OlderNewer