Author Topic: [REQ] How to add a picture, but link the thumb to an external site/page  (Read 6751 times)

0 Members and 1 Guest are viewing this topic.

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Hello.

I believe this could come in handy for a lot of us.

I would like to know if it is possible to add a picture (with a thumb), but instead of the thumb pointing to an internal image page (on your own site) it would point to an external page/site.

For those who asks why this is needed, it is useful to point visitors to a friends site.

Thanks!
Greetz: Lasse

TheOracle

  • Guest
Re: [REQ] How to add a picture, but link the thumb to an external site/page
« Reply #1 on: September 21, 2005, 12:41:56 AM »
4images already handles remote image, either, from the upload page or from the ACP - > images pages. ;)

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [REQ] How to add a picture, but link the thumb to an external site/page
« Reply #2 on: September 21, 2005, 01:14:54 AM »
Yes, I know that.

Not what I'm talking about. Please re-read my original post.

Let me illustrate with a simple example. Instead of:

<a href="/img2.htm"><img src="pic1.jpg"></a>

I want:

<a href="http://www.google.com"><img src="pic1.jpg"></a>

-And I want to be able to, of course, insert any URL I chose where you see google.com
Greetz: Lasse

Offline Xyu BAM

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: [REQ] How to add a picture, but link the thumb to an external site/page
« Reply #3 on: September 21, 2005, 01:25:08 AM »
4images already handles remote image, either, from the upload page or from the ACP - > images pages. ;)
jeez...read again the question would you? :roll:


@marod0er:
I think this was requested before, and I havent seen anyone coded such mod yet.

But, if you have a little mysql knowlege here is an idea what you can do:

1) add a new field into 4images_images table in the database, lets call it as image_url (obviosly the name is your choice ;)). Make it VARCHAR(255)
2) add the infromation about that field into includes/db_field_definitions.php:
Code: [Select]
$additional_image_fields['image_url'] = array("URL to an external site", "text", 0);3) in includes/functions.php find:
Code: [Select]
    if ($open_window) {
insert above:
Code: [Select]
    global $image_row;
    if (!empty($image_row['image_url']))
    {
      $thumb = "<a href=\"".$image_row['image_url']."\" target=\"externalsite\">".$thumb."</a>";
    }
    else
4) if you upload images from ACP then this is it, but if you want upload images from members upload page, you'll need add {lang_image_url} and <input type="text" value="{image_url}" name="image_url"> tags into member_uploadform.html template.

a few notes:
- image upload is required
- the url must contein http://, https://, ftp:// or etc protocol part, otherwise it will appent the url into the url of your page.

Offline marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [REQ] How to add a picture, but link the thumb to an external site/page
« Reply #4 on: September 21, 2005, 04:04:47 AM »
Hmm...

Definately looks interesting. I will have to give it a shot in the morning.
Thanks, so far.

Gave you a small karma boost ;)
Greetz: Lasse