images php coding issues or problems here.
Moderators: macek, egami, gesf
by tradertt » Sun Mar 02, 2003 10:40 pm
Hi I was wondering if anyone uses 4images as a image gallery. I do not know what the problem is so I tot I would just post here to see if anyone can help.
Please have a look at this thread
http://www.4homepages.de/forum/viewtopic.php?t=3808
I am on a *nix system and all the setttings have been done. Does anyone know why my watermark just does not appear? Is this a problem with my server or anything?
Is there any test that I can do ?
-
tradertt
- New php-forum User

-
- Posts: 4
- Joined: Thu Feb 27, 2003 10:56 am
by tradertt » Sun Mar 02, 2003 10:42 pm
- Code: Select all
#############################################################################################
## Title: Auto annotate images MOD for 4images - Image Gallery Management System.
## Version: 1.1
## Author: Silly Little Lamer <sll@dalnet.ru>
##
## Description:
## This MOD automatically place a line of custom text, called "Annotation" on every
## image uploaded to the Gallery. Fully customisable: font type, size and color, shadow
## usage, offsets, annotation location, etc. "Batch Annotate" admin plugin included, to
## annotate images, uploaded to your gallery before you installed this MOD.
##
## Requirements: GD2 Library compiled with Freetype support. Also works with ImageMagic,
## but GD still needed for some functions, which ImageMagic is missing.
##
## GD users can check http://www.coupin.net/gd-freetype/
## and http://www.coupin.net/gd-freetype/windows.php
##
## New in v.1.1 - Now you can customize both text and shadow colors and set alpha blending
## (text transparency) value for your annotation (thanks to V@no)
##
## Attention! Since this MOD is altering 4images database, please go Control Panel
## and backup you database!
##
## Installation Level: Easy
## Installation Time: 10 Minutes
##
## Files To Edit: 4
## /4images/member.php
## /4images/admin/settings.php
## /4images/lang/english/admin.php
## /lang/english/main.php
##
#############################################################################################
## BEFORE ADDING THIS MOD, YOU SHOULD BACK UP ALL FILES RELATED TO 4IMAGES!
#############################################################################################
#
#-----[ COPY FILES ]----------------------------------
#
install_annotation.php >>> to the ROOT 4images directory
annotate.ttf >>> to the ROOT 4images directory
ia.sql >>> to the ROOT 4images directory
annotate.php >>> to the /includes directory
batch_annotate.php >>> to the /admin/plugins directory (create, if not exists)
#
#-----[ RUN ]----------------------------------------
#
/4images/install_annotation.php
All neccessary fields will be added to 4images database.
Delete install_annotation.php and ia.sql for security reasons.
#
#-----[ OPEN ]----------------------------------------
#
/4images/member.php
#
#-----[ FIND ]----------------------------------------
#
if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
$new_thumb_name = $new_name;
#
#-----[ AFTER ADD ]------------------------------------
#
//-----------------------------------------------------
// --- Annotate Images --------------------------------
//-----------------------------------------------------
require(ROOT_PATH.'includes/annotate.php');
function annotate_image($file) {
global $convert_options, $config;
if ($config['annotation_use']) {
$file_bak = $file.".bak";
if (!rename($file, $file_bak)) {
return false;
}
$annotate_handle = "annotate_image_".$convert_options['convert_tool'];
if ($annotate_handle($file_bak, $file)) {
@chmod($file, CHMOD_FILES);
@unlink($file_bak);
return true;
}
else {
rename($file_bak, $file);
return false;
}
}
}
if ($direct_upload) {
$ann_src = MEDIA_PATH."/".$cat_id."/".$new_name;
$ann_dest = MEDIA_PATH."/".$cat_id."/".$new_name;
}
else {
$ann_src = MEDIA_TEMP_PATH."/".$new_name;
$ann_dest = MEDIA_TEMP_PATH."/".$new_name;
}
if (annotate_image($ann_src, $ann_dest)) {
$annotated = 1;
}
//-----------------------------------------------------
#
#-----[ OPEN ]----------------------------------------
#
/4images/admin/settings.php
#
#-----[ FIND ]----------------------------------------
#
function show_image_order_select($setting_name, $setting_value) {
global $image_order_optionlist;
#
#-----[ DIRECT BEFORE, ADD ]--------------------------
#
function show_annotation_v_positioning_select($setting_name, $setting_value) {
global $annotation_v_positioning_optionlist;
echo "<select name=\"setting_item[".$setting_name."]\">";
foreach ($annotation_v_positioning_optionlist as $key => $val) {
echo "<option value=\"$key\"";
if ($setting_value == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>";
}
echo "</select>";
}
function show_annotation_h_positioning_select($setting_name, $setting_value) {
global $annotation_h_positioning_optionlist;
echo "<select name=\"setting_item[".$setting_name."]\">";
foreach ($annotation_h_positioning_optionlist as $key => $val) {
echo "<option value=\"$key\"";
if ($setting_value == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>";
}
echo "</select>";
}
#
#-----[ FIND ]----------------------------------------
#
show_form_footer($lang['save_changes'], "", 2);
#
#-----[ DIRECT BEFORE, ADD ]--------------------------
#
if ($config['convert_tool'] != 'netpbm') {
show_table_separator($setting_group[8], 2, "#setting_group_8");
show_setting_row("annotation_use", "radio");
show_setting_row("annotation_text");
show_setting_row("annotation_font");
show_setting_row("annotation_font_size");
show_setting_row("annotation_fill_color");
show_setting_row("annotation_shadow_color");
if ($config['convert_tool'] != 'im') {
show_setting_row("annotation_fill_alpha");
show_setting_row("annotation_shadow_alpha");
}
show_setting_row("annotation_use_shadow", "radio");
show_setting_row("annotation_shadow_offset");
show_setting_row("annotation_image_quality");
show_setting_row("annotation_v_alignment", "show_annotation_v_positioning_select");
show_setting_row("annotation_h_alignment", "show_annotation_h_positioning_select");
show_setting_row("annotation_top_offset");
show_setting_row("annotation_bottom_offset");
show_setting_row("annotation_left_offset");
show_setting_row("annotation_right_offset");
}
#
#-----[ OPEN ]----------------------------------------
#
/4images/lang/english/admin.php
#
#-----[ FIND ]----------------------------------------
#
$setting['display_whosonline'] = "Display \"Who's Online\". Only visible for admins when deactivated.";
$setting['highlight_admin'] = "Display admins bold in \"Who's online\" ";
#
#-----[ AFTER ADD ]------------------------------------
#
/*-- Setting-Group 8 --*/
$setting_group[8]="Images Annotation settings";
$setting['annotation_use'] = "Use auto images annotation on image upload";
$setting['annotation_font'] = "Annotation font<br /><span class=\"smalltext\">Specify full path and font filename</span>";
$setting['annotation_font_size'] = "Annotation font size";
$setting['annotation_use_shadow'] = "Use letter shadows";
$setting['annotation_shadow_offset'] = "Shadow offset (same right and down)";
$setting['annotation_image_quality'] = "Resulting image quality (in per cent)";
$setting['annotation_text'] = "Annotation message";
$setting['annotation_fill_color'] = "Annotation text fill color<br /><span class=\"smalltext\">Define HEX value, for example #FFFFFF. Have a look at <a target=\"_blank\" href=\"color.html\">color samples</a></span>";
$setting['annotation_shadow_color'] = "Annotation text shadow color<br /><span class=\"smalltext\">Define HEX value, for example #000000. Have a look at <a target=\"_blank\" href=\"color.html\">color samples</a></span>";
$setting['annotation_fill_alpha'] = "Fill color alpha blending (transparency)<br /><span class=\"smalltext\">Alpha blending value must be between 0.0 and 1.0&&&&0.0 = no transparency</span>";
$setting['annotation_shadow_alpha'] = "Shadow color alpha blending (transparency)<br /><span class=\"smalltext\">Alpha blending value must be between 0.0 and 1.0&&&&0.0 = no transparency</span>";
$setting['annotation_v_alignment'] = "Vertical annotation message alignment";
$setting['annotation_h_alignment'] = "Horizontal annotation message alignment";
$annotation_v_positioning_optionlist = array(
"top" => "image top",
"bottom" => "image bottom"
);
$annotation_h_positioning_optionlist = array(
"left" => "left image edge",
"middle" => "image middle",
"right" => "right image edge"
);
$setting['annotation_top_offset'] = "Top annotation message offset";
$setting['annotation_bottom_offset'] = "Bottom annotation message offset";
$setting['annotation_left_offset'] = "Left annotation message offset";
$setting['annotation_right_offset'] = "Right annotation message offset";
#
#
#-----[ SAVE/UPLOAD ALL FILES ]-------------------------------------
#
# Go Admin Control Panel and check/modify annotations settings.
#
#-------------------------------------------------------------------
#
# To use "Batch Annotate" admin plugin:
#
# Copy batch_annotate.php to your /admin/plugins/ directory and color.html
# to /admin/ directory. Go Admin Control Panel and run plugin.
#
#
# EoM
BY THE WAY, this is the modification that I did onto 4 images.
-
tradertt
- New php-forum User

-
- Posts: 4
- Joined: Thu Feb 27, 2003 10:56 am
Return to PHP coding => Images
Who is online
Users browsing this forum: No registered users and 2 guests