Author Topic: Implementing imageshack transload script - ?  (Read 5905 times)

0 Members and 1 Guest are viewing this topic.

Offline ajh287sjhsdbsdasd

  • Pre-Newbie
  • Posts: 3
    • View Profile
Implementing imageshack transload script - ?
« on: October 02, 2007, 02:58:00 AM »
I'd like to have 4images set up to where when someone uploads an image, it gets sent to the imageshack server. Is this possible? Does anyone know how to go about doing it and what files I need to modify?

I have the transload scripts that I've used elsewhere (on another site) if that helps:

function uploadURLToImageshack($url) {
   $ch = curl_init("http://imageshack.us/transload.php");

   $post['xml']='yes';
   $post['url']=$url;

    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: '));

    $result = curl_exec($ch);
    curl_close($ch);

    if (strpos($result, '<'.'?xml version="1.0" encoding="iso-8859-1"?>') === false) {
       return 'failed';
    } else {
        return $result; // XML data
   }
}


Thanks

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Implementing imageshack transload script - ?
« Reply #1 on: October 02, 2007, 02:59:27 AM »
Is your server support cURL ?

If no have answer - go to: ACP - > phpinfo() and check for cURL extention.
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 ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Implementing imageshack transload script - ?
« Reply #2 on: October 02, 2007, 03:30:35 AM »
Ok file you need edit is member.php and admin/validateimages.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 ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Implementing imageshack transload script - ?
« Reply #3 on: October 02, 2007, 03:38:28 AM »
Your question is which file edit and no to add code. :?

If need integrate, please post in request for paid for custom job.
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 ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Implementing imageshack transload script - ?
« Reply #4 on: October 02, 2007, 03:46:58 AM »
Ok - here:

http://www.4homepages.de/forum/index.php?topic=11412.0

Is look like is done in past.
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 ?