Skip to content

Commit

Permalink
изменение системных файлов добавление снипетов
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmi3yy committed Oct 27, 2011
1 parent 8b225c2 commit 5cf730a
Show file tree
Hide file tree
Showing 38 changed files with 2,528 additions and 63 deletions.
39 changes: 38 additions & 1 deletion README
Expand Up @@ -13,8 +13,14 @@


-------Изменение системных файлов----------------
-поправил robot.txt
-транслитерация файлов в менеджере картинко и файлов
-wait.static.php - ускоряем переход на главную при сохранении
-jot обновил шаблоны
-правка managermanager - глюк тв параметра с картинкой mm_widget_showimagetvs
-ditto отключение пагинации если 1 страничка (ditto.class.inc.php)
-ditto замена ?=& при работе с @CODE на |xq|','|xe|','|xa| (template.class.inc.php)
-transalias - правильная транслитерация по умолчанию


------------------------Шаблоны----------------
Expand All @@ -33,20 +39,51 @@
-MultiFiles 1.11
-MultiPhotos 1.22
-TvTable 1.1
-aDate - вывод русской даты
-GetField 1.3
-parentTitle - получаем pagetitle парента
-sitemap.xml 1.0.8
-splitPagination 2.0 - красивая пагинация для Ditto
-YouTube 0.1


------------------------Плагины----------------
-добавил плагин seo_strict_urls
-добавил codemirror (подсветка кода)
-TvTable 1.11
-MultiFiles 1.01
-MultiFiles 1.01
-MultiPhotos 1.23
-customTemplate 0.1
-devStat 1.0
-PHx 2.1.4



-------------------------Модули----------------
-добавил Модуль doc finder
-добавил Модуль mass redirect


----------------Экстендеры для Ditto---------
-customsort
-distinct
-jotcount
-tvFilter
-glossaryFilter

--------------setup.sql----------------------
-Default admin account -> admin
-My MODx site -> MODx Site By Dmi3yy
-Шаблон по умолчанию СОСЕДНИЙ
-Опубликованно по умолчанию
-Дружественные урлы ВКЛ с вложенностью
-капча 0,1,2,3,4,5,6,7,8,9
-запоминать вкладки ДА







своя сборка modx
Expand Down
Expand Up @@ -79,7 +79,8 @@ function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $ro
});
}
}); // Trigger a change event on load
$j.data(this,"lastvalue", $j(this).val());
}).trigger("load"); // Trigger a change event on load
';
Expand All @@ -94,7 +95,7 @@ function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $ro
$j(".imageField").each( function() {
var $this = $j(this);
if ($this.val() != $this.data("lastvalue") ) {
$this.trigger("change").data("lastvalue", $this.val());
$this.trigger("change");
}
});
}
Expand Down
31 changes: 31 additions & 0 deletions assets/plugins/phx/docs/install.txt
@@ -0,0 +1,31 @@
Quick Installation and Setup quide:
-------------------------------------

New Install:

1) Download and extract the archive.
2) Create a directory called "phx" in your [MODx Directory]/assets/plugins directory
3) FTP or copy the files into [MODx Directory]/assets/plugins/phx
4) Create a new plugin in the manager called "PHx" and copy/paste the contents of phx.plugin.txt into the code field.
5) Check "OnParseDocument" at the System Events tab

Update:

1) Download and extract the archive.
2) Backup and delete the contents of [MODx Directory]/assets/snippets/phx
3) Create a directory called "phx" in your [MODx Directory]/assets/plugins directory
4) FTP or copy the files into [MODx Directory]/assets/plugins/phx
5) Update the "PHx" plugin in the manager and copy/paste the contents of phx.plugin.txt into the code field.
6) Check "OnParseDocument" at the System Events tab

Optional steps (as of 2.0):

On the Configuration tab -> Plugin configuration enter:

&phxdebug=Debug;int;0 &phxmaxpass=Max. Passes;int;50






12 changes: 12 additions & 0 deletions assets/plugins/phx/modifiers/7bit.phx.php
@@ -0,0 +1,12 @@
<?php

/* Retrieved from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
* description: returns the 7bit representation of a string
* usage: [+string:7bit+]
*/

$text = mb_convert_encoding($output,'HTML-ENTITIES',mb_detect_encoding($output));
$text = preg_replace(array('/&szlig;/','/&(..)lig;/','/&([aouAOU])uml;/','/&(.)[^;]*;/'),array('ss',"$1","$1".'e',"$1"),$text);
return $text;

?>
24 changes: 24 additions & 0 deletions assets/plugins/phx/modifiers/bbcode.phx.php
@@ -0,0 +1,24 @@
<?php

// Retrieved from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
// description: parse bb code (also escapes all html and MODx tags characters)
// usage: [+variable:bbcode+]

