Ejemplo n.º 1
0
    imageBoldLine($bcg, $x * $wsp, $y * $wsp + imagesy($thumb), $x * $wsp + imagesx($thumb), $y * $wsp + imagesy($thumb), $black, 2);
    /*		RIGHT	*/
    imageBoldLine($bcg, $x * $wsp + imagesx($thumb), $y * $wsp, $x * $wsp + imagesx($thumb), $y * $wsp + imagesy($thumb), $black, 2);
}
function setText($x, $y, $text)
{
    global $bcg, $wsp;
    $bbox = imagettfbbox(10, 0, 'arial.ttf', $text);
    $fontColor = ImageColorAllocate($bcg, 0, 0, 0);
    $im = imagecreatetruecolor(abs($bbox[0]) + abs($bbox[2]) + 8, abs($bbox[1]) + abs($bbox[7]) + 8);
    $white = imagecolorallocatealpha($im, 255, 255, 255, 0);
    imagefilledrectangle($im, 1, 1, abs($bbox[0]) + abs($bbox[2]) + 6, abs($bbox[1]) + abs($bbox[7]) + 6, $white);
    imagecopymerge($bcg, $im, $x * $wsp, $y * $wsp, 0, 0, imagesx($im), imagesy($im), 100);
    ImageTTFText($bcg, 10, 0, $x * $wsp + 3, $y * $wsp + 14, $fontColor, 'arial.ttf', $text);
}
$tab_text = json_decode($_POST['texts']);
if (count($tab_text) > 0) {
    for ($i = 0; $i < count($tab_text); $i++) {
        setText($tab_text[$i]->x, $tab_text[$i]->y, $tab_text[$i]->text);
    }
}
$tab_image = json_decode($_POST['images']);
if (count($tab_image) > 0) {
    for ($i = 0; $i < count($tab_image); $i++) {
        setImage($tab_image[$i]->x, $tab_image[$i]->y, 'cache/' . $tab_image[$i]->filename);
    }
}
@imagejpeg($bcg, 'cache/' . $_POST['filename'], 100);
@imagedestroy($thumb);
@imagedestroy($img);
@imagedestroy($bcg);
Ejemplo n.º 2
0
<?php

include_once 'database/connection.php';
include_once 'database/images.php';
include_once 'database/users.php';
try {
    $id = addImage();
    setImage($id, $_POST['user_id']);
} catch (PDOException $e) {
    die($e->getMessage());
}
header('Location: ' . $_SERVER['HTTP_REFERER']);
Ejemplo n.º 3
0
<?php

$id = $_POST['id'];
$file = $_POST['file'];
$image = $_POST['image'];
//upload();
setImage($id, $file, $image);
function setImage($id, $file, $image)
{
    $library = simplexml_load_file($file);
    $ent = $library->xpath('//entity[@name="' . $id . '"]');
    $ent[0]->image = $image;
    header("Content-type: text/xml");
    echo $library->asXML($file);
}
/*function upload(){
	
		if($_FILES['file']['name'] != ""){
			copy($_FILES[][], ) or die();
		}
		header('Content-type: image/jpg');
		echo $name = $_FILES['file']['name'];
	}*/
Ejemplo n.º 4
0
Archivo: ajax.php Proyecto: noikiy/zays
    $sql = "update {$dbTablePre}members_search set pic_num='{$user_pic}'  where uid='{$userid}'";
    $_MooClass['MooMySQL']->query($sql);
    if (MOOPHP_ALLOW_FASTDB) {
        $pic_arrs = array();
        $pic_arrs['pic_num'] = $user_pic;
        MooFastdbUpdate('members_search', 'uid', $userid, $pic_arrs);
    }
    searchApi("members_man members_women")->updateAttr(array('images_ischeck', 'pic_num'), array($memberid => array(0, $user_pic)));
    //searchApi("members_man members_women")->UpdateAttributes(array($memberid=>array('images_ischeck'=>'0','pic_num'=>$user_pic)));
}
//***************************************控制层(C)************************************************//
//header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // 过去的时间
$h = MooGetGPC('h', 'string');
switch ($h) {
    case 'checkmack':
        reg_checkmack();
        break;
    case 'telphone':
        reg_telphone();
        break;
    case 'save_skin':
        reg_save_skin();
        break;
    case 'setImage':
        setImage();
        break;
    case 'delPhoto':
        deletePhoto();
        break;
}