Archive for April, 2007

CHAPTER 2 (Medical web site) CONFIGURING DRUPAL Managing Comments Any

Wednesday, April 25th, 2007

CHAPTER 2 CONFIGURING DRUPAL Managing Comments Any content can support user comments. Comments are also the principal building blocks of user forums. As a result, comments can become a defining characteristic of your site and a great source of user-supplied content. Configuring Comments To configure comments, select administer . comments . configure (admin/comment/configure). From the comment configuration page, you can control how comments are displayed and the fields for posting comments. Comment Viewing Options The first group of fields on the comment configuration page, Comment Viewing Options, controls how comments are presented on your site. Default display mode: This determines how comments appear on the page. Comments can be flat or threaded, expanded or collapsed. The comments on Drupal.org are threaded and expanded. Default display order: This determines whether comments are displayed in chronological or reverse chronological order. While this is mostly a matter of personal preference, you should consider that threaded comment listings work better in chronological order. Default comments per page: This is the number of comments that will be displayed before pagination kicks in. Comment controls: If you want your users to choose for themselves how comments should be displayed, this field should be set to display the comment controls above and/or below the comments. If you feel that this clutters the page and presents the user with too many options, you can disable the personalized comment controls. Comment Posting Settings The second group of fields on the comment configuration page, Comment Posting Settings, details comment workflow and the fields that are presented to users when they create comments. Anonymous poster settings: This determines whether anonymous users may or may not enter contact information, and if so, whether the information is required. Name, e-mail, and homepage: These are the contact information fields that are requested. If the information is required, the name and e-mail fields become mandatory fields. Names matching the usernames of registered users are not allowed. When comments from anonymous users are displayed, the name they supply will be wrapped in a hyperlink pointing to the site they entered as their homepage. Comment subject field: This determines whether the subject field should be enabled for comments. Once again, this is a matter of taste. One could argue that anyone commenting on a posting is going to talk about the posting and therefore shares the subject of the posting. On the other hand, maybe the commenter wants to address only one specific point relating to the posting, so it might make sense to allow subject fields.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services

X web hosting - CHAPTER 2 CONFIGURING DRUPAL Ordering of Filters

Wednesday, April 25th, 2007

CHAPTER 2 CONFIGURING DRUPAL Ordering of Filters Sometimes, the order in which filters are applied is important. For example, if you were to install the Smileys module so that users could decorate their posts with happy or sad faces, the Smileys module filter would look for various character sequences and replace them with HTML image tags. If the input format also included the HTML filter and it was configured to strip HTML tags, and it was applied after the smileys, the smileys would simply disappear. To avoid conflicts like this, Drupal allows you to set the order in which filters are applied. The Rearrange tab shows a list of enabled filters for an input format and their weight. Filters with smaller weights are executed earlier than filters with larger weights. If you are having any problems with your filters not generating the output that you expect, take a look at the order and try to determine where the conflict arises. Viewing, Searching, and Updating Content The content administration page (admin/node), accessed by selecting administer . content, shows an overview of the content on your site and offers a search function to assist you in executing bulk operations on multiple nodes (content) at once. Search Filters The search function has a fine-grained filter, so that you can select nodes with exactly the status, type, or category that you are interested in seeing. You can successively refine your search. Clicking the Filter button replaces it with three new buttons. These let you refine your search by adding another filter, undo the most recent search, or reset the filter altogether. The search criteria are saved in your session, so they will still be applied when you return to the content administration page (admin/node). The search filters become especially helpful when your site has a lot of content. Update Options As explained earlier in this chapter, Drupal defines four different attributes that content can have to determine its publishing status. Now let s look at the different transitions between these states that a node can take. These are represented on the content administration page (admin/ node) as Update Options. The administrator can select nodes from the list on this page by clicking the check box, and whatever update option is executed will be applied to all of the selected nodes. Approve the selected posts: Executing this action on a node will take the node out of the moderation queue and publish it. Promote the selected posts: This guarantees that a node is published and promoted. It does not influence whether the node remains in the moderation queue. Make the selected posts sticky: Sets sticky to true and published to true, so executing this action on unpublished nodes will have the undocumented side effect of publishing them. Demote the selected posts: Sets promoted to false, but leaves status unchanged. Unpublish the selected posts: Sets published to false. Delete the selected posts: Deletes all selected nodes.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

CHAPTER 2 CONFIGURING DRUPAL http://en.wikipedia.org/wiki/XSS), and the (Apache web server for windows)

