Тут вообще-то ничего интересного,
просто мои закладки и прочий говнокод

EVO CMS / Заметки

select styling
Стилизация выбора размера товара
    <link href="/select/select.css" rel="stylesheet" type="text/css" />
    <script src="/select/select.js"></script>

Не забыть обренуть select в div с id
Например: <div id="sizes">
Tiny slider
Слайдер для сайта
     <!-- TINY SLIDER -->
    <link rel="stylesheet" href="/tns/tiny-slider.css">
    <!--[if (lt IE 9)]><script src="/tns/tiny-slider.helper.ie8.js"></script><![endif]-->
    <script src="/tns/tiny-slider.js"></script>
    <link href="/tns/tns.css" rel="stylesheet" type="text/css" />
    <script src="/tns/tns.js"></script>
    <!-- // TINY SLIDER -->

Стили оформления

tns-style-round
tns-style-round2
tns-style-square
tns-style-squareround
tns-style-arrows

Не забываем про картинки в папке TNS


 
    <div class="tns-container tns-style2">  
        <div class="tns">
          <div class="tns-screen tns-screen1"></div>
          <div class="tns-screen tns-screen2"></div>
          <div class="tns-screen tns-screen3"></div>
        </div>
    </div>  
IMAGES
Базовый набор картинок для работы

PNG + SVG

fix.css
Сбрасываем стили

@charset "utf-8";


form {
margin: 0px;
padding: 0px;
}


.opa { opacity: 0.5; }

.rad2 {
border-radius: 2px;
}


.rad3 {
border-radius: 3px;
}

.rad4 {
border-radius: 4px;
}

.rad5 {
border-radius: 5px;
}

.rad6 {
border-radius: 6px;
}
.rad50 {
border-radius: 100% !important;
overflow: hidden !important;
}


.clearfix {
display: inline-block;
width: 100%;
height: auto;
}


img {
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
/* width: 100%; */
max-width: 100%;
height: auto !important;
}

/* .errors {
font-size: 11px;
color: #C00;
margin-bottom: 10px;
} */


.justifyfull {
text-align: justify;
}

.justifyleft {
text-align: left;
}

.justifyright {
text-align: right;
}

.justifycenter {
text-align: center;
}


p { margin-top: 0px;}

{{HEAD}}
Заготовка HEAD

<!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">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Павел Савченков. Разработка веб-сайтов | {*pagetitle*]</title>

<meta name="viewport" content="initial-scale=1, maximum-scale=1" />

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Alumni+Sans:wght@100;200;300;400;500;600;700;800;900&family=Rubik:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">

<meta name="keywords" content='{*mykeywords*]' />
<meta name="description" content='{*mydescription*]' />
<base href="https://3fir.ru/" />

<script src="//ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/tiny-slider.css">
<!--[if (lt IE 9)]><script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/min/tiny-slider.helper.ie8.js"></script><![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js"></script>


<link href="/preloader/preloader.css" rel="stylesheet" type="text/css" />
<script src="/preloader/preloader.js"></script>

<script src="/js/script.js"></script>

<link href="/css/fix.css" rel="stylesheet" type="text/css" />
<link href="/css/style.css" rel="stylesheet" type="text/css" />

<meta name="twitter:title" content="Павел Савченков. Разработка веб-сайтов" />
<meta name="twitter:description" content="Павел Савченков. Разработка веб-сайтов" />
<meta name="twitter:image" content="https://3fir.ru/og.jpg" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Павел Савченков. Разработка веб-сайтов" />
<meta property="og:description" content="Павел Савченков. Разработка веб-сайтов" />
<meta property="og:url" content="https://3fir.ru/[~{*id*]~]" />
<meta property="og:image" content="https://3fir.ru/og.jpg" />
<meta property="og:image:type" content="image/jpg" />
<meta property="og:image:width" content="900" />
<meta property="og:image:height" content="402" /><link rel="image_src" href="https://3fir.ru/og.jpg"/>


</head>

[[lastOrder]]
Выводим ID последнего заказа

<?php
global $modx;
$count = $modx->db->getValue( $modx->db->select( 'MAX(id)', 'evo_commerce_orders') );
return $count;

[[inwishlist]]
Проверяем добавлен ли товар в избранное

<?php
// if (ci()->carts->getCart('wishlist')->has($modx->documentIdentifier)) {
if (ci()->carts->getCart('wishlist')->has($id)) {
return 'active';
}

gallery.php
Переход с evoGallery на SimpleGallery

Кладём gallery.php в корень.
Правим пути. Запускаем. Потом не забыть удалить.

<?php
define('MODX_API_MODE', true);
define('MODX_BASE_PATH', __DIR__ . '/');
define('MODX_BASE_URL', '/');
define('MODX_SITE_URL', 'http://sitename.ru/');
include_once("index.php");
$modx->db->connect();
if (empty ($modx->config)) {
$modx->getSettings();
}
include_once(MODX_BASE_PATH.'assets/plugins/simplegallery/lib/table.class.php');
$modx->invokeEvent("OnManagerPageInit");
$q = $modx->db->query("SELECT * FROM {$modx->getFullTableName('portfolio_galleries')} ORDER BY `content_id` ASC, `sortorder` ASC, `id` ASC");
$fs = \Helpers\FS::getInstance();
$sg = new \SimpleGallery\sgData($modx);
while ($row = $modx->db->getRow($q)) {
$path = 'assets/galleries/'.$row['content_id'].'/';
if ($fs->checkFile($path.'original/'.$row['filename'])) {
$sg->create();
$sg->set('sg_rid',$row['content_id']);
$sg->set('sg_title',$row['title']);
$sg->set('sg_description',$row['description']);
$sg->set('sg_image',$path.$row['filename']);
$fs->moveFile($path.$row['filename'],$path.'large/'.$row['filename']);
$fs->moveFile($path.'original/'.$row['filename'],$path.$row['filename']);
$name = MODX_BASE_PATH . $path.$row['filename'];
$info = getimagesize($name);
$properties = array(
'width' => $info[0],
'height' => $info[1],
'size' => filesize($name)
);
$sg->set('sg_properties',$properties);
$sg->save();
}
}

