Skip to content

Instantly share code, notes, and snippets.

View pmfx's full-sized avatar

Piotr Matysiak pmfx

View GitHub Profile
@pmfx
pmfx / tv_categorized_tabs
Created October 1, 2016 17:32
tv_categorized_tabs MODX Evolution plugin. Now working with MultiTV.
<?php
/**
* $Id: plugin.php 22 2010-03-24 19:37:03Z stefan $
*
* Collect the currently used TVs and sort them to tabs which created on there
* associated categories
*
*
*
* Updated by Piotr Matysiak (pmfx) on 2016-09-27: Now works with multiTV
@pmfx
pmfx / EvoGallery_counter
Created October 1, 2016 17:35
Count EvoGallery images MODX snippet.
<?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;
?>
@pmfx
pmfx / EvoGallery_first
Created October 1, 2016 17:36
Get first picture path from EvoGallery MODX snippet.
<?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 October 1, 2016 17:37
Get first picture thumb path from EvoGallery MODX snippet.
<?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 / MODxRE2-login.tpl
Created October 2, 2016 20:15
MODxRE2 MODX Evolution theme 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 October 4, 2016 14:15
MODxRE2 MODX Evolution theme. Based on new MODX Revolution theme and build on top of MODxRE (new styles start from line 2640)
/* -------------------------[ Neutralize styles, fonts and viewport ]--- */
* html {
overflow-x: hidden;
overflow-y: auto;
}
/* for IE6 */
@pmfx
pmfx / modx.evo.1.2.md
Last active December 1, 2016 15:06 — forked from Dmi3yy/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 / evoSystemInfo.php
Last active February 4, 2019 09:03
Snippet for EVO/MODX Evolution displaying system info and some actions on the frontend. Similar to Quick Manager+
<?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'];
@pmfx
pmfx / multitvThumbZoom.php
Last active February 26, 2019 20:25
Plugin for Evolution CMS. Adds nice style for multiTV image preview with zoom on hover
// 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 / PageBuilder_saveContent.php
Last active March 9, 2019 22:05
Saves a copy of PageBuilder values in content field of the site_content table. Useful for search or filtering with other snippets.
<?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" ) {