Skip to content

Instantly share code, notes, and snippets.

@srsad
srsad / select`ы
Created December 6, 2017 09:43
Отцентровка выборного элемента в select
<style>
select {
text-align: center;
text-align-last: center;
}
option {
text-align: left;
}
</style>
<select name="number-of-default" aria-invalid="false">
@srsad
srsad / yourCity.php
Last active December 22, 2017 10:12
<?php
// определение ip
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip=$_SERVER['HTTP_CLIENT_IP'];
}elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip=$_SERVER['REMOTE_ADDR'];
}
// https://dadata.ru/
//<div id="google-maps"><div class="google-maps"></div></div>
$(window).load(function() {
$(".google-maps").gmap3({
marker:{
address:"23, Mornington Crescent, London",options:{icon: "img/marker.png"}},
map:{
options:{
zoom: 14,
scrollwheel: false,
mapTypeControl: false,
@srsad
srsad / schema.tpl
Created August 4, 2017 13:15
pdoCrumbs по стандарту микроразметок schema.org
{'pdoCrumbs' | snippet : [
'showHome' => 1,
'showHidden' => 0,
'tpl' => '@INLINE <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a href="{{+link}}" itemscope itemtype="http://schema.org/Thing" itemprop="item">
<span itemprop="name">{{+menutitle}}</span>
</a>
<meta itemprop="position" content="{{+idx}}" />
</li>',
'tplCurrent' => '@INLINE <li class="active" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<?php
/*****************************************************
** Вывод списка заказов пользователей
**
**
****************************************************/
$tpl = $modx->getOption('tpl', $scriptProperties, '');
$pdoTools = $modx->getService('pdoTools');
$pdo = $modx->getService('pdoFetch');