Tuesday, April 24th, 2007

CHAPTER 2 CONFIGURING DRUPAL http://en.wikipedia.org/wiki/XSS), and the HTML filter is your first line of defense against these types of attacks. If the Display HTML Help check box is checked, each content creation form will display a link to the Compose Tips page (filter/tips), where users can read more instructions on using the particular filters that are enabled for them. This might be helpful if your target audience doesn t know any HTML and you want to encourage them to apply markup to their posts for linking or formatting purposes. Note that there are several contributed modules available that address this need; most users will balk at having to write HTML. Tip The TinyMCE module (http://drupal.org/project/tinymce) allows WYSIWYG HTML editing and integrates nicely with the Image module (http://drupal.org/project/image). Both modules are discussed in Chapter 4. The final field on the HTML filter s configuration page is Spam Link Deterrent. In early 2005, Google announced (http://en.wikipedia.org/wiki/Blog_spam#nofollow) that it would no longer award any page rank credit to sites based on links with the rel=”nofollow” attribute in them. This was done in response to the increasing phenomenon of spammers posting comments on blogs with links to their own sites just to increase their page ranking with Google and other search engines. Drupal quickly responded, and by checking the Spam Link Deterrent option, you ensure that any links posted by your site s users will have the rel=”nofollow” attribute, and Google will not follow them when spidering. Let s hope that the incentive for comment spam will dwindle as spammers realize that they are wasting their time. Line Break Converter and PHP Evaluator Filters The line break converter filter is less complicated than the HTML filter. Its sole purpose is to detect hard (carriage return) and soft (Shift plus carriage return) line breaks in users posts and replace them with

or
elements accordingly, so that the post retains its paragraphs without the user needing to use any HTML. No extra configuration is necessary for the line break converter. The PHP evaluator is also straightforward. Anything that falls between in the post will be evaluated as PHP code. This is great for creating custom pages or including third- party scripts into your Drupal site. However, you should be very careful to whom you grant permission to use this filter! Someone could literally write a post that reads all the information from your database, changes your password, sends mail on your behalf, or whatever else one can think of and achieve using PHP code. If you do not intend to use this filter yourself, I recommend turning it off for all input types. Caution If you don t need the PHP evaluator filter on your site, turn it off. Because it allows running PHP code, it presents a serious security risk.
Note: If you are looking for reliable webhost to maintain and run your java application check Vision java hosting services

CHAPTER 2 CONFIGURING DRUPAL Tip Many contributed (Adult web hosting)

Tuesday, April 24th, 2007

