Skip to content

Instantly share code, notes, and snippets.

Piotr Matysiak pmfx

Block or report user

Report or block pmfx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pmfx
pmfx / PageBuilder_saveContent.php
Last active Mar 9, 2019
Saves a copy of PageBuilder values in content field of the site_content table. Useful for search or filtering with other snippets.
View PageBuilder_saveContent.php
<?php
// PageBuilder_saveContent
// Saves a copy of PageBuilder values in content field of the site_content table.
// Event: OnDocFormSave
// https://gist.github.com/pmfx/fcb50c22cb83aa29c63986ce88c7db3f
$e = &$modx->Event;
if ( $e->name == "OnDocFormSave" ) {
@pmfx
pmfx / ManagerCssContexts.php
Last active Mar 10, 2019
Plugin for Evolution CMS. Adds some style to the first level tree elements, to make them stand out more. Usefull when you are using first level documents as "context" folders.
View ManagerCssContexts.php
<?php
// ManagerCssContexts
// Add some style too the first level tree elements.
// Event: OnManagerTreePrerender
// Modify $contexts variable for your needs.
$e = & $modx->Event;
if ( $e->name == "OnManagerTreePrerender" ) {
@pmfx
pmfx / multitvThumbZoom.php
Last active Feb 26, 2019
Plugin for Evolution CMS. Adds nice style for multiTV image preview with zoom on hover
View multitvThumbZoom.php
// multitvThumbZoom
// adds nice style for image preview with zoom on hover
// event: OnManagerMainFrameHeaderHTMLBlock
$e = & $modx->Event;
if ( $e->name == "OnManagerMainFrameHeaderHTMLBlock" ) {
$html = '
<style>
.multitv .list li.element .mtvThumb {
@pmfx
pmfx / evoSystemInfo.php
Last active Feb 4, 2019
Snippet for EVO/MODX Evolution displaying system info and some actions on the frontend. Similar to Quick Manager+
View evoSystemInfo.php
<?php
// evoSystemInfo 1.3
// Snippet displaying EVO system info and some actions on the frontend.
// Call it uncached [!evoSystemInfo!] before </body> tag in your template.
// Dark theme: [!evoSystemInfo? &theme=`dark`!] (EVO 1.4.4 or later required)
// author: Piotr Matysiak webready.pl
if ( isset($_SESSION['mgrValidated']) ) {
$docId = $modx->documentIdentifier;
$docTemplateId = $modx->documentObject['template'];
View modx.evo.1.2.md

#Release 1.2 from 01.12.2016.

This release includes many changes and improvements that would make simpler of creating sites on MODX EVO.

More then 1200 commits

##On MODX Evolution 1.2 worked:

@pmfx
pmfx / MODxRE2-login.tpl
Created Oct 2, 2016
MODxRE2 MODX Evolution theme login.tpl
View MODxRE2-login.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>MODX CMF Manager Login</title>
<meta http-equiv="content-type" content="text/html; charset=[+modx_charset+]" />
<meta name="robots" content="noindex, nofollow" />
<style type="text/css">
body {
font-family: Arial, HelveticaNeue, "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic Pro", Meiryo, sans-serif;
}
@pmfx
pmfx / MODxRE2-style.css
Last active Oct 4, 2016
MODxRE2 MODX Evolution theme. Based on new MODX Revolution theme and build on top of MODxRE (new styles start from line 2640)
View MODxRE2-style.css
/* -------------------------[ Neutralize styles, fonts and viewport ]--- */
* html {
overflow-x: hidden;
overflow-y: auto;
}
/* for IE6 */
@pmfx
pmfx / EvoGallery_counter
Created Oct 1, 2016
Get first picture thumb path from EvoGallery MODX snippet.
View EvoGallery_counter
<?php
$output='';
if($id){
$table = $modx->getFullTableName( 'portfolio_galleries' );
$query = $modx->db->query('SELECT content_id,filename,sortorder FROM '.$table.' WHERE content_id='.$id.' ORDER BY sortorder ASC LIMIT 0,1');
$row = $modx->db->getRow($query);
$gal_id = $row['content_id'];
$gal_filename = $row['filename'];
if ($row){
$output = 'assets/galleries/'.$gal_id.'/thumbs/'.$gal_filename;
@pmfx
pmfx / EvoGallery_first
Created Oct 1, 2016
Get first picture path from EvoGallery MODX snippet.
View EvoGallery_first
<?php
$output='';
if($id){
$table = $modx->getFullTableName( 'portfolio_galleries' );
$query = $modx->db->query('SELECT content_id,filename,sortorder FROM '.$table.' WHERE content_id='.$id.' ORDER BY sortorder ASC LIMIT 0,1');
$row = $modx->db->getRow($query);
$gal_id = $row['content_id'];
$gal_filename = $row['filename'];
if ($row){
$output = 'assets/galleries/'.$gal_id.'/'.$gal_filename;
@pmfx
pmfx / EvoGallery_counter
Created Oct 1, 2016
Count EvoGallery images MODX snippet.
View EvoGallery_counter
<?php
$output='0';
if($id){
$table = $modx->getFullTableName( 'portfolio_galleries' );
$query = $modx->db->query('SELECT content_id FROM '.$table.' WHERE content_id='.$id.' ORDER BY sortorder ASC');
$output = mysql_num_rows($query);
}
return $output;
?>
You can’t perform that action at this time.