Dev Mod CSV Bulk Auction Importer

Discussion in 'Modding/Theme Help' started by renlok, Jan 10, 2013.

  1. renlok

    renlok Administrator Staff Member

    Joined:
    Oct 20, 2008
    Messages:
    2,858
    Likes Received:
    330
    Title: CSV Bulk Auction Importer
    Version(s): Any
    Credits: renlok
    Install Time: 1 min
    Install Difficulty: easy
    Description: A very bare bones CSV auction importer

    Files/List of changes:
    v0.3 (1/10/2013):
    - Fixed images and start time now being imported correctly

    v0.2 (1/10/2013):
    - Fixed for versions under 1.1
    - No longer need to enter start/end times

    v0.1 (1/10/2013):
    - Initial release

    Instructions:
    Install
    ------------------
    - upload contents of to upload to your WeBid installation

    Usage
    ------------------
    - You must be logged into your WeBid sites admin then direct your browser to http://yourwebid.com/admin/bulk/batch.php
    - You can either upload the csv file to the admin/bulk folder on your server or upload it via the web interface

    Notes
    ------------------
    - The colomn headers in the CSV file MUST match with the names of the colomns in the webid_auctions database table although you can leave out colomns if your not using them
    - With images you have to give thier absolute server address i.e. /home/user/renlok/webid/admin/bulk/myimage.jpeg or you can reference them with the address relative to the batch.php file
    - As for start time, end time and duration all but duration can be left blank and it will start the auction now and calculate the end time for you

    Bulk Uplaoder - 1.0-.zip is for all version of WeBid 1.0.6 and under
    Bulk Uplaoder - 1.1+.zip is for all version of WeBid 1.1.0 and higher
     

    Attached Files:

  2. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    I got these errors:

    error1.jpg

    So, in 'batch.php', I changed lines 15, 16, and 17 to be:
    And then when I run 'batch.php', with my .csv I got:
    batchuplaod1.png

    But no new auctions show, and no new info is in the mysql database.
     
  3. renlok

    renlok Administrator Staff Member

    Joined:
    Oct 20, 2008
    Messages:
    2,858
    Likes Received:
    330
    If you download Bulk Uplaoder - 1.0-.zip it should be working fine now also cleaned up the auctions.csv a little
     
  4. Maryann

    Maryann New Member

    Joined:
    Dec 4, 2012
    Messages:
    13
    Likes Received:
    0
    I see a download for 1.1+, has a new version been released? If so, when can I get it?
     
  5. renlok

    renlok Administrator Staff Member

    Joined:
    Oct 20, 2008
    Messages:
    2,858
    Likes Received:
    330
    haha no not yet atm thats just for people who use dev releases for now. But hopefully a new release will be coming in the next month or a so
     
  6. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    Now if thumbnail images were working correctly, this little beta script would already be very powerful.

    "item.php" automatically tries "getthumb.php?w=120&fromfile=uploaded/AuctionID#/IMAGE.jpeg"

    If you have specified the absolute image address in your CSV file, "item.php" will add the absolute DIR to this. So, for example, mine looks like:
    "http://xxxxxxx.com/getthumb.php?w=120&fromfile=uploaded/35//xxxx/xxxxxx/public_html/uploaded/35/1.jpeg"

    The correct location is:
    "http://xxxxxx.com/getthumb.php?w=120&fromfile=uploaded/35/1.jpeg"
     
  7. renlok

    renlok Administrator Staff Member

    Joined:
    Oct 20, 2008
    Messages:
    2,858
    Likes Received:
    330
    haha well I'm getting warmer at least. try this View attachment batch.php
     
    leoinker likes this.
  8. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    it's working

    YES! It works! Everything works very very well!
    There is only one little "bug". And I think this can even be avoided if you write your descriptions correctly.

    If you have hyphens in your descriptions, or subtitle:
    Somtimes "-" Is being displayed as "–"
    Also, Sometimes it is not. (And is being displayed correctly)
    By looking at my own descriptions, I don't see why some would be displayed funny, and other would not.


    P.S. The .CSV file included in the package download is broken. These files are easy to break if you are using certain text editors. I use Leafpad on Linux, and it works well.

    I have attached a fixed version of this csv file. Non-needed columns are still included. I will make a fresh new sample CSV tonight with all needed columns. I may also write a step-by-step guide to batch auction creation with screenshots, etc.

    View attachment batch2.csv.zip
     
    renlok likes this.
  9. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    Okay, further testing shows that when importing CSV file, any non-existant columns are assumed as "NULL", this prevents the listing from showing up on site. Manually changing "NULL" to "0" in phpMyAdmin fixes the listing.

    To anyone that tries using this: For pictures to show in your gallery, you need to manually upload them to your auctionID folder in "Uploaded" - AFTER importing your CSV file. Example directory: "/public_html/uploaded/15"

    What I do:
    1. Take pics, crop, etc, put them into folders ordered by what their auction ID will be. (Folder names of: 1, 2, 3, etc)
    2. Upload CSV file. This then creates a folder for each auction number in your "uploaded" folder on server.
    3. Now you can go "uploaded" dir with ftp and copy+paste your folders(on comp) to your server. Click "overwrite".

    Your pictures will now show in your auctions, without refreshing cache.
     
  10. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    I feel like a spammer making 3 posts in a row, but I'm back after a couple hours of editing auction listings.
    I strongly discourage anyone from actually trying to use this Mod version 0.3 on an active site.

    The reasons:
    1. If you use non alphanumerical characters, they will be replaced with gibberish.
    2. If you make any error in your CSV, you could be spending hours trying to fix a bunch of errors in auction. (Like if you get your picture #'s and auction #'s out of synch, it will be a nightmare)
    3. After CSV file is imported, No users besides Admin can edit the auctions.
    4. There is still too much that has to be done manually.
    5. Only admin can use this script at it's current stage of development. (V 0.3)
     
  11. helios

    helios Member

    Joined:
    Sep 26, 2012
    Messages:
    43
    Likes Received:
    2
    If I change the file with Microsoft Excel 2007 No auction is uploaded.
    What is a good software progam to use this ??
     
  12. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    Did you download and edit "batch2.csv.zip" which I attached previously? If you edit that file with Excel and save as .csv with txt formatting, it should work. You will need to specify your own settings (such as user#)
    Double-check your .csv edits by comparing them to my original. (View with notepad or other text editor)

    I was going to create a "How-To" on .csv imports, but I haven't yet. Those who would need a "How-To" are likely to cause themselves more headaches than it's worth (with this mod in it's current state. V0.3 )
     
  13. renlok

    renlok Administrator Staff Member

    Joined:
    Oct 20, 2008
    Messages:
    2,858
    Likes Received:
    330
    Yeah this mod still needs quite a bit of work. It really needs some sort of data checker and a confirmation page
     
  14. helios

    helios Member

    Joined:
    Sep 26, 2012
    Messages:
    43
    Likes Received:
    2
    Okay, upload only from server, no upload from desktop and no photo upload.
     
  15. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    what are you trying to say?
     
  16. helios

    helios Member

    Joined:
    Sep 26, 2012
    Messages:
    43
    Likes Received:
    2
    What I mean is , if I copy the batch file to my server to admin/bulk. The auctins are uploaded without pictures.
    If I have the batch file in my computer and want to upload from my computer no auction is uploaded.
     
  17. leoinker

    leoinker Donor Donor

    Joined:
    Dec 31, 2012
    Messages:
    35
    Likes Received:
    1
    You need to manual add your pictures to the appropriate folder in your WeBidInstallDIR/Uploaded
    Your auction ID # is the same as the folder number.
    If you're not already, I suggest using an FTP client for this. It will save much time.
     
  18. grandpha

    grandpha Donor Donor

    Joined:
    Feb 17, 2010
    Messages:
    207
    Likes Received:
    10
    Seems to work fine so far . The only error I see is that the auctions uploaded like this are not shown in the counters.I just uploaded the sample csv file that comes with the mod and has 9 auctions and my counters only shows the 4 auctions I had listed before.
     
  19. helios

    helios Member

    Joined:
    Sep 26, 2012
    Messages:
    43
    Likes Received:
    2
    You have to refesh the counters in admin panel
     
    grandpha likes this.
  20. grandpha

    grandpha Donor Donor

    Joined:
    Feb 17, 2010
    Messages:
    207
    Likes Received:
    10
    I'm planning to upload about 3000 auctions and creating 3000 folders and manually adding the pictures in them is not a pretty idea. On another software I would just put all the pictures in one folder create the image path and that's it. The nicest thing would be to make a folder , upload all the pictures in it and than let the script move the matching image files to the "uploaded" folder. I'm saying this from experience, my last distributor had an image folder containing over 15000 images and I only needed about 3000. For me was a pain to find a way to extract only the needed images.
    Also I don't know what is wrong , I created a new .csv file replaced the original with the new onee and after I click submit the same 9 auctions that came with the original file were loaded.
     

Share This Page