first commit
This commit is contained in:
209
libraries/MySQLDump.php
Normal file
209
libraries/MySQLDump.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* MySQL database dump.
|
||||
|
||||
*
|
||||
|
||||
* @author David Grudl (http://davidgrudl.com)
|
||||
|
||||
* @copyright Copyright (c) 2008 David Grudl
|
||||
|
||||
* @license New BSD License
|
||||
|
||||
* @version 1.0
|
||||
|
||||
*/
|
||||
|
||||
class MySQLDump
|
||||
|
||||
{
|
||||
|
||||
const MAX_SQL_SIZE = 1e6;
|
||||
|
||||
|
||||
|
||||
const NONE = 0;
|
||||
|
||||
const DROP = 1;
|
||||
|
||||
const CREATE = 2;
|
||||
|
||||
const DATA = 4;
|
||||
|
||||
const TRIGGERS = 8;
|
||||
|
||||
const ALL = 15; // DROP | CREATE | DATA | TRIGGERS
|
||||
|
||||
|
||||
|
||||
/** @var array */
|
||||
|
||||
public $tables = array(
|
||||
|
||||
'*' => self::ALL,
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
/** @var mysqli */
|
||||
|
||||
private $connection;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Connects to database.
|
||||
|
||||
* @param mysqli connection
|
||||
|
||||
*/
|
||||
|
||||
public function __construct(mysqli $connection, $charset = 'utf8')
|
||||
|
||||
{
|
||||
|
||||
$this->connection = $connection;
|
||||
|
||||
|
||||
|
||||
if ($connection->connect_errno) {
|
||||
|
||||
throw new Exception($connection->connect_error);
|
||||
|
||||
|
||||
|
||||
} elseif (!$connection->set_charset($charset)) { // was added in MySQL 5.0.7 and PHP 5.0.5, fixed in PHP 5.1.5)
|
||||
|
||||
throw new Exception($connection->error);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Saves dump to the file.
|
||||
|
||||
* @param string filename
|
||||
|
||||
* @return void
|
||||
|
||||
*/
|
||||
|
||||
public function save($file)
|
||||
|
||||
{
|
||||
|
||||
$handle = strcasecmp(substr($file, -3), '.gz') ? fopen($file, 'wb') : gzopen($file, 'wb');
|
||||
|
||||
if (!$handle) {
|
||||
|
||||
throw new Exception("ERROR: Cannot write file '$file'.");
|
||||
|
||||
}
|
||||
|
||||
$this->write($handle);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Writes dump to logical file.
|
||||
|
||||
* @param resource
|
||||
|
||||
* @return void
|
||||
|
||||
*/
|
||||
|
||||
public function write($handle = null)
|
||||
|
||||
{
|
||||
|
||||
if ($handle === null) {
|
||||
|
||||
$handle = fopen('php://output', 'wb');
|
||||
|
||||
} elseif (!is_resource($handle) || get_resource_type($handle) !== 'stream') {
|
||||
|
||||
throw new Exception('Argument must be stream resource.');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$tables = $views = array();
|
||||
|
||||
|
||||
|
||||
$res = $this->connection->query('SHOW FULL TABLES');
|
||||
|
||||
while ($row = $res->fetch_row()) {
|
||||
|
||||
if ($row[1] === 'VIEW') {
|
||||
|
||||
$views[] = $row[0];
|
||||
|
||||
} else {
|
||||
|
||||
$tables[] = $row[0];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$res->close();
|
||||
|
||||
|
||||
|
||||
$tables = array_merge($tables, $views); // views must be last
|
||||
|
||||
|
||||
|
||||
$this->connection->query('LOCK TABLES `' . implode('` READ, `', $tables) . '` READ');
|
||||
|
||||
|
||||
|
||||
$db = $this->connection->query('SELECT DATABASE()')->fetch_row();
|
||||
|
||||
fwrite($handle, '-- Created at ' . date('j.n.Y G:i') . " using David Grudl MySQL Dump Utility\n"
|
||||
|
||||
. (isset($_SERVER['HTTP_HOST']) ? "-- Host: $_SERVER[HTTP_HOST]\n" : '')
|
||||
|
||||
. '-- MySQL Server: ' . $this->connection->server_info . "\n"
|
||||
|
||||
. '-- Database: ' . $db[0] . "\n"
|
||||
|
||||
. "\n"
|
||||
|
||||
. "SET NAMES utf8;\n"
|
||||
|
||||
. "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';\n"
|
||||
|
||||
. "SET FOREIGN_KEY_CHECKS=0;\n"
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
foreach ($tables as $table) {
|
||||
|
||||
$this->dumpTable($handle, $table);
|
||||
|
||||
}
|
||||
0
libraries/additional-classes.ini
Normal file
0
libraries/additional-classes.ini
Normal file
27
libraries/functions-front.js
Normal file
27
libraries/functions-front.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var user_agent = navigator.userAgent.toLowerCase();
|
||||
var click_event = user_agent.match(/(iphone|ipod|ipad)/) ? "touchend" : "click";
|
||||
var windowsize = $(window).width();
|
||||
|
||||
$( function()
|
||||
{
|
||||
function hasWebP() {
|
||||
var rv = $.Deferred(), img = new Image();
|
||||
img.onload = function() { rv.resolve(); };
|
||||
img.onerror = function() { rv.reject(); };
|
||||
img.src = "/libraries/webp.webp";
|
||||
return rv.promise();
|
||||
}
|
||||
|
||||
hasWebP().then(function() {
|
||||
}, function() {
|
||||
$('body').addClass('nowebp');
|
||||
$( 'img' ).each( function()
|
||||
{
|
||||
if ( $( this ).attr( 'src-nowebp' ) )
|
||||
{
|
||||
$( this ).attr( 'src', $( this ).attr( 'src-nowebp' ) );
|
||||
$( this ).attr( 'data-src', $( this ).attr( 'src-nowebp' ) );
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
87
libraries/functions.js
Normal file
87
libraries/functions.js
Normal file
@@ -0,0 +1,87 @@
|
||||
var user_agent = navigator.userAgent.toLowerCase();
|
||||
var click_event = user_agent.match(/(iphone|ipod|ipad)/) ? "touchend" : "click";
|
||||
|
||||
function checkForm(id)
|
||||
{
|
||||
check = true;
|
||||
$('form#' + id + ' input[type="text"]').each(function () {
|
||||
if ($(this).hasClass('require') && $(this).val() === '')
|
||||
{
|
||||
$(this).parents('.form-group').addClass('has-error');
|
||||
check = false;
|
||||
} else
|
||||
$(this).parents('.form-group').removeClass('has-error');
|
||||
});
|
||||
|
||||
$('form#' + id + ' textarea').each(function () {
|
||||
if ($(this).hasClass('require') && $(this).val() === '')
|
||||
{
|
||||
$(this).parents('.form-group').addClass('has-error');
|
||||
check = false;
|
||||
} else
|
||||
$(this).parents('.form-group').removeClass('has-error');
|
||||
});
|
||||
|
||||
if (check)
|
||||
$('form#' + id).submit();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function number_format(number, decimals, dec_point, thousands_sep)
|
||||
{
|
||||
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
|
||||
var n = !isFinite(+number) ? 0 : +number,
|
||||
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
|
||||
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
|
||||
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
|
||||
s = '',
|
||||
toFixedFix = function (n, prec) {
|
||||
var k = Math.pow(10, prec);
|
||||
return '' + Math.round(n * k) / k;
|
||||
};
|
||||
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
|
||||
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
|
||||
if (s[0].length > 3) {
|
||||
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
|
||||
}
|
||||
if ((s[1] || '').length < prec) {
|
||||
s[1] = s[1] || '';
|
||||
s[1] += new Array(prec - s[1].length + 1).join('0');
|
||||
}
|
||||
return s.join(dec);
|
||||
}
|
||||
|
||||
$(document).ready(function ()
|
||||
{
|
||||
$('.date').datetimepicker({
|
||||
format: "YYYY-MM-DD",
|
||||
pickTime: false
|
||||
});
|
||||
|
||||
$('.date-time').datetimepicker({
|
||||
format: "YYYY-MM-DD HH:mm:SS"
|
||||
});
|
||||
|
||||
$('body').on('click', '.date-range', function ()
|
||||
{
|
||||
$(this).daterangepicker().focus();
|
||||
});
|
||||
|
||||
$('body').on('change', '.number-format', function ()
|
||||
{
|
||||
var value = $(this).val();
|
||||
value = value.replace(' ', '');
|
||||
|
||||
value = parseFloat(value.replace(',', '.') * 1);
|
||||
value = number_format(value, 2, '.', '');
|
||||
$(this).val(value);
|
||||
});
|
||||
});
|
||||
|
||||
function disable_menu()
|
||||
{
|
||||
$('.sidebar-menu li ul').remove();
|
||||
$('.sidebar-menu li ').addClass("disable_menu");
|
||||
$('.sidebar-menu li:last-child').removeClass("disable_menu");
|
||||
}
|
||||
39
libraries/htaccess.conf
Normal file
39
libraries/htaccess.conf
Normal file
@@ -0,0 +1,39 @@
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
Options +FollowSymlinks
|
||||
Options -Indexes
|
||||
|
||||
{REDIRECT}
|
||||
|
||||
ErrorDocument 404 /404.html
|
||||
|
||||
RewriteCond %{REQUEST_URI} !^(.*)/libraries/(.*) [NC]
|
||||
RewriteCond %{REQUEST_URI} !^(.*)/css/(.*) [NC]
|
||||
RewriteRule ^admin/([^/]*)/([^/]*)/(.*)$ admin/index.php?module=$1&action=$2&$3 [L]
|
||||
{PIXIESET]
|
||||
{ADDITIONAL_CLASSES}
|
||||
RewriteRule ^admin/$ admin/index.php [L]
|
||||
RewriteRule ^wyszukiwarka(|/)$ index.php?search=true&lang=pl [L]
|
||||
RewriteRule ^wersja-tymczasowa(|/)$ index.php?devel=true&lang=pl [L]
|
||||
RewriteRule ^pixieset/(.*)$ index.php?module=articles&action=image&hash=$1 [L]
|
||||
RewriteRule ^pixieset-wszystkie/(.*)$ index.php?module=articles&action=images_download&hash=$1 [L]
|
||||
RewriteRule ^audyt-seo/wynik(|/)$ index.php?module=auditSEO&action=main_view&%{QUERY_STRING} [L]
|
||||
|
||||
RewriteCond %{REQUEST_URI} ^/auditSEO/(.*) [NC]
|
||||
RewriteRule ^([^/]*)/([^/]*)/(.*)$ index.php?module=$1&action=$2&$3 [L]
|
||||
|
||||
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.php
|
||||
RewriteRule ^ /%1 [R=301,L]
|
||||
{HTACCESS_CACHE}
|
||||
<Files *.conf>
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
</Files>
|
||||
<Files *.log>
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
</Files>
|
||||
<Files *.ini>
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
</Files>
|
||||
1
libraries/htaccess.ini
Normal file
1
libraries/htaccess.ini
Normal file
@@ -0,0 +1 @@
|
||||
RewriteRule ^oferty-pracy(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=1&%{QUERY_STRING} [L]
|
||||
14
libraries/jquery.browser.min.js
vendored
Normal file
14
libraries/jquery.browser.min.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/*!
|
||||
* jQuery Browser Plugin 0.1.0
|
||||
* https://github.com/gabceb/jquery-browser-plugin
|
||||
*
|
||||
* Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Modifications Copyright 2015 Gabriel Cebrian
|
||||
* https://github.com/gabceb
|
||||
*
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 23-11-2015
|
||||
*/!function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";function b(a){void 0===a&&(a=window.navigator.userAgent),a=a.toLowerCase();var b=/(edge)\/([\w.]+)/.exec(a)||/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(iemobile)[\/]([\w.]+)/.exec(a)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(ipod)/.exec(a)||/(windows phone)/.exec(a)||/(iphone)/.exec(a)||/(kindle)/.exec(a)||/(silk)/.exec(a)||/(android)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/.exec(a)||/(playbook)/.exec(a)||/(bb)/.exec(a)||/(blackberry)/.exec(a)||[],d={},e={browser:b[5]||b[3]||b[1]||"",version:b[2]||b[4]||"0",versionNumber:b[4]||b[2]||"0",platform:c[0]||""};if(e.browser&&(d[e.browser]=!0,d.version=e.version,d.versionNumber=parseInt(e.versionNumber,10)),e.platform&&(d[e.platform]=!0),(d.android||d.bb||d.blackberry||d.ipad||d.iphone||d.ipod||d.kindle||d.playbook||d.silk||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv||d.iemobile){var f="msie";e.browser=f,d[f]=!0}if(d.edge){delete d.edge;var g="msedge";e.browser=g,d[g]=!0}if(d.safari&&d.blackberry){var h="blackberry";e.browser=h,d[h]=!0}if(d.safari&&d.playbook){var i="playbook";e.browser=i,d[i]=!0}if(d.bb){var j="blackberry";e.browser=j,d[j]=!0}if(d.opr){var k="opera";e.browser=k,d[k]=!0}if(d.safari&&d.android){var l="android";e.browser=l,d[l]=!0}if(d.safari&&d.kindle){var m="kindle";e.browser=m,d[m]=!0}if(d.safari&&d.silk){var n="silk";e.browser=n,d[n]=!0}return d.name=e.browser,d.platform=e.platform,d}return window.jQBrowser=b(window.navigator.userAgent),window.jQBrowser.uaMatch=b,a&&(a.browser=window.jQBrowser),window.jQBrowser});
|
||||
4
libraries/taboverride.min.js
vendored
Normal file
4
libraries/taboverride.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/*! taboverride v4.0.3 | https://github.com/wjbryant/taboverride
|
||||
(c) 2015 Bill Bryant | http://opensource.org/licenses/mit */
|
||||
!function(a){"use strict";var b;"object"==typeof exports?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):(b=window.tabOverride={},a(b))}(function(a){"use strict";function b(a,b){var c,d,e,f=["alt","ctrl","meta","shift"],g=a.length,h=!0;for(c=0;g>c;c+=1)if(!b[a[c]]){h=!1;break}if(h)for(c=0;c<f.length;c+=1){if(e=f[c]+"Key",b[e])if(g){for(h=!1,d=0;g>d;d+=1)if(e===a[d]){h=!0;break}}else h=!1;if(!h)break}return h}function c(a,c){return a===q&&b(s,c)}function d(a,c){return a===r&&b(t,c)}function e(a,b){return function(c,d){var e,f="";if(arguments.length){if("number"==typeof c&&(a(c),b.length=0,d&&d.length))for(e=0;e<d.length;e+=1)b.push(d[e]+"Key");return this}for(e=0;e<b.length;e+=1)f+=b[e].slice(0,-3)+"+";return f+a()}}function f(a){a=a||event;var b,e,f,g,h,i,j,k,l,s,t,w,x,y,z,A,B,C,D=a.currentTarget||a.srcElement,E=a.keyCode,F="character";if((!D.nodeName||"textarea"===D.nodeName.toLowerCase())&&(E===q||E===r||13===E&&u)){if(v=!1,f=D.value,k=D.scrollTop,"number"==typeof D.selectionStart)l=D.selectionStart,s=D.selectionEnd,t=f.slice(l,s);else{if(!o.selection)return;g=o.selection.createRange(),t=g.text,h=g.duplicate(),h.moveToElementText(D),h.setEndPoint("EndToEnd",g),s=h.text.length,l=s-t.length,n>1?(i=f.slice(0,l).split(m).length-1,j=t.split(m).length-1):i=j=0}if(E===q||E===r)if(b=p,e=b.length,y=0,z=0,A=0,l!==s&&-1!==t.indexOf("\n"))if(w=0===l||"\n"===f.charAt(l-1)?l:f.lastIndexOf("\n",l-1)+1,s===f.length||"\n"===f.charAt(s)?x=s:"\n"===f.charAt(s-1)?x=s-1:(x=f.indexOf("\n",s),-1===x&&(x=f.length)),c(E,a))y=1,D.value=f.slice(0,w)+b+f.slice(w,x).replace(/\n/g,function(){return y+=1,"\n"+b})+f.slice(x),g?(g.collapse(),g.moveEnd(F,s+y*e-j-i),g.moveStart(F,l+e-i),g.select()):(D.selectionStart=l+e,D.selectionEnd=s+y*e,D.scrollTop=k);else{if(!d(E,a))return;0===f.slice(w).indexOf(b)&&(w===l?t=t.slice(e):A=e,z=e),D.value=f.slice(0,w)+f.slice(w+A,l)+t.replace(new RegExp("\n"+b,"g"),function(){return y+=1,"\n"})+f.slice(s),g?(g.collapse(),g.moveEnd(F,s-z-y*e-j-i),g.moveStart(F,l-A-i),g.select()):(D.selectionStart=l-A,D.selectionEnd=s-z-y*e)}else if(c(E,a))g?(g.text=b,g.select()):(D.value=f.slice(0,l)+b+f.slice(s),D.selectionEnd=D.selectionStart=l+e,D.scrollTop=k);else{if(!d(E,a))return;0===f.slice(l-e).indexOf(b)&&(D.value=f.slice(0,l-e)+f.slice(l),g?(g.move(F,l-e-i),g.select()):(D.selectionEnd=D.selectionStart=l-e,D.scrollTop=k))}else if(u){if(0===l||"\n"===f.charAt(l-1))return void(v=!0);if(w=f.lastIndexOf("\n",l-1)+1,x=f.indexOf("\n",l),-1===x&&(x=f.length),B=f.slice(w,x).match(/^[ \t]*/)[0],C=B.length,w+C>l)return void(v=!0);g?(g.text="\n"+B,g.select()):(D.value=f.slice(0,l)+"\n"+B+f.slice(s),D.selectionEnd=D.selectionStart=l+n+C,D.scrollTop=k)}return a.preventDefault?void a.preventDefault():(a.returnValue=!1,!1)}}function g(a){a=a||event;var b=a.keyCode;if(c(b,a)||d(b,a)||13===b&&u&&!v){if(!a.preventDefault)return a.returnValue=!1,!1;a.preventDefault()}}function h(a,b){var c,d=x[a]||[],e=d.length;for(c=0;e>c;c+=1)d[c].apply(null,b)}function i(a){function b(b){for(c=0;f>c;c+=1)b(a[c].type,a[c].handler)}var c,d,e,f=a.length;return o.addEventListener?(d=function(a){b(function(b,c){a.removeEventListener(b,c,!1)})},e=function(a){d(a),b(function(b,c){a.addEventListener(b,c,!1)})}):o.attachEvent&&(d=function(a){b(function(b,c){a.detachEvent("on"+b,c)})},e=function(a){d(a),b(function(b,c){a.attachEvent("on"+b,c)})}),{add:e,remove:d}}function j(a){h("addListeners",[a]),l.add(a)}function k(a){h("removeListeners",[a]),l.remove(a)}var l,m,n,o=window.document,p="\t",q=9,r=9,s=[],t=["shiftKey"],u=!0,v=!1,w=o.createElement("textarea"),x={};l=i([{type:"keydown",handler:f},{type:"keypress",handler:g}]),w.value="\n",m=w.value,n=m.length,w=null,a.utils={executeExtensions:h,isValidModifierKeyCombo:b,createListeners:i,addListeners:j,removeListeners:k},a.handlers={keydown:f,keypress:g},a.addExtension=function(a,b){return a&&"string"==typeof a&&"function"==typeof b&&(x[a]||(x[a]=[]),x[a].push(b)),this},a.set=function(a,b){var c,d,e,f,g,i,l;if(a)for(c=arguments.length<2||b,d=a,e=d.length,"number"!=typeof e&&(d=[d],e=1),c?(f=j,g="true"):(f=k,g=""),i=0;e>i;i+=1)l=d[i],l&&l.nodeName&&"textarea"===l.nodeName.toLowerCase()&&(h("set",[l,c]),l.setAttribute("data-taboverride-enabled",g),f(l));return this},a.tabSize=function(a){var b;if(arguments.length){if(a&&"number"==typeof a&&a>0)for(p="",b=0;a>b;b+=1)p+=" ";else p="\t";return this}return"\t"===p?0:p.length},a.autoIndent=function(a){return arguments.length?(u=a?!0:!1,this):u},a.tabKey=e(function(a){return arguments.length?void(q=a):q},s),a.untabKey=e(function(a){return arguments.length?void(r=a):r},t)});
|
||||
//# sourceMappingURL=taboverride.min.js.map
|
||||
46
libraries/thumb.php
Normal file
46
libraries/thumb.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?
|
||||
require_once '../autoload/class.Image.php';
|
||||
error_reporting( 0 );
|
||||
|
||||
$img = $_GET['img'];
|
||||
|
||||
$width = $_GET['w'];
|
||||
if ( !$width )
|
||||
$width = 500;
|
||||
|
||||
$height = $_GET['h'];
|
||||
if ( !$height )
|
||||
$height = 500;
|
||||
|
||||
$crop_w = $_GET['c_w'];
|
||||
$crop_h = $_GET['c_h'];
|
||||
|
||||
$img_md5 = md5( $img . $height . $width . $crop_h . $crop_w );
|
||||
$cache_dir = 'temp/' . $img_md5[0] . '/' . $img_md5[1] . '/' . $img_md5[2] . '/';
|
||||
|
||||
if ( !file_exists( '../' . $cache_dir . $img_md5 ) )
|
||||
{
|
||||
$img = new ImageManipulator( '..' . $img );
|
||||
$img -> resample( $width, $height );
|
||||
|
||||
if ( $crop_w && $crop_h )
|
||||
{
|
||||
$centreX = round( $img -> getWidth() / 2 );
|
||||
$centreY = round( $img -> getHeight() / 2 );
|
||||
|
||||
$x1 = $centreX - $crop_w / 2;
|
||||
$y1 = $centreY - $crop_h / 2;
|
||||
|
||||
$x2 = $centreX + $crop_w / 2;
|
||||
$y2 = $centreY + $crop_h / 2;
|
||||
|
||||
$img -> crop( $x1, $y1, $x2, $y2 );
|
||||
}
|
||||
|
||||
$img -> save( '../' . $cache_dir . $img_md5 );
|
||||
chmod( '../' . $cache_dir . $img_md5, 0755 );
|
||||
}
|
||||
|
||||
header( 'Cache-Control: public' );
|
||||
header( "Content-type: image/jpeg" );
|
||||
readfile( '../' . $cache_dir . $img_md5 );
|
||||
9
libraries/validator.js
Normal file
9
libraries/validator.js
Normal file
File diff suppressed because one or more lines are too long
1
libraries/version.ini
Normal file
1
libraries/version.ini
Normal file
@@ -0,0 +1 @@
|
||||
1.681
|
||||
1
libraries/visit-counter.ini
Normal file
1
libraries/visit-counter.ini
Normal file
@@ -0,0 +1 @@
|
||||
179
|
||||
BIN
libraries/webp.webp
Normal file
BIN
libraries/webp.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user