Author Topic: Trade Script  (Read 7569 times)

0 Members and 1 Guest are viewing this topic.

Offline J.Lond

  • Newbie
  • *
  • Posts: 23
    • View Profile
Trade Script
« on: April 15, 2007, 05:39:00 AM »
I searched the forums and I am unable to find the answer to my question.  I am running version 1.7.4.  Images are currently opening in a new window.  I need the images to go through my trade script.  Is it possible and where do I make the changes.  The following links are examples of what I need (links do not work).

Before

hxxp://www.yoursite.com/gallery/details.php?image_id=5361

After

hxxp://www.yoursite.com/cgi-bin/ttt-out?pct=80&url=http://www.yoursite.com/gallery/details.php?image_id=5361

Help is very much appreciated.

Best Regards,

Jason

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Trade Script
« Reply #1 on: April 15, 2007, 07:16:25 AM »
Hi,

in includes/functions.php
find:
Code: [Select]
  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;

replace with:
Code: [Select]
  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"hxxp://www.yoursite.com/cgi-bin/ttt-out?pct=80&url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"hxxp://www.yoursite.com/cgi-bin/ttt-out?pct=80&url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;


cu
Kurt

Offline J.Lond

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Trade Script
« Reply #2 on: April 15, 2007, 07:45:22 AM »
Thanks for the quick reply.  The changes load the trade script properly but the new window goes 404. The details page is incorrect (see red).


hxxp://www.yoursite.com/cgi-bin/ttt-out?pct=80&url=./details.php?image_id=5361


Jason

Offline J.Lond

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Trade Script
« Reply #3 on: April 16, 2007, 03:57:47 AM »
I just eliminated ROOT_PATH from the following code and replaced it with the actual domain and 4images directory.  It works fine now.  I just need to remember the changes if I ever change directories or move servers.  If this will not create any future problems I will leave it as is.  Thanks again to KurtW for getting me started.

Best Regards,

Jason

Offline J.Lond

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Trade Script
« Reply #4 on: May 15, 2009, 02:58:05 AM »
Is it possible to change the code based on guest/registered user levels?  If guest then use this functions code if registered then use these options. Thank you gentlemen.

Offline J.Lond

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Trade Script
« Reply #5 on: May 21, 2009, 05:21:45 AM »
If someone can just point me in the right direction I would appreciate it. Thank you.