Archive for April, 2007

134 CHAPTER 4 ADDING CONTRIBUTED MODULES to (My web site)

Monday, April 16th, 2007

134 CHAPTER 4 ADDING CONTRIBUTED MODULES to at least one group. Set this to Required to make sure that the site s content exists only within the context of groups. Otherwise, choose Optional to give users the choice of whether their content should be posted to a group. Omitted Content Types The Omitted Content Types field allows you to exclude certain node types from the groups functionality altogether. This means that group-based visibility will not apply to nodes of this type. Excluded node types will simply have site-wide visibility. This is an effective way to help establish sections of the site that are for the community at large, while reserving other areas for groups that form around specific areas of interest. Configuring Organic Groups Albums In order to let your users groups make photo albums, you need to have a free-tagging taxonomy vocabulary that can be used to manage the structure of the albums. An appropriate vocabulary will be created for you when you navigate to administer . settings . og_album (admin/settings/og_album). Visiting the page for the first time will prompt Drupal to create and configure a vocabulary called Group Albums. If you wish to use a different free-tagging vocabulary, you can update the Select Vocabulary field. Creating Groups Groups are another content type, just like blogs, pages, and stories. To create a group, you use the group link on the Create content page (node/add). In this case, the group node that you create serves as a container for all of the other content and activities of your group. You have the same general services that Drupal provides for other types of nodes, such as the ability to be categorized with the taxonomy system. Note that you must have the Create Groups permission to create a group. When you create a new group, you will be faced with several decisions, among them the name and description of the group. You also get to decide how new group members will be admitted by setting the Selective field, which has the following options: Open: This means that subscription requests are accepted immediately. Open is the easiest to maintain and the most organic. Moderated: This means that subscription requests must be approved. If the group is moderated, the person who created the group is the manager. The manager will have the chance to approve or deny the request for subscription via the subscribers link in the Group Details block. This link shows not only how many current subscribers there are, but also how many requests for subscription have been made (in parentheses, as shown in Figure 4-18). Invite only: With this setting, subscriptions must be created by an administrator. If the group is made to be invite only, the moderator should add users by clicking the add subscribers link that is visible as a tab on the page listing all of a group s subscribers. Users are added by entering a comma-separated list of usernames. Closed: Subscriptions are managed fully by the administrator. Users cannot choose to join or invite others.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

CHAPTER 4 ADDING CONTRIBUTED MODULES 133 Caution (Web host music)

Monday, April 16th, 2007

CHAPTER 4 ADDING CONTRIBUTED MODULES 133 Caution Deactivating the Organic Groups module from the module administration page (admin/ modules) without first disabling the module from the Organic Groups settings page (admin/settings/og) will lead to problems. Submission Guidelines The Explanation or Submission Guidelines provide you with a chance to offer guidance to anyone who is in the process of creating a new group. Depending on how you configure the Organic Groups module, there will be different options available in the form for creating new groups, so you are best advised to come back to this once you have made other fundamental decisions and experimented with the module a bit. Only then will you be able to judge which parts of the process might not be clear to your user base and thus what instructions they should be given. Visibility of Posts Someone must decide whether a given node should be visible only within a group or whether it also should be visible to others not in the group. There are cases for both usages. If groups are being used on your site to do private secretive work and the Organic Groups module is being used to provide this privacy, then the nodes that are created for that group should be visible only to the members of that group and no one else. On the other hand, if groups are being used to organize content that should otherwise be visible to nongroup members, nodes created for that group should remain accessible to the wider public. The Visibility of Posts field lets you decide who gets to make these decisions. It offers three choices: Visible only within the targeted groups Visible within the targeted groups and on other pages Visibility to be determined by the author/editor using a check box on the posting form The first two options let you, the site administrator, make the visibility decision. The third option defers the decision to the user who creates content. The content-creation form will include a check box titled Public, and the node creator is left to make the choice. Maximum Posts and User Pictures The Maximum Posts on Group Home Page field determines how many content teasers will be shown on the group s home page before pagination begins. Checking the Show Member Pictures field will result in avatars being shown for content posts. However, this works only if user pictures have been configured (by selecting administer . settings . users). Audience Required Also found on the content-creation forms is a check box for each group to which a user belongs. The Audience Required setting controls whether this check box is a required field. Making the check box Required will disallow users from submitting content before assigning the content
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

