After having problems with RapidWeaver publishing my site over FTP, I searched the net looking for solutions. After looking for an answer to why my FTP client is uploading files of size zero, a quote from the movie Zoolander came to mind. Will Ferrel as the evil Mr. Mugatu in response to his feelings about fashion model Derick Zoolander being famous for his many modeling facial expressions all of which are exactly the same says “I feel like I’m taking crazy pills!” These quotes will help you understand:
National Instruments
http://digital.ni.com/public.nsf/allkb/4D5B0EF024E178B386256DF2007A6909Situation:
After you install Norton Internet Security for Macintosh 2.0.x, when you upload a file to an FTP server using an FTP client in passive mode, the file you upload is empty or contains 0 bytes.Solution:
In some cases when uploading files to an FTP server with an FTP client in passive mode, the files uploaded are empty or contain 0 bytes.
To avoid uploading empty files, disable passive mode in your FTP client and use active mode to transfer files. To disable passive mode in your FTP client, see the documentation for the FTP application that you are using. You may also need to disable passive mode in Mac OS X if it is enabled.
OK, so I should FTP in active mode? National Instruments seems to be so sure.
Symantic
http://service1.symantec.com/SUPPORT/num.nsf/pfdocs/2003013010180811Problem:
When I use the FTP Put File VI to upload a file to an FTP server, why does the file appear on the FTP server as an empty file with 0 bytes size? The VI does not report an error.Solution:
You must send the passive command before you can upload files to an FTP server that does not allow anonymous logins but requires you specify a username and password. The passive command requests the FTP server to listen on a data port that is not the default data port and to wait for a connection instead of initiating one when it receives a transfer command.Wire a FALSE constant to the active input of an FTP Put VI to send a passive command to an FTP server, as shown in the following image…
Wait, my problem must be solved in active mode! Hmm… why doesn’t my client have an indecisive mode? The real answer depends on your individual situation so you must read up here to get a clue:
Two more features that seem necessary to an inventory are searching and a tag list. A quick look at codex.wordpress.org shows that there are two basic parts to their built-in search engine. The search field and button, and the search results page.
Stick this code in your sidebar or wherever you want the search field and submit button to show up on your website: “<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>”
Then you have to create a page which is where the search results will show up. Copy your inventory page and call it searchform.php. Put it in the same directory as your inventory page. Cut out the section of your page that starts with “<?php if (have_posts()) : ?>” and ends with”<?php endif; ?> “. This is called “the loop” and usually is inside your content div. Replace it with “<?php /* Template Name: Search Page */ ?>”. That should do it!
Now to add a tag list or cloud. This shows you a list of all the tags you use on your inventory so people can see features or descriptive words of your inventory and click on them to see a list of items that are tagged. Put this code in your sidebar or wherever: “<?php wp_tag_cloud(”); ?>”. The default format is as a cloud, where the tags with the most use are in bigger sized fonts. To make them show up as a list use “<?php wp_tag_cloud(’format=list’); ?>”.
The search needs more capabilities, like being able to click checkboxes to search for specific keywords, and select price ranges and the like, but I haven’t found any info on that yet…
Adding a photo gallery for each inventory item goes like this:
- Upgrade to Wordpress 2.7 or later.
- Install http://www.jarinteractive.com/code/photoJAR/photojar-base/
- Install http://www.jarinteractive.com/code/photojar/photojar-post-thumbnailer
- Install http://stimuli.ca/lightbox/
- Replace all HTML for the image you have in your inventory posts with , or to make it square and cropped.
Now all the images in the Wordpress gallery are in a pop-up slideshow-like gallery when you click on the image in your inventory post. Also, since I am using RapidWeaver as mentioned before you must add a little more code.
- In RapidWeaver, for each inventory page, click Page Info.
- Click the Header button.
- Under the Header tab below add <?php wp_head(); ?> on a new line in the text box.
- Remove the line “<div style=”clear:both”></div>” from “yoursite.com/yourwordpressdir/wp-content/plugins/photojar-post-thumbnailer/default-theme.php”
I’m not positive but I think this gets code from all your plugins and puts it in the <head>. I noticed after adding it, there was a section called “lightbox script” in the source code when viewed online.Basically, the that you added to the post HTML is called a shortcode in Wordpress lingo. The plugins you install modify what those shortcodes mean from the default in Wordpress.I noticed that my custom fields now fall below the image. My next venture will be to try and change the CSS for Lightbox or photoJAR to keep the custom fields to the right of the photo.