Skip to content

Instantly share code, notes, and snippets.

Vasily Naumkin bezumkin

Block or report user

Report or block bezumkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bezumkin
bezumkin / tpl.Tickets.comment.wrapper
Created May 18, 2015
tpl.Tickets.comment.wrapper
View tpl.Tickets.comment.wrapper
<div class="comments">
[[+modx.user.id:isloggedin:is=`1`:then=`
<span class="comments-subscribe pull-right">
<label for="comments-subscribe" class="checkbox">
<input type="checkbox" name="" id="comments-subscribe" value="1" [[+subscribed:notempty=`checked`]] /> [[%ticket_comment_notify]]
</label>
</span>
`:else=``]]
<h4 class="title">[[%comments]] (<span id="comment-total">[[+total]]</span>)</h4>
View tpl.Tickets.comment.wrapper.fenom
<div class="comments">
{if $modx->user->isAuthenticated($modx->context->key)}
<span class="comments-subscribe pull-right">
<label for="comments-subscribe" class="checkbox">
<input type="checkbox" name="" id="comments-subscribe" value="1" {$subscribed != '' ? 'checked' : ''} /> {$modx->lexicon('ticket_comment_notify')}
</label>
</span>
{/if}
<h4 class="title">{$modx->lexicon('comments')} (<span id="comment-total">{$total}</span>)</h4>
View getUserComments.php
<?php
/* @var array $scriptProperties */
/* @var Tickets $Tickets */
$Tickets = $modx->getService('tickets','Tickets',$modx->getOption('tickets.core_path',null,$modx->getOption('core_path').'components/tickets/').'model/tickets/',$scriptProperties);
$Tickets->initialize('web');
$where = array(
'TicketComment.deleted' => 0
,'Ticket.published' => 1
,'Ticket.deleted' => 0
@bezumkin
bezumkin / dropbox
Last active Dec 23, 2015
Dropbox init script for Ubuntu server
View dropbox
#!/bin/sh
# dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"
DAEMON=.dropbox-dist/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
View markItUp! config
{onTab: {keepDefault:false, replaceWith:" "}
,markupSet: [
{name:"Bold", className: "bold", key:"B", openWith:"<b>", closeWith:"</b>" }
,{name:"Italic", className: "italic", key:"I", openWith:"<i>", closeWith:"</i>" }
,{name:"Underline", className: "underline", key:"U", openWith:"<u>", closeWith:"</u>" }
,{name:"Stroke through", className: "stroke", key:"S", openWith:"<s>", closeWith:"</s>" }
,{separator:"---------------" }
,{name:"Header 2", className: "h2", openWith:"<h2>", closeWith:"</h2>"}
,{name:"Header 3", className: "h3", openWith:"<h3>", closeWith:"</h3>"}
,{name:"Header 4", className: "h4", openWith:"<h4>", closeWith:"</h4>"}
@bezumkin
bezumkin / YMLexport2.php
Created Jun 21, 2013
YML export for miniShop2
View YMLexport2.php
<?php
$siteName = $modx->getOption('siteName', $scriptProperties, $modx->getOption('site_name')); // Имя сайта
$companyName = $modx->getOption('companyName', $scriptProperties, $modx->getOption('site_name')); // Компания
$bid = $modx->getOption('bid', $scriptProperties, 10); // Цена за клик
$siteUrl = $modx->makeUrl($modx->getOption('site_start'), '', '', 'full'); // Ссылка на главную страницу сайта
$descTpl = strip_tags($modx->getOption('descTpl', $scriptProperties, '[[+description]]')); // Шаблон для описания товара, без html
$paramCurrency = $modx->getOption('paramCurrency', $scriptProperties, 'RUR'); // Валюта
$paramDelivery = $modx->getOption('paramDelivery', $scriptProperties, true); // Доставка, по умолчанию - да. Можно указать имя параметра.
//////////////////////////////////////////////////////////////////////////////
@bezumkin
bezumkin / videothumb.class.php
Last active Jul 23, 2019
Parse link on YouTube, Vimeo and ruTube and returns preview image and clean link on video
View videothumb.class.php
<?php
class videoThumb {
var $config;
function __construct($config = array()) {
$this->config = array_merge(array(
'imagesPath' => dirname(__FILE__) . '/images/'
,'imagesUrl' => '/images/'
@bezumkin
bezumkin / addplace.sh
Last active Aug 16, 2019
Script for add non MODX site
View addplace.sh
#!/bin/bash
# MySQL root password
ROOTPASS='password'
TIMEZONE='Europe/Moscow'
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############
@bezumkin
bezumkin / memberSync.php
Created Aug 1, 2012
Invision Power Board (IPB) to MODX Revolution user synchronization
View memberSync.php
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.3
* Forum permissions mappings
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
@bezumkin
bezumkin / remove.sh
Last active Jun 16, 2018
Ubuntu 10.04 (nginx + php5-fpm): remove site including user & database
View remove.sh
#!/bin/bash
ROOTPASS='password'
echo "Enter username to delete:"
read USERNAME
mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost"
mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
rm -f /etc/nginx/sites-enabled/$USERNAME.conf
You can’t perform that action at this time.