Skip to content

Instantly share code, notes, and snippets.

View kolyadin's full-sized avatar

Aleksey kolyadin

  • Easy Commerce
  • Russia
View GitHub Profile
<?
#print $GLOBALS['trafapril'];
/*
print "=".$HTTP_POST_VARS["pageid1"]."=($rand)";
print "=".$HTTP_POST_VARS["pageid"]."=($rand)";
print "=".$HTTP_POST_VARS["pageid2"]."=($rand)";
print "=$pageid/$subpageid/$page_id/$fold_id/$good_id=<br>";
<?php
/**
* Данное api обеспечивает взаимодействие между мобильными приложениями (iphone,ipad,android) и backend'ом кино
*
* @date 23.07.2013
* @author Колядин Алексей
*/
ini_set('display_errors',1);
ini_set('html_errors',1);
error_reporting(E_ALL);
/**
* @param int $announceLength
* @return null|string
*/
public function getAnnounceFriendly($announceLength = 100){
$announce = trim($this->getAnnounce());
$content = trim($this->getContent());
$output = null;
public static function newMessageSave() {
$recipient = UserFactory::getUser(self::getSlim()->request()->post('recipient'));
$message = new Message();
$message->setSentTime(new \DateTime());
$message->setAuthor(UserFactory::getCurrentUser());
$message->setRecipient($recipient);
$message->setContent(self::getSlim()->request()->post('message'));
$message->setRead(0);
$timestamp = func_get_args()[0];
$month = explode(' ', 'января февраля марта апреля мая июня июля августа сентября октября ноября декабря');
if ((time() - $timestamp) < 60 * 60 * 24) {
$out = 'сегодня, ';
} elseif ((time() - $timestamp) > 60 * 60 * 24 && (time() - $timestamp) < 60 * 60 * 24 * 2) {
$out = 'вчера, ';
} else {
$out = sprintf('%u %s %04u, ',
//Выбираем основные новости (большие)
{
$dataMapHelper = new DataMapHelper();
$dataMapHelper->setRelationship([
'popcorn\\model\\dataMaps\\NewsPostDataMap' => NewsPostDataMap::WITH_TAGS,
'popcorn\\model\\dataMaps\\TagDataMap' => TagDataMap::WITH_ENTITY,
'popcorn\\model\\dataMaps\\PersonDataMap' => PersonDataMap::WITH_NONE
]);
$dataMap = new NewsTagDataMap($dataMapHelper);
{
"name": "traffic/popcorn",
"description": "popcornnews",
"minimum-stability": "dev",
"authors": [
{
"name": "Aleksey Kolyadin",
"email": "donflash@gmail.com"
},
{
$this->getApp()->exitWithJsonSuccessMessage([
'comment' => $this->getTwig()->render('/comments/Comment.twig', [
'comment' => $lastComment,
'forceImageLoad' => true
]),
'replyTo' => $replyTo,
'level' => $lastComment->getLevel(),
'id' => $lastComment->getId()
]);
<script type="text/javascript">
brand({
hrz : 'http://upload.wikimedia.org/wikipedia/commons/9/97/2010_Audi_A5_(8T)_3.0_TDI_quattro_Sportback_04.jpg',
vrt : 'http://upload.wikimedia.org/wikipedia/commons/9/97/2010_Audi_A5_(8T)_3.0_TDI_quattro_Sportback_04.jpg',
click : 'http://www.kinoafisha.info',
views : [
'http://ad.adriver.ru/cgi-bin/erle.cgi?sid=92926&target=blank&bt=41&pz=0&rnd=' + Math.random(),
function(){
_gaq.push(['_trackEvent','branding','robocop','show']);
}
<script type="text/javascript">
brand({
hrz : 'http://upload.wikimedia.org/wikipedia/commons/9/97/2010_Audi_A5_(8T)_3.0_TDI_quattro_Sportback_04.jpg',
vrt : 'http://upload.wikimedia.org/wikipedia/commons/9/97/2010_Audi_A5_(8T)_3.0_TDI_quattro_Sportback_04.jpg',
click : 'http://www.kinoafisha.info',
views : function(){
(new Image()).src = 'http://ad.adriver.ru/cgi-bin/erle.cgi?sid=92926&target=blank&bt=41&pz=0&rnd=' + Math.random();
_gaq.push(['_trackEvent','branding','robocop','show']);
}
});