This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
В методе function Register в классе webloginPe просто | |
1. Напишите вместо строки | |
<code>$username = $_POST['username'];</code> | |
строку | |
<code>$username = $modx->db->escape($modx->stripTags($_POST['email']));</code> | |
2. Закомментируйте кусок кода чуть ниже (валидация username) | |
<code>if (!ctype_alnum($username)) | |
{ | |
return $this->FormatMessage($this->LanguageArray[32]); | |
}</code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Вызов формы | |
[!AjaxSearch? &ajaxSearch=`0` &landingPage=`22` &tplInput=`search_form` &parents=`in:5` &tplResult=`search_result` &showResults=`0`!] | |
Страница поиска | |
<ul class="search_list">[!AjaxSearch? &ajaxSearch=`0` &parents=`in:5` &pagingType=`0` &showInputForm=`0` &tplResult=`search_result` &extractLength=`500` &grabMax=`10` &showInputForm=`0` !]</ul> | |
чанк search_form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[phpthumb? &input=`[+image+]` &options=`w=200,h=200,far=C,bg=fff`]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[DocInfo? &docid=`2` &field=`phone1`]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$params = array('docid' => $id, 'field' => 'pagetitle'); | |
$pagetitle = $modx->runSnippet('DocInfo', $params); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@INCLUDE/assets/tvs/multitv/multitv.customtv.php | |
[[multiTV? | |
&tvName=`item_photo_MTV` | |
&docid=`[*id*]` | |
&outerTpl=`@CODE:((wrapper))` | |
&rowTpl=`item_gallery_mini_TPL` | |
&display=`all` | |
]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$useridmassive = $modx->userLoggedIn(); | |
$userid = $useridmassive["id"]; // Получаем ИД-пользователя | |
[+phx:userinfo=`email`+] | |
$user_data = $modx->getWebUserInfo($userId); //получение массива с инфой о пользователе по id, например $user_data['email'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********Конверсия валют************/ | |
[[conversion? &price=`[*price*]`]] | |
<?php | |
$docid = 2; | |
$kurs = $modx->getTemplateVar('kurs', '*', $docid); | |
$kurs = $kurs['value']; | |
$kurs = str_replace(',', ".", $kurs); | |
$price = $price*$kurs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************Последние просмотренные*******************/ | |
[!LastView? &mode=`register`!] | |
[!Ditto? &tpl=`last-tpl` &documents=`[!LastView? &mode=`show` !]` &filter=`id,[*id*],2` &hideFolders=`1` &display=`3` &extenders=`nosort`!] | |
<?php | |
$mode = isset($mode) ? $mode : 'show'; | |
$outerTpl = isset($outerTpl) ? $outerTpl : '@CODE:[+rows+]'; | |
$outerClass = isset($outerClass) ? $outerClass : 'last-view'; | |
$rowTpl = isset($rowTpl) ? $rowTpl : '@CODE:[+id+],'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***********Форматирование телефона***************/ | |
<a class="phone-a" href="tel:[[formatting_phones? &phone=`phone1`]]" title="">[!GetField? &docid=`2` &field=`phone1`!]</a> | |
<?php | |
$tv = $modx->getTemplateVar($phone, "",2); | |
$string = $tv['value']; | |
$string = preg_replace('~[^0-9+]+~','',$string); | |
return $string; |