[[getGET]]
Получаем GET параметр

[[getGET? &param=`search`]]

 

<?php
echo($_GET[$param]);

[[GetDate]]
Выводим дату из

[[GetDate? &whatDate=`{*dater*]`]]

<?php
$MyDate=(int)$whatDate;

$monthes =array('','01','02','03','04','05','06','07','08','09','10','11','12');
$day = date('j',$MyDate);
$month = $monthes[date('n',$MyDate)];
$year = date('Y',$MyDate);
$hour = date('H',$MyDate);
$minutes = date('i',$MyDate);
echo $day.'.'.$month.'.'.$year;

pagerdiv
CSS код для разбивки на страницы

.pagerdiv {
font-size: 16px;
line-height: 16px;

}

.pagerdiv .pagination a {
display: block;
padding: 10px;
padding-left: 12px;
padding-right: 12px;
margin-right: 2px;
border-radius: 4px;
float: left;
text-decoration: none;
transition-duration: 0.5s;
}

.pagerdiv .pagination span {
display: block;
padding: 10px;
padding-left: 12px;
padding-right: 12px;
margin-right: 2px;
border-radius: 4px;
float: left;
text-decoration: none;
}

.pagerdiv .pagination a:hover {
background-color: #eca016;
color: #FFF;

}

 

.pagerdiv .pagination b {
font-weight: normal;
display: block;
padding: 10px;
padding-left: 12px;
padding-right: 12px;
margin-right: 2px;
border-radius: 4px;
float: left;
background-color:#c40d23;
color: #FFF;
}

.pagerdiv .pagination a.current {
font-weight: normal;
display: block;
padding: 10px;
padding-left: 12px;
padding-right: 12px;
margin-right: 2px;
border-radius: 4px;
float: left;
background-color:#c40d23;
color: #FFF;
}

evoSearch + DocLister
Вывод результатов

[!DocLister?
&id=`searchresults`
&documents=`[!evoSearch? &action=`ids` &output=`1` &rel=`5` ]]`
&tpl=`tovarTPL-V3`
&display=`20`
&TvNames=`articul`
&tvList=`tovarpic1,articul,tovarpic2,price,oldprice,notinstock,video`
&noneTPL='@CODE: По запросу <u> {+ stat_request +] </u> ничего не найдено. Смягчите условия поиска.'
&filters=`AND(content:template:eq:7)`
&TplCurrentPage=`@CODE: <a href="{+link+]" class="current">{+num+]</a>`
&TplNextP=`@CODE: <a class="nextpage" href="{+link+]">→</a>`
&TplPrevP=`@CODE: <a href="{+link+]">←</a>`
&TplDotsPage=`@CODE:<span>...</span>`
&paginate=`pages`
]]

[[phpthumb]]
phpthumb обычный и с водяным знаком

[[phpthumb? &input=`{+tv.photo+]` &options=`w=400,h=207,f=jpg,q=95,zc=1`]]

С водяным знаком (wm.png должен находиться в корне сайта)

[[phpthumb? &input=`{+tv.photo+]` &options=`fltr=wmi|/wm.png|BR|65,w=765,h=342,zc=1,f=jpg,q=95`]]

Cookies.js
Работа с cookies

<script src="/js/js.cookie.min.js"></script>

Cookies.set('CookieName', 'false', { expires: 7, path: '/'});

if ( Cookies.get('nohide')=='true' ) {
 // DO THIS
}

 

[[DocLister]]
Вывод с сортировкой по dater

[[DocLister?
&id=`newslist`
&tpl=`newsTPL`
&display=`20`
&tvList=`dater,newspic`
&renderTV=`dater`
&depth=`3`
&filters=`AND(content:template:eq:10)`
&paginate=`pages`

&sortType=`other`
&tvSortType=`TVDATETIME`
&orderBy=`dater DESC`

&TplNextP=`@CODE: <a class="nextpage" href="{+link+]">→</a>`
&TplPrevP=`@CODE: <a href="{+link+]">←</a>`
&TplDotsPage=`@CODE:<span>...</span>`

]]


<div class="pagerdiv">
<div class="clearfix"><br /><br />
{+newslist.pages+]
</div>
</div>

[[IF]]
Сниппет IF

[[if? &is=`{+tv+]:notempty:` &then=``]]

[[pricePercent]]
Считаем какая скидка в процентах если указана старая цена

[[pricePercent? &num=`{*price*]` &num2=`{*priceold*]`]]

<?php
if ($num1=='') { $num1=100; }
if ($num2=='') { $num2=100; }
$out=100-(($num1/$num2)*100);
echo floor($out);

{{preloader}}
HTML код прелоадера

<link href="/preloader/preloader.css" rel="stylesheet" type="text/css" />
<script src="/preloader/preloader.js"></script>

 

<!-- PRELOADER -->
<input type="hidden" id="progress_width" value="0">
<div class='progress' id="progress_div">
<div class='bar' id='bar1'></div>
<div class='percent' id='percent1'></div>
</div>
<!--//PRELOADER -->

[[currenttime]]
Выводим timestamp

Добавляем к JS или CSS 
Например: script.js?time=[[currenttime]]

<?php
$timestamp = time();
return $timestamp;