4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: babe on June 02, 2003, 08:28:45 PM

Title: Extending details with extra function: img name & url needed
Post by: babe on June 02, 2003, 08:28:45 PM
On my image details page, I'd like to add an extra button --but only to specific categories. So I guess I could edit the action performed by clicking the eCard button, because I don't use this option anywhere and that way I could turn it on for the categories that need the extra action (called 'Direct Import').

After a quick search, I think I have to edit includes/functions.php and probably this part?

Quote

  if (!check_permission("auth_sendpostcard", $image_row['cat_id'])) {
    $postcard_button = "<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" />";
  }
  else {
    $postcard_button = "<a href=\"".$site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\"><img src=\"".get_gallery_image("postcard.gif")."\" border=\"0\" alt=\"\" /></a>";
  }



What does it have to do? Well... On clicking it should execute a javascript. The code for it looks like this:

<a href='javascript:PI("image%20name","absolute url of the image","extension of the image -gif, png, jpg")'><img border="0" src="absolute url of the image">Direct Import</a>

Can somebody please tell me how I mod this correctly?