This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
root /var/www/demo; | |
index index.php index.html; | |
server_name www.demo.com demo.com; | |
gzip on; | |
gzip_comp_level 5; | |
gzip_disable "msie6"; | |
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* MailNotify | |
* | |
* Отправка уведомлений на почту пользователю при публикации документа | |
* | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @author Agel_Nash <[email protected]> | |
* @version 0.1 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name <домен>; | |
root <абсолютный путь к директории с движком>; | |
index index.php; | |
location / { | |
root <абсолютный путь к директории с движком>; | |
if (!-e $request_filename){ | |
rewrite ^/(.*)$ /index.php?q=$1 last; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model:: | |
/*Select*/ | |
select('col1','col2') | |
->select(array('col1','col2')) | |
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating')) | |
->addSelect('col3','col4') | |
->distinct() // distinct select | |
/*From*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// quit script if you aren't accessing it with ajax | |
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) == false){ | |
die(); | |
} | |
// include database class | |
include('database.class.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(e) { | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
//ga.src = ('https:' == document.location.protocol ? '<a href="https://ssl">https://ssl</a>' : '<a href="http://www">http://www</a>') + '.<a href="http://google-analytics.com/ga.js">google-analytics.com/ga.js</a>'; | |
//replace the google provided src attribute with the local file starting from the www directory | |
ga.src = 'ga.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
})(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'Slim/Slim.php'; | |
\Slim\Slim::registerAutoloader(); | |
$app = new \Slim\Slim(); $app->get('/', function () use ($app) { | |
require_once 'lib/mysql.php'; | |
$db = connect_db(); | |
$result = $db->query( 'SELECT id, name, job FROM friends;' ); | |
while ( $row = $result->fetch_array(MYSQLI_ASSOC) ) { | |
$data[] = $row; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********************************************************** | |
* Update inventory stock through amazon mws api | |
* | |
***********************************************************/ | |
$sku1 = '10101-AM'; | |
$quantity1 = '9'; | |
$leadTimeToShip1 = '7'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* OnFileManagerUpload. | |
*/ | |
switch ($modx->event->name) { | |
case 'OnFileManagerUpload': | |
$generator = $modx->newObject('modResource'); | |
$bases = $source->getBases($directory); | |
$fullPath = $bases['pathAbsolute'].ltrim($directory,'/'); | |
$directory = $source->fileHandler->make($fullPath); |
NewerOlder