Skip to content

Instantly share code, notes, and snippets.

<?php
if ($thread = $modx->getObject('TicketThread', array('resource' => $id))) {
echo $thread->get('comments');
}
[[!BannerY?
&position=`1`
&tpl=`@INLINE <a href="[[+url]]" target="_blank"><img src="[[+image]]" alt="[[+name]]" class="img-responsive" title="[[+description]]"></a>`
]]
Options +FollowSymlinks
RewriteBase /
RewriteRule ^robots.txt$ /robot.php?%{REQUEST_URI}
<?php
/**
* versionCleanX
*
* @author Scott Pronych, September 27, 2013
*
* DESCRIPTION
*
* For use with VersionX to delete old content
*
<?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;
<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"}`
<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=`{
[[pdoResources?
&parents=`0`
&select=`{
"modResource":"id, pagetitle",
"Children":"COUNT(Children.id) as count"
}`
&leftJoin=`{
"Children":{"class":"modResource", "on":"modResource.id = Children.parent"}
}`
&sortby=`{"id":"ASC"}`
@ru2fac
ru2fac / Bootstrap
Created November 6, 2018 00:37
Сообщение об успешной отправке AjaxForm в модалке на Fancybox
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="successModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="successModalLabel">Спасибо</h4>
</div>
<div class="modal-body">
</div>