http://www.classified-software.co.uk/forum/viewtopic.php?f=1&t=8
Using The Maffo Bulk Upload System
Chapters
1. About
2. Prepping Your CSV file
3. Prepping Your Images
4. Using the Maffo Bulk Upload System
UPDATE Version 2
The bulk upload system now has the ability to accept listings from MULTIPLE users.
1. About
The mbu is designed to allow you to upload mass listings to your 68 classifieds
website. Take your 68 classifieds system to an entirely new level, you now have
the ability to approach companies with huge databases of information and upload
them to your website.
With the mbu:
- No Programming or code changes are needed.
Works with Developer or Designer Versions.
**NEW**
Verifies and validates Users via their email address or Username
*********
Verifies and validates the categories on your CSV file. If a category exists
within your CSV file but not on your 68 Classifieds system, the mbu will
help you correct this.
Verifies and validates images. This system allows for bulk upload of listings
along with their images. Should the system be searching for an image that
doesn't exist you will be prompted to correct the matter before continuing.
Verifies and validates extra fields. This was no easy task but the mbu can
validate most types of extra fields. Should an extra field be invalid within
your CSV, you will prompted to correct it.
Once these steps are completed, the system takes over itself and starts the
upload process. A typical ad with 2 large images 800*600px at 200kb will
take approx 1 second to process so 1000 records will take 1000 seconds or
16minutes
VERY IMPORTANT NOTE
The mbu DOES NOT and CAN NOT handle extra field types of:
- FILE UPLOADS
PARENT DROPDOWNS
CHILD DROPDOWNS
fields.
2.Prepping Your CSV file
For starters if you don't know what a CSV file is, you maybe shouldn't be using this
program until you have done your homework. I would suggest using either
Microsoft excel or OpenOffice.org Calc to generate your csv files.
I have included a sample CSV inside the mbu package, please open it with your
preferred spreadsheet program.

You can see the first 8 columns here in our sheet. You MUST have the columns in
the EXACT order that I specify. You can only go wrong with this system if you DO
NOT FOLLOW INSTRUCTIONS!!!
ID
The spreadsheet MUST contain an ID, this is not the product ID it just needs to
contain a numeric individual ID. Its easiest to start at 1 and auto fill drag down
the column to automatically fill in the ids for the rest of the column.
***NEW***
Client
With this latest version of the MBU you have the ability to upload listings from multiple users.
The column 'Client' has been added to the CSV and you MUST enter a value for each entry in this column.
You have the choice of entering an email addresses OR usernames. You can not mix the column with both.
Once you have launched the MBU module you will be asked to select Email OR Username.
************
Section
The CSV must contain a section, only a numeric value will be accepted by the
mbu, however, as you can see in the above diagram there are text values such as
cars and bikes. The mbu will flag when this happens and you will be able to
convert all text values to their numeric value. The system also looks for any
section values with the same name, in this example there are two that say cars,
so the system will allow you to change both of them at the same time to save
time. Also if an illegal number is entered, lets say 12 doesn't exist in your table,
you will be prompted by the mbu to enter a correct category.
Title
The system expects a title for each ad, it doesn't matter how long the title is as
you can set this to be cut to certain length once you initialize the mbu, eg 100
characters. If you have no title, this is not a huge problem but under no
circumstances remove this column from the spreadsheet.
Short Description
If you use short descriptions they are to be placed in this column. Length is not
important as the mbu will allow you to choose the length and will cut it down to
that specified length.
IF YOU DO NOT USE SHORT DESCRIPTIONS

You can DELETE the entire column, DO NOT delete contents or cut, be sure to
remove the entire column and you should end up with a spreadsheet that looks
like this.

Note the description is now in column E
When Using the MBU be sure to set the SHORT DESCRIPTION length to zero.
Description
Functions exactly the same as above. If you choose not to have descriptions,
remove the column as above and set the DESCRITPION length to zero in the MBU
Price
The system expects a price column. DO NOT REMOVE IT!!!
The price can have a decimal point but DO NOT use a currency symbol. If your
spreadsheet contains currency symbols it is very easy to format the column to a
plain number.
URL
The system expects a URL column. DO NOT REMOVE IT!!!
Whether you allow URLS or not you must leave this column on the sheet.
Hint, outbound quality links are great for your SEO!!!
Images
The mbu system handles images very easily as long as it receives the correct
information. First you must decide how many images you are allowing your
client.

In my example there I have allowed for two images. If I want to add a third I will
need to add Image3 and an Img3 Title to the sheet to look like this.

Images MUST go BEFORE the EXTRA FIELDS!!
You can have as many or as few images as you require.
Image Titles
You can choose to have or not to have Image titles but the choice must be the
same for all images, in the example above all three images have titles.
In this example below I have removed the img title columns