132 CHAPTER 4 (Best web hosting) ADDING CONTRIBUTED MODULES changes

Monday, April 16th, 2007

132 CHAPTER 4 ADDING CONTRIBUTED MODULES changes in the database s data, and that will alter the way the database behaves. Specifically, there is a table, node_access, which controls whether a given user can view a given node. In the absence of a node-level access module such as Organic Groups, this table contains one row that grants access to all nodes to every user. Organic Groups will delete this row and instead manage node permissions on a per-node basis. While the Organic Groups module itself provides a mechanism for uninstalling itself, it is best to secure a backup before installing the module. Download the latest version of the Organic Groups module from http://drupal.org/ project/og. After making your backup, you can load the database definition from the og.mysql or og.pgsqlfile. Copy the og folder into your modules folder, and activate the Organic Groups, the Organic Groups Albums (og_album), and Taxonomy modules from the admin/modulespage. The Organic Groups module depends on the Image module and the Organic Groups Albums module to provide each group with its own photo gallery. Installing the Image module was covered earlier in this chapter. Note In order for your groups to have their own image galleries, you will need the Image, Taxonomy, and Organic Groups modules. The Organic Groups module comes packaged with the Organic Groups download. The Image module is available from http://drupal.org/project/image. The Taxonomy module is a core module and is discussed in Chapter 3. Activating Group Blocks The Organic Groups module makes almost no sense without the Group Details block activated, so the logical place to start is on the block administration page (admin/blocks). Enable this block and decide where it should be located (right, left, weight, and so on). It is not necessary to specify paths where this block should or shouldn t appear, because the module takes care of this for you. You can also decide whether you would like to activate the Group Subscribers and Group Albums blocks. Configuring the Organic Groups Module Select administer . settings . og (admin/settings/og) to see the configuration settings for the Organic Groups module. Access Control Status First, check the current status of the Organic Groups access permissions. In the Module Status section at the top of the page is a status message that should read Organic groups access control is currently enabled and a button that will should be labeled Disable when you first view this screen. Confirm that access control is enabled. If the status message tells you that the Organic Groups access control is disabled, use the button (which is labeled Enable) to enable access control before proceeding with further configuration. You can use the Disable button to disable Organic Groups if you want to stop using it for whatever reason. The Organic Groups module can be enabled or disabled as many times as you like without negative side effects or loss of previous group-related information.
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

CHAPTER 4 ADDING CONTRIBUTED MODULES 131 Location-Enabling (Make web site)

Sunday, April 15th, 2007

