WebCam Images


A WebCam is a camera that regularly uploads new images to a Web server for display on one or more Web pages. The Web page displaying the WebCam image uses an img src tag that includes the URL to the image. As a result, the latest version of the image automatically appears when the page is loaded.

Once you have a WebCam set up, it's easy to include the image in your WordPress blog. In this section, we explain how to display a WebCam image in the sidebar of your blog (Figure 19).

Figure 19. One of Maria's blogs, wickenburg-az.com, has three WebCams on the home page.


Tips

  • These instructions assume that you have already set up a WebCam and that the images are already being uploaded regularly to an Internet-accessible server. Instructions for setting up WebCam hardware and software are beyond the scope of this book.

  • WebCam images are not animated and do not automatically refresh. It may be necessary to clear your Web browser's cache or restart your Web browser to display a revised image, depending on the browser and its settings.

  • For best results, the WebCam image should be sized so it fits where you want to display it. For example, if you plan to display the image in the sidebar, as discussed here, the image should be narrow enough to fit in the sidebar.


To add a webcam image

1.

Consult your WebCam software to get the complete URL for the WebCam image file (Figure 20).

Figure 20. In this example from EvoCam WebCam software, the Location box displays the FTP upload location. This is easily converted into an http:// URL. (Miraz can be such a ham.)


2.

Open the sidebar.php file for your site in a text editor.

3.

Insert the following code where you want the image to appear:

<li><img src="/books/2/586/1/html/2/http://www.example. com/pathtoimage.jpg" alt="Webcam. " /></li>


Be sure to use the URL you obtained in step 1 (Figure 21).

Figure 21. Insert the code where you want the image to appear.


4.

Save the edited file.

5.

View your blog to see the WebCam image (Figure 22).

Figure 22. The WebCam image appears in the sidebar.


Tips

  • The Default WordPress sidebar is 190 pixels wide. For best results use a WebCam image with a width less than 190 pixels.

  • You can also create a Page with a larger version of the image and more information about what visitors are viewing. Then you can link the sidebar image to the Page you created. We explain how to create Pages in Chapter 3.





WordPress 2. Visual QuickStart Guide
WordPress 2
ISBN: 0321450191
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net