$OmadaAimatosGrammaKaiSimbolo[0] = "";
        $OmadaAimatosGrammaKaiSimbolo[1] = "";
    } else {
        $OmadaAimatosGrammaKaiSimbolo = str_split($TeamBlood);
    }
}
//    echo "UploadFile = ".$UploadFile."<br>";
$UploadFileSplit = explode('.', ConvertEncoding($UploadFile));
$UploadFileΤοToShowArray = explode('.', $UploadFileΤοToShow);
$PathToSaveForegroundImage = $UploadFileSplit[0] . "-Foreground.png";
$PathToSaveBackgroundImage = $UploadFileSplit[0] . "-Background.png";
$ImageForMergeDST = imagecreatefrompng("images/tautotita_politikou_prosopikou_ypy_frantzeskakis_page_0.png");
$ΒlackColorM = imagecolorallocate($ImageForMergeDST, 0, 0, 0);
$font = "font/verdana.ttf";
$x = 650;
$ImageForMergeSRC = imagecreatefrompng(ConvertEncoding($UploadFile));
$ImageWidth = imagesx($ImageForMergeSRC);
$ImageHeight = imagesy($ImageForMergeSRC);
imagettftext($ImageForMergeDST, 30, 0, 690, 322, $ΒlackColorM, $font, date("d.m.Y"));
//Destination x and y are axes of 'ImageForMergeDST' image that begins merging with second image
//Source x and y are axes of 'ImageForMergeSRC' image that start merging with first image and stop mergin until x=374 and y=497, which are height and weight of resizable image
//The two last parameters are widht and height of begin image
//This function fisrt resize 'ImageForMergeSRC' into desire height and weight if size of first image
//dont match with the size second, for this example 375x498, and second copy second image on specific location on the first image
imagecopyresized($ImageForMergeDST, $ImageForMergeSRC, 87, 237, 0, 0, 374, 497, $ImageWidth, $ImageHeight);
imagepng($ImageForMergeDST, $PathToSaveForegroundImage);
//Save png image(foregroun of political identity) to path stored in variable "PathToSaveForegroundImage"
$BackImage = imagecreatefrompng("images/tautotita_politikou_prosopikou_ypy_frantzeskakis_page_1.png");
$ΒlackColor = imagecolorallocate($BackImage, 0, 0, 0);
//	if ($BackImage)
//	{
 /**
  * Creates phpQuery document from string or file.
  * Options: 
  * FixHtml (True|False): Clean content by HtmlFormatter
  * phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM),
  * API based on jQuery JavaScript Library. 
  * More information: http://code.google.com/p/phpquery/
  * 
  * @param mixed $Document, string, file or url.
  * @return PhpQueryDocument object.
  */
 function PqDocument($Document, $Options = False)
 {
     if (!function_exists('Pq')) {
         require_once USEFULFUNCTIONS_VENDORS . '/phpQuery.php';
     }
     $Cache = GetValue('Cache', $Options);
     if ($Cache) {
         $Name = Crc32Value($Options);
         if ($Cache === True) {
             $Name = Crc32Value($Document, $Name);
         }
         $CacheDirectory = PATH_CACHE . '/PqDocument';
         if (!is_dir($CacheDirectory)) {
             mkdir($CacheDirectory, 0777, True);
         }
         $CacheFile = $CacheDirectory . DS . $Name . '.php';
         if (file_exists($CacheFile)) {
             $IncludeCache = True;
             if (is_numeric($Cache)) {
                 $Created = filemtime($CacheFile);
                 $LifeTime = time() - $Created;
                 if ($LifeTime > $Cache) {
                     // Cache expired.
                     $IncludeCache = False;
                 }
             }
             if ($IncludeCache) {
                 $Document = (include $CacheFile);
                 return phpQuery::newDocumentXHTML($Document);
             }
         }
     }
     if (strpos($Document, '<') === False) {
         if (is_file($Document) || substr($Document, 0, 7) == 'http://') {
             $Document = file_get_contents($Document);
         }
     }
     if (ArrayValue('ConvertEncoding', $Options)) {
         $Document = ConvertEncoding($Document);
     }
     if (ArrayValue('FixHtml', $Options, True)) {
         $HtmlFormatter = Gdn::Factory('HtmlFormatter');
         if ($HtmlFormatter) {
             $Document = $HtmlFormatter->Format($Document);
         }
     } elseif (ArrayValue('Body', $Options, False)) {
         $BodyPos1 = strpos($Document, '<body');
         $EndTag = '</body>';
         $BodyPos2 = strrpos($Document, $EndTag);
         if ($BodyPos1 !== False) {
             if ($BodyPos2 === False) {
                 $Document = substr($Document, $BodyPos1);
             } else {
                 $Document = substr($Document, $BodyPos1, strlen($Document) - $BodyPos1 - strlen($EndTag));
             }
         }
     }
     if ($Cache) {
         $Contents = "<?php if(!defined('APPLICATION')) exit(); \nreturn " . var_export($Document, True) . ';';
         file_put_contents($CacheFile, $Contents);
     }
     return phpQuery::newDocumentXHTML($Document);
 }
     $extension = strtolower($extension);
     $CreateFileName = ConvertEncoding($temp[0]) . "." . $extension;
 } else {
     $CreateFileName = ConvertEncoding($temp[0]) . "." . $extension;
 }
 $RelativePathToSaveImage = "images/" . $NameForFolderOfEmployee . "/";
 if ($_FILES['file']['type'] != "image/png") {
     if (file_exists($RelativePathToSaveImage . $CreateFileName)) {
         echo '<span style="color:red;text-align:center;">Το αρχείο που προσπαθείτε να ανεβάσετε υπάρχει ήδη στον φάκελο images </span>' . "<br>";
         die;
         exit;
     }
     move_uploaded_file($_FILES['file']['tmp_name'], $RelativePathToSaveImage . $CreateFileName);
     imagepng(imagecreatefromstring(file_get_contents($RelativePathToSaveImage . $CreateFileName)), $RelativePathToSaveImage . ConvertEncoding($temp[0]) . ".png");
     //$_SESSION['UploadFile'] = $RelativePathToSaveImage.ConvertEncoding($temp[0]).".png";
     $UploadFile = $RelativePathToSaveImage . ConvertEncoding($temp[0]) . ".png";
     $UploadFileToShow = str_replace(' ', '%20', "images/" . $_POST['SurnameOfEmployeeText'] . "/" . $_FILES['file']['name']);
     //                    echo str_replace(' ', '%20', "images/".$_POST['SurnameOfEmployeeText']."/".$_FILES['file']['name']);
     $UploadFileΤοToShow = $RelativePathToSaveImage . $_FILES['file']['name'];
     //                    echo $UploadFile."<br>";
     $res = $con->prepare("UPDATE kataxorisiuser SET PathOfEmployeeImageToSave=?, UploadImageTF=?," . " PathOfEmployeeImageToShow=? " . "WHERE Surname=? AND Name=?", array("images/" . $_POST['SurnameOfEmployeeText'] . "/" . $temp[0] . ".png", 'true', $UploadFileToShow, $SurnameOfEmployeeArray[0], $SurnameOfEmployeeArray[1]));
 } else {
     if (file_exists($RelativePathToSaveImage . $CreateFileName)) {
         echo '<span style="color:red;text-align:center;">Το αρχείο που προσπαθείτε να ανεβάσετε υπάρχει ήδη στον φάκελο images </span>' . "<br>";
         exit;
     }
     move_uploaded_file($_FILES['file']['tmp_name'], $RelativePathToSaveImage . $CreateFileName);
     //$_SESSION['UploadFile'] =$RelativePathToSaveImage.ConvertEncoding($temp[0]).".png";
     $UploadFile = $RelativePathToSaveImage . $CreateFileName;
     $UploadFileToShow = str_replace(' ', '%20', "images/" . $_POST['SurnameOfEmployeeText'] . "/" . $_FILES['file']['name']);
     //                    echo str_replace(' ', '%20', "images/".$_POST['SurnameOfEmployeeText']."/".$_FILES['file']['name'])."<br>";
示例#4
0
 function d()
 {
     static $bSetStyle = True;
     static $bExit = True;
     if (!class_exists('Dumphper', False)) {
         define('DPHP_USE_ACCESSIBLE', version_compare(PHP_VERSION, '5.3.0') >= 0);
         $Path = defined('USEFULFUNCTIONS_VENDORS') ? USEFULFUNCTIONS_VENDORS : dirname(__FILE__) . '/../vendors';
         require $Path . '/class.dumphper.php';
         Dumphper::$escape_keys = false;
         Dumphper::$max_showw_depth = 8;
         Dumphper::$encoding = 'utf-8';
     }
     $Args = func_get_args();
     if (count($Args) == 0 && $bExit) {
         $bExit = False;
     }
     if (PHP_SAPI != 'cli') {
         if (!headers_sent()) {
             header('Content-Type: text/html; charset=utf-8');
         }
         if ($bSetStyle) {
             $bSetStyle = False;
             echo "<style type='text/css'>.dumphper span{font-size:13px !important;font-family:'Arial' !important;}</style>\n";
         }
         foreach ($Args as $A) {
             if (is_string($A) && defined('CP1251')) {
                 $A = ConvertEncoding($A);
             }
             Dumphper::dump($A);
         }
     } else {
         $i = 1;
         ob_start();
         foreach ($Args as $A) {
             echo str_repeat('*', $i++) . ' ';
             var_dump($A);
         }
         $String = ob_get_contents();
         @ob_end_clean();
         $Encoding = Gdn::Config('Plugins.UsefulFunctions.Console.MessageEnconding');
         $String = preg_replace("/\\=\\>\n +/s", '=> ', $String);
         if ($Encoding && $Encoding != 'utf-8') {
             $String = mb_convert_encoding($String, $Encoding, 'utf-8');
         }
         echo $String;
     }
     if (class_exists('Gdn')) {
         $Database = Gdn::Database();
         if ($Database != Null) {
             $Database->CloseConnection();
         }
     }
     if ($bExit) {
         exit;
     }
 }
示例#5
0
 /**
  * Creates phpQuery document from string or file.
  * Options: 
  * FixHtml (True|False): Clean content by HtmlFormatter
  * phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM),
  * API based on jQuery JavaScript Library. 
  * More information: http://code.google.com/p/phpquery/
  * 
  * @param mixed $Document, string, file or url.
  * @return PhpQueryDocument object.
  */
 function PqDocument($Document, $Options = False)
 {
     if (!function_exists('Pq')) {
         require_once USEFULFUNCTIONS_VENDORS . '/phpQuery.php';
     }
     if (strpos($Document, '<') === False) {
         if (is_file($Document) || substr($Document, 0, 7) == 'http://') {
             $Document = file_get_contents($Document);
         }
     }
     if (ArrayValue('ConvertEncoding', $Options)) {
         $Document = ConvertEncoding($Document);
     }
     if (ArrayValue('FixHtml', $Options, True)) {
         $HtmlFormatter = Gdn::Factory('HtmlFormatter');
         if ($HtmlFormatter) {
             $Document = $HtmlFormatter->Format($Document);
         }
     }
     return phpQuery::newDocumentXHTML($Document);
 }