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 | |
require '/lightopenid/openid.php'; | |
$steamkey = 'Ваш Steam Key'; | |
$script = 'http://ваш.сайт/этот.скрипт'; | |
try { | |
$openid = new LightOpenID($script); | |
if(!$openid->mode) { |
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 | |
/** функция изменения размера фотки: | |
$picture - путь до исходной фотографии | |
$save_as - путь для сохранения миниатюры | |
$quality - качество миниатюры (0-100) | |
$new_x - ширина миниатюры (высоту рассчитывает сама, в соответствии с пропорциями) | |
возвращает true либо 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
<?php | |
/** функция добавления графического копирайта | |
$picture - файл куда добавляем копирайт | |
$copyright - файл графического копирайта | |
возвращает true либо false | |
**/ | |
function addcopyright($picture, $copyright='copyright.png') |
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 | |
session_start(); | |
if(!isset($_SESSION['captcha'])) { | |
$_SESSION['captcha'] = rand(11111,99999); | |
} | |
$font = 'system/font.ttf'; | |
$img = imagecreate(120, 30); |
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 zip_add_copyright( | |
$archive, | |
$copyright_file = 'ReadMe-FIRST.txt', | |
$copyright = NULL | |
) { | |
$copyright = ($copyright) ? $copyright : "Скачано с http://$_SERVER[HTTP_HOST]/\n" ; | |
$copyright = mb_convert_encoding($copyright, 'cp1251', mb_detect_encoding($copyright)); |
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 | |
define('HOST', 'localhost'); | |
define('USER', 'root'); | |
define('PASS', ''); | |
define('BASE', 'base'); | |
define('CHAR', 'utf8'); | |
try { | |
$pdo = new Pdo('mysql:host='.HOST.';dbname='.BASE.';charset='.CHAR, USER, PASS); |
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
Options +FollowSymLinks | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC] | |
RewriteRule ^([^/]+) $1 [L] | |
RewriteCond %{HTTP_HOST} ^old-site\.ru | |
RewriteRule ^(.*)$ http://new-site.su/$1 [R=301,L] | |
RewriteCond %{HTTP_HOST} ^www\.old-site\.ru | |
RewriteRule ^(.*)$ http://new-site.su/$1 [R=301,L] |
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 scanVirus($dir) { | |
$files = scandir($dir); | |
foreach($files as $file) { | |
if(is_file($dir.$file) and pathinfo($file, PATHINFO_EXTENSION) == 'js') { | |
$content = trim(file_get_contents($dir.$file)); | |
$pattern = '#var ([a-zA-Z0-9]+)="(.[^\"]*)",([a-zA-Z0-9]+)="";for\(var ([a-zA-Z0-9]+)=(.*?).length-1;(.*?)>0;(.*?)--\){if\((.*?)%2==1\)(.*?)+=(.*?).charAt\((.*?)\)}eval\((.*?)\);#mi'; |
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
ErrorDocument 404 /404.php | |
<ifModule mod_rewrite.c> | |
RewriteEngine On | |
# переадресация www.domain.com -> domain.com | |
RewriteCond %{HTTP_HOST} . | |
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |
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 | |
set_time_limit(0); | |
ignore_user_abort(true); | |
header("Connection: close"); | |
ob_flush(); | |
flush(); | |
$ftp_server = ''; | |
$ftp_user_name = ''; |
OlderNewer