Author Topic: Small Modifcation Help  (Read 8556 times)

0 Members and 1 Guest are viewing this topic.

Offline DynaMite

  • Pre-Newbie
  • Posts: 3
    • View Profile
Small Modifcation Help
« on: April 02, 2002, 06:23:44 PM »
Hello,

First of all my compliments for this amazing script! I have a question.
I want to add a field to the database in order to achieve the following.
I want the large image to be clickable to a URL that is stored in an extra
field in the database.

So thumb goes to large image, large image goes to URL that is stored in database. I need to add a form field in add/edit image and I need to change the template that is being used for the file, etc, etc

Can you point me in which files I have to look....I probably can handle
it from there....I just need to be pointed in the right direction.

Thank you very much!

DynaMite

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Small Modifcation Help
« Reply #1 on: April 02, 2002, 07:36:57 PM »
Hi!

Uhh...not easy to explain. I will try it:

in "includes/functions.php" you will find the function ShowImage().
The argument $img_result contains an associative array with the data from database for the image.
You have to register the content of the database field for the template parsing. Look at $site_template->register_vars(), you will see how it works.

For the Control Panel you have to edit "admin/images.php".

Greets Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline DynaMite

  • Pre-Newbie
  • Posts: 3
    • View Profile
almost there
« Reply #2 on: April 03, 2002, 01:05:26 PM »
okay the admin stuff is ready, database field added, everything fine here
The dispay site is not working yet. I looked in functions saw the stuff you
mentioned. I have added a registers_var

"out_url" => $img_result['out_url'],

I also noted that image points to another fucntion

"image" => MakeMediaCode

Since I want to use the template file:

<!-- Template file for JPG Files -->
<a href="/out.php?ID={out_url}" target="_blank"><img src="{file}" border="1" alt="Click Here for More!" /></a>

I probably have to register a registers_var here too right?

I have been playing around a bit with but must forget something.  I had
it returned 0 and once it returned Resource id #13 which didn't made
any sense to me.

Should I add something in ShowImage() function to that image var?

Hope you have 1 more enlightning clue :-)

Thanks a lot!

DynaMite

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Small Modifcation Help
« Reply #3 on: April 03, 2002, 01:28:27 PM »
Hi,

try this:
open global.php and add the field "out_url" to the query string in line 182.
I hope this will help.

Greets Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline DynaMite

  • Pre-Newbie
  • Posts: 3
    • View Profile
THANX DUDE!!
« Reply #4 on: April 03, 2002, 02:45:12 PM »
Thank you very much!

I've got it working now. I also added $img_result['out_url']

"image" => MakeMediaCode($img_result['image_media_file'], $img_result['image_id'], $img_result
['cat_id'], $img_result['out_url'], $showlink),

and

function MakeMediaCode($media_file_name, $image_id, $cat_id, $out_url, $show_link = 0) {

Thanks again!

DynaMite