This file contains 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
$event= $modx->newObject('modEvent'); | |
$event->fromArray(array ( | |
'name' => 'OnMyEvent', | |
'service' => 1, | |
'groupname' => 'MyGroup' | |
)); | |
$event->save(); | |
/* Then associate it with a plugin: */ |
This file contains 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
if (!empty($options['showBoards'])) { | |
$c = array( | |
'board' => 0, | |
'groups' => $_groups, | |
); | |
if (!empty($scriptProperties['category'])) $c['category'] = (int)$scriptProperties['category']; | |
$cacheKey = 'discuss/board/user/'.$discuss->user->get('id').'/index-'.md5(serialize($c)); | |
$boardIndex = $modx->cacheManager->get($cacheKey); | |
if (empty($boardIndex)) { |
This file contains 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 | |
/** | |
* Use like so: | |
* [[!getTpl? &file=`/path/to/my/file`]] | |
*/ | |
$o = ''; | |
if (file_exists($file)) { | |
$o = file_get_contents($file); | |
} else { $o = 'File not found: '.$file; } | |
return $o; |
This file contains 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
$thumbUrl = $item->get('thumbnail',array( | |
'w' => (int)$modx->getOption('imageWidth',$scriptProperties,500), | |
'h' => (int)$modx->getOption('imageHeight',$scriptProperties,500), | |
'zc' => (boolean)$modx->getOption('imageZoomCrop',$scriptProperties,0), | |
'far' => (string)$modx->getOption('imageFar',$scriptProperties,false), | |
'q' => (int)$modx->getOption('imageQuality',$scriptProperties,90), | |
)); | |
/* or */ | |
$thumbUrl = $item->get('thumbnail',array( |
This file contains 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 | |
$response = array(); | |
switch ($modx->event->name) { | |
case 'OnDiscussRenderHome': | |
$response['top'] = 'My custom stuff goes here!'; | |
break; | |
} | |
$modx->event->_output = $response; | |
return; |
This file contains 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 | |
$eventName = $modx->event->name; | |
switch ($eventName) { | |
case 'OnLoadWebDocument' : | |
$output = $modx->codeContent = $modx->resource->getContent(); | |
preg_match_all('/<pre.*?>(.*?)<\/pre>/ims', $output, $matches); | |
$i = 0; | |
if (empty($matches[1])) return; | |
if (empty($modx->codeMatches)) $modx->codeMatches = array(); |
This file contains 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
- Q&A thread types, where specific replies can be marked as answers and moved to the top of the thread, and the title appends [Solved] | |
- Enable FURLs for boards | |
- Enable FURLs for users | |
- Enable ability for users to set "Display Name" | |
- Better post parsing to prevent HTML injection, mistyped tags, etc | |
- Lots of fixes and improvements to URL parsing, better abstraction on that front | |
- Add New Replies to Posts page | |
- Bad words filter | |
- Solr powered search | |
- Improved print page |
This file contains 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 | |
$c = $modx->newQuery('modUserGroupRole'); | |
$c->innerJoin('modUserGroupMember','UserGroupMembers'); | |
$c->innerJoin('modUserGroup','UserGroup','UserGroup.id = UserGroupMembers.user_group'); | |
$c->where(array( | |
'UserGroupMembers.member' => $userId, | |
'UserGroup.name' => $userGroupName, | |
)); | |
$role = $modx->getObject('modUserGroupRole',$c); |
This file contains 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 | |
/** | |
* Loads the edit file page | |
* | |
* @package modx | |
* @subpackage manager.system.file | |
*/ | |
class SystemFileEditManagerController extends modManagerController { | |
/** @var string The basename of the file */ | |
public $filename = ''; |
This file contains 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
Ext.onReady(function() { | |
Ext.getCmp('modx-layout').hideLeftbar(); | |
}); |
OlderNewer