In the mbu system you will be given a choice whether to use image titles from the
CSV file. If you have image title columns on your spreadsheet, be sure to choose
this option. If you have removed the image title columns you will have the choice
of whether to generate titles from the image name or from the title of the
advert.
On testing the system on a Windows Server and on a Linux Server, I had no issues
with lowercase or uppercase images, it seemed to find the file no matter what.
Please contact me if this causes you any issues and we can investigate it.
All images upon processing will be named and stored as lowercase.
Be sure to read the section on Prepping Images as this extremely important.
Extra Fields
Nasty Extra fields have been a nightmare to program but your King, Maffo has
managed to make validation possible.
I will re-iterate what is at the top of this documentation..
THIS SYSTEM CAN NOT MANAGE FILE UPLOADS, PARENT OR CHILD DROPDOWNS
If you are using these types of extra fields on your 68 classifieds system then I
advise you not to use this software.
You can add as many or as few extra fields as you wish.
Once you start the MBU process, you will asked to check which ones you are
including.
Make sure you tick the exact same amount you have on your CSV file/
spreadsheet.
IT IS VITAL that the extra fields on your CSV are in order of ID. In your 68 admin
-> extra fields. Each extra field has an ID and an Order. The Order is not
important but the ID is!!! In the example below from 68 admin->extra fields,
Color comes 1st on our CSV because of its ID regardless of its order!!

The mbu system will check the extra field,
1st to see if that extra field is actually allowed in that category.
2nd to see if the extra field is required but you have a blank space.
3rd to check that the value of the field is valid for example if you have a dropdown
with 3 options and your value doesn't match one of these 3 options, the system
will flag and you can put this right.
Special Note on CHECKBOX extra fields.
I have written a function that will validate checkbox fields for example...

The above is how I would select my options in the normal process of placing an
ad.
Suppose we receive our data in the form of the image below

We need to 'concatenate' the boxes all into one. What a horrible word
concatenate. It sounds complicated but it is really simple to do.
Step 1
We want to change all of 'yes' answers to the column name. This is easy to do,
click on the column header to highlight the entire column, press 'ctrl & f' and
replace 'yes' with the column name so it now looks like this.

Step 2
Concatenate the columns using this formula in the next available column. In my
example this is column R.
- Code: Select all
=CONCATENATE(N2;"|";O2;"|";P2;"|";Q2)
VERY IMPORTANT that between each column name in your formula you place a "|"
just like in the example

Upon pressing enter your values will 'concatenate'. You can copy and paste the
formula down the entire column so you should have a Spreadsheet that looks like
this.

The final step is to Copy column R and Paste WITHOUT FORMULA or AS A VALUE

This will make the values in column, absolute so you now remove the four
individual checkbox columns leaving you with the correct format for use within
the mbu system.

Saving
The information must be placed within your CSV file/spreadsheet like this.
Save the file as CSV, some systems may call it a txt file but normally it will say
CSV. The standard operators are:
- Code: Select all
Field Delimiter ;
Text Delimiter “
Its best not to play with these too much but as a precaution you might be best to
run a find & replace(CTRL & F) on your spreadsheet to see if you have ; or “
within your new listings.
One quick note, you can call your column names anything you like. Just make
sure that it is obvious to you and your client what the column names mean.
Thats it!!! Thats your CSV prepped. Check it and double check it. This info is
being injected into your database to the utmost care is imperative.
4.Prepping Your images.
Another vital part of this process is prepping your images. Many times you will
receive a bulk load of images of all shapes and sizes. Before we start using the
MBU system we will be uploading all of your clients images to your website so it is
extremely efficient to prep your images beforehand to save you an incredible
amount of time with uploads and also once the MBU system is actually processing
your records.
REMEMBER. Processing images is what uses all of your server resources whilst the
MBU system is running.
I have bundled two pieces of software with this package. PIXresizer & 'Picture
Resize Genius'
1. PIXresizer is freeware, yes 100% free and works fast.
2. Picture & Resize Genius is not free and also works slower than PIXresizer. This
is trial software but a purchase is something small , under $30usd. I
recommended this software as you can place watermarks on your pictures like in
this example. This is great for putting your site name or an even better gimic is
to put your clients name on there.

I will run through a quick sample of bulk image resizing.
As an example I will use a folder of really high quality images from my holidays in
the South of France.
There 425 images and measure 1.11Gigabytes in total.

This is simply far too much to upload to my server, the pictures are huge and are
averaging 3mb each. I would hate to think how long it would take to process
these images so lets run them through PIXresizer.
First I need to create a new empty folder and I will call it resized_france.

1. Source & Selection
Locate my 'source' folder which is france.
Locate my 'target' folder which is resized_france.
I want to search any subfolders in case there are any pictures not in the top folder
but not I do not select 'Copy Directory Structure'. This is because we want all of
our new resized images inside the same folder with no sub-folders.
2. Select new size
I think 600px is more than adequate for a classifieds site. Note, for best results
make sure you use the same size in your 68 admin image settings.
3. Select File Format
You have two options here, you can either convert all the images to JPEG format
or use SAME as ORIGINAL. If you convert all to JPEG then in your CSV, all image
files must end in '.jpg' . You easily do this be doing a 'Find & Replace' in your
spreadsheet program (normally CTRL & F together)

In my example I keep the images in their original format and do not alter the file
type.
NOTE: PHP uses the GD2 graphics library to manipulate graphics. Its not perfect
for usage with gifs or pngs with transparent backgrounds. If some of your images
appear with black backgrounds this is the explanation.
4. Save the pictures
Sit back and go make a quick coffee while the files resize. My pictures are
resized in less than 4 minutes!!! Great!!

