$vars_out = array(); $text_out = array(); foreach ($d as $row) { list($key) = explode('.', $row['image']); $out[$key] = array(array(calc_bytes($row['unified'])), calc_bytes($row['softbank']), calc_bytes($row['google']), $row['short_names'], $row['sheet_x'], $row['sheet_y'], calc_img_has($row), 0); if ($row['text']) { $out[$key][] = $row['text']; } if (count($row['texts'])) { foreach ($row['texts'] as $txt) { $text_out[$txt] = $row['short_name']; } } if (count($row['variations'])) { foreach ($row['variations'] as $var) { array_unshift($out[$key][0], calc_bytes($var)); } } if (count($row['skin_variations'])) { foreach ($row['skin_variations'] as $row2) { list($key) = explode('.', $row2['image']); $vars_out[$key] = array($row2['sheet_x'], $row2['sheet_y'], calc_img_has($row2)); } } } $json = pretty_print_json($out); $json_vars = pretty_print_json($vars_out); $json_text = pretty_print_json($text_out); # # calc sheet size #
$InputName_License = "license"; $InputName_Accept = "accept"; ${$InputName_Accept} = getVar($InputName_Accept); $InputName_Reg = "reg"; ${$InputName_Reg} = getVar($InputName_Reg); $InputName_RegMsg = "regmsg"; ${$InputName_RegMsg} = getVar($InputName_RegMsg); /***********************************************************/ /***********************************************************/ $set = getVar("set"); $check = false; /***********************************************************/ //get infos /***********************************************************/ $php_sapi = php_sapi_name(); $php_os = php_uname(); //PHP_OS $mem = calc_bytes(ini_get("memory_limit")); $exec_time = ini_get("max_execution_time"); /***********************************************************/ /***********************************************************/ $created = date("Y-m-d H:i:s"); if (DEBUG) { $debug_translated = array(); } if (DEBUG) { $debug_not_translated = array(); } if (DEBUG) { $debug_same_translated = array(); }
<?php $in = file_get_contents('emoji.json'); $d = json_decode($in, true); # # build the catalog # $out = array(); foreach ($d as $row) { list($key) = explode('.', $row['image']); $out[$key] = array(calc_bytes($row['unified']), $row['short_names']); if ($row['text']) { $out[$key][] = $row['text']; } } $json = json_encode($out); $json = str_replace('\\\\u', '\\u', $json); echo $json; # # turn 0+ codepoints into a JS string # function calc_bytes($codes) { if (!$codes) { return ''; } $out = ''; $codes = explode('-', $codes); foreach ($codes as $code) { $out .= format_codepoint($code); }
/***********************************************************/ $allowed_html_filetypes = "(htm|html|txt)"; $allowed_image_filetypes = "(jpg|jpeg)"; $allowed_trackimage_filetypes = "(jpg|jpeg|png)"; $allowed_csv_filetypes = "(csv|txt)"; $max_upload_size = 2048000; //2M if (DEMO) { $max_upload_size = 2048; } //2k /***********************************************************/ //limits /***********************************************************/ $adr_row_limit = 500; $available_mem = calc_bytes(ini_get("memory_limit")); if ($available_mem == 0) { //we have unlimted memory, but set a limit here $adr_row_limit = 5000; //5k is enough :) like having ~48mb of ram } if ($available_mem >= 8 * 1024 * 1024) { //8M $adr_row_limit = 750; } if ($available_mem >= 16 * 1024 * 1024) { $adr_row_limit = 1500; } if ($available_mem >= 24 * 1024 * 1024) { $adr_row_limit = 2500; }