Welcome to the Forum!
1.) Copy the File "install_weblink.php" from the Attachment in your Gallery "root", login as Admin, and call it to.
2.) search in includes/db_field_definitions.php "?>" and insert above:
$additional_image_fields['image_weblink'] = array($lang['image_weblink'], "text", 0);
3.) search in lang/your Lang/main.php "?>" and insert above:
(english)
$lang['image_weblink'] = "Weblink: <span class=\"smalltext\">input without: http://<span>";
(deutsch)
$lang['image_weblink'] = "Weblink: <span class=\"smalltext\">eingabe ohne: http://<span>";
4a.) search in includes/functions.php (for 4images 1.7.8 and newer):
$site_template->register_vars(array(
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
))
and repalce:
// #### Start Weblink ######
if(!empty($image_row['image_weblink'])){
$weblink = str_replace("http://","",$image_row['image_weblink']);
$weblink = "<a href=\"http://".$weblink."\">".get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view)."</a>";
}else{
$weblink = get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view);
}
$site_template->register_vars("image",$weblink);
// #### End Weblink ######
4b.) search in includes/functions.php (for 4images 1.7.7 and older):
$site_template->register_vars(array(
"image_id" => $image_row['image_id'],
insert above:
// #### Start Weblink ######
if(!empty($image_row['image_weblink'])){
$weblink = str_replace("http://","",$image_row['image_weblink']);
$weblink = "<a href=\"http://".$weblink."\">".get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view )."</a>";
}else{
$weblink = get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view);
}
// #### End Weblink ######
search some lines including:
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
and replace:
"image" => $weblink,
5.) search in member.php:
$value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
and repalce:
// #### Start Weblink ######
//$value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
$value = (isset($HTTP_POST_VARS[$key])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
// #### End Weblink ######
6.) search in your Templates/member_uploadform.html:
{if captcha_upload}
insert above:
<tr>
<td class="row1" valign="top"><b>{lang_image_weblink}</b></td>
<td class="row1">
<input type="text" name="image_weblink" size="30" value="{image_weblink}" class="input">
</td>
</tr>
7.) search in your Templates/member_editimage.html:
<textarea name="image_keywords" cols="30" rows="10" wrap="virtual" class="textarea">{image_keywords}</textarea>
</td>
</tr>
insert below:
<tr>
<td class="row1" valign="top"><b>{lang_image_weblink}</b></td>
<td class="row1">
<input type="text" name="image_weblink" size="30" value="{image_weblink}" class="input">
</td>
</tr>
mfg Andi