Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / gist:2483894
Created Apr 24, 2012
MODx: Get all members of a user group in MODx Revolution.
View gist:2483894
by kairon - http://www.unchi.co.uk/author/admin/
Get all members of a user group in MODx Revolution. This can been done by accessing the database in the following way.
<?php
$usergroup = 4;
$c = $modx->newQuery('modUser');
$c->innerJoin ('modUserProfile','Profile');
$c->innerJoin ('modUserGroupMember','UserGroupMembers');
$c->innerJoin ('modUserGroup','UserGroup','`UserGroupMembers`.`user_group` = `UserGroup`.`id`');
@pepebe
pepebe / plugin.createdOnBy.php
Last active May 2, 2022
Add createdon and createdby to settings tab
View plugin.createdOnBy.php
<?php
/**
* Sample plugin to add a "createdby and createdon" field on a resource form
* Background: Issue #12305 "Adding createdon/createdby/publishedby/etc. to settings"
* https://github.com/modxcms/revolution/issues/12305
*
* Original author: rtripaul
* Original source: https://gist.github.com/rtripault/7306c8487a39fd1ce0db5f334c99be57
*
* @var modX $modx
View plugin.seoSuiteRecoverLongtitle.php
<?php
/**
* seoSuiteRecoverLongtitle v:0.0.1
* Last edited: 2022-05-01
*
* AUTHOR:
* info@pepebe.de
*
* PLUGIN EVENT(S):
* OnDocFormRender
@pepebe
pepebe / managerquicknav.plugin.php
Last active May 1, 2022
ManagerQuickNav v:0.01i (BETA) ManagerQuickNav adds: - buttons with links to the previous or next resource in the current menuindex - a combobox with links the current parent resource and all siblings. - a button to quickly add a new resource with the same parent
View managerquicknav.plugin.php
<?php
/**
* ManagerQuickNav v:0.0.1j (BETA)
* Last edited: 2014-04-09 14:26
*
* AUTHOR:
* info@pepebe.de
*
* DESCRIPTION:
* This plugin injects js to add new items to 'modx-action-buttons'
@pepebe
pepebe / 01_readme.md
Last active Apr 23, 2022
ConfigurePHP recursively searches all directories below its own position for php files. If a directory with at least one php file is found, a symlink to ./php.ini will be created.
View 01_readme.md

Found this script years ago on the 1und1 forum. It was a nice workaround to make sure that the php.ini file would work inside root and all directories below it.

View useful-console-commands.md
@pepebe
pepebe / 00-datagrid.md
Last active Feb 3, 2022
Data Grid Tutorial by Susann Ottwell
View 00-datagrid.md

Backup of a an article write by Susan Ottwell in February 2008

The original source seems to be lost but there is still a copy a archive.org

Disclaimer: I didn't check the code for potential problems with current versions of MODX. If you find something that breaks the code, post it in the comments below.

@pepebe
pepebe / 01-introduction.md
Last active Feb 2, 2022
Collections Editors Complete List
View 01-introduction.md

1 Introduction

Collections is a handy tool to display the child resources of a parent inside a configurable grid. Each column can get its own configurable editor so you can edit a resource right from the grid.

image Example for a datatime editor

Editors can be attached by editing the collections column settings:

image

@pepebe
pepebe / readme.md
Last active Jan 7, 2022
pdoTools Kichensink
View readme.md

About this list

A currated list of useful pdoTools settings/examples

@pepebe
pepebe / CreateXpdoClasses.snippet.php
Last active Jan 6, 2022
pdoResources - load class with custom db prefix
View CreateXpdoClasses.snippet.php
<?php
/**
* @package = CreateXpdoClasses
*
* Create Xpdo Classes script
*
* This script creates xPDO-ready classes from existing custom
* database tables. Run it again whenever you change
* your schema.
*