CHAPTER 2 CONFIGURING DRUPAL Tip Many contributed modules, such as the Glossary (http://drupal.org/project/glossary), Textile (http://drupal.org/project/textile), and Markdown with Smartypants (http://drupal.org/node/ 9838) modules, leverage content filtering. They work to give the people creating content more flexibility or to enhance the quality of their input. For example, some filters simplify the process of generating HTML, and others scan what is written for important vocabulary words or technical terms that have been defined elsewhere. HTML Filter The HTML filter strips or escapes any tags that are not explicitly allowed. The administrator controls the list of allowed tags for the content. To see exactly how this filter behaves, click the Configure tab for one of the filter formats for which the HTML filter is enabled (administer . input formats . configure . configure). The first option, Filter HTML Tags, specifies whether HTML tags are removed from the output completely or escaped so that the tag itself is visible in the output. Escaping involves replacing the following characters with their HTML entities: & (ampersand) becomes & ” (double quote) becomes " ‘ (single quote) becomes ' < (less than) becomes < > (greater than) becomes > Escaping has the advantage that if a user enters a tag that isn t allowed, she sees the tag in the output and can conclude that using that tag won t work. The disadvantage is that she might leave the escaped tags there, detracting from the quality of the content. Tip The Codefilter module (http://drupal.org/project/codefilter) is ideal for sites that want to discuss PHP code. The next field for configuring the HTML filter is Allowed HTML Tags. This is a space- separated list of HTML tags that you allow for this input format. The HTML Style Attributes field decides whether tags can possess an HTML style attribute. Since it is legal for almost any HTML tag to have this attribute, the HTML filter strips it by default to prevent users from writing things like this: check this out While you might not mind someone linking to his site from within a post, you will probably object if the text appears in gigantic sizes on the screen. Worse than destroying your layout, however, are the various security risks involved with allowing anyone with a user account (potentially anyone) to enter content on your site without some level of control. The family of attacks that one could perpetrate against your site in this case are referred to as cross-site scripting (XSS, defined at
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

CHAPTER 2 CONFIGURING DRUPAL With the Workflow (Web hosting account)

Monday, April 23rd, 2007

CHAPTER 2 CONFIGURING DRUPAL With the Workflow and Revisions of the Workflow Group settings, you can decide for every node type what the initial publishing state should be when the node is created. Individual modules can also inject their own workflow settings forms into the workflow group. If the Comment module is enabled, for each node type, you can decide whether comments should be read/write, read only, or disabled. If the Upload module is enabled, you can decide whether a node type should support file attachments. If so, users will be shown a file upload form on that node s create/edit page. Tip Whenever you enable new modules, check the content types pages (admin/settings/content-types) for extra options that the enabled module may have added. Filtering Content A key aspect of all Drupal sites is that they gather text-based input from users and display it in web pages. Whenever user-provided text is included in an HTML document, there is risk that the text might interfere with the HTML in some way, or even worse, allow attackers to damage a site or render it useless. This could happen in many ways, from malformed or inappropriate HTML tags breaking the carefully designed layout of a site to a single line of JavaScript code that redirects the page to a different site selling questionable merchandise. Thankfully, Drupal has a sophisticated tool for handling this threat: content filtering. The content filtering system allows administrators to decide what type of content each user role is allowed to contribute. This can range from restrictive (no HTML tags and no scripts) to complete freedom (anything goes, even PHP code, which will be executed). Each different profile is called an input format and can consist of as many or as few filters as you choose. The filters are applied at the time content is served, which means that the same input can be represented in different ways depending on which filters are applied. To configure input formats, select administer . input formats (admin/filters). The admin/filters page lists all input formats and which user roles are allowed to use them. There are also radio buttons to indicate which input format should be the default for all new content that is created. When a user s role has more than one input format available, he will be able to decide which one to use whenever he creates new content. If you feel that this places too much burden on your users to make decisions, enable only one input format for that particular role, and the choice will be removed. An input format consists of zero or more filters, which are applied to content in an order that you specify. To see which filters are involved in any input format, click Configure for one of the input types from the admin/filters page. The resulting page lists all of the available filters. Check off each filter that should apply to this input format. In the default Drupal installation, the available filters include HTML filter, line break converter, and PHP evaluator. Various modules can add their own filters, which then show up in the list. Module-contributed filters range from fun gimmicks (for example, the Smileys module replaces certain combinations of symbols like :-) with a small graphic smiley) to useful additions (for example, the Wiki module handles a full wiki syntax and functionality, all built into a content filter).
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

CHAPTER 2 CONFIGURING DRUPAL (Affordable web design) Create new revision:

Monday, April 23rd, 2007

