View MODx number of Tickets comments
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
<?php | |
if ($thread = $modx->getObject('TicketThread', array('resource' => $id))) { | |
echo $thread->get('comments'); | |
} |
View minishop2 MODx gallery thumbnail's size
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
{"small":{"w":360,"h":180,"q":90,"zc":"1","bg":"000000"}} |
View Hide Robots.txt use htaccess
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
Options +FollowSymlinks | |
RewriteBase / | |
RewriteRule ^robots.txt$ /robot.php?%{REQUEST_URI} |
View VersionX db clean
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
<?php | |
/** | |
* versionCleanX | |
* | |
* @author Scott Pronych, September 27, 2013 | |
* | |
* DESCRIPTION | |
* | |
* For use with VersionX to delete old content | |
* |
View OpenGraph MODx
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
<meta property="og:title" content="[[*pagetitle]]"/> | |
<meta property="og:site_name" content="[[++site_name]]"/> | |
<meta property="og:url" content="[[++site_url]][[*uri]]"/> | |
<meta property="og:description" content="[[*content:notags:limit=`200`]]"/> | |
<meta property="og:image" content="[[++site_url]][[*tvname]]"/> | |
<meta name="twitter:card" content="summary" /> | |
<meta name="twitter:title" content="[[*pagetitle]]" /> | |
<meta name="twitter:image:src" content="[[++site_url]][[*tvname]]" /> | |
<meta name="twitter:description" content="[[*content:notags:limit=`200`]]" /> | |
<link rel="image_src" href="[[++site_url]][[*image]]" /> |
View Получение заголовка видео с youtube
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
<?php | |
if ($mode == 'new') { | |
if (strpos(trim($resource->pagetitle), ' ') === false) { | |
$url = 'https://www.youtube.com/watch?v=' . $resource->pagetitle; | |
$html = file_get_contents($url); | |
$dom = new DomDocument(); | |
$dom->loadHTML('<?xml version="1.0" encoding="UTF-8"?>'. $html); | |
if ($title = $dom->getElementById('eow-title')) { | |
$modx->log(1, $resource->pagetitle); | |
$video_id = $resource->pagetitle; |
View Подгрузка статей кнопкой с помощью pdoPage
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
<div class="news-items" id="newsItems"> | |
[[!+news-nav]] | |
<div class="rows" style="overflow: hidden;"> | |
[[!pdoPage? | |
&parents=`18` | |
&tpl=`newItemTpl` | |
&showHidden=`1` | |
&includeTVs=`image` | |
&limit=`4` | |
&sortby=`{"publishedon":"ASC"}` |
View Разбивка страниц по категориям (родителям)
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
<div id="pdopage"> | |
<div class="rows"> | |
[[!pdoPage? | |
&parents=`0` | |
&level=`0` | |
&limit=`6` | |
&where=`{"modResource.parent:!=":0}` | |
&sortby=`{"p_menuindex":"ASC", "publishedon":"DESC"}` | |
&ajaxMode=`default` | |
&leftJoin=`{ |
View Удалить index из URL ресурсов, дочерних главной
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
<?php | |
switch ($modx->event->name) { | |
case 'OnWebPagePrerender': | |
$modx->resource->_output = str_replace('"index/', '"', $modx->resource->_output); | |
break; | |
case 'OnPageNotFound': | |
$uri = explode('?', $_SERVER['REQUEST_URI']); | |
if ($res = $modx->findResource('index' . $uri[0])) { | |
$modx->sendForward($res); | |
} |
OlderNewer