Advertisement:

Author Topic: IMporting IMAGES with Ad Importer free AddOn  (Read 563 times)

d33p

  • Newbie
  • *
  • Posts: 17
IMporting IMAGES with Ad Importer free AddOn
« on: February 06, 2019, 11:24:29 pm »
Good day, pplz!~  :)

I tried using the Ad Importer free module to import ads for listings.

I even used the example image of a cat on an external server from the provided template file:

Code: [Select]
<image>http://conejo.me/cats/153.jpg</image>       

(It's still there: http://www.conejo.me/cats/153.jpg)


However, this image never appears on the ad I've imported.  :( :( :( :( :(

I've tried other tests putting images on other servers I have access to and it still doesn't work.

What about local files? That doesn't seem to work, either...

Any help would be greatly appreciated!!!


fog

  • Hero Member
  • *****
  • Posts: 1062
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #1 on: February 07, 2019, 03:56:52 pm »
Hi, I never tried use that plugin, but if you try import your ads, the local files to images will work, if you paste all content there on that directory (oc-content/uploads/...).

d33p

  • Newbie
  • *
  • Posts: 17
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #2 on: February 07, 2019, 07:43:46 pm »
Do I have to upload the images into Osclass, first manually, somewhere in the admin, before the AdImporter will recognize them?

So far, no success; it just hangs when I try to use local image file. Same as before.



 I notice that images I uploaded via admin (or via user account) when creating an ad in the usual manner are all converted to *_original, *_preview, and *_thumbnail.



So far, I've  just dropped my image files into the uploads directory where the other images already are  via FTP.  Also tried the temp sub-directory.


 I do notice there is a naming convention for images that Osclass has "processed", but my images still have original names and no associated different-sized images and never show up.


And, like I said, the AdImporter  AddOn  hangs when I try to include even one image, so I know it's not working yet....


Hmm...Don't know what I should try next. Maybe different sizes?

« Last Edit: February 07, 2019, 07:57:40 pm by d33p »

d33p

  • Newbie
  • *
  • Posts: 17
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #3 on: February 07, 2019, 07:55:36 pm »
OK, I checked the Downloads folder

Like 283 in index of the Addon:

Code: [Select]
$photos['tmp_name'][] = osc_content_path()."downloads/".$tmp_name;
So I checked the downloads folder, and there was

adimporterimage_0_0.61261100 1549484150 and about twenty others!!

all I did was add .jpg at the end, and it was the kitten that was lost!!    :P

There are a number of kittens in there hanging out! lol

So why is the adImporter hanging, then, if it imports the image, intact? (or is it intCAT??)


**********************************

OK, I just watched a NEW cat file placed in that directory, real-time. It's grabbing the image really quickly.  But then just hangs...

I'll leave the window open and maybe it will work in an hour??  It does say to be patient. How long should I expect for a 600px file?


I also tried putting the <image> tag last before date as in the example XML, but same results.

OK, also, if I try MULTIPLE image files (as tags inXML), only the first appears in the downloads folder.

So it's after the image DL that this add-on is hanging. Anyone uses this Addon successfully??
« Last Edit: February 07, 2019, 10:20:43 pm by d33p »

d33p

  • Newbie
  • *
  • Posts: 17
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #4 on: February 08, 2019, 12:10:49 am »
Hanging happening here Line 279 Index.php of AdImporter Plugin:

Code: [Select]
  if($image_ok) {
            $photos['error'][] = 0;
           $photos['size'][] = 100;
           $photos['type'][] = 'image/jpeg';
           $photos['tmp_name'][] = osc_content_path()."downloads/".$tmp_name;
        }

This can be commented out and the first image will save, and all ads will upload. The first image does not later appear as part of the ad. OIt also saves without an extension, something all the images grabbed with this Addon did without any changes.

I also changed this (WHILE above issues (each od the 4 lines independently generate crash) commented out):

Code: [Select]
   $tmp_name = "adimporterimage_".$k.'_'.microtime() . '.jpg';
as I considered that maybe OSClass was looking for a Jpg and the MIME type declaration above is deprecated???


What I ended up with is ONE saved .jpg file (only started with JPGs so it's OK that it's forced to be JPG), all ads upload, all images beyond the first  do not, and the one image that uploads does not end up associated with the ad it was placed with...

Hmm..this is definitely the issue. Anyone know how this should appear? PHP 5.4 Version OSClass 3.8
« Last Edit: February 08, 2019, 12:21:05 am by d33p »

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #5 on: February 08, 2019, 12:22:50 am »
Hi,

1. open importer/index.php file with notepad or code editor
2. locate line: (fixed)

Code: [Select]
foreach($image_list as $k=>$image) {

and add another line of code before it, so it looks like this:

Code: [Select]
$photos = array();
foreach($image_list as $k=>$image) {

It will work.

Regards
dev101
« Last Edit: February 08, 2019, 12:25:31 am by dev101 »

d33p

  • Newbie
  • *
  • Posts: 17
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #6 on: February 08, 2019, 01:25:03 am »
Hmm..This did not work,  tho I am getting a 640x480 .png image from my own site  that reads:

"Discover Pixabay Free Images. No Hotlinking" where the item image might show on the right (in this template).

I'm guessing I have "No Hotlinking" turned on, and entering a URL is the equivlaent of a user entering a URL to hotlink to??


SO I *do* need to use a local path, then? Unless I turn this anti-hotlinking  feature off (at least in the Admin?)

 It's odd, because program is copying the images, as I've noticed and previously described, not hotlinking.  ??? ??? ??? ??? ??? ??? ??? ???




Moved around a few things on the index.php file. I noticed as it was, even with added line of code arraying the images, I was getting a "invalid filetype extension" in the alert box when I'd immediately try checking via visiting the site.


dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #7 on: February 08, 2019, 01:28:11 am »
I have tested with conejo.me default example images, and it worked. As long as remote server permits, it is designed to import them from web.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #8 on: February 08, 2019, 01:30:17 am »
Hotlinking is part of your server protection, visit your cPanel (or config) and turn it off.

d33p

  • Newbie
  • *
  • Posts: 17
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #9 on: February 08, 2019, 01:47:14 am »
I'm getting the hotlinking image even with a local path to the images on the same server. It's  file in OSClass itself.

I'll try re-DLing the index.php file. Maybe I've changed something else somewhere?

d33p

  • Newbie
  • *
  • Posts: 17
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #10 on: February 11, 2019, 08:36:12 pm »
OK; undid a few changes (that were attempts to solve without realizing the array was missing...duh) and now it's working 100%.



Oh, and, it also helped that I checked and realized that last time I dealt with this add-on before the weekend, I was testing with a different XML file than  I was, at the time, modifying. Soooo..that kinda skewed my results as well. lol   :-[

(It was a long day....  :P :P)

PS Thanks, kindly, for all your help! Very much appreciated!!!!!!!

omid_firoznia

  • Newbie
  • *
  • Posts: 37
Re: IMporting IMAGES with Ad Importer free AddOn
« Reply #11 on: March 15, 2019, 02:57:21 am »
Hi

how to set "importer" that not import duplicate ads?