From: <chr...@us...> - 2018-02-23 10:24:03
|
Revision: 13340 http://sourceforge.net/p/xoops/svn/13340 Author: chronolabscoop Date: 2018-02-23 10:24:00 +0000 (Fri, 23 Feb 2018) Log Message: ----------- Fonts Repository Services REST API v2.7.7! Modified Paths: -------------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/constants.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/uploading-fonts.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/help.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/common.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/convert-fonts-upload.pe *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/packs-extracting.diz *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/uploads.json *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/config.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/license.dist.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/page.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/sql/dbreport.html Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md 2018-02-23 10:24:00 UTC (rev 13340) @@ -1,5 +1,7 @@ ## Chronolabs Cooperative presents -# Fonting Repository Services API - http://fonty.snails.email - +# Fonting Repository Services API +## Version 2.7.7 +### Demo: http://fonty.snails.email - # BASIC INSTALLATION MANUAL ## by. Simon Antony Roberts (Sydney) Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/constants.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/constants.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/constants.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -85,7 +85,7 @@ define('FONT_RESOURCES_SORTING', API_PATH . '/Fonts/Sorting'); define('FONT_RESOURCES_CONVERTING', API_PATH . '/Fonts/Converting'); define('FONT_RESOURCES_RESOURCE', API_PATH . '/Fonts/Repository'); - define('FONT_RESOURCES_CACHE', API_VAR_PATH . '/FontsCache'); + define('FONT_RESOURCES_CACHE', API_VAR_PATH . '/FontsAPI/Cache'); define('FONT_RESOURCES_STORE', 'https://sourceforge.net/p/chronolabsapis/Fonting/HEAD/tree/%s?format=raw'); define('FONT_RESOURCES_PEERS', 'https://sourceforge.net/p/chronolabsapis/Fonting/HEAD/tree/peers.json?format=raw'); define('FONT_RESOURCES_REPOMAP', 'https://sourceforge.net/p/chronolabsapis/Fonting/HEAD/tree/%s/%s--repository-mapping.json?format=raw'); @@ -92,7 +92,7 @@ define('FONT_RESOURCES_STORE_GIT', 'https://github.com/Chronolabs-Cooperative/Fonting-Repository/raw/master/%s'); define('FONT_RESOURCES_PEERS_GIT', 'https://github.com/Chronolabs-Cooperative/Fonting-Repository/raw/master/peers.json'); define('FONT_RESOURCES_REPOMAP_GIT', 'https://github.com/Chronolabs-Cooperative/Fonting-Repository/raw/master/%s/%s--repository-mapping.json'); - define('FONT_UPLOAD_PATH', API_VAR_PATH . '/FontsUploads'); + define('FONT_UPLOAD_PATH', API_VAR_PATH . '/FontsAPI/Uploads'); define('FONTS_CACHE', FONT_RESOURCES_CACHE . DIRECTORY_SEPARATOR . '--dumps--'); if (!is_dir(FONT_RESOURCES_UNPACKING)) Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/uploading-fonts.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/uploading-fonts.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/uploading-fonts.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -222,12 +222,23 @@ if (file_exists($uploadfile = $copypath . DIRECTORY_SEPARATOR . strtolower(basename($fontfile)))) { @exec("cd $copypath", $out, $return); - @exec($exe = sprintf(DIRECTORY_SEPARATOR . "usr" . DIRECTORY_SEPARATOR . "bin" . DIRECTORY_SEPARATOR . "fontforge -script \"%s\" \"%s\"", dirname(__DIR__ ) . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "convert-fonts-upload.pe", $uploadfile), $out, $return); - deleteFilesNotListedByArray($copypath, array(API_BASE=>API_BASE)); + @exec($exe = sprintf(DIRECTORY_SEPARATOR . "usr" . DIRECTORY_SEPARATOR . "bin" . DIRECTORY_SEPARATOR . "fontforge -script \"%s\" \"%s\"", dirname(__DIR__ ) . DIRECTORY_SEPARATOR . "include" . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "convert-fonts-upload.pe", $uploadfile), $out, $return); + deleteFilesNotListedByArray($copypath, array(API_BASE=>API_BASE, 'ufo'=>'ufo')); unlink($fontfile); + $glyphsfingerprint = ''; foreach(getFontsListAsArray($copypath) as $file) if ($file['type']==API_BASE) $uploadfile = $copypath . DIRECTORY_SEPARATOR . $file['file']; + elseif($file['type']=='ufo') { + $glyphs = array(); + $fileglyphs = getFileListAsArray($copypath . DIRECTORY_SEPARATOR . $file['file'] . DIRECTORY_SEPARATOR . 'glyphs'); + sort($fileglyphs); + foreach($fileglyphs as $glyph) + { + $glyphs[] = md5_file($copypath . DIRECTORY_SEPARATOR . $file['file'] . DIRECTORY_SEPARATOR . 'glyphs' . DIRECTORY_SEPARATOR . $glyph); + } + $glyphsfingerprint = md5(implode('', $glyphs)); + } $fontdata = getBaseFontValueStore($uploadfile); if (isset($fontdata['version'])) $fontdata['version'] = $fontdata['version'] + 1.001; @@ -246,9 +257,15 @@ $found = true; } $fingerprint = md5(implode("", $data)); + + if (!empty($glyphsfingerprint)) + { + $sql = "SELECT count(*) FROM `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` WHERE `fingerprint` LIKE '" . $glyphsfingerprint . "'"; + list($gfingers) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql)); + } $sql = "SELECT count(*) FROM `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` WHERE `fingerprint` LIKE '" . $fingerprint . "'"; list($fingers) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql)); - if ($fingers==0) + if ($fingers==0 && $gfingers == 0) { $ffile++; $data['process'] = microtime(true); @@ -284,6 +301,9 @@ $GLOBALS['APIDB']->queryF($sql); } echo "\nCreated Upload Identity: ".$uploadid; + $sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` (`type`, `upload_id`, `fingerprint`) VALUES ('" . $GLOBALS['APIDB']->escape(API_BASE) . "','" . $GLOBALS['APIDB']->escape($uploadid) . "','" . $GLOBALS['APIDB']->escape($glyphsfingerprint) . "')"; + if (!$GLOBALS['APIDB']->queryF($sql)) + echo "SQL Failed: $sql;\n"; $sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` (`type`, `upload_id`, `fingerprint`) VALUES ('" . $GLOBALS['APIDB']->escape(API_BASE) . "','" . $GLOBALS['APIDB']->escape($uploadid) . "','" . $GLOBALS['APIDB']->escape($fingerprint) . "')"; if (!$GLOBALS['APIDB']->queryF($sql)) echo "SQL Failed: $sql;\n"; Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/help.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/help.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/help.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -269,29 +269,61 @@ * @author Simon Roberts (labs.coop) wis...@us... * @return string */ - function getURIData($uri = '', $timeout = 25, $connectout = 25, $post_data = array()) - { - if (!function_exists("curl_init")) - { - return file_get_contents($uri); - } - if (!$btt = curl_init($uri)) { - return false; - } - curl_setopt($btt, CURLOPT_HEADER, 0); - curl_setopt($btt, CURLOPT_POST, (count($posts)==0?false:true)); - if (count($posts)!=0) - curl_setopt($btt, CURLOPT_POSTFIELDS, http_build_query($post_data)); - curl_setopt($btt, CURLOPT_CONNECTTIMEOUT, $connectout); - curl_setopt($btt, CURLOPT_TIMEOUT, $timeout); - curl_setopt($btt, CURLOPT_RETURNTRANSFER, true); - curl_setopt($btt, CURLOPT_VERBOSE, false); - curl_setopt($btt, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($btt, CURLOPT_SSL_VERIFYPEER, false); - $data = curl_exec($btt); - curl_close($btt); - return $data; - } + function getURIData($uri = '', $timeout = 25, $connectout = 25, $post = array(), $headers = array()) + { + if (!function_exists("curl_init")) + { + die("Install PHP Curl Extension ie: $ sudo apt-get install php-curl -y"); + } + $GLOBALS['php-curl'][md5($uri)] = array(); + if (!$btt = curl_init($uri)) { + return false; + } + if (count($post)==0 || empty($post)) + curl_setopt($btt, CURLOPT_POST, false); + else { + $uploadfile = false; + foreach($post as $field => $value) + if (substr($value , 0, 1) == '@' && !file_exists(substr($value , 1, strlen($value) - 1))) + unset($post[$field]); + else + $uploadfile = true; + curl_setopt($btt, CURLOPT_POST, true); + curl_setopt($btt, CURLOPT_POSTFIELDS, http_build_query($post)); + + if (!empty($headers)) + foreach($headers as $key => $value) + if ($uploadfile==true && substr($value, 0, strlen('Content-Type:')) == 'Content-Type:') + unset($headers[$key]); + if ($uploadfile==true) + $headers[] = 'Content-Type: multipart/form-data'; + } + if (count($headers)==0 || empty($headers)) + curl_setopt($btt, CURLOPT_HEADER, false); + else { + curl_setopt($btt, CURLOPT_HEADER, true); + curl_setopt($btt, CURLOPT_HTTPHEADER, $headers); + } + curl_setopt($btt, CURLOPT_CONNECTTIMEOUT, $connectout); + curl_setopt($btt, CURLOPT_TIMEOUT, $timeout); + curl_setopt($btt, CURLOPT_RETURNTRANSFER, true); + curl_setopt($btt, CURLOPT_VERBOSE, false); + curl_setopt($btt, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($btt, CURLOPT_SSL_VERIFYPEER, false); + $data = curl_exec($btt); + $GLOBALS['php-curl'][md5($uri)]['http']['posts'] = $post; + $GLOBALS['php-curl'][md5($uri)]['http']['headers'] = $headers; + $GLOBALS['php-curl'][md5($uri)]['http']['code'] = curl_getinfo($btt, CURLINFO_HTTP_CODE); + $GLOBALS['php-curl'][md5($uri)]['header']['size'] = curl_getinfo($btt, CURLINFO_HEADER_SIZE); + $GLOBALS['php-curl'][md5($uri)]['header']['value'] = curl_getinfo($btt, CURLINFO_HEADER_OUT); + $GLOBALS['php-curl'][md5($uri)]['size']['download'] = curl_getinfo($btt, CURLINFO_SIZE_DOWNLOAD); + $GLOBALS['php-curl'][md5($uri)]['size']['upload'] = curl_getinfo($btt, CURLINFO_SIZE_UPLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['length']['download'] = curl_getinfo($btt, CURLINFO_CONTENT_LENGTH_DOWNLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['length']['upload'] = curl_getinfo($btt, CURLINFO_CONTENT_LENGTH_UPLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['type'] = curl_getinfo($btt, CURLINFO_CONTENT_TYPE); + curl_close($btt); + return $data; + } } ?> Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/common.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/common.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/common.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -24,6 +24,7 @@ * Include files with definitions */ include_once dirname(__DIR__) . DS . 'mainfile.php'; +include_once __DIR__ . DS . 'constants.php'; include_once __DIR__ . DS . 'functions.php'; include_once __DIR__ . DS . 'version.php'; include_once __DIR__ . DS . 'license.php'; @@ -60,6 +61,7 @@ * Get database for making it global * Requires APILogger, API_DB_PROXY; */ -require_once API_ROOT_PATH . DS . 'include' . DS . 'dbconfig.php'; -require_once API_ROOT_PATH . DS . 'class' . DS . 'database' . DS . 'databasefactory.php'; -$GLOBALS['APIDB'] = APIDatabaseFactory::getDatabaseConnection(); +if (include_once API_ROOT_PATH . DS . 'include' . DS . 'dbconfig.php') { + include_once API_ROOT_PATH . DS . 'class' . DS . 'database' . DS . 'databasefactory.php'; + $GLOBALS['APIDB'] = APIDatabaseFactory::getDatabaseConnection(); +} Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/convert-fonts-upload.pe =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/convert-fonts-upload.pe 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/convert-fonts-upload.pe 2018-02-23 10:24:00 UTC (rev 13340) @@ -1,2 +1,3 @@ Open($1) -Generate($1:r + ".eot") \ No newline at end of file +Generate($1:r + ".eot") +Generate($1:r + ".ufo") \ No newline at end of file Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/packs-extracting.diz =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/packs-extracting.diz 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/packs-extracting.diz 2018-02-23 10:24:00 UTC (rev 13340) @@ -1,4 +1,4 @@ -7z||7z x -y -q -o"%path" "%pack" +7z||7z x -y -o"%path" "%pack" tar||#tar -xf --directory="%path" "%pack" tar.7z||#tar -xf --directory="%path" "%pack" tar.Z||#tar -xf --directory="%path" "%pack" Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/uploads.json =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/uploads.json 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/uploads.json 2018-02-23 10:24:00 UTC (rev 13340) @@ -1 +1 @@ -{"":{"1512978637":{"type":"pack","pack":"u.zip","packtype":"zip","files":[["\/home\/mynamesnot\/eclipse-workspace\/fonts.localhost\/data\/Fonts\/Unpacking\/simon@snails.email\/1512978637.6466\/u.zip"]],"form":{"email":"simon@snails.email","name":"Dr. Simon Antony Roberts","bizo":"Chronolabs Cooperative","prefix":"snailsemail:","email-cc":"","email-bcc":"","return":"http:\/\/fonty.localhost","callback":"","field":"5e6b4b0d3","submit":"Upload File"},"path":"\/simon@snails.email\/1512978637.6466","success":[],"start":[1512978721.754254],"ipid":"","time":1512978721,"process":1512978721.817317,"mode":"unpacking","current":null}}} \ No newline at end of file +[] \ No newline at end of file Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -36,17 +36,41 @@ * * @return float() */ - function getURIData($uri = '', $timeout = 25, $connectout = 25) + function getURIData($uri = '', $timeout = 25, $connectout = 25, $post = array(), $headers = array()) { if (!function_exists("curl_init")) { - return file_get_contents($uri); + die("Install PHP Curl Extension ie: $ sudo apt-get install php-curl -y"); } + $GLOBALS['php-curl'][md5($uri)] = array(); if (!$btt = curl_init($uri)) { return false; } - curl_setopt($btt, CURLOPT_HEADER, 0); - curl_setopt($btt, CURLOPT_POST, 0); + if (count($post)==0 || empty($post)) + curl_setopt($btt, CURLOPT_POST, false); + else { + $uploadfile = false; + foreach($post as $field => $value) + if (substr($value , 0, 1) == '@' && !file_exists(substr($value , 1, strlen($value) - 1))) + unset($post[$field]); + else + $uploadfile = true; + curl_setopt($btt, CURLOPT_POST, true); + curl_setopt($btt, CURLOPT_POSTFIELDS, http_build_query($post)); + + if (!empty($headers)) + foreach($headers as $key => $value) + if ($uploadfile==true && substr($value, 0, strlen('Content-Type:')) == 'Content-Type:') + unset($headers[$key]); + if ($uploadfile==true) + $headers[] = 'Content-Type: multipart/form-data'; + } + if (count($headers)==0 || empty($headers)) + curl_setopt($btt, CURLOPT_HEADER, false); + else { + curl_setopt($btt, CURLOPT_HEADER, true); + curl_setopt($btt, CURLOPT_HTTPHEADER, $headers); + } curl_setopt($btt, CURLOPT_CONNECTTIMEOUT, $connectout); curl_setopt($btt, CURLOPT_TIMEOUT, $timeout); curl_setopt($btt, CURLOPT_RETURNTRANSFER, true); @@ -54,6 +78,16 @@ curl_setopt($btt, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($btt, CURLOPT_SSL_VERIFYPEER, false); $data = curl_exec($btt); + $GLOBALS['php-curl'][md5($uri)]['http']['posts'] = $post; + $GLOBALS['php-curl'][md5($uri)]['http']['headers'] = $headers; + $GLOBALS['php-curl'][md5($uri)]['http']['code'] = curl_getinfo($btt, CURLINFO_HTTP_CODE); + $GLOBALS['php-curl'][md5($uri)]['header']['size'] = curl_getinfo($btt, CURLINFO_HEADER_SIZE); + $GLOBALS['php-curl'][md5($uri)]['header']['value'] = curl_getinfo($btt, CURLINFO_HEADER_OUT); + $GLOBALS['php-curl'][md5($uri)]['size']['download'] = curl_getinfo($btt, CURLINFO_SIZE_DOWNLOAD); + $GLOBALS['php-curl'][md5($uri)]['size']['upload'] = curl_getinfo($btt, CURLINFO_SIZE_UPLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['length']['download'] = curl_getinfo($btt, CURLINFO_CONTENT_LENGTH_DOWNLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['length']['upload'] = curl_getinfo($btt, CURLINFO_CONTENT_LENGTH_UPLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['type'] = curl_getinfo($btt, CURLINFO_CONTENT_TYPE); curl_close($btt); return $data; } @@ -1971,26 +2005,18 @@ $_SESSION['locality'] = array(); if (API_NETWORK_LOGISTICS==true) { - $uris = cleanWhitespaces(file($file = __DIR__ . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "lookups.diz")); - shuffle($uris); shuffle($uris); shuffle($uris); shuffle($uris); if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE || FILTER_FLAG_NO_RES_RANGE) === false || substr($ip,3,0)=="10." || substr($ip,4,0)=="127.") { $data = array(); - foreach($uris as $uri) - { - if ($_SESSION['locality']['ip']==$ip || $_SESSION['locality']['country']['iso'] == "-" || empty($_SESSION['locality'])) - $_SESSION['locality'] = json_decode(getURIData(sprintf($uri, 'myself', 'json'), 5, 10), true); - if (count($_SESSION['locality']) > 1 && $_SESSION['locality']['country']['iso'] != "-") - continue; - } + if ($_SESSION['locality']['ip']==$ip || $_SESSION['locality']['country']['iso'] == "-" || empty($_SESSION['locality'])) + $_SESSION['locality'] = json_decode(getURIData(sprintf(API_LOOKUPS_URL."/v2/country/%s/%s.api", 'myself', 'json'), 5, 10), true); + if (count($_SESSION['locality']) > 1 && $_SESSION['locality']['country']['iso'] != "-") + continue; } else{ - foreach($uris as $uri) - { - if ($_SESSION['locality']['ip']!=$ip || $_SESSION['locality']['country']['iso'] == "-" || empty($_SESSION['locality'])) - $_SESSION['locality'] = json_decode(getURIData(sprintf($uri, $ip, 'json'), 5, 10), true); - if (count($_SESSION['locality']) > 1 && $_SESSION['locality']['country']['iso'] != "-") - continue; - } + if ($_SESSION['locality']['ip']!=$ip || $_SESSION['locality']['country']['iso'] == "-" || empty($_SESSION['locality'])) + $_SESSION['locality'] = json_decode(getURIData(sprintf(API_LOOKUPS_URL."/v2/country/%s/%s.api", $ip, 'json'), 5, 10), true); + if (count($_SESSION['locality']) > 1 && $_SESSION['locality']['country']['iso'] != "-") + continue; } } if (!isset($_SESSION['locality']['ip'])) @@ -2068,19 +2094,14 @@ if (API_NETWORK_LOGISTICS==true) { $whois = array(); - $whoisuris = cleanWhitespaces(file(__DIR__ . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "whois.diz")); - shuffle($whoisuris); shuffle($whoisuris); shuffle($whoisuris); shuffle($whoisuris); - foreach($whoisuris as $uri) + if (empty($whois[$_SESSION['ipdata'][$ip]['type']]) || !isset($whois[$_SESSION['ipdata'][$ip]['type']])) { - if (empty($whois[$_SESSION['ipdata'][$ip]['type']]) || !isset($whois[$_SESSION['ipdata'][$ip]['type']])) - { - $whois[$_SESSION['ipdata'][$ip]['type']] = json_decode(getURIData(sprintf($uri, $_SESSION['ipdata'][$ip]['ipaddy'], 'json'), 5, 10), true); - } elseif (empty($whois['domain']) || !isset($whois['domain'])) - { - $whois['domain'] = json_decode(getURIData(sprintf($uri, $_SESSION['ipdata'][$ip]['domain'], 'json'), 5, 10), true); - } else - continue; - } + $whois[$_SESSION['ipdata'][$ip]['type']] = json_decode(getURIData(sprintf(API_WHOIS_URL."/v2/%s/%s.api", $_SESSION['ipdata'][$ip]['ipaddy'], 'json'), 5, 10), true); + } elseif (empty($whois['domain']) || !isset($whois['domain'])) + { + $whois['domain'] = json_decode(getURIData(sprintf(API_WHOIS_URL."/v2/%s/%s.api", $_SESSION['ipdata'][$ip]['domain'], 'json'), 5, 10), true); + } else + continue; $sql = "SELECT count(*) FROM `whois` WHERE `id` = '".$wsid = md5(json_encode($whois))."'"; list($countb) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql)); if ($countb == 0) @@ -2148,31 +2169,15 @@ { if (empty($classes)) { - if (empty($stratauris)) { - $stratauris = cleanWhitespaces(file(__DIR__ . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "stratas.diz")); - shuffle($stratauris); shuffle($stratauris); shuffle($stratauris); shuffle($stratauris); - } - shuffle($stratauris); + $attempts = 0; - while(empty($classes) || $attempts <= (count($stratauris) * 1.65)) - { - $attempts++; - $classes = array_keys(json_decode(getURIData($stratauris[mt_rand(0, count($stratauris)-1)] ."/v1/strata/serial.api", 15, 10), true)); - } + $attempts++; + $classes = array_keys(json_decode(getURIData(API_STRATA_URL ."/v1/strata/serial.api", 15, 10), true)); + } if (empty($fallout)) { - if (empty($stratauris)) { - $stratauris = cleanWhitespaces(file(__DIR__ . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "stratas.diz")); - shuffle($stratauris); shuffle($stratauris); shuffle($stratauris); shuffle($stratauris); - } - shuffle($stratauris); - $attempts = 0; - while(empty($fallout) || $attempts <= (count($stratauris) * 1.65)) - { - $attempts++; - $fallout = array_keys(json_decode(getURIData($stratauris[mt_rand(0, count($stratauris)-1)] ."/v1/fallout/serial.api", 15, 10), true)); - } + $fallout = array_keys(json_decode(getURIData(API_STRATA_URL ."/v1/fallout/serial.api", 15, 10), true)); } // Get Full Hostname Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -29,5 +29,5 @@ /** * Define API version */ -define('API_VERSION', 'Fonts Repository Services (Rest API) 2.7.5'); -define('API_TYPE', 'fonty'); +define('API_VERSION', 'Fonts Repository Services (Rest API) 2.7.7'); +define('API_TYPE', 'fonty-api'); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/config.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/config.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/config.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -33,23 +33,22 @@ // extension_loaded $configs['extensions'] = array( - 'mbstring' => array('MBString', sprintf(PHP_EXTENSION, CHAR_ENCODING)), - 'intl' => array('Intl', sprintf(PHP_EXTENSION, INTL_SUPPORT)), -// 'iconv' => array('Iconv', sprintf(PHP_EXTENSION, ICONV_CONVERSION)), - 'xml' => array('XML', sprintf(PHP_EXTENSION, XML_PARSING)), - 'zlib' => array('Zlib', sprintf(PHP_EXTENSION, ZLIB_COMPRESSION)), - 'gd' => array( - (function_exists('gd_info') && $gdlib = @gd_info()) ? 'GD ' . $gdlib['GD Version'] : '', - sprintf(PHP_EXTENSION, IMAGE_FUNCTIONS)), - 'exif' => array('Exif', sprintf(PHP_EXTENSION, IMAGE_METAS)), 'curl' => array('Curl', sprintf(PHP_EXTENSION, CURL_HTTP)), ); + +$configs['apiurl'] = array( + 'lookups' => 'http://lookups.snails.email', + 'strata' => 'http://strata.snails.email', + 'whois' => 'http://whois.snails.email' +); + // Writable files and directories $configs['writable'] = array( 'uploads/', 'data/', 'include/', + 'include/data/', 'mainfile.php', 'include/license.php', 'include/dbconfig.php', Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/license.dist.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/license.dist.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/license.dist.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -22,7 +22,7 @@ defined('API_ROOT_PATH') || exit('Restricted access'); define('API_LICENSE_CODE', 'GPL'); -define('API_LICENSE_TEXT', 'General Public License (GPL) (v. 3.0)'); +define('API_LICENSE_TEXT', 'GPL General Public License (GPL) (v. 2.0)'); define('API_LICENSE_KEY', '000000-000000-000000-000000-0000000'); define('API_LICENSE_COMPANY', ''); define('API_LICENSE_UNAME', ''); @@ -31,4 +31,4 @@ define('API_LICENSE_PROTOCOL', ''); define('API_LICENSE_REALM', ''); define('API_LICENSE_PATH', ''); -define('API_LICENSE_TYPE', ''); +define('API_LICENSE_TYPE', ''); \ No newline at end of file Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/page.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/page.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/page.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -43,6 +43,11 @@ 'title' => PATHS_SETTINGS_TITLE, 'icon' => 'fa fa-fw fa-folder-open' ), + 'extrasettings' => array( + 'name' => PATHS_EXTRA, + 'title' => PATHS_EXTRA_TITLE, + 'icon' => 'fa fa-fw fa-folder-open' + ), 'dbconnection' => array( 'name' => DATABASE_CONNECTION, 'title' => DATABASE_CONNECTION_TITLE, Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -15,6 +15,15 @@ // _LANGCODE: en // _CHARSET : UTF-8 // Translator: API Translation Team +define('API_LOOKUPS_API_URL_LABEL', 'IP Lookups API (see: <a href="https://github.com/Chronolabs-Cooperative/Lookups-API-PHP" target="_blank">github.com</a>)'); +define('API_LOOKUPS_API_URL_HELP', 'IP Lookups API (see: <a href="https://github.com/Chronolabs-Cooperative/Lookups-API-PHP" target="_blank">github.com</a>)'); +define('API_STRATA_API_URL_LABEL', 'Domain/Realms Strata+Fallouts API (see: <a href="https://github.com/Chronolabs-Cooperative/Strata-API-PHP" target="_blank">github.com</a>)'); +define('API_STRATA_API_URL_HELP', 'Domain/Realms Strata+Fallouts API (see: <a href="https://github.com/Chronolabs-Cooperative/Strata-API-PHP" target="_blank">github.com</a>)'); +define('API_WHOIS_API_URL_LABEL', 'IP+Domain WhoIS API (see: <a href="https://github.com/Chronolabs-Cooperative/WhoIS-API-PHP" target="_blank">github.com</a>)'); +define('API_WHOIS_API_URL_HELP', 'IP+Domain WhoIS API (see: <a href="https://github.com/Chronolabs-Cooperative/WhoIS-API-PHP" target="_blank">github.com</a>)'); +define('PATHS_EXTRA', 'Extra Settings'); +define('PATHS_EXTRA_TITLE', 'Extra Settings Configurations'); + define('SHOW_HIDE_HELP', 'Show/hide help text'); // License define('LICENSE_NOT_WRITEABLE', 'License file "%s" is NOT writable!'); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php 2018-02-23 10:24:00 UTC (rev 13340) @@ -65,7 +65,22 @@ $GLOBALS['error'] = !($result === true); } + $constants = file(__DIR__ . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'constants.dist.php'); + foreach($constants as $line => $code) + { + foreach($_SESSION['constants'] as $key => $values) + { + if (is_array($values)) { + foreach($values as $field => $value) + if (strpos($code, "API_".strtoupper($key)."_".strtoupper($field))) + $constants[$line] = "define('API_".strtoupper($key)."_".strtoupper($field)."','$value');\n"; + } elseif (strpos($code, "API_".strtoupper($key))) + $constants[$line] = "define('API_".strtoupper($key)."','$values');\n"; + } + } + $GLOBALS['error'] = !file_put_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'constants.php' , implode($constants)); $_SESSION['settings']['authorized'] = false; + if ($result === true) { $_SESSION['UserLogin'] = true; Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/sql/dbreport.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/sql/dbreport.html 2018-02-10 14:30:09 UTC (rev 13339) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/sql/dbreport.html 2018-02-23 10:24:00 UTC (rev 13340) @@ -1,49 +1,49 @@ -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.callbacks.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__callbacks created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.callbacks.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__callbacks created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.emails.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__emails created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.emails.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__emails created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.flows.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__flows created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.flows.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__flows created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.flows_history.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__flows_history created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.flows_history.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__flows_history created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_archiving.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_archiving created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_archiving.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_archiving created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_callbacks.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_callbacks created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_callbacks.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_callbacks created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_contributors.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_contributors created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_contributors.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_contributors created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_downloads.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_downloads created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_downloads.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_downloads created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_files.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_files created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_files.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_files created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_fingering.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_fingering created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_fingering.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_fingering created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_glyphs.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_glyphs created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_glyphs.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_glyphs created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_glyphs_contours.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_glyphs_contours created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_glyphs_contours.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_glyphs_contours created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_names.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__fonts_names created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.fonts_names.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__fonts_names created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.networking.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__networking created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.networking.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__networking created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.nodes.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__nodes created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.nodes.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__nodes created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.nodes_linking.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__nodes_linking created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.nodes_linking.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__nodes_linking created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.peers.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__peers created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.peers.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__peers created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.releases.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__releases created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.releases.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__releases created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.reserves.sql</h3></li><ul class="log"><li class="failure prestige">Unable to create table fonts__reserves</li> -<li class="failure prestige">Failed inserting -1 entries to table fonts__reserves.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.reserves.sql</h3></li><ul class="log"><li class="failure prestige">Unable to create table xc49__reserves</li> +<li class="failure prestige">Failed inserting -1 entries to table xc49__reserves.</li> </ul></ul> <ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.routines.sql</h3></li><ul class="log"></ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.structure.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__users created.</li> -<li class="failure prestige">Unable to create table fonts__peers</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.structure.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__users created.</li> +<li class="failure prestige">Unable to create table xc49__peers</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.uploads.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__uploads created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.uploads.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__uploads created.</li> </ul></ul> -<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.whois.sql</h3></li><ul class="log"><li class="success prestige">Table fonts__whois created.</li> +<ul class="prestige" style="list-style-bullet: none; float: left; width: 32%; padding: 4px; margin: 3px; font-size: 0.78764em;"><il><h3 style="font-size: 1.44812em;">mysql.whois.sql</h3></li><ul class="log"><li class="success prestige">Table xc49__whois created.</li> </ul></ul> |
From: <chr...@us...> - 2018-02-23 10:41:38
|
Revision: 13342 http://sourceforge.net/p/xoops/svn/13342 Author: chronolabscoop Date: 2018-02-23 10:41:34 +0000 (Fri, 23 Feb 2018) Log Message: ----------- Fonting Services Repository REST API v2.7.8! Modified Paths: -------------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/class/xcp.class.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/class/xcp.class.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/class/xcp.class.php 2018-02-23 10:28:53 UTC (rev 13341) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/class/xcp.class.php 2018-02-23 10:41:34 UTC (rev 13342) @@ -55,7 +55,7 @@ $this->seed = $seed; $this->length = $len; $this->base = new xcp_base((int)$seed); - $this->enum = new xcp_enumerator($this->base); + $this->enum = new xcp_enumerator($this->base, $len); if (!empty($data)) { Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php 2018-02-23 10:28:53 UTC (rev 13341) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php 2018-02-23 10:41:34 UTC (rev 13342) @@ -158,7 +158,7 @@ foreach($names as $key => $values) { - if ($GLOBALS['APIDB']->queryF($sql = "INSERT INTO `fonts_names` (`" . implode('`, `', array_keys($values)) . "`) VALUES('" . implode("', '", $values) . "')")) + if ($GLOBALS['APIDB']->queryF($sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('fonts_names') . "` (`" . implode('`, `', array_keys($values)) . "`) VALUES('" . implode("', '", $values) . "')")) echo "Font Name: " . $values['name'] . ' recorded for font identity: ' . $values['font_id'] . "\n"; else die("SQL Error: " . $sql . ";"); @@ -169,11 +169,11 @@ { foreach($nodes as $node => $values) { - if ($row = $GLOBALS['APIDB']->fetchArray($GLOBALS['APIDB']->queryF("SELECT * from `nodes` WHERE `node` = '".$values['node']."' AND `type` = '".$values['type']."'"))) { + if ($row = $GLOBALS['APIDB']->fetchArray($GLOBALS['APIDB']->queryF("SELECT * from `" . $GLOBALS['APIDB']->prefix('nodes') . "` WHERE `node` = '".$values['node']."' AND `type` = '".$values['type']."'"))) { $nodes[$node]['node_id'] = $row['id']; - $GLOBALS['APIDB']->queryF("UPDATE `nodes` SET `usage` = `usage` + '" . $values['usage'] . "' WHERE `id` = '".$row['id']."'"); + $GLOBALS['APIDB']->queryF("UPDATE `" . $GLOBALS['APIDB']->prefix('nodes') . "` SET `usage` = `usage` + '" . $values['usage'] . "' WHERE `id` = '".$row['id']."'"); } else { - $GLOBALS['APIDB']->queryF("INSERT INTO `nodes` (`" . implode('`, `', array_keys($values)) . "`) VALUES('" . implode("', '", $values) . "')"); + $GLOBALS['APIDB']->queryF("INSERT INTO `" . $GLOBALS['APIDB']->prefix('nodes') . "` (`" . implode('`, `', array_keys($values)) . "`) VALUES('" . implode("', '", $values) . "')"); $nodes[$node]['node_id'] = $GLOBALS['APIDB']->getInsertId(); } } @@ -181,7 +181,7 @@ // gets networking $networking = array(); - $resultc = $GLOBALS['APIDB']->queryF("SELECT * from `networking` WHERE `ip_id` IN ('".implode("', '", $ipnet) . "')"); + $resultc = $GLOBALS['APIDB']->queryF("SELECT * from `" . $GLOBALS['APIDB']->prefix('networking') . "` WHERE `ip_id` IN ('".implode("', '", $ipnet) . "')"); while($net = $GLOBALS['APIDB']->fetchArray($resultc)) { $networking[$net['ip_id']] = $net; Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php 2018-02-23 10:28:53 UTC (rev 13341) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php 2018-02-23 10:41:34 UTC (rev 13342) @@ -29,5 +29,5 @@ /** * Define API version */ -define('API_VERSION', 'Fonts Repository Services (Rest API) 2.7.7'); +define('API_VERSION', 'Fonts Repository Services (Rest API) 2.7.8'); define('API_TYPE', 'fonty-api'); |
From: <chr...@us...> - 2018-04-24 14:44:45
|
Revision: 13346 http://sourceforge.net/p/xoops/svn/13346 Author: chronolabscoop Date: 2018-04-24 14:44:00 +0000 (Tue, 24 Apr 2018) Log Message: ----------- fonty.xoops.org - Fonts Repository REST API 2.8.2 - Last Major! Modified Paths: -------------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.htaccess *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.project *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/apiconfig.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/css/style.css *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/register-crawling.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/unknown-fonts.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/index.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php Removed Paths: ------------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/images/ Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.htaccess =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.htaccess 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.htaccess 2018-04-24 14:44:00 UTC (rev 13346) @@ -8,40 +8,40 @@ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^([a-z0-9]{2})/(.*?)/callback.api$ callback.php?version=$1&mode=$2 [L,NC,QSA] +RewriteRule ^([a-z0-9]{2})/(.*?)/callback.api$ callback.php?version=$1&mode=$2 [L,NC,QSA] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(preview|naming)/image.(gif|jpg|png)$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/survey/(preview)/(.*?)/image.(jpg|png|gif)$ survey-$2.php?version=$1&mode=$4&key=$3&output=$2 [L] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(preview|naming)/(gif|jpg|png).api$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/survey/(preview)/(.*?)/(jpg|png|gif).api$ survey-$2.php?version=$1&mode=$4&key=$3&output=$2 [L] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(glyph)/([0-9]+)/image.(gif|jpg|png)$ index.php?version=$1&mode=$2&clause=$3&state=$6&output=$4&char=$5 [L] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(glyph)/([0-9]+)/(gif|jpg|png).api$ index.php?version=$1&mode=$2&clause=$3&state=$6&output=$4&char=$5 [L] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(ufo).api$ index.php?version=$1&mode=$2&clause=$3&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(ufo).api/(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(preview|naming)/image.(gif|jpg|png)$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/survey/(preview)/(.*?)/image.(jpg|png|gif)$ survey-$2.php?version=$1&mode=$4&key=$3&output=$2 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(preview|naming)/(gif|jpg|png).api$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/survey/(preview)/(.*?)/(jpg|png|gif).api$ survey-$2.php?version=$1&mode=$4&key=$3&output=$2 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(glyph)/([0-9]+)/image.(gif|jpg|png)$ index.php?version=$1&mode=$2&clause=$3&state=$6&output=$4&char=$5 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(glyph)/([0-9]+)/(gif|jpg|png).api$ index.php?version=$1&mode=$2&clause=$3&state=$6&output=$4&char=$5 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(ufo).api$ index.php?version=$1&mode=$2&clause=$3&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(ufo).api/(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/(font)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=$5&output=$4 [L] - -RewriteRule ^([a-z0-9]{2})/survey/page-([0-9]+)/(.*?)/(.*?).api$ survey-page-$2.php?version=$1&mode=$2&key=$3&output=$4& [L] -RewriteRule ^([a-z0-9]{2})/survey/(.*?)/(.*?)/(.*?).api?(.*?)$ survey-$2.php?version=$1&mode=$2&key=$3&output=$4&$5 [L] -RewriteRule ^([a-z0-9]{2})/survey/(.*?)/(.*?)/(.*?).api$ survey-$2.php?version=$1&mode=$2&key=$3&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/survey/(.*?)/(.*?).api$ survey-$2.php?version=$1&key=$2&output=$3& [L] - -RewriteRule ^([a-z0-9]{2})/(.*?)/upload.api$ upload.php?version=$1&field=$2 [L] -RewriteRule ^([a-z0-9]{2})/(.*?)/releases.api$ releases.php?version=$1&field=$2 [L] -RewriteRule ^([a-z0-9]{2})/(uploads|releases)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4&$5 [L] -RewriteRule ^([a-z0-9]{2})/(uploads|releases)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/(uploads|releases)/(forms).api$ index.php?version=$1&mode=$2&clause=&state=&output=$3 [L] + +RewriteRule ^([a-z0-9]{2})/survey/page-([0-9]+)/(.*?)/(.*?).api$ survey-page-$2.php?version=$1&mode=$2&key=$3&output=$4& [L] +RewriteRule ^([a-z0-9]{2})/survey/(.*?)/(.*?)/(.*?).api?(.*?)$ survey-$2.php?version=$1&mode=$2&key=$3&output=$4&$5 [L] +RewriteRule ^([a-z0-9]{2})/survey/(.*?)/(.*?)/(.*?).api$ survey-$2.php?version=$1&mode=$2&key=$3&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/survey/(.*?)/(.*?).api$ survey-$2.php?version=$1&key=$2&output=$3& [L] + +RewriteRule ^([a-z0-9]{2})/(.*?)/upload.api$ upload.php?version=$1&field=$2 [L] +RewriteRule ^([a-z0-9]{2})/(.*?)/releases.api$ releases.php?version=$1&field=$2 [L] +RewriteRule ^([a-z0-9]{2})/(uploads|releases)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4&$5 [L] +RewriteRule ^([a-z0-9]{2})/(uploads|releases)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/(uploads|releases)/(forms).api$ index.php?version=$1&mode=$2&clause=&state=&output=$3 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5&name=$6&$7 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5&$6 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|fonthit|archive)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4&$5 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|identities)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=&state=&output=$3&$4 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5&name=$6&$7 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5&$6 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|fonthit|archive)/(.*?)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4&$5 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|identities)/(.*?).api?(.*?)$ index.php?version=$1&mode=$2&clause=&state=&output=$3&$4 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5&name=$6 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|fonthit|archive)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4 [L] -RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|identities)/(.*?).api$ index.php?version=$1&mode=$2&clause=&state=&output=$3& [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5&name=$6 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads)/(.*?)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=$4&output=$5 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|fonthit|archive)/(.*?)/(.*?).api$ index.php?version=$1&mode=$2&clause=$3&state=&output=$4 [L] +RewriteRule ^([a-z0-9]{2})/(fonts|nodes|random|data|callbacks|downloads|identities)/(.*?).api$ index.php?version=$1&mode=$2&clause=&state=&output=$3& [L] -RewriteRule ^font-download-example.zip$ examples/sample-font-api2-download.zip [L] -RewriteRule ^callback-example.php$ examples/callback-example.php.txt [L] -RewriteRule ^(.*?).(css|txt|php|jpg|png|gif|ico)$ $1.$2 [L] \ No newline at end of file +RewriteRule ^font-download-example.zip$ examples/sample-font-api2-download.zip [L] +RewriteRule ^callback-example.php$ examples/callback-example.php.txt [L] +RewriteRule ^(.*?).(css|txt|php|jpg|png|gif|ico)$ $1.$2 [L] Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.project =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.project 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/.project 2018-04-24 14:44:00 UTC (rev 13346) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>Font API</name> + <name>fonts.localhost</name> <comment></comment> <projects> </projects> Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/README.md 2018-04-24 14:44:00 UTC (rev 13346) @@ -1,11 +1,11 @@ ## Chronolabs Cooperative presents # Fonting Repository Services API -## Version 2.7.7 -### Demo: http://fonty.snails.email - +## Version: 2.8.0 +#### Demo: http://fonty.snails.email # BASIC INSTALLATION MANUAL -## by. Simon Antony Roberts (Sydney) -## simon@snails.email +## by. Dr. Simon Antony Roberts (Sydney) +### simon@snails.email # Foreword Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/apiconfig.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/apiconfig.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/apiconfig.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -31,8 +31,9 @@ } require_once __DIR__ . DIRECTORY_SEPARATOR . 'mainfile.php'; +error_reporting(E_ALL); +ini_set('display_errors', true); - /** * Opens Access Origin Via networking Route NPN */ Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/css/style.css =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/css/style.css 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/css/style.css 2018-04-24 14:44:00 UTC (rev 13346) @@ -6,7 +6,7 @@ text-align:justify; } .main { - font-family: "Labtop Thin" !important; + font-family: "Labtop Thin"; font-size: 1.179894em; border:3px solid #000000; border-radius:15px; @@ -18,7 +18,7 @@ box-shadow: 7px 7px 10px 0px rgba(108, 80, 99, 0.72); } h1 { - font-family: "Labtop Superwide Boldish" !important; + font-family: "Labtop Superwide Boldish"; font-weight:bold; font-size:1.456554em; background-color:#FFEED9; @@ -27,7 +27,7 @@ text-shadow: 4px 4px 2px rgba(150, 150, 150, 1); } h2 { - font-family: "Labtop Bold" !important; + font-family: "Labtop Bold"; font-weight:500; font-size:1.2495em; text-shadow: 4px 4px 2px rgba(150, 150, 150, 1); @@ -35,7 +35,7 @@ blockquote { margin-left:25px; margin-right:25px; - font-family: "Prestige Elite", "Courier New", Courier, monospace !important; + font-family: "Prestige Elite", "Courier New", Courier, monospace; font-size: 0,844441em; margin-bottom:25px; padding: 25px 25px 25px 25px; @@ -57,7 +57,7 @@ input, button, textarea, radio, select, label { - font-family: "Prestigue Elite Bold" !important; + font-family: "Prestigue Elite Bold"; font-size:1.211115em; margin: 3px; -webkit-border-radius: 4px; @@ -67,16 +67,16 @@ .help-title-text { - font-family: "Labtop Bold Italics" !important; + font-family: "Labtop Bold Italics"; font-weight:300; font-size:0.8761145em; margin-top: 6px; - color: rgb(0,120,0) !important; + color: rgb(0,120,0); } .help-url-example { - font-family: "Prestige Elite Bold" !important; + font-family: "Prestige Elite Bold"; font-weight:600; font-size:0.6781115em; margin-top: 3px; Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/register-crawling.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/register-crawling.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/register-crawling.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -54,9 +54,9 @@ $uploader[$ipid][$time]['form']['bizo'] = API_DEFAULT_BIZO; $uploader[$ipid][$time]['form']['prefix'] = API_IDENTITY_TAG; $uploader[$ipid][$time]['form']['scope'] = array(); -list($emails) = $GLOBALS['FontsDB']->fetchRow($GLOBALS['FontsDB']->queryF($sql = "SELECT `emails` from `emails` ORDER BY RAND() LIMIT 1")); +list($emails) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql = "SELECT `emails` FROM `" . $GLOBALS['APIDB']->prefix('emails') . "` ORDER BY RAND() LIMIT 1")); $cc = array_merge(json_decode($emails['emails'], true), cleanWhitespaces(file(dirname(__DIR__) . '/data/emails-crawling-cc.diz'))); -list($emails) = $GLOBALS['FontsDB']->fetchRow($GLOBALS['FontsDB']->queryF($sql = "SELECT `emails` from `emails` ORDER BY RAND() LIMIT 1")); +list($emails) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql = "SELECT `emails` FROM `" . $GLOBALS['APIDB']->prefix('emails') . "` ORDER BY RAND() LIMIT 1")); $bcc = array_merge(json_decode($emails['emails'], true), cleanWhitespaces(file(dirname(__DIR__) . '/data/emails-crawling-bcc.diz'))); $uploader[$ipid][$time]['form']['email-cc'] = implode(',', $cc); $uploader[$ipid][$time]['form']['email-bcc'] = implode(',', $bcc); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/unknown-fonts.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/unknown-fonts.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/unknown-fonts.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -239,7 +239,7 @@ // gets networking $networking = array(); - $resultc = $GLOBALS['APIDB']->queryF("SELECT * from `networking` WHERE `ip_id` IN ('".implode("', '", $ipnet) . "')"); + $resultc = $GLOBALS['APIDB']->queryF("SELECT * FROM `" . $GLOBALS['APIDB']->prefix('networking') . "` WHERE `ip_id` IN ('".implode("', '", $ipnet) . "')"); while($net = $GLOBALS['APIDB']->fetchArray($resultc)) { $networking[$net['ip_id']] = $net; @@ -396,7 +396,7 @@ { foreach($names as $key => $values) { - if ($GLOBALS['APIDB']->queryF($sql = "INSERT INTO `fonts_names` (`" . implode('`, `', array_keys($values)) . "`) VALUES('" . implode("', '", $values) . "')")) + if ($GLOBALS['APIDB']->queryF($sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('fonts_names') . "` (`" . implode('`, `', array_keys($values)) . "`) VALUES('" . implode("', '", $values) . "')")) $namings++; elseif ($GLOBALS['APIDB']->errno()<>0) die("SQL Failed: $sql :: ".$GLOBALS['APIDB']->error()); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/zip-fonts.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -46,7 +46,7 @@ $reserves = getReserves($datastore["FontName"]); $currently = $upload['currently_path']; $packname = urlencode($datastore["FontName"]); - $sortpath = str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR,DIRECTORY_SEPARATOR,str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR,DIRECTORY_SEPARATOR,FONT_RESOURCES_RESOURCE . DIRECTORY_SEPARATOR . urlencode(substr(strtolower($datastore["FontName"]),0, 1)) . DIRECTORY_SEPARATOR . urlencode(substr(strtolower($datastore["FontName"]),0, 2)) . DIRECTORY_SEPARATOR . urlencode(substr(strtolower($datastore["FontName"]),0, 3)) . DIRECTORY_SEPARATOR . urlencode($datastore["FontName"]) . (count($reserves['parent'])>0?DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $reserves['parent']):"")));; + $sortpath = FONT_RESOURCES_RESOURCE . DIRECTORY_SEPARATOR . urlencode(substr(strtolower($datastore["FontName"]),0, 1)) . DIRECTORY_SEPARATOR . urlencode(substr(strtolower($datastore["FontName"]),0, 2)) . DIRECTORY_SEPARATOR . urlencode(substr(strtolower($datastore["FontName"]),0, 3)) . DIRECTORY_SEPARATOR . urlencode($datastore["FontName"]); $packfile = $sortpath . (substr($sortpath, strlen($sortpath)-1, 1)!=DIRECTORY_SEPARATOR?DIRECTORY_SEPARATOR:"") . $packname . '.zip'; // Builds types table Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -65,11 +65,9 @@ if ($uploadfile==true) $headers[] = 'Content-Type: multipart/form-data'; } - if (count($headers)==0 || empty($headers)) - curl_setopt($btt, CURLOPT_HEADER, false); - else { - curl_setopt($btt, CURLOPT_HEADER, true); - curl_setopt($btt, CURLOPT_HTTPHEADER, $headers); + if (count($headers)!=0 || !empty($headers)) + { + curl_setopt($btt, CURLOPT_HEADER, implode("\n", $headers)); } curl_setopt($btt, CURLOPT_CONNECTTIMEOUT, $connectout); curl_setopt($btt, CURLOPT_TIMEOUT, $timeout); @@ -2303,8 +2301,8 @@ } if (isset($font) && file_exists($font)) { - require_once __DIR__ . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-preview.png'); + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-preview.png'); if ($state == 'jpg') { $bg = $img->allocateColor(255, 255, 255); @@ -2427,19 +2425,19 @@ if (isset($font) && file_exists($font)) { $naming = getRegionalFontName($clause); - require_once __DIR__ . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; if (strlen($naming)<=9) { - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-small.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-small.png'); } elseif (strlen($naming)<=12) { - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-medium.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-medium.png'); }elseif (strlen($naming)<=21) { - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-large.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-large.png'); } else { - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-extra.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-extra.png'); } $height = $img->getHeight(); $point = $height * (32/99); @@ -2508,8 +2506,8 @@ if (isset($font) && file_exists($font)) { - require_once __DIR__ . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-glyph.png'); + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-glyph.png'); if ($state == 'jpg') { $bg = $img->allocateColor(255, 255, 255); @@ -2979,7 +2977,7 @@ if (!file_exists($cache = getCacheFilename(FONT_RESOURCES_CACHE, '%sfont-raw-data-by-id--%s.raw', sha1($clause.$output.$version), $output))) { global $ipid; - if (!$GLOBALS['APIDB']->queryF($sql = "UPDATE `" . $GLOBALS['APIDB']->prefix('networking') . "` SET `" . $GLOBALS['APIDB']->prefix('fonts') . "` = `" . $GLOBALS['APIDB']->prefix('fonts') . "` + 1 WHERE `ip_id` LIKE '$ipid'")) + if (!$GLOBALS['APIDB']->queryF($sql = "UPDATE `" . $GLOBALS['APIDB']->prefix('networking') . "` SET `fonts` = `fonts` + 1 WHERE `ip_id` LIKE '$ipid'")) die("SQL Failed: $sql;"); $sql = "SELECT * from `" . $GLOBALS['APIDB']->prefix('fonts_archiving') . "` WHERE (`font_id` = '$clause' OR `fingerprint` = '$clause')"; if (!$result = $GLOBALS['APIDB']->queryF($sql)) @@ -3557,8 +3555,8 @@ { if (isset($preview) && file_exists($preview)) { - require_once __DIR__ . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-preview.png'); + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'WideImage' . DIRECTORY_SEPARATOR . 'WideImage.php'; + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-preview.png'); $height = $img->getHeight(); $lsize = 66; $ssize = 14; @@ -3594,13 +3592,13 @@ unset($img); $title = spacerName(getRegionalFontName($row['font_id'])); if (strlen($title)<=9) - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-small.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-small.png'); elseif (strlen($title)<=18) - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-medium.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-medium.png'); elseif (strlen($title)<=35) - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-large.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-large.png'); elseif (strlen($title)>=36) - $img = WideImage::load(__DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-extra.png'); + $img = WideImage::load(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'font-title-extra.png'); $canvas->useFont($preview, 78, $img->allocateColor(0, 0, 0)); $canvas->writeText('center', 'center', $title); $img->saveToFile($currently . DIRECTORY_SEPARATOR . 'font-name-banner.png'); @@ -3814,16 +3812,16 @@ $html .= "<table>\n"; $html .= "<tbody>"; $html .= "<tr><th colspan=\"5\"><hr></th></tr>"; - $html .= "<tr><td valign=\"top\"><img src=\"".API_URL."/images/back.gif\" alt=\"[PARENTDIR]\"></td><td><a href=\"".$filez['parent']."\">Parent Directory</a></td><td> </td><td align=\"right\"> - </td><td> </td></tr>\n"; + $html .= "<tr><td valign=\"top\"><img src=\"".API_URL."/assets/images/back.gif\" alt=\"[PARENTDIR]\"></td><td><a href=\"".$filez['parent']."\">Parent Directory</a></td><td> </td><td align=\"right\"> - </td><td> </td></tr>\n"; if (isset($filez['folder'])) { foreach($filez['folder'] as $md5 => $folder) - $html .= "<tr><td valign=\"top\"><img src=\"".API_URL."/images/folder.gif\" alt=\"[DIR]\"></td><td><a href=\"".$filez['root']."/$folder/\">$folder/</a></td><td align=\"right\">".date("Y-m-d H:i:s")."</td><td align=\"right\"> - </td><td> </td></tr>\n"; + $html .= "<tr><td valign=\"top\"><img src=\"".API_URL."/assets/images/folder.gif\" alt=\"[DIR]\"></td><td><a href=\"".$filez['root']."/$folder/\">$folder/</a></td><td align=\"right\">".date("Y-m-d H:i:s")."</td><td align=\"right\"> - </td><td> </td></tr>\n"; } if (isset($filez['files'])) { foreach($filez['files'] as $md5 => $file) - $html .= "<tr><td valign=\"top\"><img src=\"".API_URL."/images/text.gif\" alt=\"[FILE]\"></td><td><a href=\"".$filez['root']."/".$file['name']."\">".$file['name']."</a></td><td align=\"right\">".date("Y-m-d H:i:s")."</td><td align=\"right\">".$file['bytes']." bytes</td><td> </td></tr>\n"; + $html .= "<tr><td valign=\"top\"><img src=\"".API_URL."/assets/images/text.gif\" alt=\"[FILE]\"></td><td><a href=\"".$filez['root']."/".$file['name']."\">".$file['name']."</a></td><td align=\"right\">".date("Y-m-d H:i:s")."</td><td align=\"right\">".$file['bytes']." bytes</td><td> </td></tr>\n"; } $html .= "<tr><th colspan=\"5\"><hr></th></tr></tbody></table>\n"; $html .= "<address>Fonts API/".API_VERSION." (".PHP_VERSION.") Server at ".parse_url("http://".$_SERVER["HTTP_HOST"], PHP_URL_HOST). " Port ".$_SERVER["SERVER_PORT"]."</address>\n"; Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/version.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -29,5 +29,5 @@ /** * Define API version */ -define('API_VERSION', 'Fonts Repository Services (Rest API) 2.7.8'); +define('API_VERSION', 'Fonts Repository Services (Rest API) 2.8.2'); define('API_TYPE', 'fonty-api'); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/index.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/index.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/index.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -67,100 +67,95 @@ } $GLOBAL['apifuncs'] = array(); $help=true; - if (isset($inner['output']) || !empty($inner['output'])) { - $version = isset($inner['version'])?(string)$inner['version']:'v2'; - $output = isset($inner['output'])?(string)$inner['output']:''; - $name = isset($inner['name'])?(string)$inner['name']:''; - $clause = isset($inner['clause'])?(string)$inner['clause']:''; - $callback = isset($_REQUEST['callback'])?(string)$_REQUEST['callback']:''; - $mode = isset($inner['mode'])?(string)$inner['mode']:''; - $state = isset($inner['state'])?(string)$inner['state']:''; - switch($output) - { - default: - if (!in_array($output, cleanWhitespaces(file(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'font-supported-'.$version.'.diz')))) - $help=true; - elseif (in_array($mode, array('font')) && strlen($clause) == 32) - $help=false; + + $version = isset($inner['version'])?(string)$inner['version']:'v2'; + $output = isset($inner['output'])?(string)$inner['output']:''; + $name = isset($inner['name'])?(string)$inner['name']:''; + $clause = isset($inner['clause'])?(string)$inner['clause']:''; + $callback = isset($inner['callback'])?(string)$inner['callback']:''; + $mode = isset($inner['mode'])?(string)$inner['mode']:''; + $state = isset($inner['state'])?(string)$inner['state']:''; + switch($output) + { + default: + if (in_array($mode, array('font')) && !empty($clause) && in_array($output, cleanWhitespaces(file(__DIR__ . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'font-supported-'.$version.'.diz')))) + $help=false; + break; + case "callback": + if (in_array($mode, array('fonthit', 'archive')) && strlen($clause) == 32) + $help=false; break; - case "callback": - if (in_array($mode, array('fonthit', 'archive')) && strlen($clause) == 32) - $help=false; - break; - case "ufo": - if (in_array($mode, array('font')) && strlen($clause) == 32) - $help=false; - break; - case "rss": - if (in_array($mode, array('data'))) - $help=false; - + case "ufo": + if (in_array($mode, array('font')) && strlen($clause) == 32) + $help=false; break; - case "download": - if (in_array($mode, array('data')) && strlen($clause) == 32) - $help=false; - else + case "rss": + if (in_array($mode, array('data'))) + $help=false; + + break; + case "download": + if (in_array($mode, array('data')) && strlen($clause) == 32) + $help=false; + else + $help=true; + if (in_array($state, array_keys(getArchivingShellExec()))) + $help=false; + else + $help=true; + case "diz": + if (in_array($mode, array('data')) && strlen($clause) == 32) + $help=false; + + break; + case "raw": + case "html": + case "serial": + case "json": + case "xml": + if (in_array($mode, array('nodes', 'fonts', 'data', 'callbacks','identities'))) + $help=false; + break; + case "forms": + if (in_array($mode, array('uploads','releases'))) + { + $help=false; + if (empty($clause) && isset($_POST['return'])) + $clause = $_POST['return']; + } + break; + case "profile": + if (in_array($mode, array('sites')) && in_array($clause, array('create', 'forgotten', 'edit'))) + $help=false; + break; + case "css": + if (in_array($mode, array('fonts', 'font', 'random')) && !empty($clause)) + { + $help=false; + if ($mode == 'random' && empty($state)) $help=true; - if (in_array($state, array_keys(getArchivingShellExec()))) - $help=false; - else + } + break; + case "naming": + if (in_array($mode, array('font')) && !empty($clause)) + { + $help=false; + } + break; + case "preview": + if (in_array($mode, array('fonts', 'font', 'random')) && !empty($clause)) + { + $help=false; + if ($mode == 'random' && empty($state)) $help=true; - case "diz": - if (in_array($mode, array('data')) && strlen($clause) == 32) - $help=false; - - break; - case "raw": - case "html": - case "serial": - case "json": - case "xml": - if (in_array($mode, array('nodes', 'fonts', 'data', 'callbacks','identities'))) - $help=false; - break; - case "forms": - if (in_array($mode, array('uploads','releases'))) - { - $help=false; - if (empty($clause) && isset($_POST['return'])) - $clause = $_POST['return']; - } - break; - case "profile": - if (in_array($mode, array('sites')) && in_array($clause, array('create', 'forgotten', 'edit'))) - $help=false; - break; - case "css": - if (in_array($mode, array('fonts', 'font', 'random')) && !empty($clause)) - { - $help=false; - if ($mode == 'random' && empty($state)) - $help=true; - } - break; - case "naming": - if (in_array($mode, array('font')) && !empty($clause)) - { - $help=false; - } - break; - case "preview": - if (in_array($mode, array('fonts', 'font', 'random')) && !empty($clause)) - { - $help=false; - if ($mode == 'random' && empty($state)) - $help=true; - } - break; - case "glyph": - if (in_array($mode, array('font')) && !empty($clause) && !empty($inner['char'])) - { - $help=false; - } - break; - } - } else { - $help=true; + } + break; + case "glyph": + if (in_array($mode, array('font')) && !empty($clause) && !empty($inner['char'])) + { + $help=false; + } + break; } if ($help==true) { @@ -181,8 +176,8 @@ { default: $data = getFontRawData($mode, $clause, $output, $version); - $GLOBALS['FontsDB']->queryF($sql = "UPDATE `fonts` SET `sourcings` = `sourcings` + 1, `sourced` = UNIX_TIMESTAMP() WHERE `filename` LIKE '" . $GLOBALS['filename'] . "' AND `font_id` = '" . $clause . "'"); - $GLOBALS['FontsDB']->queryF($sql = "UPDATE `fonts` SET `downloaded` = `downloaded` + 1, `accessed` = UNIX_TIMESTAMP() WHERE `id` = '" . $clause . "'"); + $GLOBALS['APIDB']->queryF($sql = "UPDATE `fonts` SET `sourcings` = `sourcings` + 1, `sourced` = UNIX_TIMESTAMP() WHERE `filename` LIKE '" . $GLOBALS['filename'] . "' AND `font_id` = '" . $clause . "'"); + $GLOBALS['APIDB']->queryF($sql = "UPDATE `fonts` SET `downloaded` = `downloaded` + 1, `accessed` = UNIX_TIMESTAMP() WHERE `id` = '" . $clause . "'"); break; case "callback": $data = setFontCallback($mode, $clause, $state, $output, $version); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/language/english/install.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -15,15 +15,15 @@ // _LANGCODE: en // _CHARSET : UTF-8 // Translator: API Translation Team -define('API_LOOKUPS_API_URL_LABEL', 'IP Lookups API (see: <a href="https://github.com/Chronolabs-Cooperative/Lookups-API-PHP" target="_blank">github.com</a>)'); -define('API_LOOKUPS_API_URL_HELP', 'IP Lookups API (see: <a href="https://github.com/Chronolabs-Cooperative/Lookups-API-PHP" target="_blank">github.com</a>)'); -define('API_STRATA_API_URL_LABEL', 'Domain/Realms Strata+Fallouts API (see: <a href="https://github.com/Chronolabs-Cooperative/Strata-API-PHP" target="_blank">github.com</a>)'); -define('API_STRATA_API_URL_HELP', 'Domain/Realms Strata+Fallouts API (see: <a href="https://github.com/Chronolabs-Cooperative/Strata-API-PHP" target="_blank">github.com</a>)'); -define('API_WHOIS_API_URL_LABEL', 'IP+Domain WhoIS API (see: <a href="https://github.com/Chronolabs-Cooperative/WhoIS-API-PHP" target="_blank">github.com</a>)'); -define('API_WHOIS_API_URL_HELP', 'IP+Domain WhoIS API (see: <a href="https://github.com/Chronolabs-Cooperative/WhoIS-API-PHP" target="_blank">github.com</a>)'); -define('PATHS_EXTRA', 'Extra Settings'); -define('PATHS_EXTRA_TITLE', 'Extra Settings Configurations'); +define('PATHS_EXTRA', "Extra Settings"); +define('PATHS_EXTRA_TITLE', "Extra Settings + Configurations"); +define('API_WHOIS_API_URL_LABEL', 'URL for WhoIS API [ see: <a href="https://github.com/Chronolabs-Cooperative/Whois-API-PHP" target="_blank">github.com...</a> ]'); +define('API_WHOIS_API_URL_HELP', 'This is the URL for the WhoIS REST API from the Chronolabs Cooperative!'); +define('API_LOOKUPS_API_URL_LABEL', 'URL for Ipv4+Ipv6 Lookups API [ see: <a href="https://github.com/Chronolabs-Cooperative/Lookups-API-PHP" target="_blank">github.com...</a> ]'); +define('API_LOOKUPS_API_URL_HELP', 'This is the URL for the IP lookups REST API from the Chronolabs Cooperative!'); +define('API_STRATA_API_URL_LABEL', 'URL for Internet Strata API [ see: <a href="https://github.com/Chronolabs-Cooperative/Strata-API-PHP" target="_blank">github.com...</a> ]'); +define('API_STRATA_API_URL_HELP', 'This is the URL for the Internet Strata REST API from the Chronolabs Cooperative!'); define('SHOW_HIDE_HELP', 'Show/hide help text'); // License define('LICENSE_NOT_WRITEABLE', 'License file "%s" is NOT writable!'); Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php 2018-04-18 22:21:32 UTC (rev 13345) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_configsave.php 2018-04-24 14:44:00 UTC (rev 13346) @@ -57,7 +57,8 @@ 'GROUP_USERS' => 2, 'GROUP_ANONYMOUS' => 3); $rewrite = array_merge($rewrite, $vars); - + error_reporting(E_ALL); + ini_set('display_errors', true); $result = writeConfigurationFile($rewrite, $vars['ROOT_PATH'] . '/include', 'dbconfig.dist.php', 'dbconfig.php'); $GLOBALS['error'] = !($result === true); if ($result === true) { |
From: <chr...@us...> - 2018-04-24 18:01:53
|
Revision: 13348 http://sourceforge.net/p/xoops/svn/13348 Author: chronolabscoop Date: 2018-04-24 18:00:48 +0000 (Tue, 24 Apr 2018) Log Message: ----------- fonty.xoops.org - Fonts Repository REST API 2.8.2 - Last Major! Added Paths: ----------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Converting/ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Converting/index.html *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Repository/ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Sorting/ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Sorting/index.html *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Unpacking/ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Unpacking/index.html *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/index.html *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/index.html *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/crawling.json *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/constants.dist.php *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_extrasettings.php Removed Paths: ------------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/ Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Converting/index.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Converting/index.html (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Converting/index.html 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Converting/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Sorting/index.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Sorting/index.html (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Sorting/index.html 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Sorting/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Unpacking/index.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Unpacking/index.html (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Unpacking/index.html 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/Unpacking/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/index.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/index.html (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/index.html 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/Fonts/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/index.html =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/index.html (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/index.html 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/data/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/crawling.json =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/crawling.json (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/crawling.json 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1 @@ +null \ No newline at end of file Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/data/crawling.json ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/constants.dist.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/constants.dist.php (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/constants.dist.php 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1,23 @@ +<?php +/** + * API constants file + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright (c) 2000-2016 API Project (www.api.org) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + */ + +// Default Language Settings +if (!defined('API_LANGUAGE')) + define('API_LANGUAGE','english'); + +// API URL's for Functions +define('API_WHOIS_URL', ''); +define('API_LOOKUPS_URL', ''); +define('API_STRATA_URL', ''); Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/include/constants.dist.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_extrasettings.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_extrasettings.php (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_extrasettings.php 2018-04-24 18:00:48 UTC (rev 13348) @@ -0,0 +1,74 @@ +<?php +/** + * WhoIS REST Services API + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://syd.au.snails.email + * @license ACADEMIC APL 2 (https://sourceforge.net/u/chronolabscoop/wiki/Academic%20Public%20License%2C%20version%202.0/) + * @license GNU GPL 3 (http://www.gnu.org/licenses/gpl.html) + * @package whois-api + * @since 2.2.13 + * @author Dr. Simon Antony Roberts <simon@snails.email> + * @version 2.2.14 + * @description A REST API Interface which retrieves IPv4, IPv6, TLD, gLTD Whois Data + * @link http://internetfounder.wordpress.com + * @link https://github.com/Chronolabs-Cooperative/WhoIS-API-PHP + * @link https://sourceforge.net/p/chronolabs-cooperative + * @link https://facebook.com/ChronolabsCoop + * @link https://twitter.com/ChronolabsCoop + * + */ + + +require_once './include/common.inc.php'; +defined('API_INSTALL') || die('API Installation wizard die'); + +$wizard->loadLangFile('extras'); + +include_once './include/functions.php'; + +$pageHasForm = true; +$pageHasHelp = true; + +if ($_SERVER['REQUEST_METHOD'] === 'GET' && @$_GET['var'] && @$_GET['action'] === 'checkfile') { + $file = $_GET['var']; + echo genPathCheckHtml($file, is_file($file)); + exit(); +} +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $enabled = array(); + foreach($wizard->configs['apiurl'] as $setting => $values) + { + $_SESSION['constants'][$setting]['url'] = $_POST[$setting]; + } + $wizard->redirectToPage('+1'); + return 302; +} +ob_start(); +?> + <div class="panel panel-info"> + <div class="panel-heading"><?php echo API_EXTRAS; ?></div> + <div class="panel-body"> + <div class="form-group"> + <?php + foreach($wizard->configs['apiurl'] as $setting => $default) + {?> + <label for="<?php echo $setting; ?>"><?php echo constant("API_".strtoupper($setting) . "_API_URL_LABEL"); ?></label> + <div class="xoform-help alert alert-info"><?php echo constant("API_".strtoupper($setting) . "_API_URL_HELP"); ?></div> + <input type="text" class="form-control" name="<?php echo $setting; ?>" id="<?php echo $setting; ?>" value="<?php echo $default; ?>"/> + <?php } + ?> + </div> + </div> + +<?php +$content = ob_get_contents(); +ob_end_clean(); + +include './include/install_tpl.php'; Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/install/page_extrasettings.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property |
From: <chr...@us...> - 2018-07-31 17:31:33
|
Revision: 13386 http://sourceforge.net/p/xoops/svn/13386 Author: chronolabscoop Date: 2018-07-31 17:31:30 +0000 (Tue, 31 Jul 2018) Log Message: ----------- Additional SVN Font Picker Cronjob! Modified Paths: -------------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php Added Paths: ----------- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.2.tmp *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.tmp *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/pickings-fonts.php Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.2.tmp =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.2.tmp (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.2.tmp 2018-07-31 17:31:30 UTC (rev 13386) @@ -0,0 +1,4 @@ +Media Assests +--This line, and those below, will be ignored-- + +A /home/mynamesnot/Repositories/sourceforge.net/xoops-svn/*.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.2.tmp ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.tmp =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.tmp (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.tmp 2018-07-31 17:31:30 UTC (rev 13386) @@ -0,0 +1,4 @@ + +--This line, and those below, will be ignored-- + +A /home/mynamesnot/Repositories/sourceforge.net/xoops-svn/*.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/assets/media/svn-commit.tmp ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/pickings-fonts.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/pickings-fonts.php (rev 0) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/pickings-fonts.php 2018-07-31 17:31:30 UTC (rev 13386) @@ -0,0 +1,237 @@ +<?php +/** + * Chronolabs Fontages API + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @package fonts + * @since 1.0.2 + * @author Simon Roberts <wis...@us...> + * @version $Id: functions.php 1000 2013-06-07 01:20:22Z mynamesnot $ + * @subpackage cronjobs + * @description Screening API Service REST + */ + +$seconds = floor(mt_rand(1, floor(60 * 4.75))); +set_time_limit($seconds ^ 4); +sleep($seconds); + +ini_set('display_errors', true); +ini_set('log_errors', true); +error_reporting(E_ERROR); +define('MAXIMUM_QUERIES', 25); +ini_set('memory_limit', '315M'); +include_once dirname(__DIR__).'/constants.php'; +include_once dirname(__DIR__).'/include/functions.php'; +require_once dirname(__DIR__).'/class/fontsmailer.php'; + +if (!defined('API_FRONT_EXECSECS')) + define('API_FRONT_EXECSECS', (mt_rand(27, 60) * mt_rand(5, 8))); +if (!defined('API_PATH_CONTROLS')) + define('API_PATH_CONTROLS', API_PATH . DS . 'pickings-json'); +if (!is_dir(API_PATH_CONTROLS)) + mkdir(API_PATH_CONTROLS, 0777, true); +if (!defined('API_PATH_PICKINGS')) + define('API_PATH_PICKINGS', API_PATH . DS . 'Fonts' . DS . 'Pickings'); +if (!defined('API_PATH_MEXICAN')) + define('API_PATH_MEXICAN', date('W') . DS . date('Y') . DS . date('m') . DS . date('D') . DS . date('d')); + +if (!defined('API_JSON_STRUCTURES')) + define('API_JSON_STRUCTURES', 'https://sourceforge.net/p/chronolabs-cooperative/fonts/HEAD/tree/json/structures.json?format=raw'); +if (!defined('API_GET_SVNFILE')) + define('API_GET_SVNFILE', 'https://sourceforge.net/p/chronolabs-cooperative/fonts/HEAD/tree/%s?format=raw'); +if (!defined('API_EXPORT_SVNFILE')) + define('API_EXPORT_SVNFILE', 'svn export --force \"svn://svn.code.sf.net/p/chronolabs-cooperative/fonts/%s\" \"%s\"'); +if (!defined('API_FONTS_UPLOADED')) + define('API_FONTS_UPLOADED', 'eot|otf|ttf|woff|sfd|pf3|pfa|pfb|pt3|t42|gsf|gai'); + +set_time_limit(7200*99*25); +//shell_exec('rm -rf "' . API_PATH_PICKINGS . DS . '*"'); +$start = time(); +$structures = json_decode(getURIData(API_JSON_STRUCTURES, 480, 480, array()), true); +foreach($structures as $structmd5 => $structure) { + if ($structure['meter'] != 'all' && strlen($structure['meter']) == 3 && $structure['type'] == 'fonts') { + if (file_exists($jfile = API_PATH_CONTROLS . DS . 'fonts.md5s.' . substr($structure['meter'], 0, 2) . '.json')) { + $filemd5s = json_decode(file_get_contents($jfile), true); + } else + $filemd5s = array(); + if (!in_array($structmd5, $filemd5s)) { + if (file_exists($jfont = API_PATH_CONTROLS . DS . 'fonts.keys.' . substr($structure['meter'], 0, 2) . '.json')) { + $fontkeys = json_decode(file_get_contents($jfont), true); + } else + $fontkeys = array(); + $fonts = json_decode(getURIData(sprintf(API_GET_SVNFILE, $structure['path'] . DS . $structure['filename']), 480, 480, array()), true); + $files = json_decode(getURIData(sprintf(API_GET_SVNFILE, str_replace('fonts', 'files', $structure['path'] . DS . $structure['filename'])), 480, 480, array()), true); + foreach ($fonts as $fkey => $ffont) { + if (!in_array($ffont['key'], $fontkeys)) { + if (!is_dir($outpath = API_PATH_PICKINGS . DS . API_PATH_MEXICAN . DS . $ffont['key'])) + mkdir(API_PATH_PICKINGS . DS . API_PATH_MEXICAN . DS . $ffont['key'], 0777, true); + foreach(explode('|', API_FONTS_UPLOADED) as $fontext) { + foreach($files as $filename => $svnfile) { + if ($svnfile['extension'] == $fontext && $svnfile['key'] == $ffont['key']) { + echo "\nPicking Font Exporting: " . $svnfile['filename']; + $output = array(); + exec(sprintf(API_EXPORT_SVNFILE, $svnfile['path'] . DS . $svnfile['filename'], $ffile = $outpath . DS . $svnfile['filename']), $output); + echo implode("\n ~ ", $output); + if (md5_file($ffile) == $svnfile['md5']) { + $fontkeys[$ffont['key']] = $ffont['key']; + continue; + continue; + echo " ~ success exporting"; + } else + echo " ~ failed exporting"; + } + } + } + } + } + file_put_contents($jfont, json_encode($fontkeys)); + if ($start + API_FRONT_EXECSECS < time()) + { + continue; + } + } + if ($start + API_FRONT_EXECSECS < time()) + { + continue; + continue; + } else + $filemd5s[$structmd5] = $structmd5; + file_put_contents($jfile, json_encode($filemd5s)); + } +} + +$files = getCompleteFontsListAsArray(constant("API_PATH_PICKINGS")); +$data['files'] = array(); +foreach($files as $type => $fontfiles) +{ + $keys = array_keys($fontfiles); + shuffle($keys); shuffle($keys); shuffle($keys); + foreach($keys as $key) + $data['files'][$type][$key] = $fontfiles[$key]; +} +$files = $data['files']; +$size = 0; +foreach($files as $type => $fontfiles) +{ + foreach($fontfiles as $finger => $fontfile) + { + $size += filesize($fontfile); + } +} + +foreach($files as $type => $fontfiles) +{ + $GLOBALS['APIDB']->queryF($sql = "START TRANSACTION"); + foreach($fontfiles as $finger => $fontfile) + { + $copypath = FONT_RESOURCES_SORTING . DIRECTORY_SEPARATOR . API_LICENSE_EMAIL . DIRECTORY_SEPARATOR . microtime(true); + if (!is_dir($copypath)) + mkdir($copypath, 0777, true); + + if (!file_exists($copypath . DIRECTORY_SEPARATOR . basename($fontfile))&&filesize($fontfile)>199) + { + if (copy($fontfile, $copypath . DIRECTORY_SEPARATOR . strtolower(basename($fontfile)))) + { + if (file_exists($uploadfile = $copypath . DIRECTORY_SEPARATOR . strtolower(basename($fontfile)))) + { + @exec("cd $copypath", $out, $return); + @exec($exe = sprintf(DIRECTORY_SEPARATOR . "usr" . DIRECTORY_SEPARATOR . "bin" . DIRECTORY_SEPARATOR . "fontforge -script \"%s\" \"%s\"", dirname(__DIR__ ) . DIRECTORY_SEPARATOR . "include" . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "convert-fonts-upload.pe", $uploadfile), $out, $return); + deleteFilesNotListedByArray($copypath, array(API_BASE=>API_BASE, 'ufo'=>'ufo')); + unlink($fontfile); + $glyphsfingerprint = ''; + foreach(getFontsListAsArray($copypath) as $file) + if ($file['type']==API_BASE) + $uploadfile = $copypath . DIRECTORY_SEPARATOR . $file['file']; + elseif($file['type']=='ufo') { + $glyphs = array(); + $fileglyphs = getFileListAsArray($copypath . DIRECTORY_SEPARATOR . $file['file'] . DIRECTORY_SEPARATOR . 'glyphs'); + sort($fileglyphs); + foreach($fileglyphs as $glyph) + { + $glyphs[] = md5_file($copypath . DIRECTORY_SEPARATOR . $file['file'] . DIRECTORY_SEPARATOR . 'glyphs' . DIRECTORY_SEPARATOR . $glyph); + } + $glyphsfingerprint = md5(implode('', $glyphs)); + } + $fontdata = getBaseFontValueStore($uploadfile); + if (isset($fontdata['version'])) + $fontdata['version'] = $fontdata['version'] + 1.001; + $fontdata['person'] = $data['form']['name']; + $fontdata['company'] = $data['form']['bizo']; + $fontdata['uploaded'] = microtime(true); + $fontdata['licence'] = API_LICENCE; + writeFontRepositoryHeader($uploadfile, API_LICENCE, $fontdata); + $data = file($uploadfile); + $found = false; + foreach($data as $line => $value) + if (!strpos(" $value", 'currentfile eexec') && $found == false) + unset($data[$line]); + elseif (strpos(" $value", 'currentfile eexec') && $found == false) { + unset($data[$line]); + $found = true; + } + $fingerprint = md5(implode("", $data)); + + if (!empty($glyphsfingerprint)) + { + $sql = "SELECT count(*) FROM `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` WHERE `fingerprint` LIKE '" . $glyphsfingerprint . "'"; + list($gfingers) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql)); + } + $sql = "SELECT count(*) FROM `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` WHERE `fingerprint` LIKE '" . $fingerprint . "'"; + list($fingers) = $GLOBALS['APIDB']->fetchRow($GLOBALS['APIDB']->queryF($sql)); + if ($fingers==0 && $gfingers == 0) + { + $ffile++; + $data['process'] = microtime(true); + $data['mode'] = 'queuing'; + $data['current'] = $copypath . DIRECTORY_SEPARATOR . strtolower(basename($uploadfile)); + $queued[] = $fontfile; + $sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('uploads') . "` (`ip_id`, `available`, `key`, `scope`, `prefix`, `email`, `uploaded_file`, `uploaded_path`, `uploaded`, `referee_uri`, `callback`, `bytes`, `batch-size`, `datastore`, `cc`, `bcc`, `frequency`, `elapses`, `longitude`, `latitude`) VALUES ('$ipid','" . $available = mt_rand(7,13) . "','" . basename(dirname(dirname($fontfile))) . "','none','" . 'webdav'. "','" . $GLOBALS['APIDB']->escape($email = API_LICENSE_EMAIL) . "','" . $GLOBALS['APIDB']->escape($filename = strtolower(basename($uploadfile))) . "','" . $GLOBALS['APIDB']->escape($copypath) . "','" . time(). "','" . $GLOBALS['APIDB']->escape($_SERVER['HTTP_REFERER']) . "','" . $GLOBALS['APIDB']->escape($callback = '') . "'," . (filesize($uploadfile)==''?0:filesize($uploadfile)) . "," . $size . ",'" . $GLOBALS['APIDB']->escape(json_encode(array('scope' => '', 'ipsec' => $locality = json_decode(array()), 'name' => API_LICENSE_COMPANY, 'bizo' => API_LICENSE_COMPANY, 'batch-size' => $size, 'font' => $fontdata))) . "','$ccid','$bccid','" . $GLOBALS['APIDB']->escape($freq = mt_rand(2.76,6.75)*3600*24) . "','" . $GLOBALS['APIDB']->escape($elapse = mt_rand(9,27)*3600*24) . "','". (!isset($_SESSION['locality']['location']["coordinates"]["longitude"])?"0.0001":$_SESSION['locality']['location']["coordinates"]["longitude"])."','". (!isset($_SESSION['locality']['location']["coordinates"]["latitude"])?"0.0001":$_SESSION['locality']['location']["coordinates"]["latitude"])."')"; + if ($GLOBALS['APIDB']->queryF($sql)) + { + $uploadid = $GLOBALS['APIDB']->getInsertId(); + if ($scope == 'none') + { + $sql = "UPDATE `" . $GLOBALS['APIDB']->prefix('uploads') . "` SET `quizing` = UNIX_TIMESTAMP(), `expired` = UNIX_TIMESTAMP()+1831, `slotting` = 0, `needing` = 1, `finished` = 2, `surveys` = 2, `available` = 0 WHERE `id` = $uploadid"; + $GLOBALS['APIDB']->queryF($sql); + } + echo "\nCreated Upload Identity: ".$uploadid; + $sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` (`type`, `upload_id`, `fingerprint`) VALUES ('" . $GLOBALS['APIDB']->escape(API_BASE) . "','" . $GLOBALS['APIDB']->escape($uploadid) . "','" . $GLOBALS['APIDB']->escape($glyphsfingerprint) . "')"; + if (!$GLOBALS['APIDB']->queryF($sql)) + echo "SQL Failed: $sql;\n"; + $sql = "INSERT INTO `" . $GLOBALS['APIDB']->prefix('fonts_fingering') . "` (`type`, `upload_id`, `fingerprint`) VALUES ('" . $GLOBALS['APIDB']->escape(API_BASE) . "','" . $GLOBALS['APIDB']->escape($uploadid) . "','" . $GLOBALS['APIDB']->escape($fingerprint) . "')"; + if (!$GLOBALS['APIDB']->queryF($sql)) + echo "SQL Failed: $sql;\n"; + $success[] = basename($fontfile); + $data['success'][] = basename($fontfile); + if (isset($data['form']['callback']) && !empty($data['form']['callback'])) + @setCallBackURI($data['form']['callback'], 145, 145, array('action'=>'uploaded', 'file-md5' => $finger, 'allocated' => $available, 'key' => $key, 'email' => $data['form']['email'], 'name' => $data['form']['name'], 'bizo' => $data['form']['bizo'], 'frequency' => $freq, 'elapsing' => $elapses, 'filename' => $filename, 'culled' => false)); + $GLOBALS["APIDB"]->queryF('UPDATE `' . $GLOBALS['APIDB']->prefix('networking') . '` SET `fonts` = `fonts` + 1 WHERE `ip_id` = "'.$ipid.'"'); + echo "\nUploaded file Queued: ".basename($fontfile); + unlink($uploadfile); + rmdir(dirname($uploadfile)); + } else { + echo ("SQL Failed: $sql;\n"); + } + $GLOBALS['APIDB']->queryF($sql = "COMMIT"); + $GLOBALS['APIDB']->queryF($sql = "START TRANSACTION"); + } + } + } + } + } + $GLOBALS['APIDB']->queryF($sql = "COMMIT"); + sleep(mt_rand(2,7)); +} + +deleteFilesNotListedByArray(API_PATH_PICKINGS, explode('|', API_FONTS_UPLOADED)); +removeEmptyPathFolderList(API_PATH_PICKINGS); + +?> Property changes on: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/crons/pickings-fonts.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php =================================================================== --- *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php 2018-07-31 04:23:30 UTC (rev 13385) +++ *.xoops.org (Subdomain APIs & Sites)/fonty.xoops.org/include/functions.php 2018-07-31 17:31:30 UTC (rev 13386) @@ -206,6 +206,25 @@ } +if (!function_exists("removeEmptyPathFolderList")) { + function removeEmptyPathFolderList($dirname, $result = array()) + { + $folders = array_keys(getCompleteDirListAsArray($dirname)); + $result = array(); + sort($folders, SORT_DESC); + foreach($folders as $path) + { + while($path != $dirname) { + if (rmdir($path)) + $result[$path] = $path; + $path = dirname($path); + } + } + return $result; + } + +} + if (!function_exists("getCompleteHistoryListAsArray")) { function getCompleteHistoryListAsArray($dirname, $result = array()) { |