CHAPTER 4 ADDING CONTRIBUTED MODULES 131 Location-Enabling Node Types With the basic configuration options settled, the next step is to decide which node types should collect location information and exactly which information is desired or required. Node type configuration takes place from the admin/node/configure/types page, which lists all of the node types. Click configure for any of the listed node types, and you will see a section of the form titled Locative Information. The Enable for Locations field does just what it says. The rest of the fields allow you to customize the location form by making fields invisible, optional, or required, based on your specific needs. Organic Groups Module One of the hallmarks of vibrant online communities is the presence of a common interest or theme that unites those who are involved. Whether this common interest is relatively broad or narrow, there are likely to be smaller but related topics that are of interest only to a subset of the community. For instance, on a music school site, the brass players might want to organize their own rehearsals and brass ensemble concerts. The ability for these people to band together and form a group is the main offering of the Organic Groups (OG) module. Groups have their own home page, can select their own theme (design template), can have content that is visible only to members of the group, and can have image galleries. Most important, they can be created and joined by users as the need arises, thus growing and thriving based on the current interests of the community. This is what makes them organic. Until this point, none of the content on your Drupal site has had any sort of node-level access control. This means that if user A and user B have the same roles, they both are able to see the same content. The Organic Groups module is one of the modules that implement node-level permissions to decide who can see content. If user A is in a group and user B is not, and if that group s content is private, user B will not be able to see the same content that user A sees, despite the fact that they have the same roles. Organic Groups isn t the only module in the contributions repository that implements node-level access controls. Other modules that provide access controls are Node Privacy by Role (http://drupal.org/project/node_privacy_byrole), Taxonomy Access Control (http:// drupal.org/project/taxonomy_access), and Nodeperm Role (http://drupal.org/project/ nodeperm_role). Unfortunately, these modules tend to interfere with each other. This is a basic weakness in the way Drupal s permissions are handled and is a topic of hot debate in the developer community. Be warned: do not try to mix multiple node-access modules! Caution Do not try to use the Organic Groups module with other node-level access modules, as they are not designed to work together. Installing the Organic Groups Module Please take the time to back up your database before installing the Organic Groups module. While this is good advice for every module that has its own database definitions, it is especially important in this case, as the installation of the Organic Groups module will make fundamental
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

Windows 2003 server web - 130 CHAPTER 4 ADDING CONTRIBUTED MODULES Distance

Sunday, April 15th, 2007

130 CHAPTER 4 ADDING CONTRIBUTED MODULES Distance Units Distances are an issue only when you re using the Location module to do proximity searches, which is possible only if you are working with one of the available zip code databases. In this case, you can set the Distance Unit field to select the units in which distances will be displayed for location-based searches. Note The Drupal path to the location module s proximity search screen is search/location. Location Display The Location module handles the task of displaying location information (an address, basically) for those nodes that have it available. You might want to display this information some other way. The Toggle Location Display field allows you to turn off the default display of location information. The idea is that you would then write a themable function that would display the information in the form that you want. See Chapter 5 for instructions for writing custom themable functions. User Location Information You can collect location information for nodes and users. Knowing where your users are located can be very helpful, depending on the type of site you are building. For example, if your site is being used for a music school to track orchestra rehearsals and concerts, it might be very useful for your users to be able to add their address to their profile information for the sake of organizing carpools to rehearsals. The User Locations field turns this functionality on or off. Country Location Features The last section on the Location module settings page, entitled Enable all available features for locations from the following countries, is a list of countries that have specific features available. It corresponds directly with the files found in the modules/location/supportedfolder. The vast majority of the countries listed offer the feature of knowing their states or provinces and nothing else. Thus, the major practical implication of enabling ten or so countries from central Africa is that you will need to scroll through all these countries and their provinces when entering location information for specific nodes later. At the time of this writing, only three countries have significant features to offer: the United States, Canada, and Germany. The United States has the most full-featured set, including proximity searches and deep linking into map services such as Google or Yahoo! Maps for addresses. Germany and Canada have only partially implemented sets of features. Tip If you would like to implement further location features for a country that does not have them, the location_API.txt file provides an excellent description of the programming API that needs to be used. The supported/location.us.inc file is a complete sample implementation of the API.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Web hosting script - CHAPTER 4 ADDING CONTRIBUTED MODULES 129 4.

Saturday, April 14th, 2007

CHAPTER 4 ADDING CONTRIBUTED MODULES 129 4. Transfer the necessary files to the web server. As the location folder contains several very large data dumps and a couple hundred country-specific files, it is worth the effort to select only the files that you actually need. Figure 4-17 shows an example of a minimal directory structure for the Location module, which will be able to support locations in Mexico, the United States, and Canada. Figure 4-17. Location module directory structure 5. If you wish to work with the finer features of the Location module, create a table called zipcodesusing the file supported/zipcodes.mysql. Then, depending on which data dumps are available, import zip code data into this table. The supported/zipcodes.us.mysql file, for example, provides the data dump for the United States. If you intend to run multiple location-enabled sites on the same database server, you might consider putting the zipcodes table in a separate database and sharing it among all the sites. Since it is used only for looking up zip code information and is never written to, this is a safe and efficient approach. See Chapter 6 for details on running multiple sites and database table prefixing. 6. Navigate to administer . modules (admin/modules) and enable the module. As with the Event module, your next steps are to configure the module and make some nodes location-enabled. Configuring the Location Module Select administer . settings . location (admin/settings/location) to see the configuration settings for the Location module. Country Selection As a convenience, the Location module lets you set a default country for your web site with the Default Country Selection field. This should be the country that generates the largest portion of your traffic. Whichever country you set here will be selected by default in all location forms. If the locations your site tracks are all within one country, you can simplify matters even further by checking Hide Country Selection, which saves your users the step of selecting the country. The default country will be used instead.
Note: If you are looking for reliable webhost to maintain and run your java application check Vision java hosting services

128 CHAPTER 4 ADDING CONTRIBUTED MODULES Location (Vps web hosting)

Saturday, April 14th, 2007

128 CHAPTER 4 ADDING CONTRIBUTED MODULES Location Module Adding location information to content can be very useful. Whether it is a shipping address, a meeting place, or the place where a photograph was taken, location adds an interesting dimension and opens up new possibilities for how communities form and how web sites are used. The Location module provides a set of location services, including appending location information to content and users, doing proximity searches, and linking to external map providers. Much like the Event module, the Location module lets you choose what content should have location information, and the concept of a location-enabled node type is analogous to the event-enabled node type, but with different information. Furthermore, the Location module complements the Event module in a very meaningful way in that it can be used to answer the question Where does this event take place? To draw on the examples in the Event module section of this chapter, the Concert and Rehearsal flexinode types could be location-enabled, making the events calendar even more useful. Installing the Location Module The Location module is made up of the following parts: A public API definition describing how to work with location information in Drupal. This can be found in the file location_API.txt. location.module, an implementation of the Location module location.inc, a set of common tools earth.inc, a set of tools for working with latitude and longitude values A set of 243 files found in location/supported, each representing a different country, providing location services that range from a list of states or provinces to proximity searches and geocoding of postal addresses location/database/zipcodes.mysql, the definition for an optional zip codes table, which is required for the advanced features like geocoding A growing number of location/database/zipcodes.country-code.mysql data dumps to provide zip code support for specific countries (the United States and Germany are currently available) Follow these steps to install the Location module: 1. Download the latest version of the Location module from http://drupal.org/project/ location. 2. Make a backup of your database. 3. Load the database definition from the file appropriate to your database, either location.mysql or location.pgsql.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

CHAPTER 4 ADDING CONTRIBUTED MODULES 127 (Ecommerce web host) Figure

Friday, April 13th, 2007

CHAPTER 4 ADDING CONTRIBUTED MODULES 127 Figure 4-16. Men s Choir concerts and rehearsals from December 14 to 19 Exporting Event Information You can export your Drupal site s event information for external use by any program that supports the webcal protocol, such as iCal (http://www.apple.com/macosx/features/ical/) or as an RSS feed. The icon at the bottom right of the screen underneath the calendar will export the current display for iCal. You can generate both RSS and iCal format using the URL manipulation techniques described in the preceding section, by substituting ical or feed for the $view_type variable. For example, for an RSS feed, the URL for displaying the Men s Choir rehearsals and concerts could be rewritten like this: q=event/2005/12/1/feed/1+2/10
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services

126 CHAPTER (Web proxy server) 4 ADDING CONTRIBUTED MODULES

Friday, April 13th, 2007

126 CHAPTER 4 ADDING CONTRIBUTED MODULES $taxonomy_terms: A list of term IDs, separated by a plus sign (+). For example, to view entries assigned to the taxonomy terms with IDs 4 and 9, you would use 4+9. The value all will show all terms. $duration: The number of days to display. Currently, only the table view observes this setting. For example, suppose you wanted to see all of the Men s Choir concerts and rehearsals for the five-day period December 14 to 19. Here s what the URL would look like: http://domain/?q=event/2005/12/14/table/1+2/10/5 This URL is built as follows: $year: 2005 $month: 12, for December $day: 14, the starting day $view_type: table $content_type: 1+2, which means Concert and Rehearsal, since these are flexinode 1 and flexinode 2 types $taxonomy_terms: 10, the taxonomy term for Men s Choir $duration: 5, for five days The result is a subset of the events shown in a tabular view, as illustrated in Figure 4-16.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

Web hosting service - CHAPTER 4 ADDING CONTRIBUTED MODULES 125 Figure

Thursday, April 12th, 2007

CHAPTER 4 ADDING CONTRIBUTED MODULES 125 Figure 4-15. The month of December showing only holidays when school is open (a taxonomy category) All of the parameters governing time range, category, and type of event can be built into the URL. This makes URL manipulation an effective tool for querying a Drupal site for its event information. Here is how event URLs are built: ?q=event/$year/$month/$day/$view_type/$content_type/$taxonomy_terms/$duration The event URL variables are as follows: $year: A four-digit integer, such as 2005. $month: An integer from 1 to 12 representing the month. $day: A two-digit integer representing the day of the month to start from. Leading zeros are required, as in 03. $view_type: The type of calendar layout. Values include month, week, day, table, icalfor an iCal export, and feed for an RSS feed. $content_type: A list of node types, separated by a plus sign (+). Flexinode types require only the integer value of the type. For example, to view story nodes and flexinode type 1, you would use story+1. The value all will show all types.
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services