$adherent["titre_adh"] = "1";
    $adherent["date_crea_adh"] = date("d/m/Y");
    #annoying
    #$adherent["url_adh"] = "http://";
    $adherent["url_adh"] = "";
    $adherent["pref_lang"] = PREF_LANG;
}
// - declare dynamic fields for display
$disabled['dyn'] = array();
if (!isset($adherent['dyn'])) {
    $adherent['dyn'] = array();
}
//image to defeat mass filling forms
$spam_pass = PasswordImage();
$s = PasswordImageName($spam_pass);
$spam_img = print_img($s);
$dynamic_fields = prepare_dynamic_fields_for_display($DB, 'adh', $_SESSION["admin_status"], $adherent['dyn'], $disabled['dyn'], 1);
// template variable declaration
$tpl->assign("spam_pass", $spam_pass);
$tpl->assign("spam_img", $spam_img);
$tpl->assign("required", $required);
$tpl->assign("disabled", $disabled);
$tpl->assign("data", $adherent);
$tpl->assign("time", time());
$tpl->assign("dynamic_fields", $dynamic_fields);
$tpl->assign("error_detected", $error_detected);
$tpl->assign("warning_detected", $warning_detected);
$tpl->assign("languages", drapeaux());
$tpl->assign("head_redirect", $head_redirect);
// pseudo random int
$tpl->assign("time", time());
Esempio n. 2
0
} else {
    $th_height = $maxsize;
    $th_width = $width * $th_height / $height;
}
$dst_id = imagecreatetruecolor($th_width, $th_height);
imagecopyresampled($dst_id, $src_id, 0, 0, 0, 0, $th_width, $th_height, $width, $height);
if (strcasecmp($ftype, ".png") == 0) {
    imagepng($dst_id, $cachename);
} elseif (strcasecmp($ftype, ".jpg") == 0 or strcasecmp($ftype, ".jpeg") == 0) {
    imagejpeg($dst_id, $cachename);
} elseif (strcasecmp($ftype, ".gif") == 0) {
    imagegif($dst_id, $cachename);
}
imagedestroy($src_id);
imagedestroy($dst_id);
print_img($cachename);
exit;
function print_emptyimg()
{
    header("Content-type: image/gif\n\n");
    readfile(XOOPS_ROOT_PATH . "/modules/" . $mydirname . "/images/blank.gif");
}
// imgname is already checked
function print_img($imgname)
{
    $ftype = strrchr($imgname, ".");
    // extention
    $type = "Content-type: image/";
    if (strcasecmp($ftype, ".png") == 0) {
        $type .= "png\n\n";
    } elseif (strcasecmp($ftype, ".jpg") == 0 or strcasecmp($ftype, ".jpeg") == 0) {