Block Management


It will probably come as no surprise that the Administration menu contains an item named Blocks, and that clicking on it will take you into the Blocks Administration screen, shown in Figure 8.1.

Figure 8.1. The Blocks Administration menu.


Now, unlike the Modules menu, which lists every installed module, the Blocks menu lists only those blocks that you've specifically added to it. Blocks can still be activated and deactivated, but there's a whole slew of 'em available to you that won't be shown on this menu. More on that in a bit.

The Blocks menu has seven columns:

  • Title. This is the title of the block, as it appears on your Web site. You can change this to whatever you like.

  • Position. This lets you decide whether you want the block on the left- or right-side column of the page.

  • Weight. This enables you to configure the order in which the blocks appear. Just click the little arrows to move a block up or down in the list. Note that sometimes PHP-Nuke gets confused: You'll have multiple blocks with the same weight number, and the wrong arrow buttons will appear. If this happens, go to the bottom of the list and click Fix Block's Weight Conflicts, and PHP-Nuke will regroup and fix itself.

  • Type. This is the type of block. A few blocks are built by PHP-Nuke itself, and these have a type of SYSTEM. Most are read from a file on the Web server, and these have a type of, obviously, FILE. There are other types, but you don't really need to sweat this particular detail.

  • Status. This is Active or Inactive, telling you whether the block is currently appearing on your site.

  • Visible To. This lets you decide who can see the block. Your options include All Visitors, Administrators Only, Registered Users Only, and Subscribers Only.

  • Functions. Finally, this column contains links enabling you to edit a block, delete it, or deactivate it. Inactive blocks contain a Show link that activates the block.

Below the list is the Add a New Block section, which is whereyou guessed ityou add new blocks to the list. Blocks offer a lot of flexibility, but, unfortunately, this Add a New Block section is unnecessarily complicated. Here's what to do (Figure 8.2 shows the screen if you'd like to follow along):

  • Title. This applies to all blocks and is the title of the block as it will appear on your site. Keep titles short because most themes will get messed up if block titles run more than one line of text.

  • RSS/RFS file URL. Some explanation is in order. An RSS feed is basically a set of news headlines pulled from another Web site. The headlines are displayed within the block as hyperlinks, which link back to the site that the news came from. Yahoo! News provides several RSS feeds, for example.

    There are two ways to configure an RSS feed. One is to select Custom from the drop-down list and type the URL of an RSS feed, which you normally pick up from the site that's offering the feed. The second option is to select a preconfigured feed from the drop-down list; PHP-Nuke comes with a couple of dozen. You can also click the Setup link, to the right of the drop-down list, to configure your own feeds for future use.

    If you configure an RSS feed, you can skip down to the Position item on the Add a New Block screen. You won't use Filename or Content.

    Honestly, the easiest way to see this in action is to try it. Figure 8.3 shows a portion of the news.yahoo.com Web site. Notice in the left column of the site that several XML icons appear (other sites use a similar RSS icon). That's your indication that the RSS newsfeed is available. Click on the XML link, and you'll get a funny-looking page; copy its URL from your Web browser into PHP-Nuke, and you'll be able to add that newsfeed as a new block and see what it looks like on your site.

    Figure 8.3. Finding RSS feeds.


  • Filename. Assuming you didn't decide to create an RSS block, you can select an existing block filename from the Filename drop-down list. I discuss the available files in the next section of this topic. If you do select a file, you won't use the Content text box.

  • Content. If you didn't select either an RSS feed or a filename, you can provide some plain HTML content that will appear in your block. This is a handy way to add a brief, static message to your site.

  • Position. Select Left or Right to have this block appear on that side. After you add the block, you can adjust its vertical position using the block list, as I described earlier.

  • Activate URL. Simple: Do you want the block turned on or not?

  • Expiration and After Expiration. Blocks can expire after a specified number of days. After they expire, you can have them deactivate themselves or be permanently deleted (note that deleting removes them only from the list; it doesn't delete any files on disk if the block is a file-based block).

  • Refresh time. This applies for RSS blocks and controls how frequently PHP-Nuke re-fetches the headlines.

  • Who Can View This? Select Registered Users, All Visitors, Administrators, or Subscribers.

  • Visible to Subscribers? Choose Yes or No. This option enables you to define a block of, say, advertising that is visible to All Users but not visible to subscribers, who may have paid for the privilege of not being inundated with advertising on your site.

Figure 8.2. Adding a block.




    PHP-Nuke Garage
    PHP-Nuke Garage
    ISBN: 0131855166
    EAN: 2147483647
    Year: 2006
    Pages: 235
    Authors: Don Jones

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