2020-04-01 17:51:22 +03:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-07 19:19:31 +03:00
|
|
|
|
ini_set('display_errors','off');
|
|
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
|
|
2020-04-08 17:05:30 +03:00
|
|
|
|
function anpromo_kuri($page = 1, $scale = 1.5){
|
2020-04-01 17:51:22 +03:00
|
|
|
|
|
|
|
|
|
|
// $pdfile = 'https://argumenti.ru/templinks/md5files/f9598f88e667146d50d106eeedbd74c1.pdf';
|
2020-04-01 21:26:25 +03:00
|
|
|
|
$pdfile = '/pub/files/promo.pdf';
|
2020-04-01 17:51:22 +03:00
|
|
|
|
$maxpage = 32;
|
2020-04-02 08:53:50 +00:00
|
|
|
|
$title = 'Номер 12(706)';
|
2020-04-07 19:39:01 +03:00
|
|
|
|
$baseurl = '/';
|
2020-04-01 17:51:22 +03:00
|
|
|
|
|
|
|
|
|
|
if ($page < $maxpage){
|
|
|
|
|
|
$nextpage = $page + 1;
|
|
|
|
|
|
$nexturl = "/anpromo/$nextpage";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($page > 1) {
|
|
|
|
|
|
$prevpage = $page - 1;
|
|
|
|
|
|
$prevurl = "/anpromo/$prevpage";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-08 17:05:30 +03:00
|
|
|
|
include ('anpdf2.phtml');
|
2020-04-01 17:51:22 +03:00
|
|
|
|
|
2020-04-07 19:09:45 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-07 20:07:25 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-08 22:39:21 +03:00
|
|
|
|
function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
|
2020-04-07 19:09:45 +03:00
|
|
|
|
|
|
|
|
|
|
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset($price['price_id'])){
|
|
|
|
|
|
header("HTTP/1.0 404 Not Found");
|
|
|
|
|
|
echo "file not found";
|
|
|
|
|
|
return False;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-09 00:53:14 +03:00
|
|
|
|
$namefile = $hash.'.pdf';
|
2020-04-23 21:43:44 +03:00
|
|
|
|
$pgfile = PGDIR.$hash.'/'.$hash.'-'.$page.'.pdf';
|
2020-04-23 18:19:11 +03:00
|
|
|
|
$cachefile = PDFDIR.$namefile;
|
2020-04-09 00:00:18 +03:00
|
|
|
|
|
2020-04-23 22:50:45 +03:00
|
|
|
|
if (file_exists($cachefile)){
|
|
|
|
|
|
$fullpdf = '/pdf/'.$namefile;
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$fullpdf = '/file/'.$hash;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-23 23:18:00 +03:00
|
|
|
|
|
2020-04-23 21:43:44 +03:00
|
|
|
|
if (file_exists($pgfile)){
|
2020-04-23 22:03:30 +03:00
|
|
|
|
$pdfile = '/pages/'.$hash.'/'.$hash.'-'.$page.'.pdf';
|
2020-04-23 23:18:00 +03:00
|
|
|
|
|
2020-04-23 23:26:28 +03:00
|
|
|
|
if ($page > 1 or $promo){
|
2020-04-23 23:18:00 +03:00
|
|
|
|
$fullpdf = $pdfile;
|
|
|
|
|
|
$downtitle = 'Если, по какой-то причине у вас не загрузилась страница ниже, то нажмите сюда, чтобы скачать pdf';
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
2020-04-23 23:41:14 +03:00
|
|
|
|
$downtitle = 'Если, по какой-то причине у вас не загрузилось издание ниже, то нажмите сюда, чтобы скачать pdf';
|
2020-04-23 23:18:00 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-23 22:07:26 +03:00
|
|
|
|
$pagenum = 1;
|
2020-04-23 21:43:44 +03:00
|
|
|
|
}
|
|
|
|
|
|
elseif (file_exists($cachefile)){
|
2020-04-23 21:34:32 +03:00
|
|
|
|
$pdfile = '/pdf/'.$namefile;
|
2020-04-23 22:07:26 +03:00
|
|
|
|
$pagenum = $page;
|
2020-04-09 00:00:18 +03:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
2020-04-23 22:50:45 +03:00
|
|
|
|
$pdfile = $fullpdf;
|
2020-04-23 22:07:26 +03:00
|
|
|
|
$pagenum = $page;
|
2020-04-09 00:00:18 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-07 19:09:45 +03:00
|
|
|
|
$id = $price['price_id'];
|
2020-04-09 00:00:18 +03:00
|
|
|
|
$maxpage = 24;
|
2020-04-07 19:09:45 +03:00
|
|
|
|
$title = $price['pricename'];
|
2020-04-07 20:07:25 +03:00
|
|
|
|
|
2020-04-23 23:26:28 +03:00
|
|
|
|
if ($promo){
|
2020-04-07 20:07:25 +03:00
|
|
|
|
$filedown = True;
|
2020-04-23 23:26:28 +03:00
|
|
|
|
$baseurl = "/promo/$hash/";
|
2020-04-07 20:07:25 +03:00
|
|
|
|
|
2020-04-23 23:26:28 +03:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
$filedown = True;
|
|
|
|
|
|
$baseurl = "/read/$hash/";
|
|
|
|
|
|
}
|
2020-04-07 20:07:25 +03:00
|
|
|
|
|
|
|
|
|
|
if ($page < $maxpage){
|
|
|
|
|
|
$nextpage = $page + 1;
|
|
|
|
|
|
$nexturl = "$baseurl$nextpage";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($page > 1) {
|
|
|
|
|
|
$prevpage = $page - 1;
|
|
|
|
|
|
$prevurl = "$baseurl$prevpage";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-27 12:24:59 +03:00
|
|
|
|
$tempcontent = VIEWPATH.'anpdf2.phtml'; //подшаблон
|
|
|
|
|
|
include VIEWPATH.'layout.phtml'; //центральный шаблон
|
2020-04-07 20:07:25 +03:00
|
|
|
|
|
|
|
|
|
|
|
2020-04-23 14:42:01 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function text_kuri(){
|
|
|
|
|
|
|
|
|
|
|
|
$id = 659286;
|
|
|
|
|
|
|
|
|
|
|
|
$news = file_get_contents(API.'id/'.$id);
|
|
|
|
|
|
print_r($news);
|
|
|
|
|
|
|
2020-04-27 12:24:59 +03:00
|
|
|
|
$tempcontent = VIEWPATH.'anpdf.phtml';
|
|
|
|
|
|
include VIEWPATH.'layout.phtml';
|
|
|
|
|
|
|
2020-04-23 14:42:01 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//view( 'views/antext.phtml',['news'=> $news] );
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-07 20:07:25 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function promo_kuri($hash, $page = 1, $scale = 2, $promo = false){
|
|
|
|
|
|
|
2020-04-23 23:26:28 +03:00
|
|
|
|
return read_kuri($hash, $page, $scale, true);
|
2020-04-23 23:21:28 +03:00
|
|
|
|
|
2020-04-07 20:07:25 +03:00
|
|
|
|
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset($price['price_id'])){
|
|
|
|
|
|
header("HTTP/1.0 404 Not Found");
|
|
|
|
|
|
echo "file not found";
|
|
|
|
|
|
return False;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$id = $price['price_id'];
|
|
|
|
|
|
$pdfile = "/file/$hash";
|
|
|
|
|
|
$maxpage = 32;
|
|
|
|
|
|
$title = $price['pricename'];
|
|
|
|
|
|
|
|
|
|
|
|
if (!$promo)
|
|
|
|
|
|
$filedown = False;
|
2020-04-07 19:09:45 +03:00
|
|
|
|
|
2020-04-07 20:11:09 +03:00
|
|
|
|
$baseurl = "/promo/$hash/";
|
2020-04-07 19:29:13 +03:00
|
|
|
|
|
2020-04-07 19:09:45 +03:00
|
|
|
|
if ($page < $maxpage){
|
|
|
|
|
|
$nextpage = $page + 1;
|
2020-04-07 19:31:16 +03:00
|
|
|
|
$nexturl = "$baseurl$nextpage";
|
2020-04-07 19:09:45 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($page > 1) {
|
|
|
|
|
|
$prevpage = $page - 1;
|
2020-04-07 19:31:16 +03:00
|
|
|
|
$prevurl = "$baseurl$prevpage";
|
2020-04-07 19:09:45 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-08 22:39:21 +03:00
|
|
|
|
include ('anpdf2.phtml');
|
2020-04-07 19:09:45 +03:00
|
|
|
|
|
|
|
|
|
|
|
2020-04-08 17:05:30 +03:00
|
|
|
|
}
|