WOW!!!! Look at the difference in the folder size!!! 27megabytes compare to
1150 megabytes!!! This folder is now really easy for me to upload via ftp and will
take minutes, not days.
Here is a sample of the photo quality.

As you can see, more than adequate for a classifieds site.
Unfortunately visitors to my classifieds site don't want to see pictures of me in
France, they want to see photos of the ad listings.
Using exactly the same principles I convert my motorbike and car images and
upload them to...
modules/maffo_bulk_uploads/clients_images
You can upload a folder to that directory also, but you must specify this in the
mbu system, more info is below.
EG modules/maffo_bulk_uploads/clients_images/honest_bobs_motors
In the mbu system, when prompted you put
clients_images/honest_bobs_motors
Thats the images prepped.
Be sure to give Picture & Resize Genius a trial as well just to see what you think.
Yes it is a hell of a lot slower but the watermarks make all the difference.
5.Using Maffo Bulk Upload System
Well you have persisted and believe me thats the hard work done. Hopefully!!
5.1 Access the module in your 68 admin -> manage modules.
Locate the maffo_bulk_uploads mod and click admin
The module should load up, if it doesn't try re-installing it or report the issue to
myself, Maffo, your King.
Ad Settings

Very simple to do.
*** NEW ***
Choose the listing package you want these ads to conform to.
The only elements that will be taken from the Packages are
1. The title length
2. The short description length
3. The description length
IMPORTANT: If you have 0 Characters for your short description length or description length, be sure that these columns do NOT exist in the CSV file.
Remember if you are not using either of these, set to 0 and remove the column
from your CSV file/ spreadsheet.
Will you allow html tags? Place in here in the format shown. Note you do not
need closing tags such as </p>
Are the records active? Easy yes or no?
Date added and date expiry? Again super simple
Listing extras, you can set all the ads to bold and/or highlighted and/or featured.
Be sure to charge your client sufficiently!!
Continuing further we reach the vital information where a mistake could be
crucial.

Set how you have identified your clients in the CSV. Choices are Email or Username
Set the amount of image columns you have. In my example CSV I have 3. I am
not using image titles so I have the option to generate image titles for me from
the image name.
The Route to the image source by default is in your clients_images folder which is
inside the modules/maffo_bulk_uploads folder. I recommended uploading all
images to here. If you upload an entire folder eg 'honest_bobs_motors' then
simply add this to the end of the source folder so
clients_images/honest_bobs_motors
I am including both the color and year (NOTE THE ORDER--- THEY SHOULD BE IN
THIS ORDER ON YOUR CSV!!)
Browse for your CSV
My example sheet contains column names so I will set this next option yes so that
my column names are not treat like an ad listing. Remember you can call your
column names anything you like.
I will leave the Field Delimiter and Text Delimiter how they are in their default
state.
Auto-Tick checkboxes. As a beginner with this system I do not recommended
using this. Should you have an error and the same error applies to other listings,
the option to change all or some of them will appear. With this set to Yes, all the
similar ads are automatically checked. Use with caution and once you are
familiar with the way the system works.
Click submit
The mbu system will now perform some validation checks on the initial
information you have given it.
If validation fails, an error in red will appear at the top which you must amend to
continue.
Once validation is passed, the CSV file will be uploaded to your database.
You should see 3 'random' listings from your CSV file uploaded. Take the time to
have a look and make sure that the right data is in the right fields. If not go back
to the start. If so you can continue.
There is no need for me to write any further more on the actual system processes
as each page contains full instructions on what you are doing.
Just be sure to read everything clearly before you click on anything.
The system offers you the chance at every stage to back up your work. This is
fully recommended if you are working and changing lots of info from your original
CSV file. It takes only a second to back up your work so there is no excuse and
shame on you if you have to repeat a load of processes.
Once you have gone through all the validation the mbu system will tell you that
its ready to process the records.
I fully recommend taking the site offline for this. As soon as the process is
complete it will automatically put it back online so you wont lose a seconds more
trade than you need to. Taking the site offline allows the server to fully commit
to your task and get the job done rather than sharing its resources with lots of
other users, all of which having an ultra slow experience as your server is panting
for breathe.
Once processing, if the server times out (a blank white screen or an execution
failed warning) then you are processing to many records at a time. Refresh the
page.
If this is happening constantly.....
You can open up the file maffo_bulk_uploads/includes/maffo_limits.php and
reduce the amount of records being processed at a time. The more records the
system can process in one time, the faster the job will be done. Once you have
changed the limits, press refresh on your browser again and monitor the
performance.
You then sit back whilst your site fills up with ads!!
Once the system has processed your records, take the time to 'open a new
window' and have a look at some of the records you have uploaded. If they are
correct, great, if something is wrong you remove the entire batch you have just
uploaded by entering back into the MBU system. You will only get one opportunity
to do this so this is why it is vital you check your listings straight away. You have
been warned.
Thats the lot enjoy the system and tell all your friends!