$string = preg_replace("/&amp;(#[0-9]+|[a-z]+);/i", "&$1;", htmlspecialchars($output));
$string = preg_replace('~\[b\](.+?)\[/b\]~is', '<b>\1</b>', $string);
$string = preg_replace('~\[i\](.+?)\[/i\]~is', '<i>\1</i>', $string);
$string = preg_replace('~\[u\](.+?)\[/u\]~is', '<u>\1</u>', $string);
$string = preg_replace('~\[link\]www.(.+?)\[/link\]~is', '<a href="http://www.\1">www.\1</a>', $string);
$string = preg_replace('~\[link\](.+?)\[/link\]~is', '<a href="\1">\1</a>', $string);
$string = preg_replace('~\[link=(.+?)\](.+?)\[/link\]~is', '<a href="\1">\2</a>', $string);
$string = preg_replace('~\[url\]www.(.+?)\[/url\]~is', '<a href="http://www.\1">www.\1</a>', $string);
$string = preg_replace('~\[url\](.+?)\[/url\]~is', '<a href="\1">\1</a>', $string);
$string = preg_replace('~\[url=(.+?)\](.+?)\[/url\]~is', '<a href="\1">\2</a>', $string);
$string = preg_replace('~\[img\](.+?)\[/img\]~is', '<img src="\1" alt="[image]" style="margin: 5px 0px 5px 0px" />', $string);
$string = preg_replace('~\[img-l\](.+?)\[/img\]~is', '<img src="\1" alt="[image]" style="border: thin solid #DFE5F2; FLOAT: left; MARGIN-RIGHT: 20px" />', $string);
$string = preg_replace('~\[img-r\](.+?)\[/img\]~is', '<img src="\1" alt="[image]" style="border: thin solid #DFE5F2; FLOAT: right; MARGIN-LEFT: 20px;" />', $string);
$string = str_replace(array("[","]","`"),array("&#91;","&#93;","&#96;"),$string);
return $string;


?>
10 changes: 10 additions & 0 deletions assets/plugins/phx/modifiers/get.phx.php
@@ -0,0 +1,10 @@
<?php

// Returns the GET parameter which has been posted as a query string
// It takes the paramater name as an argument
// e.g. a page with URL of http://www.whatever.com/modx?paramname=rckt
// [*phx:get=`paramname`*] returns "rckt"

return $_GET[$options];

?>
10 changes: 10 additions & 0 deletions assets/plugins/phx/modifiers/ifnotempty.phx.php
@@ -0,0 +1,10 @@
<?php
/*
* description: The opposite of the native PHX "isempty" function. Returns the option value ONLY if the input value is empty (excluding whitespace)
* usage: [+string:ifnotempty=`String to return if not empty`+]
*/

if (trim($output) != '') {
return $options;
}
?>
12 changes: 12 additions & 0 deletions assets/plugins/phx/modifiers/nohttp.phx.php
@@ -0,0 +1,12 @@
<?php

/*
Retrieved from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
* description: Removes the http:// from a URL, to create a display-friendly web address
* usage: [+string:nohttp+]
*/

$url = str_replace('http://', '', $output);
return $url;
?>
13 changes: 13 additions & 0 deletions assets/plugins/phx/modifiers/parent.phx.php
@@ -0,0 +1,13 @@
<?php

/* Retrived from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
* description: get specified document field from parent document (id)
* usage: [+variable:parent=`field`+]
* defaults to pagetitle
*/

$field = (strlen($options)>0) ? $options : 'pagetitle';
$parent = $modx->getParent($output,1,$field);
return $parent[$field];

?>
9 changes: 9 additions & 0 deletions assets/plugins/phx/modifiers/post.phx.php
@@ -0,0 +1,9 @@
<?php

// Returns the POST parameter which has been posted
// It takes the paramater name as an argument
// [*phx:post=`paramname`*]

return $_POST[$options];

?>
79 changes: 79 additions & 0 deletions assets/plugins/phx/modifiers/tidyword.phx.php
@@ -0,0 +1,79 @@
<?php
// Get the Word infested input
$text = $output;

// Remove font tags
$text = strip_selected_tags($text, "<font>");

// Remove weird quotes and accents
// http://uk3.php.net/manual/en/function.preg-replace.php#64828
$text = preg_replace('/([\xc0-\xdf].)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 192) * 64 + (ord(substr('$1', 1, 1)) - 128)) . ';'", $text);
$text = preg_replace('/([\xe0-\xef]..)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 224) * 4096 + (ord(substr('$1', 1, 1)) - 128) * 64 + (ord(substr('$1', 2, 1)) - 128)) . ';'", $text);

// Strip inline styles
$text = strip_styles($text);

// Remove class="MsoNormal"
$text = str_replace('class="MsoNormal"', '', $text);

// Return it
return $text;



/**
* strip_selected_tags ( string str [, string strip_tags[, strip_content flag]] )
* ---------------------------------------------------------------------
* Like strip_tags() but inverse; the strip_tags tags will be stripped, not kept.
* strip_tags: string with tags to strip, ex: "<a><p><quote>" etc.
* strip_content flag: TRUE will also strip everything between open and closed tag
* http://uk3.php.net/manual/en/function.preg-replace.php#71266
*/
function strip_selected_tags($str, $tags = "", $stripContent = false)
{
preg_match_all("/<([^>]+)>/i", $tags, $allTags, PREG_PATTERN_ORDER);
foreach ($allTags[1] as $tag) {
$replace = "%(<$tag.*?>)(.*?)(<\/$tag.*?>)%is";
if ($stripContent) {
$str = preg_replace($replace,'',$str);
}
$str = preg_replace($replace,'${2}',$str);
}
return $str;
}




// Remove styles
// http://uk3.php.net/manual/en/function.preg-replace.php#63219

function strip_styles($source=NULL) {
$exceptions = str_replace(',', '|', 'text-align');

/* First we want to fix anything that might potentially break the styler stripper, sow e try and replace
* in-text instances of : with its html entity replacement.
*/

function Replacer($text) {
$check = array (
'@:@s',
);
$replace = array(
'&#58;',
);

return preg_replace($check, $replace, $text[0]);
}

$source = preg_replace_callback('@>(.*)<@Us', 'Replacer', $source);
$regexp = '@([^;"]+)?(?<!'. $exceptions. ')(?<!\>\w):(?!\/\/(.+?)\/|<|>)((.*?)[^;"]+)(;)?@is';
$source = preg_replace($regexp, '', $source);
$source = preg_replace('@[a-z]*=""@is', '', $source);

return $source;
}


?>
?>

0 comments on commit 5cf730a

Please sign in to comment.