Skip to content

Instantly share code, notes, and snippets.

<?php
if ($modx->context->key !== 'mgr' ) {
$parts = array_reverse(explode('/', $_SERVER['REQUEST_URI']));
if ($parts[0]) {
$alias = str_replace('.html', '', $parts[0]);
} else {
$alias = $parts[1];
}
if ($res = $modx->getObject('modResource', array('alias' => $alias))) {
<?php
$end = '<div class="clear"> </div>';
$ress = $modx->getCollection('modResource', array('parent' => 43, 'content:LIKE' => '%'.$end.'%'));
$arIds = array();
foreach ($ress as $res) {
$arIds[] = $res->id;
}
$ress = $modx->getCollection('modResource', array('parent' => 43, 'content:LIKE' => '%div class="slider_lynx%', 'id:IN' => $arIds));
// print count($ress);
foreach ($ress as $res) {
<?php
$class = 'modResource';
$pdo = $modx->getService('pdoFetch');
$pdo->addTime('pdoFetch загружен');
$options = array(
'cacheTime' => '11',
);
if (!$output = $pdo->getCache($options)) {
select
`set_items`.`id`,
`set_items`.`parent_id`,
`set_items`.`objective`,
`set_items`.`origin`,
`phrases`.`id` as `phrase_id`,
`phrases`.`text`,
`frequencies`.`base`,
`frequencies`.`kei`,
`positions`.`position`,
$xml = json_decode(json_encode(simplexml_load_file($data_file)), true);
$data = [];
foreach ($xml as $key => $many) {
foreach ($many as $one) {
foreach ($one as $item) {
$attributes = $item['@attributes'];
if (isset($attributes['id'])) {
$data[$key][$attributes['id']] = array_merge($attributes, $item);
} else {
/**
* The first create app to link https://console.developers.google.com
* Later save json file of created app to own site. Path to the file transmit to GoogleHandler initialize method
*
* composer.json
* {
* "require": {
* "asimlqt/php-google-spreadsheet-client": "2.3.*", // https://github.com/asimlqt/php-google-spreadsheet-client
* "google/apiclient": "^2.0.0@RC"
* }
@justenj
justenj / Sort with parent resource
Last active April 19, 2016 16:26
Sort with parent resource
[[!mFilter2?
&cache=`1`
&class=`modResource`
&sortby=`{
"modResource.menuindex":"ASC",
"Parent.menuindex":"ASC"
}`
&leftJoin=`{
"Parent": {
"class": "modResource",
<?php
use Illuminate\Database\Seeder;
use App\Role;
use App\Permission;
class RolePermissionSeeder extends Seeder
{
protected $roles = [];
protected $permissions = [];
<?php
declare(strict_types=1);
namespace Game\PlanetBundle\Presentation\Hydrator;
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
use Doctrine\ORM\UnitOfWork;
use Game\Components\Planet\Domain\GameOverException;
use Game\Components\Planet\Domain\Planet;