CHAPTER 2 CONFIGURING DRUPAL Create new revision: This causes a new revision of the content to be created every time the user executes an update. When revisions are present, an extra tab appears on the content page alongside View and Edit. On this tab, revisions can be viewed or deleted and rollbacks to earlier versions can be executed. This is a powerful feature when combined with moderation, as normal users can submit an updated version of a published node. The revision then goes into the moderation queue, and the previously published version stays visible to the general public. An administrator or a moderator can then review the revision and decide whether to publish or delete it. This is how documentation in the Drupal handbook is maintained on Drupal.org, and is similar to the functionality found in wikis (http://en.wikipedia.org/wiki/Wiki). You can set these states individually (if you have the Administer Nodes permission) when you create content, as shown in Figure 2-5, or configure them for each content type, as described in the next section. Figure 2-5. Publishing options for a page Type-Specific Configuration You can configure individual content types separately, so that not every post made to your site behaves the same way. For example, it is unlikely that you will want everything to be automatically promoted to the front page of your site. Perhaps only really interesting content should make it to the front page, and all the rest should be visible only in the other sections, such as the forums or in individuals blogs. These are the types of decisions you can make from the content types page, accessed by selecting administer . settings . content types (admin/settings/ content-types). All of the active content types, such as stories or pages, will be listed. Clicking the configure link for one of the content types listed will show you a page with at least two sections: Submission Form and Workflow. The Explanation or Submission Guidelines field is your chance to instruct users on how this particular content type is to be used on your site and provide any other guidelines or tips you may want to convey to them. The instructions appear above the form for this content type when it is being created. If you want to enforce a minimum length policy for a content type, the Minimum Number of Words setting is the right tool. If you specify a minimum number of words, a validation error will occur if the post is shorter.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

Cheap web hosting - CHAPTER 2 CONFIGURING DRUPAL Number of posts

Sunday, April 22nd, 2007

CHAPTER 2 CONFIGURING DRUPAL Number of posts on main page: This sets the number of posts that will be displayed whenever your front page is a list of posts, such as the default front page, node. All such listing pages have an automatic pagination feature for accessing the rest of the posts beyond whatever number you set for this field. Length of trimmed posts: For every node, Drupal prepares a shortened teaser view and a full view. The teaser view uses an algorithm to find a logical place in the content text to break off. The text is truncated and followed by a Read More link, which takes you to the full view. The Length of Trimmed Posts setting sets the maximum number of characters that will be shown in the teaser view. If Drupal finds a more logical place to break that has fewer characters than this setting, such as after an HTML block level element, it will. Note that this has only a limited influence on the actual displayed size of the teaser, since it doesn t take into account factors such as images or different font sizes that may be in the text. If you always want your posts to be viewed in full, set this to Unlimited. Tip If you want to control where Drupal breaks the text for the teaser view, use at the desired location in the text. Preview post: This controls whether users can submit new nodes or comments directly, without seeing a preview version first. In addition to its very useful function in reducing human error, the preview has a secondary benefit as well. If your site allows anonymous users to post nodes or comments of any type, I recommend that you require this preview. It makes it somewhat harder to post to the site via an automated script and can help reduce spam. Publishing Status Drupal defines four different attributes content can have to determine its publishing status: Published: Published content is generally visible. Unpublished nodes cannot be seen by anyone who does not have the Administer Nodes permission. In moderation queue: The moderation queue is all of the content on your site that needs approval from an administrator or moderator before being published. Promoted to front page: This is a somewhat misleading name. It should read Promoted to the list of all promoted content. This flag ensures that a node will appear in the list of content generated by the Drupal path node, which is the default front page in any Drupal installation. The content will be promoted to the front page only if the path to the front page remains node. Sticky at top of lists: The default front page lists content in reverse chronological order, from newest to oldest. Marking content as sticky makes it appear at the top of the list instead of taking its place in the historical order, and it will stay there, along with any other sticky content, for as long as it is marked sticky.
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services

CHAPTER 2 (Web design service) CONFIGURING DRUPAL Exercise 2-3. Play

Sunday, April 22nd, 2007

CHAPTER 2 CONFIGURING DRUPAL Exercise 2-3. Play Block Lottery! Imagine how many visitors your site would get if every time they viewed a page, they had a chance to win the lottery. It doesn t matter which page is viewed if the lucky number is drawn, a winner has been chosen. Here s how to make a random You Win! block for your site. 1. Create a new block (admin/block/add) named Block Lottery. Use the following message for the body (or create your own):

You win!

You have won block lottery. Congratulations, and enjoy the site.

2. Enter a description and save the block. 3. Select administer . block (admin/block), and then click Configure for the Block Lottery block. For the Show Block on Specific Pages field, choose the third option, Show if the following PHP code returns TRUE. 4. In the Pages field, enter the following code: 5. Save the block configuration. This returns you to the block administration page. Activate the block and start playing Block Lottery. The code you entered in step 4 chooses a random number between 1 and 10, and if it is equal to 10, returns the value TRUE (the return value FALSE is implicit). If TRUE is returned, the block is shown; otherwise, it is not shown. Now on every page view, there is a 10% chance that the block will be shown. If you have bad luck with lotteries in general, you may need to visit more than ten pages before you see the block appear. Managing Content Drupal is more than a tool for getting your content online. In addition, it offers rich tools for controlling where content is shown on your site, what types of text can be allowed inside of content, and a revision history to track the changes that you make to existing content. Many of these controls can be applied differently to different types of content, allowing you to tailor your site to meet your specific needs. Configuring Content You can set options that apply to site-wide content, as well as just to specific content types. Site-Wide Content To configure settings that apply to all of your site s content, select administer . settings . posts (admin/settings/node). This page has the following settings:
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services

Freelance web design - CHAPTER 2 CONFIGURING DRUPAL 3. You are

Saturday, April 21st, 2007

CHAPTER 2 CONFIGURING DRUPAL 3. You are returned to the block listing page. Now that you have specified the access to the block, you can turn it on. Click Enabled, decide whether the block should appear on the left or right, optionally set a weight to control where it appears in relation to the other blocks in the same sidebar, and then click Save Blocks. The block is now enabled and should appear only on the desired pages. 4. To test whether the block appears where you expect it to, and nowhere else, select administer . users. The block should appear there, as well as on the pages for adding users and configuration. The block should not appear on any other pages. 5. To test that users who are not administrators cannot view the block, you need to create a test account with a different username, log in as that user, and attempt to access the admin/user path. Not only should you not be able to access the page where the block is visible, it should not appear on any other pages and should not be presented as an option to be enabled on the user page for this user. Most cases for determining block visibility can be handled using Drupal paths. For the rest of the cases, the administrator has complete flexibility and control in the form of the third option for the Show Block on Specific Pages field, Show if the following PHP code returns TRUE. This option takes a segment of PHP code, runs it, and uses the result (a value of TRUE or FALSE) to decide whether or not to display the block. See Exercise 2-3 for an example. Adding Blocks Block administration offers not only flexibility to determine where existing blocks appear, but also the ability to create completely new blocks. To create a new block, click the Add Block tab on the block administration page (admin/ block/add). The Name field will appear as the heading of your block on the page. The field is not mandatory and does not need to be unique. To make sure you can identify your new block on the administration pages, give it a unique description. This field is also not mandatory, but if you add a description, it must be unique. Next, choose an input format and write the body of your block. Since you can elect to write PHP code in the block, the possibilities for what you can do are endless. In fact, writing PHP in blocks is one of the easiest and most accessible ways to extend your Drupal site. Exercise 2-3 demonstrates how to create a new block using PHP code. Tip You can find ready-to-use code for many different custom blocks at http://drupal.org/ node/17170.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web design programs services

CHAPTER 2 CONFIGURING DRUPAL Custom Visibility Settings (Web site domain)

Saturday, April 21st, 2007

CHAPTER 2 CONFIGURING DRUPAL Custom Visibility Settings The first field on the block configuration page, Custom Visibility Settings, deals with the question of whether authenticated users should be able to customize which blocks are visible to them when they visit the site. The first option, Users cannot control whether or not they see this block, means essentially that the administrator-defined visibility settings are to be honored, and the user will not be given the choice to enable/disable this block. The other two options, Show this block by default, but let individual users hide it and Hide this block by default but let individual users show it, both allow users to enable/disable the block for themselves, but differ in whether the block is initially shown or not shown. (Users can enable or disable custom blocks from their user account editing page, user/uid/edit.) Page-Specific Visibility Settings The Page Specific Visibility Settings options allow the administrator to define exactly on which pages a block should appear. Two approaches are available for doing this. The first leverages the Drupal menu system to build a list of pages where a block should or shouldn t appear, and the second allows the administrator to write a segment of PHP code that determines whether or not a block is to appear. The first two options of the Show Block on Specific Pages field, Show on every page except the listed pages and Show on only the listed pages, expect a list of Drupal paths, possibly including wildcards. You can use any Drupal path or path fragment as a mask, as well as the asterisk wildcard (*) to cover whole sections of the site. If you have the Path module activated, you can also use the custom paths, or aliases, that you have created. The special variable exists to represent the front page of your site, which is difficult to address otherwise, as it has no path. Exercise 2-2 demonstrates controlling block visibility with the Show on only the listed pages option. Exercise 2-2. Make a Block Visible to Only Administrators Suppose you would like to know who is currently visiting your site, but this is not information that you want your visitors themselves to be able to see. The solution is to activate the Who s Online block and use a path fragment to limit the visibility of the block to an area that only you (or other administrators) can access. One such area is the User Administration section on the admin/user page. The Administer Users permission is required to access this path, and since you will probably not want to extend this permission to normal site visitors, it is a perfect candidate for showing information that only you or other administrators are supposed to see. 1. Navigate to administer . blocks and find the Who s Online block. Click its Configure link. In the Page Specific Visibility Settings section, set the Show block on specific pages option to Show on only the listed pages. Now you can specify a path, and the block will appear only on pages that match the path you specify. 2. The path to the user administration section of the site is admin/user. Since you want the block to appear on that and all related pages, use the wildcard character to match the entire section: admin/ user/*. Enter this value in the Pages field and click Save Block.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision servlet hosting services