Author Topic: Automaticaly saving the Additional field value in DB  (Read 4602 times)

0 Members and 1 Guest are viewing this topic.

computer123

  • Guest
Automaticaly saving the Additional field value in DB
« on: August 15, 2007, 04:05:03 PM »
Hello,

I made twee additional fields for my images and they are working fine:

1- image_flash (showing on the details.html and shows a link to download the flash file)
2- image_flashYESorNOT (This field is serchable and NOT showing on the details.html)

Everything is working good because if someone search for FLASH (via the search form) he get those images with the flash download file.

At the ACP I fill the woord Flash in the image_flashYESorNOT field, but if I have 3000 images it will be verry difficult to do that manually.

I tryed this on the functions.php but it does not work:



Quote
$image_flash= $image_row['image_flash];
$image_flashYESorNOT = $image_row['image_flashYESorNOT];
 
  if ($image_flash== "") {

   $image_flashYESorNOT = "No";
  }
  else {
 
    $image_flashYESorNOT = "Flash";

 }

What I want is if I put a download link in image_flash it will save automatically the woord Flash in image_flashYERorNOT othewise the woord NO.

I hope I get this time some support because I am sure it a peace of cake for some who know a little bit of PHP programing. :)

Thank you in advance,
SZ

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Automaticaly saving the Additional field value in DB
« Reply #1 on: August 15, 2007, 04:20:33 PM »
Need modify includes/functions.php and download.php file.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: Automaticaly saving the Additional field value in DB
« Reply #2 on: August 15, 2007, 05:16:55 PM »
Thank you thunderstrike for your answer.

I am not a PHP Programeur but I think that we have here nothing to do with the file download.php.
Let's say we have two additional fields and we want to save the woord "Flash" in the image_flashYESorNOT if the other additional field image_flash contain the woord "flash file is available".

So why we have to modify the file download.php. :roll:

 Help me please! :cry:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Automaticaly saving the Additional field value in DB
« Reply #3 on: August 15, 2007, 06:59:47 PM »
Quote
What I want is if I put a download link in image_flash it will save automatically the woord Flash in image_flashYERorNOT othewise the woord NO.

Is where download is done ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: Automaticaly saving the Additional field value in DB
« Reply #4 on: August 15, 2007, 07:04:00 PM »
An extern URL (Just a normal link like: www.google.com/information.zip

That why I said that download.php has nothing to do with this small issue :?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Automaticaly saving the Additional field value in DB
« Reply #5 on: August 15, 2007, 07:05:41 PM »
Sorry - no understand 1st ... now do.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: Automaticaly saving the Additional field value in DB
« Reply #6 on: August 15, 2007, 07:09:11 PM »
What do you mean? I do not understand you!! 8O