Home > Articles > Programming > PHP

Writing a Story in PHP-Nuke

📄 Contents

  1. The Add New Article Screen
  2. Formatting Your Story
  • Print
  • + Share This
At its base, a website's function is to provide information to users, and the most simple way of doing this is a news story. This chapter explains how to format and build a news story on PHP-Nuke.
This chapter is from the book

This chapter is from the book

PHP-Nuke is set up so that stories—news articles, whatever you want to call them—form a central part of your site. That does not have to remain the case; if you want your site to focus primarily on downloads, then make that module (Downloads, that is) the module that appears on your site's home page and disable the News module completely. But most sites will want to have a place to post announcements, at least, and the News module is good for that, too. Plus, whatever module is in the home page must be accessible to all visitors, and you might want to restrict access to other modules to just those users who've registered with you (which is free for them) or subscribed to your site (which might cost something).

Writing a story, then, is a fundamental part of managing a PHP-Nuke site. To start, click the NEW Story link in the special Administration block (which only administrators can see). You can also click the Add Story item from the Administration menu.

The Add New Article Screen

Figure 9.1 shows the top part of the Add New Article screen, which is where you'll write your story.

Figure 9.1Figure 9.1 Adding a new article.

Start by providing a title. Be descriptive; titles like "Hey, this is cool" don't really draw readers in. Think newspaper headlines: "Thousands Cheer for New Apple Pie Recipe" or something really catchy.

Next, select the topic. Now, if you haven't set up your topics yet, you should do that from the Topics item on the Administration menu. The default topic, PHP-Nuke, is probably not going to be very descriptive for you. You can also select associated topics, which might be topics that this story has something to do with but aren't really the best topic for it. For example, an article on apple pie would certainly have a main topic of Desserts, but it might have associated topics, such as Pastries or High-Fat Food. These associated topics will show up as links when the reader views your story, helping them find additional, related (at least vaguely) content.

Next, you'll need to select a category. There's only one default category, Articles. You can think of categories as sort of subtopics, I guess. To add, edit, or delete a category, just click the appropriate links to the right of the Category drop-down list. Categories aren't related to a single topic; all of the topics on your site share the same categories.

Yeah, I know, this is confusing. Maybe an example would work better. Let's say you have the following topics: Desserts, Entrees, Appetizers, and Sides. Now suppose you create the following categories: News, Recipes, Meal Plans, Tips, and the default, Articles. Now suppose you post a new apple pie recipe: That'd be in the Desserts topic, in the Recipes category. What about a news article on new heirloom apples? News topic, Articles category. Not every topic- category combination will make sense (Entrée News?), but you don't have to use them.

When readers view an article, they'll be able to cross-link to a list of other articles in the same category or topic, so categories and topics really just provide a way of organizing articles according to two separate lists. That way, readers can quickly get a list of recipes or read everything you've written about entrees.

Okay, hopefully that makes sense. Your next choice is whether this story will appear in the home page (assuming you've set up the News module to be in the home page). You can also choose to activate or deactivate comments for the story, although for comments to be active, the site-wide preference must also be enabled (I cover those preferences in Topic 6, "Configuring Site Preferences").

Now comes the fun part. For story text, enter a short lead-in paragraph that will appear under the story's headline. The Extended Text box should contain the remainder of your story. And while you can put basic HTML tags in the story, PHP-Nuke filters out most advanced tags. For example, you won't be able to embed client-side JavaScript, styles, and so forth.

Finally, you have the option to program the story, meaning that you can keep it in reserve and have it automatically appear on a specified date at a specified time. When you're all done, you can preview your story to see what it will look like, and then go ahead and post it for all to see.

  • + Share This
  • 🔖 Save To Your Account