function encode_combine($str) { $db = new db_query('SELECT "5529e6b0760d73d38d3d3a5bb33e3eaf" as kdm_hash1, kdims.* FROM kdims LIMIT 1'); $hash = mysqli_fetch_assoc($db->result); unset($db); $string = str_rot13(str_rot13($hash['kdm_hash1']) . base64_url_encode($str)); return base64_encode($string); }
function generate_signed_request($data, $secret) { // always present, and always at the top level $data['algorithm'] = 'HMAC-SHA256'; $data['issued_at'] = time(); // sign it $payload = base64_url_encode(json_encode($data)); $sig = base64_url_encode(hash_hmac('sha256', $payload, $secret, $raw = true)); return $sig . '.' . $payload; }
function universalfetchElement($name, $value, &$node) { $document =& JFactory::getDocument(); if (version_compare(JVERSION, '3.0.0', 'lt')) { $document->addStyleSheet(JURI::base() . '../modules/' . $this->_moduleName . '/params/css/offlajn.css'); } else { $document->addStyleSheet(JURI::base() . '../modules/' . $this->_moduleName . '/params/css/offlajnj30.css'); } $xml = dirname(__FILE__) . DS . '../' . $this->_moduleName . '.xml'; if (!file_exists($xml)) { $xml = dirname(__FILE__) . DS . '../install.xml'; if (!file_exists($xml)) { return; } } if (version_compare(JVERSION, '3.0.0', 'lt')) { $xml = simplexml_load_file($xml); $hash = (string) $xml->hash; $this->label = (string) $xml->name; if ($hash == '') { return; } return '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update&hash=' . base64_url_encode($hash) . '&v=' . $xml->version . '&u=' . JURI::root() . '" frameborder="no" style="border: 0;" width="100%" height="30"></iframe>'; } if (version_compare(JVERSION, '3.0', 'ge')) { $xmlo = JFactory::getXML($xml); $xmld = $xmlo; } else { jimport('joomla.utilities.simplexml'); $xmlo = JFactory::getXMLParser('Simple'); $xmlo->loadFile($xml); $xmld = $xmlo->document; } if (isset($xmld->hash)) { if (version_compare(JVERSION, '3.0', 'ge')) { $hash = (string) $xmld->hash[0] ? (string) $xmld->hash[0] : (string) $xmld->hash; $this->label = (string) $xmld->name[0]; } else { $hash = (string) $xmld->hash[0]->data(); } } if (!isset($hash)) { $this->generalInfo = '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update_info&v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '" frameborder="no" style="border: 0;" width="100%" height="200px" ></iframe>'; $this->relatedNews = '<iframe id="related-news-iframe" src="http://offlajn.com/index2.php?option=com_offlajn_related_news" frameborder="no" style="border: 0;" width="100%" ></iframe>'; } else { $this->generalInfo = '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update_info&hash=' . base64_url_encode($hash) . '&v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '&u=' . JURI::root() . '" frameborder="no" style="border: 0;" width="100%" height="200px" ></iframe>'; $this->relatedNews = '<iframe id="related-news-iframe" src="http://offlajn.com/index2.php?option=com_offlajn_related_news&tag=Universal AJAX Live Search" frameborder="no" style="border: 0;" width="100%" ></iframe>'; } $this->loadDashboard(); return $this->offlajnDashboard; }
function generate_signed_request($data, $secret, $encrypt = false) { // wrap data inside payload if we are encrypting if ($encrypt) { $cipher = MCRYPT_RIJNDAEL_128; $mode = MCRYPT_MODE_CBC; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, $mode), MCRYPT_DEV_URANDOM); $data = array('payload' => base64_url_encode(mcrypt_encrypt($cipher, $secret, json_encode($data), $mode, $iv)), 'iv' => base64_url_encode($iv)); } // always present, and always at the top level $data['algorithm'] = $encrypt ? 'AES-256-CBC HMAC-SHA256' : 'HMAC-SHA256'; $data['issued_at'] = time(); // sign it $payload = base64_url_encode(json_encode($data)); $sig = base64_url_encode(hash_hmac('sha256', $payload, $secret, $raw = true)); return $sig . '.' . $payload; }
function cr($texto, $senha = "1nqv3w5", $iv_len = 16) { $texto .= "\x13"; $n = strlen($texto); if ($n % 16) $texto .= str_repeat("\0", 16 - ($n % 16)); $i = 0; $Enc_Texto = randomizar($iv_len); $iv = substr($senha ^ $Enc_Texto, 0, 512); while ($i < $n) { $Bloco = substr($texto, $i, 16) ^ pack('H*', md5($iv)); $Enc_Texto .= $Bloco; $iv = substr($Bloco . $iv, 0, 512) ^ $senha; $i += 16; } $x = base64_url_encode($Enc_Texto); return $x; }
function generate_signed_request($data, $secret) { // always present, and always at the top level $data['algorithm'] = 'HMAC-SHA256'; $data['issued_at'] = time(); if ($_SERVER['BAD_ALGO']) { $data['algorithm'] = 'junky_junk'; } if ($_SERVER['BAD_TIME']) { $data['issued_at'] = -10000; } if ($_SERVER['OLD_TIME']) { $data['issued_at'] = time() - 3601; } // sign it $payload = base64_url_encode(json_encode($data)); $sig = base64_url_encode(hash_hmac('sha256', $payload, $secret, $raw = true)); if ($_SERVER['BAD_SIG']) { $sig = 'junky_junk'; } return $sig . '.' . $payload; }
include 'db.php'; $email = $_POST['email']; // Password Encryption, If you like you can also leave sha1. $result = mysql_query("SELECT name FROM registration WHERE email='{$email}'"); $data = mysql_num_rows($result); //$row =mysql_fetch_array($result); if ($data == 0) { echo "Invalid email"; } else { $row = mysql_fetch_array($result); //$email=$row['email']; $sender_name = "Sunstone Business School"; $sender = "*****@*****.**"; $to = $email; $subject = "Password reset request on sunstone.in"; $email = base64_url_encode($email); $message = "<p>Hi " . $name . ",</p>\n \n \n <p>We received a request to change your password on http://sunstone.in/,\n if you authorize it Click here to change your password\n http://sunstone.editsoft.in/resetpassword.php?info=" . $email . "\n </p>\n <p>Otherwise ignore this email.</p>\n\n <p> </p>\n\n <p>Thanks,<br />\n Sunstone Team<br />\n </p>\n "; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From:' . $sender_name . '<' . $sender . '>' . "\r\n"; $result = mail($to, $subject, $message, $headers); // echo "<h3>Please Check your mail<h3>"; echo "<script type='text/javascript'>\n\t\t\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\t\$('#myModalemail').modal('show');\n\t\t\t\t });\n\t\t\t\t\t\t</script>"; } } ?> </div> </div>
<a href="' . $root . '/profile/' . $row[0] . '">Visit profile</a><br /> </div> </div> '; } /* $people = $people.' </div> </div> </div> </div> </div>';*/ pg_freeresult($result); // md5 for venues_search_people $key = '371555a819ed7a48f8c117e4cf6832a3'; $people_results = base64_url_encode(encrypt($people, $key)); header("Location: " . $root . "/search/people/" . $people_results); /* $p1 = encrypt($people, $key); echo "1) ".$p1."<br />"; //echo '<script type="text/javascript">alert('.$people_results.')</script>'; $p2 = base64_url_encode($p1); echo "2) ".$p2."<br />"; //echo "<script type='text/javascript'>console.log('people_results: ".$people_results.")</script>"; $p3 = base64_url_decode($p2); echo "3) ".$p3."<br />"; //echo "<script type='text/javascript'>console.log('people_results: ".$decoded.")</script>"; $p4 = decrypt($p3, $key); echo "4) ".$p4."<br />5)"; //echo "<script type='text/javascript'>console.log('people_results: ".$decoded.")</script>";
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) && isset($_SESSION['captcha'], $_POST['captcha']) && $_POST['captcha'] == $_SESSION['captcha']) { $email = trim(filter_var($_POST['email'], FILTER_SANITIZE_STRING)); $sql = "select username,concat_ws(' ',fname,lname) as 'fullname' from user where email=:em and type=1"; $stmt = $pdo->prepare($sql); $stmt->bindvalue(':em', $email, PDO::PARAM_STR); $stmt->execute(); if ($stmt->rowCount()) { $user = $stmt->fetch(PDO::FETCH_ASSOC); $username = $user['username']; $fullname = $user['fullname']; $_SESSION['timeout'] = time(); $password = ''; $rsa->loadKey($privateKey); $ciphertext = $rsa->encrypt($username); $ciphertext_session = $ciphertext; $ciphertext = base64_url_encode($ciphertext); #================================== require 'phpmailer/PHPMailerAutoload.php'; $mail = new PHPMailer(); $mail->isSMTP(); //$mail->SMTPDebug = 1; $mail->Host = 'ssl://smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = ''; // SMTP username $mail->Password = ''; // SMTP password $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
protected function defaultAssingns() { parent::defaultAssingns(); $this->assign('__jsFiles', base64_url_encode(gzcompress(serialize($this->jsFiles)))); $this->assign('__cssFiles', base64_url_encode(gzcompress(serialize($this->cssFiles)))); $this->assign('__customJsFiles', $this->customJsFiles); $this->assign('__customCssFiles', $this->customCssFiles); }
function url_encrypt($url, $key = false) { if ($key) { $url = str_rot_pass($url, $key); } else { if (Config::get('encryption_key')) { $url = str_rot_pass($url, Config::get('encryption_key')); } } return Config::get('url_mode') ? base64_url_encode($url) : rawurlencode($url); }
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { $ckey_length = 4; $key = md5($key ? $key : C('AUTH_KEY')); $keya = md5(substr($key, 0, 16)); $keyb = md5(substr($key, 16, 16)); $keyc = $ckey_length ? $operation == 'DECODE' ? substr($string, 0, $ckey_length) : substr(md5(microtime()), -$ckey_length) : ''; $cryptkey = $keya . md5($keya . $keyc); $key_length = strlen($cryptkey); $string = $operation == 'DECODE' ? base64_url_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $keyb), 0, 16) . $string; $string_length = strlen($string); $result = ''; $box = range(0, 255); $rndkey = array(); for ($i = 0; $i <= 255; $i++) { $rndkey[$i] = ord($cryptkey[$i % $key_length]); } for ($j = $i = 0; $i < 256; $i++) { $j = ($j + $box[$i] + $rndkey[$i]) % 256; $tmp = $box[$i]; $box[$i] = $box[$j]; $box[$j] = $tmp; } for ($a = $j = $i = 0; $i < $string_length; $i++) { $a = ($a + 1) % 256; $j = ($j + $box[$a]) % 256; $tmp = $box[$a]; $box[$a] = $box[$j]; $box[$j] = $tmp; $result .= chr(ord($string[$i]) ^ $box[($box[$a] + $box[$j]) % 256]); } if ($operation == 'DECODE') { if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16)) { return substr($result, 26); } else { return ''; } } else { return $keyc . base64_url_encode($result); } }
/** * Returns the user avatar in HTML string format * * @param string $group_name * @return string address in HTML format */ function getAvatarAsHTML($padding = "", $border = false, $withname = false) { global $service_host; $w = 80; $h = 80; $addr = $this->getAvatar(); $namesurname = $this->getNameSurname(); $style = ""; if (!empty($padding) && is_int($padding)) { $style .= "padding:{$padding}px;"; } if ($border) { $style .= "border: 1px dotted #f00;"; } if ($withname) { $addr = $service_host . "avatar.php?q=" . base64_url_encode($namesurname . "::::" . $addr); $h = 100; } $html = sprintf("<img src=\"%s\" width=\"{$w}\" height=\"{$h}\" border=\"0\" alt=\"%s\" style=\"%s\" />", $addr, $namesurname, $style); return $html; }
function base64_encrypt($data, $key = false) { if ($key) { $data = str_rot_pass($data, $key); } else { if (Config::get('encryption_key')) { $data = str_rot_pass($data, Config::get('encryption_key')); } } return base64_url_encode($data); }
function universalfetchElement($name, $value, &$node) { define("OFFLAJNADMIN", "1"); $this->loadFiles(); $this->loadFiles('legacy', 'offlajndashboard'); $j17 = 0; if (version_compare(JVERSION, '1.6.0', 'ge')) { $j17 = 1; } $style = ""; $opened_ids = json_decode(stripslashes(@$_COOKIE[$this->_moduleName . "lastState"])); if ($opened_ids) { foreach ($opened_ids as $id) { $style .= '#content-box #' . $id . ' div.content{' . 'opacity: 1;' . 'height: 100%;' . '}'; } } $document =& JFactory::getDocument(); $document->addStyleDeclaration($style); DojoLoader::r('dojo.uacss'); DojoLoader::addScript(' var offlajnParams = new OfflajnParams({ joomla17 : ' . $j17 . ', moduleName : "' . $this->_moduleName . '" }); '); $lang =& JFactory::getLanguage(); $lang->load($this->_moduleName, dirname(__FILE__) . DS . '..' . DS . '..'); $xml = dirname(__FILE__) . DS . '../../' . $this->_moduleName . '.xml'; if (!file_exists($xml)) { $xml = dirname(__FILE__) . DS . '../../install.xml'; if (!file_exists($xml)) { return; } } if (version_compare(JVERSION, '3.0', 'ge')) { $xmlo = JFactory::getXML($xml); $xmld = $xmlo; } else { jimport('joomla.utilities.simplexml'); $xmlo = JFactory::getXMLParser('Simple'); $xmlo->loadFile($xml); $xmld = $xmlo->document; } if (isset($xmld->hash) && (string) $xmld->hash) { if (version_compare(JVERSION, '3.0', 'ge')) { $hash = (string) $xmld->hash[0]; } else { $hash = (string) $xmld->hash[0]->data(); } } $this->attr = $node->attributes(); if (!isset($hash)) { $this->generalInfo = '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update_info&v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '" frameborder="no" style="border: 0;" width="100%"></iframe>'; $this->relatedNews = '<iframe id="related-news-iframe" src="http://offlajn.com/index2.php?option=com_offlajn_related_news&tag=' . @$this->attr['blogtags'] . '" frameborder="no" style="border: 0;" width="100%" ></iframe>'; } else { $this->generalInfo = '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update_info&hash=' . base64_url_encode($hash) . '&v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '&u=' . JURI::root() . '" frameborder="no" style="border: 0;" width="100%"></iframe>'; $this->relatedNews = '<iframe id="related-news-iframe" src="http://offlajn.com/index2.php?option=com_offlajn_related_news&tag=' . @$this->attr['blogtags'] . '" frameborder="no" style="border: 0;" width="100%" ></iframe>'; } $this->loadDashboard(); if (!version_compare(JVERSION, '1.6.0', 'ge')) { preg_match('/(.*)\\[([a-zA-Z0-9]*)\\]$/', $name, $out); @($control = $out[1]); $x = file_get_contents($xml); preg_match('/<fieldset.*?>(.*)<\\/fieldset>/ms', $x, $out); $params = str_replace(array('<field', '</field'), array('<param', '</param'), $out[0]); $n = new JSimpleXML(); $n->loadString($params); $attrs = $n->document->attributes(); if ($_REQUEST['option'] == 'com_modules' || $_REQUEST['option'] == 'com_advancedmodules') { $n->document->removeChild($n->document->param[0]); $params = new OfflajnJParameter(''); $params->setXML($n->document); $params->_raw =& $this->_parent->_raw; $params->bind($this->_parent->_raw); echo $params->render($control); } } if (!isset($hash) || $hash == '') { return; } return ""; }
public function bind_action() { if (AWS_APP::session()->weibo_user) { $weibo_user_info = AWS_APP::session()->weibo_user; unset(AWS_APP::session()->weibo_user); } if ($_GET['error'] == 'access_denied') { H::redirect_msg(AWS_APP::lang()->_t('授权失败'), '/account/login/'); } if ($this->user_id) { $weibo_user = $this->model('openid_weibo_oauth')->get_weibo_user_by_uid($this->user_id); if ($weibo_user) { H::redirect_msg(AWS_APP::lang()->_t('此账号已绑定微博账号'), '/account/login/'); } } $callback_url = '/account/openid/weibo/bind/'; if ($_GET['return_url']) { $callback_url .= 'return_url-' . $_GET['return_url']; } if ($_GET['code']) { if ($_GET['code'] != $weibo_user_info['authorization_code']) { $this->model('openid_weibo_oauth')->authorization_code = $_GET['code']; $this->model('openid_weibo_oauth')->redirect_url = $callback_url; if (!$this->model('openid_weibo_oauth')->oauth2_login()) { H::redirect_msg($this->model('openid_weibo_oauth')->error_msg, '/account/login/'); } $weibo_user_info = $this->model('openid_weibo_oauth')->user_info; } if (!$weibo_user_info) { H::redirect_msg(AWS_APP::lang()->_t('微博登录失败,用户信息不存在'), '/account/login/'); } $weibo_user = $this->model('openid_weibo_oauth')->get_weibo_user_by_id($weibo_user_info['id']); if ($this->user_id) { if ($weibo_user) { H::redirect_msg(AWS_APP::lang()->_t('此微博账号已被绑定'), '/account/login/'); } $this->model('openid_weibo_oauth')->bind_account($weibo_user_info, $this->user_id); if (!$this->model('integral')->fetch_log($this->user_id, 'BIND_OPENID')) { $this->model('integral')->process($this->user_id, 'BIND_OPENID', round(get_setting('integral_system_config_profile') * 0.2), '绑定 OPEN ID'); } HTTP::redirect('/account/setting/openid/'); } else { if ($weibo_user) { $user = $this->model('account')->get_user_info_by_uid($weibo_user['uid']); if (!$user) { $this->model('openid_weibo_oauth')->unbind_account($weibo_user['uid']); H::redirect_msg(AWS_APP::lang()->_t('本地用户不存在'), '/account/login/'); } $this->model('openid_weibo_oauth')->update_user_info($weibo_user['id'], $weibo_user_info); if (get_setting('register_valid_type') == 'approval' and $user['group_id'] == 3) { $redirect_url = '/account/valid_approval/'; } else { if ($_GET['state']) { $state = base64_url_decode($_GET['state']); } if (get_setting('ucenter_enabled') == 'Y') { $redirect_url = '/account/sync_login/'; if ($state['return_url']) { $redirect_url .= 'url-' . base64_encode($state['return_url']); } } else { if ($state['return_url']) { $redirect_url = $state['return_url']; } else { $redirect_url = '/'; } } HTTP::set_cookie('_user_login', get_login_cookie_hash($user['user_name'], $user['password'], $user['salt'], $user['uid'], false)); if (get_setting('register_valid_type') == 'email' and !$user['valid_email']) { AWS_APP::session()->valid_email = $user['email']; } } HTTP::redirect($redirect_url); } else { switch (get_setting('register_type')) { case 'close': H::redirect_msg(AWS_APP::lang()->_t('本站目前关闭注册'), '/account/login/'); break; case 'invite': H::redirect_msg(AWS_APP::lang()->_t('本站只能通过邀请注册'), '/account/login/'); break; case 'weixin': H::redirect_msg(AWS_APP::lang()->_t('本站只能通过微信注册'), '/account/login/'); break; } AWS_APP::session()->weibo_user = $weibo_user_info; $this->crumb(AWS_APP::lang()->_t('完善资料'), '/account/login/'); TPL::assign('register_url', 'account/ajax/weibo/register/'); $user_name = str_replace('-', '', AWS_APP::session()->weibo_user['screen_name']); while ($this->model('account')->check_username($user_name) || !$this->model('account')->is_valid_username($user_name) || $this->model('account')->check_username_sensitive_words($user_name)) { $user_name = $this->model('account')->random_username(); } TPL::assign('user_name', $user_name); TPL::assign('sns_type', 'weibo'); TPL::import_css('css/register.css'); TPL::output('account/openid/callback'); } } } else { $state = $_GET['return_url'] ? base64_url_encode(array('return_url' => base64_decode($_GET['return_url']))) : null; HTTP::redirect($this->model('openid_weibo_oauth')->get_redirect_url('/account/openid/weibo/bind/', $state)); } }
static function thumbImageWithBackground($imageSource, $width = 0, $height = 0, $limit_size = 0, $max = false, $itemTitle = '', $have_title = 0) { if ($max) { $w_max = 960; //$h_max = 777; $h_max = 500; $quality = 80; } else { $quality = 100; } if ($imageSource == '' || !file_exists(EnBacImage::$path . UP_FOLDER . "/" . $imageSource) || !$max && !$height && !$width) { header("HTTP/1.0 404 Not Found"); echo "<h1>404 - Not Found!!</h1>"; exit; } $file_ext = self::getExtension($imageSource); if ($max) { $thumbDir = "thumb_max/"; if ($have_title) { if ($itemTitle != '') { function base64_url_encode($input) { return str_replace('=', '', strtr(base64_encode($input), '+/', '-_')); } $have_title = ',' . base64_url_encode($itemTitle); } else { $have_title = ','; } /*if(strlen(basename($imageSource,$file_ext).$have_title.$file_ext)>=255){ $thumbDir=''; } */ } else { $have_title = ''; } } elseif ($height && $width) { $thumbDir = "thumb/{$width}_{$height}/"; } elseif ($width) { $thumbDir = "thumb_w" . ($limit_size ? "l" : "") . "/{$width}/"; } $get_direct_img = false; if (CACHE_ON) { $tempCacheDir = ''; $tempCacheFile = ''; $cacheDir = $thumbDir . dirname($imageSource) . '/'; $tempCacheDir = IMG_TEMP_DIR . $cacheDir; if ($max) { $cache_file = $cacheDir . basename($imageSource, $file_ext) . $have_title . $file_ext; $tempCacheFile = $tempCacheDir . basename($imageSource, $file_ext) . $have_title . $file_ext; } else { $cache_file = $thumbDir . $imageSource; $tempCacheFile = $tempCacheDir . basename($imageSource); } $checkCacheFile = CHECK_PATH . $cache_file; //Lấy cache ra: if (@file_exists($checkCacheFile)) { @header("Location: " . IMG_CACHE_URL . $cache_file); exit; } } $thumbImage =& new EnBacImage(); $thumbImage->loadfile(UP_FOLDER . "/" . $imageSource, $get_direct_img); if (!$thumbImage || !$thumbImage->height || !$thumbImage->width) { header("HTTP/1.0 404 Not Found"); echo "<h1>404 - Not Found!!!</h1>"; exit; } if ($max) { //Chế độ view full ảnh $width = $thumbImage->width; $height = $thumbImage->height; if ($thumbImage->width > $w_max || $thumbImage->height > $h_max) { if ($thumbImage->width / $thumbImage->height <= $w_max / $h_max) { //Ảnh gốc cao hơn $h_max px $height = $h_max; $thumbImage->resizetoheight($height); $width = $thumbImage->width; } else { $width = $w_max; $thumbImage->resizetowidth($width); $height = $thumbImage->height; } } if ($thumbImage->width < 300 || $thumbImage->height < 250) { if ($thumbImage->width < 300) { $width = 300; } if ($thumbImage->height < 250) { $height = 250; } self::create_thumb($thumbImage, $width, $height); } self::logo_paint($thumbImage, $width, $height, $itemTitle); } else { self::create_thumb($thumbImage, $width, $height, $limit_size); self::logo_paint($thumbImage, $width, $height); } if (CACHE_ON && $cache_file) { if (FTP_CACHE && $tempCacheFile && ImageLib::CheckDir($tempCacheDir) && ImageLib::ftp_check_dir($cacheDir)) { //Che do ghi cache qua ftp $thumbImage->savefile($tempCacheFile, $quality); if (@file_exists($tempCacheFile)) { //upload file via ftp ImageLib::ftp_image_delete_file($cache_file); ImageLib::ftp_image_put_file($cache_file, $tempCacheFile); @unlink($tempCacheFile); ImageLib::ftp_image_close(); } } elseif (ImageLib::CheckDir($cacheDir)) { $thumbImage->savefile($cache_file, $quality); } if (!FIRST_SHOW_IMAGE && @file_exists($checkCacheFile)) { @header("Location: " . IMG_CACHE_URL . $cache_file); imagedestroy($thumbImage->ImageStream); exit; } } //show img if (SET_HEADER) { //standard method # header('HTTP/1.0 200 OK'); //HTTP/1.1 200 OK //CGI method # header('Status: 200 OK'); header("Expires: "); header("Last-Modified: "); header('Cache-Control: public,max-age=2592000'); //Adjust maxage appropriately header('Pragma: public'); //header("Cache-Control: public, must-revalidate");header("Pragma: hack"); } //header("Cache-Control: no-cache"); //header("Pragma: no-cache"); if (stripos($_SERVER['HTTP_USER_AGENT'], "msie") === false) { header('Content-type: ' . $thumbImage->mimetype); } if (SET_HEADER) { header('Content-Disposition: inline; filename=' . basename($imageSource, $file_ext)); } $thumbImage->showImage($quality); imagedestroy($thumbImage->ImageStream); exit; }