This file contains hidden or 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 | |
function detect_encoding($string) | |
{ | |
foreach (array('UTF-8', 'Windows-1251') as $enc) { | |
$sample = @iconv($enc, $enc, $string); | |
if (md5($sample) == md5($string)) | |
return $enc; | |
} | |
return false; |
This file contains hidden or 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
using System; | |
using System.Text; | |
using System.Security.Cryptography; | |
static class Hashes | |
{ | |
public static string SHA1(string text) | |
{ | |
byte[] buffer = Encoding.UTF8.GetBytes(text); | |
var sha1 = new SHA1CryptoServiceProvider(); |
This file contains hidden or 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 | |
/* | |
SQLyog | |
Copyright 2003-2006, Webyog | |
http://www.webyog.com | |
HTTP Tunneling Page | |
This page exposes the MySQL API as a set of web-services which is consumed by SQLyog - the most popular GUI to MySQL. |
This file contains hidden or 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 | |
ini_set( 'display_errors', 1 ); | |
error_reporting( E_ALL ); | |
$from = "[email protected]"; | |
$to = "[email protected]"; | |
$subject = "PHP Mail Test script"; | |
$message = "This is a test to check the PHP Mail functionality"; | |
$headers = "From:" . $from; |
This file contains hidden or 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 | |
/* see: | |
* http://rtfm.modx.com/revolution/2.x/administering-your-site/contexts/using-one-gateway-plugin-to-manage-multiple-domains | |
* "mobileContext" - mobile version context name | |
*/ | |
if (!isset($scriptProperties['mobileContext']) || empty($scriptProperties['mobileContext'])) { | |
return; | |
} | |
/* don't execute if in the Manager */ | |
if ($modx->context->get('key') == 'mgr') { |
This file contains hidden or 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 | |
function get_client_ip() { | |
$ipaddress = ''; | |
if (getenv('HTTP_CLIENT_IP')) | |
$ipaddress = getenv('HTTP_CLIENT_IP'); | |
else if(getenv('HTTP_X_FORWARDED_FOR')) | |
$ipaddress = getenv('HTTP_X_FORWARDED_FOR'); | |
else if(getenv('HTTP_X_FORWARDED')) | |
$ipaddress = getenv('HTTP_X_FORWARDED'); | |
else if(getenv('HTTP_FORWARDED_FOR')) |
This file contains hidden or 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 | |
parse_str($options, $options); | |
$options = array_merge(array( | |
'ul' => 0 | |
), $options); | |
$lines = preg_split('/\n\r?/', trim($input)); | |
$output = '<li>' . implode('</li><li>', $lines) . '</li>'; | |
if ($options['ul']) { |
This file contains hidden or 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
<!-- chunk: tpl.catalogFilter --> | |
<div class="filter clearfix"> | |
[[!initProductsFilter]] | |
<form action="" method="get" class="filter-form[[+filter.active:notempty=` filter-active`]]"> | |
<div class="filter-buttons"> | |
<button type="submit" class="btn">Фильтр</button> | |
<button type="reset" class="btn filter-reset">Сбросить</button> | |
</div> | |
<div class="filter-rows"> | |
<div class="filter-row"> |
This file contains hidden or 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 | |
class InvoiceGenerator | |
{ | |
/** | |
* @var modX | |
*/ | |
public $modx; | |
public $file_name_prefix = 'invoice_'; |
This file contains hidden or 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 |
OlderNewer