diff --git a/modules/aggregator.module b/modules/aggregator.module index 818f9816de022a470b022cbd8248cfe823753026..4c66501a387d116517e99240f3e0393a240b8fa9 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -4,55 +4,55 @@ function aggregator_help($section) { switch ($section) { case 'admin/help#aggregator': - $output = "

Thousands of web sites, especially news sites and weblogs, syndicate their most recent site content for others to display. The syndicated content always includes titles, also known as headlines, for the newest published stories. Each headline acts as a direct link to the stories on the remote site. Along with the headline, most sites typically provide either the first few paragraphs of the story or a short summary. Many individuals use client-based news aggregators on their personal computer to aggregate content, such as Amphetadesk.

"; - $output .= "

Drupal also has a news aggregator built in as a standard feature. With it, you can subscribe to feeds from other sites and display their content for your site users. Simply enable the aggregator module in site administration and enter the feeds that you choose.

"; - $output .= "

What do I need to subscribe to a feed?

"; - $output .= "

The standard method of syndication is using the XML-based Rich Site Summary (RSS). To syndicate a site's content, obtain the full URL of the RSS page providing syndication. Common file tags for RSS pages are .rss, .xml and .rdf. Example: Slashdot RSS.

"; - $output .= "

Most weblog sites that offer syndication will have an obvious link on the main page. Often you need only look for an XML syndication button, such as the one Drupal uses for site syndication.

"; - $output .= "

But some sites do not make their RSS feeds as easy to find. Or maybe you want to find a number of feeds on a given topic, without extensively searching the web. In that case, try an RSS syndication directory such as Syndic8.

"; - $output .= "

To learn much more about RSS, read Mark Pilgrim's What is RSS and WebReference.com's The Evolution of RSS.

"; - $output .= "

NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.

"; - $output .= "

Configuring news feeds

"; - $output .= "

To subscribe to an RSS feed on another site, use the RSS/RDF shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.

"; - $output .= "

Once there, select new feed from the left hand menu. Drupal will then ask for the following:

"; - $output .= ""; - $output .= "

Once you submit your new feed, check to see if it is working properly. Select update items on the RSS/RDF page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.

"; - $output .= "

Adding bundles

"; - $output .= "

You may want to follow some feeds more closely than others. Or perhaps you'd like to display a select list of the titles for some feeds as a block for users. Bundles are a way of grouping your feeds into categories. Bundles look for feeds that contain at least one of the keywords, or attributes, associated with the bundle and display those feeds together.

"; - $output .= "

When adding a bundle, Drupal will ask for:

"; - $output .= ""; - $output .= "

Using the news aggregator

"; - $output .= "

The news aggregator has a number of ways that it displays your subscribed content:

"; - $output .= ""; - $output .= "

RSS feed blocks

"; - $output .= "

In addition to providing subscribed content through the news aggregator, Drupal automatically creates a block for each subscribed feed and every bundle created. Beside each headline in each block, Drupal includes an icon which acts a blog it link. Enable any or all of the blocks using block management.

"; - $output .= "

Subscription list

"; - $output .= "

Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.

"; - $output .= "

Technical details

"; - $output .= "

When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.

"; - $output .= "

If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.

"; - return t($output, array("%amphetadesk" => "AmphetaDesk", "%rss" => "Rich Site Summary", "%slashdot-rss" => "http://slashdot.org/slashdot.rdf", "%syndic8" => "Syndic8", "%rss-what" => "What is RSS", "%rss-evolution" => "The Evolution of RSS", "%admin-news" => l(t("RSS/RDF"), "admin/syndication/news"), "%new-feed" => l(t("new feed"), "admin/syndication/news/add/feed"), "%update-items" => l(t("update items"), "admin/syndication/news"))); + $output = t(" +

Thousands of web sites, especially news sites and weblogs, syndicate their most recent site content for others to display. The syndicated content always includes titles, also known as headlines, for the newest published stories. Each headline acts as a direct link to the stories on the remote site. Along with the headline, most sites typically provide either the first few paragraphs of the story or a short summary. Many individuals use client-based news aggregators on their personal computer to aggregate content, such as Amphetadesk.

+

Drupal also has a news aggregator built in as a standard feature. With it, you can subscribe to feeds from other sites and display their content for your site users. Simply enable the aggregator module in site administration and enter the feeds that you choose.

+

What do I need to subscribe to a feed?

+

The standard method of syndication is using the XML-based Rich Site Summary (RSS). To syndicate a site's content, obtain the full URL of the RSS page providing syndication. Common file tags for RSS pages are .rss, .xml and .rdf. Example: Slashdot RSS.

+

Most weblog sites that offer syndication will have an obvious link on the main page. Often you need only look for an XML syndication button, such as the one Drupal uses for site syndication.

+

But some sites do not make their RSS feeds as easy to find. Or maybe you want to find a number of feeds on a given topic, without extensively searching the web. In that case, try an RSS syndication directory such as Syndic8.

+

To learn much more about RSS, read Mark Pilgrim's What is RSS and WebReference.com's The Evolution of RSS.

+

NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.

+

Configuring news feeds

+

To subscribe to an RSS feed on another site, use the RSS/RDF shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.

+

Once there, select new feed from the left hand menu. Drupal will then ask for the following:

+ +

Once you submit your new feed, check to see if it is working properly. Select update items on the RSS/RDF page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.

+

Adding bundles

+

You may want to follow some feeds more closely than others. Or perhaps you'd like to display a select list of the titles for some feeds as a block for users. Bundles are a way of grouping your feeds into categories. Bundles look for feeds that contain at least one of the keywords, or attributes, associated with the bundle and display those feeds together.

+

When adding a bundle, Drupal will ask for:

+ +

Using the news aggregator

+

The news aggregator has a number of ways that it displays your subscribed content:

+ +

RSS feed blocks

+

In addition to providing subscribed content through the news aggregator, Drupal automatically creates a block for each subscribed feed and every bundle created. Beside each headline in each block, Drupal includes an icon which acts a blog it link. Enable any or all of the blocks using block management.

+

Subscription list

+

Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.

+

Technical details

+

When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.

+

If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.

", array("%amphetadesk" => "AmphetaDesk", "%rss" => "Rich Site Summary", "%slashdot-rss" => "http://slashdot.org/slashdot.rdf", "%syndic8" => "Syndic8", "%rss-what" => "What is RSS", "%rss-evolution" => "The Evolution of RSS", "%admin-news" => l(t("RSS/RDF"), "admin/syndication/news"), "%new-feed" => l(t("new feed"), "admin/syndication/news/add/feed"), "%update-items" => l(t("update items"), "admin/syndication/news"))); case 'admin/system/modules#description': return t("Used to aggregate syndicated content (RSS and RDF)."); case 'admin/system/modules/aggregator': diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 818f9816de022a470b022cbd8248cfe823753026..4c66501a387d116517e99240f3e0393a240b8fa9 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -4,55 +4,55 @@ function aggregator_help($section) { switch ($section) { case 'admin/help#aggregator': - $output = "

Thousands of web sites, especially news sites and weblogs, syndicate their most recent site content for others to display. The syndicated content always includes titles, also known as headlines, for the newest published stories. Each headline acts as a direct link to the stories on the remote site. Along with the headline, most sites typically provide either the first few paragraphs of the story or a short summary. Many individuals use client-based news aggregators on their personal computer to aggregate content, such as Amphetadesk.

"; - $output .= "

Drupal also has a news aggregator built in as a standard feature. With it, you can subscribe to feeds from other sites and display their content for your site users. Simply enable the aggregator module in site administration and enter the feeds that you choose.

"; - $output .= "

What do I need to subscribe to a feed?

"; - $output .= "

The standard method of syndication is using the XML-based Rich Site Summary (RSS). To syndicate a site's content, obtain the full URL of the RSS page providing syndication. Common file tags for RSS pages are .rss, .xml and .rdf. Example: Slashdot RSS.

"; - $output .= "

Most weblog sites that offer syndication will have an obvious link on the main page. Often you need only look for an XML syndication button, such as the one Drupal uses for site syndication.

"; - $output .= "

But some sites do not make their RSS feeds as easy to find. Or maybe you want to find a number of feeds on a given topic, without extensively searching the web. In that case, try an RSS syndication directory such as Syndic8.

"; - $output .= "

To learn much more about RSS, read Mark Pilgrim's What is RSS and WebReference.com's The Evolution of RSS.

"; - $output .= "

NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.

"; - $output .= "

Configuring news feeds

"; - $output .= "

To subscribe to an RSS feed on another site, use the RSS/RDF shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.

"; - $output .= "

Once there, select new feed from the left hand menu. Drupal will then ask for the following:

"; - $output .= ""; - $output .= "

Once you submit your new feed, check to see if it is working properly. Select update items on the RSS/RDF page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.

"; - $output .= "

Adding bundles

"; - $output .= "

You may want to follow some feeds more closely than others. Or perhaps you'd like to display a select list of the titles for some feeds as a block for users. Bundles are a way of grouping your feeds into categories. Bundles look for feeds that contain at least one of the keywords, or attributes, associated with the bundle and display those feeds together.

"; - $output .= "

When adding a bundle, Drupal will ask for:

"; - $output .= ""; - $output .= "

Using the news aggregator

"; - $output .= "

The news aggregator has a number of ways that it displays your subscribed content:

"; - $output .= ""; - $output .= "

RSS feed blocks

"; - $output .= "

In addition to providing subscribed content through the news aggregator, Drupal automatically creates a block for each subscribed feed and every bundle created. Beside each headline in each block, Drupal includes an icon which acts a blog it link. Enable any or all of the blocks using block management.

"; - $output .= "

Subscription list

"; - $output .= "

Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.

"; - $output .= "

Technical details

"; - $output .= "

When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.

"; - $output .= "

If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.

"; - return t($output, array("%amphetadesk" => "AmphetaDesk", "%rss" => "Rich Site Summary", "%slashdot-rss" => "http://slashdot.org/slashdot.rdf", "%syndic8" => "Syndic8", "%rss-what" => "What is RSS", "%rss-evolution" => "The Evolution of RSS", "%admin-news" => l(t("RSS/RDF"), "admin/syndication/news"), "%new-feed" => l(t("new feed"), "admin/syndication/news/add/feed"), "%update-items" => l(t("update items"), "admin/syndication/news"))); + $output = t(" +

Thousands of web sites, especially news sites and weblogs, syndicate their most recent site content for others to display. The syndicated content always includes titles, also known as headlines, for the newest published stories. Each headline acts as a direct link to the stories on the remote site. Along with the headline, most sites typically provide either the first few paragraphs of the story or a short summary. Many individuals use client-based news aggregators on their personal computer to aggregate content, such as Amphetadesk.

+

Drupal also has a news aggregator built in as a standard feature. With it, you can subscribe to feeds from other sites and display their content for your site users. Simply enable the aggregator module in site administration and enter the feeds that you choose.

+

What do I need to subscribe to a feed?

+

The standard method of syndication is using the XML-based Rich Site Summary (RSS). To syndicate a site's content, obtain the full URL of the RSS page providing syndication. Common file tags for RSS pages are .rss, .xml and .rdf. Example: Slashdot RSS.

+

Most weblog sites that offer syndication will have an obvious link on the main page. Often you need only look for an XML syndication button, such as the one Drupal uses for site syndication.

+

But some sites do not make their RSS feeds as easy to find. Or maybe you want to find a number of feeds on a given topic, without extensively searching the web. In that case, try an RSS syndication directory such as Syndic8.

+

To learn much more about RSS, read Mark Pilgrim's What is RSS and WebReference.com's The Evolution of RSS.

+

NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.

+

Configuring news feeds

+

To subscribe to an RSS feed on another site, use the RSS/RDF shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.

+

Once there, select new feed from the left hand menu. Drupal will then ask for the following:

+ +

Once you submit your new feed, check to see if it is working properly. Select update items on the RSS/RDF page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.

+

Adding bundles

+

You may want to follow some feeds more closely than others. Or perhaps you'd like to display a select list of the titles for some feeds as a block for users. Bundles are a way of grouping your feeds into categories. Bundles look for feeds that contain at least one of the keywords, or attributes, associated with the bundle and display those feeds together.

+

When adding a bundle, Drupal will ask for:

+ +

Using the news aggregator

+

The news aggregator has a number of ways that it displays your subscribed content:

+ +

RSS feed blocks

+

In addition to providing subscribed content through the news aggregator, Drupal automatically creates a block for each subscribed feed and every bundle created. Beside each headline in each block, Drupal includes an icon which acts a blog it link. Enable any or all of the blocks using block management.

+

Subscription list

+

Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.

+

Technical details

+

When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.

+

If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.

", array("%amphetadesk" => "AmphetaDesk", "%rss" => "Rich Site Summary", "%slashdot-rss" => "http://slashdot.org/slashdot.rdf", "%syndic8" => "Syndic8", "%rss-what" => "What is RSS", "%rss-evolution" => "The Evolution of RSS", "%admin-news" => l(t("RSS/RDF"), "admin/syndication/news"), "%new-feed" => l(t("new feed"), "admin/syndication/news/add/feed"), "%update-items" => l(t("update items"), "admin/syndication/news"))); case 'admin/system/modules#description': return t("Used to aggregate syndicated content (RSS and RDF)."); case 'admin/system/modules/aggregator': diff --git a/modules/block.module b/modules/block.module index b5172058a21d4b1e7d25a1b14c9c4bf1feae638a..4b2738e07ea83c1883f5abcdd4b8516ff5a83f43 100644 --- a/modules/block.module +++ b/modules/block.module @@ -6,7 +6,8 @@ function block_help($section = "admin/help#block") { switch ($section) { case 'admin/help#block': - $output = t("

Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

+ $output = t(" +

Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.

Whether a block is visible in the first place depends on four things:

The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a weight to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.

The path setting lets you define the pages on which a specific block is visible. If you leave the path blank it will appear on all pages. The path uses a regular expression syntax so remember to escape special characters!

diff --git a/modules/block/block.module b/modules/block/block.module index b5172058a21d4b1e7d25a1b14c9c4bf1feae638a..4b2738e07ea83c1883f5abcdd4b8516ff5a83f43 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -6,7 +6,8 @@ function block_help($section = "admin/help#block") { switch ($section) { case 'admin/help#block': - $output = t("

Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

+ $output = t(" +

Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.

Whether a block is visible in the first place depends on four things:

The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a weight to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.

The path setting lets you define the pages on which a specific block is visible. If you leave the path blank it will appear on all pages. The path uses a regular expression syntax so remember to escape special characters!

diff --git a/modules/blog.module b/modules/blog.module index f06b2117ef31d4f77992b8ac65efa3402aa2ec76..3d4dfd04e79b6e6e583f50e5bd13ae4e97c2653e 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -70,11 +70,11 @@ function blog_help($section) { switch ($section) { case 'admin/help#blog': - $output .= "

Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. These can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.

"; - $output .= "

Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.

"; - $output .= "

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

"; - $output .= "

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

"; - $output = t($output, array("%scripting-com" => "http://www.scripting.com/")); + $output .= t(" +

Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. These can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.

+

Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.

+

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

+

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

", array("%scripting-com" => "http://www.scripting.com/")); break; case 'admin/system/modules#description': $output .= t("Enables keeping a blog or easily and regularly updated web page."); diff --git a/modules/blog/blog.module b/modules/blog/blog.module index f06b2117ef31d4f77992b8ac65efa3402aa2ec76..3d4dfd04e79b6e6e583f50e5bd13ae4e97c2653e 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -70,11 +70,11 @@ function blog_help($section) { switch ($section) { case 'admin/help#blog': - $output .= "

Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. These can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.

"; - $output .= "

Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.

"; - $output .= "

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

"; - $output .= "

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

"; - $output = t($output, array("%scripting-com" => "http://www.scripting.com/")); + $output .= t(" +

Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. These can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.

+

Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.

+

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

+

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

", array("%scripting-com" => "http://www.scripting.com/")); break; case 'admin/system/modules#description': $output .= t("Enables keeping a blog or easily and regularly updated web page."); diff --git a/modules/book.module b/modules/book.module index 56ba8e6d6f3982886af44e000b59a2101c4e9214..e9b2399042e8c870ac3ebbad990c0eed96f18e72 100644 --- a/modules/book.module +++ b/modules/book.module @@ -444,7 +444,7 @@ function book_show($node, $cid) { } else { - if (module_hook($node->type, "content")) { + if (node_hook($node, "content")) { $node = node_invoke($node, "content"); /* @@ -696,7 +696,7 @@ function book_print($id = "", $depth = 1) { if ($node) { // output the content: - if (module_hook($node->type, "content")) { + if (node_hook($node, "content")) { $node = node_invoke($node, "content"); } $output .= "

nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title

"; @@ -731,7 +731,7 @@ function book_print_recurse($parent = "", $depth = 1) { if ($node) { // output the content: - if (module_hook($node->type, "content")) { + if (node_hook($node, "content")) { $node = node_invoke($node, "content"); } $output .= "

nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title

"; @@ -880,17 +880,17 @@ function book_help($section = "admin/help#book") { switch ($section) { case 'admin/help#book': - $output .= "

The book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.

"; - $output .= "

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

"; - $output .= "

A book page is a special node type that allows you to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

"; - $output .= "

Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use permissions to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <root>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the edit book outline button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the submit content » book page link.

"; - $output .= "

Administrators may review the hierarchy of their books by clicking on the collaborative book link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically review their books for orphans and reaffiliate those pages as desired. Finally, administrators may also export their books to a single, flat HTML page which is suitable for printing.

"; - $output .= "

Maintaining a FAQ using a collaborative book

"; - $output .= "

Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

"; - $output .= "

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the submit content » book page link. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <root> as the parent of this page. Leave the log message and type fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.

"; - $output .= "

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.

"; - $output .= "

Notes:

"; - $output = t($output, array("%permissions" => url("admin/user/permission"), "%create" => url("node/add/book"), "%collaborative-book" => url("admin/node/book"), "%orphans-book" => url("admin/node/book/orphan"), "%export-book" => url("book/print"))); + $output .= t(" +

The book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.

+

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

+

A book page is a special node type that allows you to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

+

Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use permissions to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <root>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the edit book outline button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the submit content » book page link.

+

Administrators may review the hierarchy of their books by clicking on the collaborative book link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically review their books for orphans and reaffiliate those pages as desired. Finally, administrators may also export their books to a single, flat HTML page which is suitable for printing.

+

Maintaining a FAQ using a collaborative book

+

Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

+

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the submit content » book page link. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <root> as the parent of this page. Leave the log message and type fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.

+

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.

+

Notes:

", array("%permissions" => url("admin/user/permission"), "%create" => url("node/add/book"), "%collaborative-book" => url("admin/node/book"), "%orphans-book" => url("admin/node/book/orphan"), "%export-book" => url("book/print"))); break; case 'admin/system/modules#description': $output = t("Allows users to collaboratively author a book."); diff --git a/modules/book/book.module b/modules/book/book.module index 56ba8e6d6f3982886af44e000b59a2101c4e9214..e9b2399042e8c870ac3ebbad990c0eed96f18e72 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -444,7 +444,7 @@ function book_show($node, $cid) { } else { - if (module_hook($node->type, "content")) { + if (node_hook($node, "content")) { $node = node_invoke($node, "content"); /* @@ -696,7 +696,7 @@ function book_print($id = "", $depth = 1) { if ($node) { // output the content: - if (module_hook($node->type, "content")) { + if (node_hook($node, "content")) { $node = node_invoke($node, "content"); } $output .= "

nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title

"; @@ -731,7 +731,7 @@ function book_print_recurse($parent = "", $depth = 1) { if ($node) { // output the content: - if (module_hook($node->type, "content")) { + if (node_hook($node, "content")) { $node = node_invoke($node, "content"); } $output .= "

nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title

"; @@ -880,17 +880,17 @@ function book_help($section = "admin/help#book") { switch ($section) { case 'admin/help#book': - $output .= "

The book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.

"; - $output .= "

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

"; - $output .= "

A book page is a special node type that allows you to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

"; - $output .= "

Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use permissions to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <root>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the edit book outline button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the submit content » book page link.

"; - $output .= "

Administrators may review the hierarchy of their books by clicking on the collaborative book link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically review their books for orphans and reaffiliate those pages as desired. Finally, administrators may also export their books to a single, flat HTML page which is suitable for printing.

"; - $output .= "

Maintaining a FAQ using a collaborative book

"; - $output .= "

Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

"; - $output .= "

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the submit content » book page link. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <root> as the parent of this page. Leave the log message and type fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.

"; - $output .= "

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.

"; - $output .= "

Notes:

"; - $output = t($output, array("%permissions" => url("admin/user/permission"), "%create" => url("node/add/book"), "%collaborative-book" => url("admin/node/book"), "%orphans-book" => url("admin/node/book/orphan"), "%export-book" => url("book/print"))); + $output .= t(" +

The book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.

+

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

+

A book page is a special node type that allows you to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

+

Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use permissions to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <root>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the edit book outline button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the submit content » book page link.

+

Administrators may review the hierarchy of their books by clicking on the collaborative book link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically review their books for orphans and reaffiliate those pages as desired. Finally, administrators may also export their books to a single, flat HTML page which is suitable for printing.

+

Maintaining a FAQ using a collaborative book

+

Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

+

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the submit content » book page link. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <root> as the parent of this page. Leave the log message and type fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.

+

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.

+

Notes:

", array("%permissions" => url("admin/user/permission"), "%create" => url("node/add/book"), "%collaborative-book" => url("admin/node/book"), "%orphans-book" => url("admin/node/book/orphan"), "%export-book" => url("book/print"))); break; case 'admin/system/modules#description': $output = t("Allows users to collaboratively author a book."); diff --git a/modules/comment.module b/modules/comment.module index 9150a980650a598a155e6539f39fab197d566407..7bd5b5240d243417010724dab328d606eedf0d97 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -6,68 +6,68 @@ function comment_help($section = "admin/help#comment") { switch ($section) { case 'admin/help#comment': - $output .= "

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

"; - $output .= "

User control of comment display

"; - $output .= "

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

"; - $output .= ""; - $output .= "

When a user chooses save settings, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in administer » configuration » modules » comment.

"; - $output .= "

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

"; - - $output .= "

Additional comment configurations

"; - $output .= "

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in administer » configuration under Submission settings.

"; - $output .= "

Administrators can control access to various comment module functions through administer » accounts » permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

"; - $output .= "

The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:

"; - $output .= ""; - - $output .= "

Notification of new comments

"; - $output .= "

Drupal provides specific features to inform site members when new comments have been posted:

"; - $output .= ""; - - $output .= "

Comment moderation

"; - $output .= "

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

"; - $output .= "

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.

"; - $output .= "

To enable moderation, the administrator must grant moderate comments permissions. Then, a number of options in administer » comments » moderation must be configured.

"; - - $output .= "

Moderation votes

"; - $output .= "

The first step is to create moderation labels which allow users to rate a comment. Go to administer » comments » moderation » votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples are

"; - $output .= ""; - $output .= "

So that users know how their votes affect the comment, these examples include the vote value as part of the label, although that is optional.

"; - $output .= "

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

"; - - $output .= "

Moderator vote/values matrix

"; - - $output .= "

Next go to administer » comments » moderation » matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.

"; - $output .= "

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

"; - $output .= "

Creating comment thresholds

"; - $output .= "

In administer » comments » moderation » thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting their thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.

"; - $output .= "

When creating the thresholds, note that the Minimum score is asking you for the lowest rating that a comment can have in order to be displayed.

"; - $output .= "

To see a common example of how thresholds work, you might visit Slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.

"; - - $output .= "

Initial comment scores

"; - $output .= "

Finally, you may want to enter some initial comment scores. In administer » comments » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

"; - $output = t($output, array("%comment-config" => url("admin/system/modules/comment"), "%site-config" => url("admin/system"), "%user-permissions" => url("admin/user/permission"), "%tracker" => url("tracker"), "%download-notify" => "http://drupal.org/project/releases", "%permission" => url("admin/user/permission"), "%comment-moderation" => url("admin/comment/moderation"), "%comment-votes" => url("admin/comment/moderation/votes"), "%comment-matrix" => url("admin/comment/moderation/matrix"), "%comment-thresholds" => url("admin/comment/moderation/filters"), "%slashdot" => " http://slashdot.org", "%comment-initial" => url("admin/comment/moderation/roles"))); + $output = t(" +

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

+

User control of comment display

+

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

+ +

When a user chooses save settings, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in administer » configuration » modules » comment.

+

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

+ +

Additional comment configurations

+

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in administer » configuration under Submission settings.

+

Administrators can control access to various comment module functions through administer » accounts » permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

+

The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:

+ + +

Notification of new comments

+

Drupal provides specific features to inform site members when new comments have been posted:

+ + +

Comment moderation

+

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

+

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.

+

To enable moderation, the administrator must grant moderate comments permissions. Then, a number of options in administer » comments » moderation must be configured.

+ +

Moderation votes

+

The first step is to create moderation labels which allow users to rate a comment. Go to administer » comments » moderation » votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples are

+ +

So that users know how their votes affect the comment, these examples include the vote value as part of the label, although that is optional.

+

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

+ +

Moderator vote/values matrix

+ +

Next go to administer » comments » moderation » matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.

+

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

+

Creating comment thresholds

+

In administer » comments » moderation » thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting their thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.

+

When creating the thresholds, note that the Minimum score is asking you for the lowest rating that a comment can have in order to be displayed.

+

To see a common example of how thresholds work, you might visit Slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.

+ +

Initial comment scores

+

Finally, you may want to enter some initial comment scores. In administer » comments » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

", array("%comment-config" => url("admin/system/modules/comment"), "%site-config" => url("admin/system"), "%user-permissions" => url("admin/user/permission"), "%tracker" => url("tracker"), "%download-notify" => "http://drupal.org/project/releases", "%permission" => url("admin/user/permission"), "%comment-moderation" => url("admin/comment/moderation"), "%comment-votes" => url("admin/comment/moderation/votes"), "%comment-matrix" => url("admin/comment/moderation/matrix"), "%comment-thresholds" => url("admin/comment/moderation/filters"), "%slashdot" => " http://slashdot.org", "%comment-initial" => url("admin/comment/moderation/roles"))); break; case 'admin/system/modules#description': $output = t("Enables user to comment on content (nodes)."); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 9150a980650a598a155e6539f39fab197d566407..7bd5b5240d243417010724dab328d606eedf0d97 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -6,68 +6,68 @@ function comment_help($section = "admin/help#comment") { switch ($section) { case 'admin/help#comment': - $output .= "

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

"; - $output .= "

User control of comment display

"; - $output .= "

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

"; - $output .= ""; - $output .= "

When a user chooses save settings, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in administer » configuration » modules » comment.

"; - $output .= "

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

"; - - $output .= "

Additional comment configurations

"; - $output .= "

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in administer » configuration under Submission settings.

"; - $output .= "

Administrators can control access to various comment module functions through administer » accounts » permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

"; - $output .= "

The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:

"; - $output .= ""; - - $output .= "

Notification of new comments

"; - $output .= "

Drupal provides specific features to inform site members when new comments have been posted:

"; - $output .= ""; - - $output .= "

Comment moderation

"; - $output .= "

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

"; - $output .= "

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.

"; - $output .= "

To enable moderation, the administrator must grant moderate comments permissions. Then, a number of options in administer » comments » moderation must be configured.

"; - - $output .= "

Moderation votes

"; - $output .= "

The first step is to create moderation labels which allow users to rate a comment. Go to administer » comments » moderation » votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples are

"; - $output .= ""; - $output .= "

So that users know how their votes affect the comment, these examples include the vote value as part of the label, although that is optional.

"; - $output .= "

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

"; - - $output .= "

Moderator vote/values matrix

"; - - $output .= "

Next go to administer » comments » moderation » matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.

"; - $output .= "

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

"; - $output .= "

Creating comment thresholds

"; - $output .= "

In administer » comments » moderation » thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting their thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.

"; - $output .= "

When creating the thresholds, note that the Minimum score is asking you for the lowest rating that a comment can have in order to be displayed.

"; - $output .= "

To see a common example of how thresholds work, you might visit Slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.

"; - - $output .= "

Initial comment scores

"; - $output .= "

Finally, you may want to enter some initial comment scores. In administer » comments » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

"; - $output = t($output, array("%comment-config" => url("admin/system/modules/comment"), "%site-config" => url("admin/system"), "%user-permissions" => url("admin/user/permission"), "%tracker" => url("tracker"), "%download-notify" => "http://drupal.org/project/releases", "%permission" => url("admin/user/permission"), "%comment-moderation" => url("admin/comment/moderation"), "%comment-votes" => url("admin/comment/moderation/votes"), "%comment-matrix" => url("admin/comment/moderation/matrix"), "%comment-thresholds" => url("admin/comment/moderation/filters"), "%slashdot" => " http://slashdot.org", "%comment-initial" => url("admin/comment/moderation/roles"))); + $output = t(" +

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

+

User control of comment display

+

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

+ +

When a user chooses save settings, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in administer » configuration » modules » comment.

+

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

+ +

Additional comment configurations

+

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in administer » configuration under Submission settings.

+

Administrators can control access to various comment module functions through administer » accounts » permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

+

The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:

+ + +

Notification of new comments

+

Drupal provides specific features to inform site members when new comments have been posted:

+ + +

Comment moderation

+

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

+

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.

+

To enable moderation, the administrator must grant moderate comments permissions. Then, a number of options in administer » comments » moderation must be configured.

+ +

Moderation votes

+

The first step is to create moderation labels which allow users to rate a comment. Go to administer » comments » moderation » votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples are

+ +

So that users know how their votes affect the comment, these examples include the vote value as part of the label, although that is optional.

+

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

+ +

Moderator vote/values matrix

+ +

Next go to administer » comments » moderation » matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.

+

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

+

Creating comment thresholds

+

In administer » comments » moderation » thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting their thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.

+

When creating the thresholds, note that the Minimum score is asking you for the lowest rating that a comment can have in order to be displayed.

+

To see a common example of how thresholds work, you might visit Slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.

+ +

Initial comment scores

+

Finally, you may want to enter some initial comment scores. In administer » comments » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

", array("%comment-config" => url("admin/system/modules/comment"), "%site-config" => url("admin/system"), "%user-permissions" => url("admin/user/permission"), "%tracker" => url("tracker"), "%download-notify" => "http://drupal.org/project/releases", "%permission" => url("admin/user/permission"), "%comment-moderation" => url("admin/comment/moderation"), "%comment-votes" => url("admin/comment/moderation/votes"), "%comment-matrix" => url("admin/comment/moderation/matrix"), "%comment-thresholds" => url("admin/comment/moderation/filters"), "%slashdot" => " http://slashdot.org", "%comment-initial" => url("admin/comment/moderation/roles"))); break; case 'admin/system/modules#description': $output = t("Enables user to comment on content (nodes)."); diff --git a/modules/drupal.module b/modules/drupal.module index 7975c412efdf1d394200683cbbee33d2ec35046a..837ec123f8d204891d4167b09508735a6cc8725c 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -5,7 +5,8 @@ function drupal_help($section = "admin/help#drupal") { switch ($section) { case 'admin/help#drupal': - return t("

The \"Drupal\" module features a capability whereby other drupal sites may call home to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.

+ return t(" +

The \"Drupal\" module features a capability whereby other drupal sites may call home to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.

Currently, the main application of this feature is the Drupal sites page. By default, fresh Drupal installations can use drupal.org as their directory server and report their existence. This reporting occurs via scheduled XML-RPC pings.

Drupal administrators should simply enable this feature to get listed on the Drupal sites page. Just set your site's name, e-mail address, slogan and mission statement on the site administration page. Then make sure that the field called Drupal XML-RPC server on the administer » configuration » modules » drupal page is set to %drupal-xml-rpc, and enable this feature using the dropdown directly below.

The listing of your site will occur shortly after your site's next cron run. Note that cron.php should be called using the domain name which you want to have listed at drupal.org. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.example.com/cron.php.

diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 7975c412efdf1d394200683cbbee33d2ec35046a..837ec123f8d204891d4167b09508735a6cc8725c 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -5,7 +5,8 @@ function drupal_help($section = "admin/help#drupal") { switch ($section) { case 'admin/help#drupal': - return t("

The \"Drupal\" module features a capability whereby other drupal sites may call home to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.

+ return t(" +

The \"Drupal\" module features a capability whereby other drupal sites may call home to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.

Currently, the main application of this feature is the Drupal sites page. By default, fresh Drupal installations can use drupal.org as their directory server and report their existence. This reporting occurs via scheduled XML-RPC pings.

Drupal administrators should simply enable this feature to get listed on the Drupal sites page. Just set your site's name, e-mail address, slogan and mission statement on the site administration page. Then make sure that the field called Drupal XML-RPC server on the administer » configuration » modules » drupal page is set to %drupal-xml-rpc, and enable this feature using the dropdown directly below.

The listing of your site will occur shortly after your site's next cron run. Note that cron.php should be called using the domain name which you want to have listed at drupal.org. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.example.com/cron.php.

diff --git a/modules/forum.module b/modules/forum.module index 8a41b4f9123b52639fa173016a934fc1acd917d5..38744796dc994cb799d3369b5ca437a71235fa64 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -1,6 +1,33 @@ Creating a forum +

The forum module uses taxonomy to organize itself. To create a forum you first have to create a taxonomy vocabulary. When doing this, choose a sensible name for it (such as \"fora\") and make sure under \"Types\" that \"forum\" is selected. Once you have done this, add some terms to it. Each term will become a forum. If you fill in the description field, users will be given additonal information about the forum on the main forum page. For example: \"troubleshooting\" - \"Please ask your questions here.\"

+

When you are happy with your vocabulary, go to administer » configutation » modules » forum and set Forum vocabulary to the one you have just created. There will now be fora active on the site. For users to access them they must have the \"access content\" permission and to create a topic they must have the \"create forum topics\" permission. These permissions can be set in the permission pages.

+

Icons

+

To disable icons, set the icon path as blank in administer » configutation » modules » forum.

+

All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16.

", array("%taxonomy" => url("admin/taxonomy/add/vocabulary"), "%taxo-terms" => url("admin/taxonomy"), "%forums" => url("admin/system/modules/forum"), "%permission" => url("admin/user/permission"))); + break; + case 'admin/system/modules#description': + $output = t("Enable threaded discussions about general topics."); + break; + case 'admin/system/modules/forum': + $output = t("Forums are threaded discussions based on the taxonomy system. For the forums to work, the taxonomy module has to be installed and enabled. When activated, a taxonomy vocabulary (eg. \"forums\") needs to be created and bound to the node type \"forum topic\".", array('%created' => url('admin/taxonomy/add/vocabulary'))); + break; + case 'node/add/forum': + $output = variable_get('forum_help', ''); + break; + } + + return $output; +} + function forum_node($field) { $info["name"] = t("forum topic"); $info["description"] = t("A forum is a threaded discussion, enabling users to communicate about a particular topic."); @@ -393,10 +420,6 @@ function _forum_new($tid) { return $nid ? $nid : 0; } -function _forum_message_taxonomy() { - return t("Forums are threaded discussions based on the taxonomy system. For the forums to work, the taxonomy module has to be installed and enabled. When activated, a taxonomy vocabulary (eg. \"forums\") needs to be created and bound to the node type \"forum topic\".", array('%created' => url('admin/taxonomy/add/vocabulary'))); -} - function forum_page() { global $sortby, $forum_per_page, $from, $user; @@ -431,7 +454,7 @@ function forum_page() { print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset); } else { - print theme("page", _forum_message_taxonomy(), t("Warning")); + print theme("page", forum_help("admin/system/modules/forum"), t("Warning")); } } else { @@ -675,31 +698,4 @@ function _forum_get_topic_order($sortby) { } } -function forum_help($section = "admin/help#forum") { - $output = ""; - - switch ($section) { - case 'admin/help#forum': - $output .= "

Creating a forum

"; - $output .= "

The forum module uses taxonomy to organize itself. To create a forum you first have to create a taxonomy vocabulary. When doing this, choose a sensible name for it (such as \"fora\") and make sure under \"Types\" that \"forum\" is selected. Once you have done this, add some terms to it. Each term will become a forum. If you fill in the description field, users will be given additonal information about the forum on the main forum page. For example: \"troubleshooting\" - \"Please ask your questions here.\"

"; - $output .= "

When you are happy with your vocabulary, go to administer » configutation » modules » forum and set Forum vocabulary to the one you have just created. There will now be fora active on the site. For users to access them they must have the \"access content\" permission and to create a topic they must have the \"create forum topics\" permission. These permissions can be set in the permission pages.

"; - $output .= "

Icons

"; - $output .= "

To disable icons, set the icon path as blank in administer » configutation » modules » forum.

"; - $output .= "

All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16.

"; - $output = t($output, array("%taxonomy" => url("admin/taxonomy/add/vocabulary"), "%taxo-terms" => url("admin/taxonomy"), "%forums" => url("admin/system/modules/forum"), "%permission" => url("admin/user/permission"))); - break; - case 'admin/system/modules#description': - $output = t("Enable threaded discussions about general topics."); - break; - case 'admin/system/modules/forum': - $output = _forum_message_taxonomy(); - break; - case 'node/add/forum': - $output = variable_get('forum_help', ''); - break; - } - - return $output; -} - ?> diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 8a41b4f9123b52639fa173016a934fc1acd917d5..38744796dc994cb799d3369b5ca437a71235fa64 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -1,6 +1,33 @@ Creating a forum +

The forum module uses taxonomy to organize itself. To create a forum you first have to create a taxonomy vocabulary. When doing this, choose a sensible name for it (such as \"fora\") and make sure under \"Types\" that \"forum\" is selected. Once you have done this, add some terms to it. Each term will become a forum. If you fill in the description field, users will be given additonal information about the forum on the main forum page. For example: \"troubleshooting\" - \"Please ask your questions here.\"

+

When you are happy with your vocabulary, go to administer » configutation » modules » forum and set Forum vocabulary to the one you have just created. There will now be fora active on the site. For users to access them they must have the \"access content\" permission and to create a topic they must have the \"create forum topics\" permission. These permissions can be set in the permission pages.

+

Icons

+

To disable icons, set the icon path as blank in administer » configutation » modules » forum.

+

All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16.

", array("%taxonomy" => url("admin/taxonomy/add/vocabulary"), "%taxo-terms" => url("admin/taxonomy"), "%forums" => url("admin/system/modules/forum"), "%permission" => url("admin/user/permission"))); + break; + case 'admin/system/modules#description': + $output = t("Enable threaded discussions about general topics."); + break; + case 'admin/system/modules/forum': + $output = t("Forums are threaded discussions based on the taxonomy system. For the forums to work, the taxonomy module has to be installed and enabled. When activated, a taxonomy vocabulary (eg. \"forums\") needs to be created and bound to the node type \"forum topic\".", array('%created' => url('admin/taxonomy/add/vocabulary'))); + break; + case 'node/add/forum': + $output = variable_get('forum_help', ''); + break; + } + + return $output; +} + function forum_node($field) { $info["name"] = t("forum topic"); $info["description"] = t("A forum is a threaded discussion, enabling users to communicate about a particular topic."); @@ -393,10 +420,6 @@ function _forum_new($tid) { return $nid ? $nid : 0; } -function _forum_message_taxonomy() { - return t("Forums are threaded discussions based on the taxonomy system. For the forums to work, the taxonomy module has to be installed and enabled. When activated, a taxonomy vocabulary (eg. \"forums\") needs to be created and bound to the node type \"forum topic\".", array('%created' => url('admin/taxonomy/add/vocabulary'))); -} - function forum_page() { global $sortby, $forum_per_page, $from, $user; @@ -431,7 +454,7 @@ function forum_page() { print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset); } else { - print theme("page", _forum_message_taxonomy(), t("Warning")); + print theme("page", forum_help("admin/system/modules/forum"), t("Warning")); } } else { @@ -675,31 +698,4 @@ function _forum_get_topic_order($sortby) { } } -function forum_help($section = "admin/help#forum") { - $output = ""; - - switch ($section) { - case 'admin/help#forum': - $output .= "

Creating a forum

"; - $output .= "

The forum module uses taxonomy to organize itself. To create a forum you first have to create a taxonomy vocabulary. When doing this, choose a sensible name for it (such as \"fora\") and make sure under \"Types\" that \"forum\" is selected. Once you have done this, add some terms to it. Each term will become a forum. If you fill in the description field, users will be given additonal information about the forum on the main forum page. For example: \"troubleshooting\" - \"Please ask your questions here.\"

"; - $output .= "

When you are happy with your vocabulary, go to administer » configutation » modules » forum and set Forum vocabulary to the one you have just created. There will now be fora active on the site. For users to access them they must have the \"access content\" permission and to create a topic they must have the \"create forum topics\" permission. These permissions can be set in the permission pages.

"; - $output .= "

Icons

"; - $output .= "

To disable icons, set the icon path as blank in administer » configutation » modules » forum.

"; - $output .= "

All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16.

"; - $output = t($output, array("%taxonomy" => url("admin/taxonomy/add/vocabulary"), "%taxo-terms" => url("admin/taxonomy"), "%forums" => url("admin/system/modules/forum"), "%permission" => url("admin/user/permission"))); - break; - case 'admin/system/modules#description': - $output = t("Enable threaded discussions about general topics."); - break; - case 'admin/system/modules/forum': - $output = _forum_message_taxonomy(); - break; - case 'node/add/forum': - $output = variable_get('forum_help', ''); - break; - } - - return $output; -} - ?> diff --git a/modules/help.module b/modules/help.module index 5020ab590004e58e03b02589fd075321f5ce03a6..56fd28d47faa8030d10701018260741bd4949e6c 100644 --- a/modules/help.module +++ b/modules/help.module @@ -10,23 +10,23 @@ function help_link($type) { function help_glossary() { - $output .= "

Glossary

"; - $output .= "
Block
A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.
"; - $output .= "
Comment
A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.
"; - $output .= "
Moderation
The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.
"; - $output .= "
Approved
A moderated post which has been accepted by the moderators for publication. (See published).
"; - $output .= "
Waiting
A moderated post which is still being voted on to be accepted for publication. (See published.)
"; - $output .= "
Moderators
The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).
"; - $output .= "
Node
The basic data unit in Drupal. Everything is a node or an extention of a node.
"; - $output .= "
Public
See published.
"; - $output .= "
Published
A node that is viewable by everyone. (See unpublished.)
"; - $output .= "
Role
A classification users are placed into for the purpose of setting users' permissions.
"; - $output .= "
Taxonomy
A division of a collection of things into ordered, classified groups. (See taxonomy help.)
"; - $output .= "
Unpublished
A node that is only viewable by administrators and moderators.
"; - $output .= "
User
A person who has an account at your Drupal site, and is logged in with that account.
"; - $output .= "
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is not logged in with that account. Also termed \"anonymous user\".
"; - $output .= "
"; - $output = t($output, array("%taxonomy" => url("admin/taxonomy/help"))); + $output .= t(" +

Glossary

+
Block
A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.
+
Comment
A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.
+
Moderation
The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.
+
Approved
A moderated post which has been accepted by the moderators for publication. (See published).
+
Waiting
A moderated post which is still being voted on to be accepted for publication. (See published.)
+
Moderators
The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).
+
Node
The basic data unit in Drupal. Everything is a node or an extention of a node.
+
Public
See published.
+
Published
A node that is viewable by everyone. (See unpublished.)
+
Role
A classification users are placed into for the purpose of setting users' permissions.
+
Taxonomy
A division of a collection of things into ordered, classified groups. (See taxonomy help.)
+
Unpublished
A node that is only viewable by administrators and moderators.
+
User
A person who has an account at your Drupal site, and is logged in with that account.
+
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is not logged in with that account. Also termed \"anonymous user\".
+
", array("%taxonomy" => url("admin/taxonomy/help"))); print theme("page", $output); } diff --git a/modules/help/help.module b/modules/help/help.module index 5020ab590004e58e03b02589fd075321f5ce03a6..56fd28d47faa8030d10701018260741bd4949e6c 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -10,23 +10,23 @@ function help_link($type) { function help_glossary() { - $output .= "

Glossary

"; - $output .= "
Block
A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.
"; - $output .= "
Comment
A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.
"; - $output .= "
Moderation
The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.
"; - $output .= "
Approved
A moderated post which has been accepted by the moderators for publication. (See published).
"; - $output .= "
Waiting
A moderated post which is still being voted on to be accepted for publication. (See published.)
"; - $output .= "
Moderators
The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).
"; - $output .= "
Node
The basic data unit in Drupal. Everything is a node or an extention of a node.
"; - $output .= "
Public
See published.
"; - $output .= "
Published
A node that is viewable by everyone. (See unpublished.)
"; - $output .= "
Role
A classification users are placed into for the purpose of setting users' permissions.
"; - $output .= "
Taxonomy
A division of a collection of things into ordered, classified groups. (See taxonomy help.)
"; - $output .= "
Unpublished
A node that is only viewable by administrators and moderators.
"; - $output .= "
User
A person who has an account at your Drupal site, and is logged in with that account.
"; - $output .= "
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is not logged in with that account. Also termed \"anonymous user\".
"; - $output .= "
"; - $output = t($output, array("%taxonomy" => url("admin/taxonomy/help"))); + $output .= t(" +

Glossary

+
Block
A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.
+
Comment
A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.
+
Moderation
The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.
+
Approved
A moderated post which has been accepted by the moderators for publication. (See published).
+
Waiting
A moderated post which is still being voted on to be accepted for publication. (See published.)
+
Moderators
The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).
+
Node
The basic data unit in Drupal. Everything is a node or an extention of a node.
+
Public
See published.
+
Published
A node that is viewable by everyone. (See unpublished.)
+
Role
A classification users are placed into for the purpose of setting users' permissions.
+
Taxonomy
A division of a collection of things into ordered, classified groups. (See taxonomy help.)
+
Unpublished
A node that is only viewable by administrators and moderators.
+
User
A person who has an account at your Drupal site, and is logged in with that account.
+
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is not logged in with that account. Also termed \"anonymous user\".
+
", array("%taxonomy" => url("admin/taxonomy/help"))); print theme("page", $output); } diff --git a/modules/node.module b/modules/node.module index 61ee57c88ac9287c0a477756cf7253ea2dc0f396..7b0bd1cb01179582ae5d481c156bc89d22347fd9 100644 --- a/modules/node.module +++ b/modules/node.module @@ -8,36 +8,33 @@ function node_help($section = "admin/help#node") { switch ($section) { case 'admin/help#node': - $output .= "

Nodes

"; - $output .= "

The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes."; - $output .= "A base node contains:

"; - $output .= "
A Title
Up to 128 characters of text that titles the node.
"; - $output .= "
A Teaser
A small block of text that is meant to get you interested in the rest of node. Drupal will automatically pull a small amount of the body of the node to make the teaser (To configure how long the teaser will be click here). The teaser can be changed if you don't like what Drupal grabs.
"; - $output .= "
The Body
The main text that comprises your content.
"; - $output .= "
A Type
What kind of node is this? Blog, book, forum, comment, unextended, etc.
"; - $output .= "
An Author
The author's name. It will either be \"anonymous\" or a valid user. You cannot set it to an arbitrary value.
"; - $output .= "
Authored on
The date the node was written.
"; - $output .= "
Changed
The last time this node was changed.
"; - $output .= "
Static on front page
The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers click here), but if you think a node is important enough that you want it to stay on the front page enable this.
"; - $output .= "
Allow user comments
A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).
"; - $output .= "
Attributes
A way to sort nodes.
"; - $output .= "
Revisions
Drupal has a revision system so that you can \"roll back\" to an older version of a post if the new version is not what you want.
"; - $output .= "
Promote to front page
To get people to look at the new stuff on your site you can choose to move it to the front page.
"; - $output .= "
In moderation queue
Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.
"; - $output .= "
Votes
If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote it will either be approved or dropped."; - $output .= "
Score
The score of the node is gotten by the votes it is given.
"; - $output .= "
Users
The list of users who have voted on a moderated node.
"; - $output .= "
Published
When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.
"; - $output .= "

Now that you know what is in a node, here are some of the types of nodes available.

"; - - $output = t($output, array("%teaser" => url("admin/system/modules/node"))); + $output .= t(" +

Nodes

+

The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes. + A base node contains:

+
A Title
Up to 128 characters of text that titles the node.
+
A Teaser
A small block of text that is meant to get you interested in the rest of node. Drupal will automatically pull a small amount of the body of the node to make the teaser (To configure how long the teaser will be click here). The teaser can be changed if you don't like what Drupal grabs.
+
The Body
The main text that comprises your content.
+
A Type
What kind of node is this? Blog, book, forum, comment, unextended, etc.
+
An Author
The author's name. It will either be \"anonymous\" or a valid user. You cannot set it to an arbitrary value.
+
Authored on
The date the node was written.
+
Changed
The last time this node was changed.
+
Static on front page
The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers click here), but if you think a node is important enough that you want it to stay on the front page enable this.
+
Allow user comments
A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).
+
Attributes
A way to sort nodes.
+
Revisions
Drupal has a revision system so that you can \"roll back\" to an older version of a post if the new version is not what you want.
+
Promote to front page
To get people to look at the new stuff on your site you can choose to move it to the front page.
+
In moderation queue
Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.
+
Votes
If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote it will either be approved or dropped. +
Score
The score of the node is gotten by the votes it is given.
+
Users
The list of users who have voted on a moderated node.
+
Published
When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.
+

Now that you know what is in a node, here are some of the types of nodes available.

", array("%teaser" => url("admin/system/modules/node"))); if ($mod == "admin") { - foreach (module_list() as $name) { - if (module_hook($name, "node") && $name != "node") { - $output .= "

". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))) ."

"; - $output .= module_invoke($name, "node", "description"); - } + foreach (node_list() as $type => $module) { + $output .= "

". t("Node type: %module", array("%module" => module_invoke($module, "node", "name", $type))). "

"; + $output .= module_invoke($module, "node", "description", $type); } } break; @@ -219,16 +216,93 @@ function node_teaser($body) { return substr($body, 0, $size); } -function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) { + +/* + * Determines the module that defines the node type of the given node. + * + * @param &$node + * Either a node object, node array, or a string containing the node type. + * @return + * A string containing the name of the defining module. + */ +function node_get_module_name($node) { if (is_array($node)) { - $function = $node["type"] ."_$hook"; + if ($pos = strpos($node["type"], ".")) { + return substr($node["type"], 0, $pos); + } else { + return $node["type"]; + } } else if (is_object($node)) { - $function = $node->type ."_$hook"; + if ($pos = strpos($node->type, ".")) { + return substr($node->type, 0, $pos); + } else { + return $node->type; + } } else if (is_string($node)) { - $function = $node ."_$hook"; + if ($pos = strpos($node, ".")) { + return substr($node, 0, $pos); + } else { + return $node; + } } +} // node_get_module_name + +/* + * Get a list of all the defined node types. + * + * @return + * An associative list in which the keys are node types and the values + * are the names of the modules that define them. + */ +function node_list() { + $types = array(); + foreach (module_list() as $module) { + if (module_hook($module, "node")) { + $module_types = module_invoke($module, "node", "types"); + if ($module_types) { + foreach ($module_types as $type) { + $types[$type] = $module; + } + } else { + $types[$module] = $module; + } + } + } + return $types; +} // node_list + +/* + * Determine whether a node hook exists. + * + * @param &$node + * Either a node object, node array, or a string containing the node type. + * @param $hook + * A string containing the name of the hook. + * @return + * TRUE iff the $hook exists in the node type of $node. + */ +function node_hook(&$node, $hook) { + $function = node_get_module_name($node) ."_$hook"; + + return function_exists($function); +} + +/* + * Invoke a node hook. + * + * @param &$node + * Either a node object, node array, or a string containing the node type. + * @param $hook + * A string containing the name of the hook. + * @param $a2, $a3, $a4 + * Arguments to pass on to the hook, after the $node argument. + * @return + * The returned value of the invoked hook is returned. + */ +function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) { + $function = node_get_module_name($node) ."_$hook"; if (function_exists($function)) { return ($function($node, $a2, $a3, $a4)); @@ -403,7 +477,7 @@ function node_view($node, $main = 0, $page = 0) { ** to display nodes. */ - if (module_hook($node->type, "view")) { + if (node_hook($node, "view")) { return node_invoke($node, "view", $main, $page); } else { @@ -461,20 +535,9 @@ function node_access($op, $node = 0) { $node = array2object($node); - /* - ** Construct a function: - */ - - if ($node->type) { - $type = $node->type; - } - else { - $type = $node; - } - // Can't use node_invoke: // the access hook takes the $op parameter before the $node parameter. - return module_invoke($type, "access", $op, $node); + return module_invoke(node_get_module_name($node), "access", $op, $node); } function node_perm() { @@ -661,7 +724,7 @@ function node_admin_nodes() { $header = array(NULL, t("title"), t("type"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2)); while ($node = db_fetch_object($result)) { - $rows[] = array(form_checkbox(NULL, "status][$node->nid", 1, 0), l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme_mark() : ""), module_invoke($node->type, "node", "name"), format_name($node), ($node->status ? t("published") : t("not published")), l(t("edit node"), "admin/node/edit/$node->nid"), l(t("delete node"), "admin/node/delete/$node->nid")); + $rows[] = array(form_checkbox(NULL, "status][$node->nid", 1, 0), l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme_mark() : ""), module_invoke(node_get_module_name($node), "node", "name", $node->type), format_name($node), ($node->status ? t("published") : t("not published")), l(t("edit node"), "admin/node/edit/$node->nid"), l(t("delete node"), "admin/node/delete/$node->nid")); } if ($pager = theme("pager", NULL, 50, 0)) { @@ -699,23 +762,20 @@ function node_admin_settings($edit) { } $header = array_merge(array(t("type")), array_keys(node_invoke_nodeapi($node, "settings"))); - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $node->type = $name; - $cols = array(); - foreach (node_invoke_nodeapi($node, "settings") as $setting) { - $cols[] = array("data" => $setting, "align" => "center", "width" => 55); - } - $rows[] = array_merge(array(module_invoke($name, "node", "name")), $cols); + foreach (node_list() as $type => $module) { + $node->type = $type; + $cols = array(); + foreach (node_invoke_nodeapi($node, "settings") as $setting) { + $cols[] = array("data" => $setting, "align" => "center", "width" => 55); } + $rows[] = array_merge(array(module_invoke($module, "node", "name", $type)), $cols); } $output .= theme("table", $header, $rows); /* This is an idea for the future. - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $node->type = $name; + foreach (node_list() as $type => $module) { + $node->type = $type; // Create theme("table", ) data: $header = array_keys(node_invoke_nodeapi($node, "settings")); @@ -724,7 +784,7 @@ function node_admin_settings($edit) { $cols[] = array("data" => $setting, "align" => "center", "width" => 75); } - $output .= "

". module_invoke($name, "node", "name") ."

"; + $output .= "

". module_invoke($module, "node", "name", $type) ."

"; $output .= theme("table", $header, array($cols)); $output .= "

"; } @@ -1090,7 +1150,7 @@ function node_form($edit, $error = NULL) { // Can't use node_invoke: // $error and $param must be passed by reference. - $function = $edit->type ."_form"; + $function = node_get_module_name($edit) ."_form"; if (function_exists($function)) { $form .= $function($edit, $error, $param); } @@ -1218,11 +1278,11 @@ function node_add($type) { ** Compile a list with the different node types and their explanation: */ - foreach (module_list() as $name) { - if (module_hook($name, "node") && node_access("create", $name)) { + foreach (node_list() as $type => $module) { + if (node_access("create", $type)) { $output .= "
  • "; - $output .= " ". l(module_invoke($name, "node", "name"), "node/add/$name", array("title" => t("Add a new %s.", array("%s" => module_invoke($name, "node", "name"))))); - $output .= "
    ". module_invoke($name, "node", "description") ."
    "; + $output .= " ". l(module_invoke($module, "node", "name", $type), "node/add/$type", array("title" => t("Add a new %s.", array("%s" => module_invoke($module, "node", "name", $type))))); + $output .= "
    ". module_invoke($module, "node", "description", $type) ."
    "; $output .= "
  • "; } } @@ -1296,30 +1356,19 @@ function node_preview($node, $error = NULL) { $node->teaser = node_teaser($node->body); - /* - ** Apply the required filters: - */ - - if ($node->nid) { - $view = array2object(array_merge(object2array($node), module_invoke($node->type, "save", "update", $node))); - } - else { - $view = array2object(array_merge(object2array($node), module_invoke($node->type, "save", "create", $node))); - } - /* ** Display a preview of the node: */ - if ($view->teaser && $view->teaser != $view->body) { + if ($node->teaser && $node->teaser != $node->body) { $output = "

    ". t("Preview trimmed version") ."

    "; - $output .= node_view($view, 1); + $output .= node_view($node, 1); $output .= "

    ". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '<!--break-->' (without the quotes) to fine-tune where your post gets split.") ."

    "; $output .= "

    ". t("Preview full version") ."

    "; - $output .= node_view($view, 0); + $output .= node_view($node, 0); } else { - $output .= node_view($view, 0); + $output .= node_view($node, 0); } $output .= node_form($node, $error); @@ -1362,7 +1411,7 @@ function node_submit($node) { if (node_access("update", $node)) { $node->nid = node_save($node); watchdog("special", "$node->type: updated '$node->title'", l(t("view post"), "node/view/$node->nid")); - $msg = t("the %name was updated.", array ("%name" => module_invoke($node->type, "node", "name"))); + $msg = t("the %name was updated.", array ("%name" => module_invoke(node_get_module_name($node), "node", "name", $node->type))); } } else { @@ -1456,7 +1505,7 @@ function node_page() { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } - $name = module_invoke(arg(2), "node", "name"); + $name = module_invoke(node_get_module_name(arg(2)), "node", "name", arg(2)); switch ($op) { case "add": diff --git a/modules/node/node.module b/modules/node/node.module index 61ee57c88ac9287c0a477756cf7253ea2dc0f396..7b0bd1cb01179582ae5d481c156bc89d22347fd9 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -8,36 +8,33 @@ function node_help($section = "admin/help#node") { switch ($section) { case 'admin/help#node': - $output .= "

    Nodes

    "; - $output .= "

    The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes."; - $output .= "A base node contains:

    "; - $output .= "
    A Title
    Up to 128 characters of text that titles the node.
    "; - $output .= "
    A Teaser
    A small block of text that is meant to get you interested in the rest of node. Drupal will automatically pull a small amount of the body of the node to make the teaser (To configure how long the teaser will be click here). The teaser can be changed if you don't like what Drupal grabs.
    "; - $output .= "
    The Body
    The main text that comprises your content.
    "; - $output .= "
    A Type
    What kind of node is this? Blog, book, forum, comment, unextended, etc.
    "; - $output .= "
    An Author
    The author's name. It will either be \"anonymous\" or a valid user. You cannot set it to an arbitrary value.
    "; - $output .= "
    Authored on
    The date the node was written.
    "; - $output .= "
    Changed
    The last time this node was changed.
    "; - $output .= "
    Static on front page
    The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers click here), but if you think a node is important enough that you want it to stay on the front page enable this.
    "; - $output .= "
    Allow user comments
    A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).
    "; - $output .= "
    Attributes
    A way to sort nodes.
    "; - $output .= "
    Revisions
    Drupal has a revision system so that you can \"roll back\" to an older version of a post if the new version is not what you want.
    "; - $output .= "
    Promote to front page
    To get people to look at the new stuff on your site you can choose to move it to the front page.
    "; - $output .= "
    In moderation queue
    Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.
    "; - $output .= "
    Votes
    If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote it will either be approved or dropped."; - $output .= "
    Score
    The score of the node is gotten by the votes it is given.
    "; - $output .= "
    Users
    The list of users who have voted on a moderated node.
    "; - $output .= "
    Published
    When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.
    "; - $output .= "

    Now that you know what is in a node, here are some of the types of nodes available.

    "; - - $output = t($output, array("%teaser" => url("admin/system/modules/node"))); + $output .= t(" +

    Nodes

    +

    The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes. + A base node contains:

    +
    A Title
    Up to 128 characters of text that titles the node.
    +
    A Teaser
    A small block of text that is meant to get you interested in the rest of node. Drupal will automatically pull a small amount of the body of the node to make the teaser (To configure how long the teaser will be click here). The teaser can be changed if you don't like what Drupal grabs.
    +
    The Body
    The main text that comprises your content.
    +
    A Type
    What kind of node is this? Blog, book, forum, comment, unextended, etc.
    +
    An Author
    The author's name. It will either be \"anonymous\" or a valid user. You cannot set it to an arbitrary value.
    +
    Authored on
    The date the node was written.
    +
    Changed
    The last time this node was changed.
    +
    Static on front page
    The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers click here), but if you think a node is important enough that you want it to stay on the front page enable this.
    +
    Allow user comments
    A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).
    +
    Attributes
    A way to sort nodes.
    +
    Revisions
    Drupal has a revision system so that you can \"roll back\" to an older version of a post if the new version is not what you want.
    +
    Promote to front page
    To get people to look at the new stuff on your site you can choose to move it to the front page.
    +
    In moderation queue
    Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.
    +
    Votes
    If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote it will either be approved or dropped. +
    Score
    The score of the node is gotten by the votes it is given.
    +
    Users
    The list of users who have voted on a moderated node.
    +
    Published
    When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.
    +

    Now that you know what is in a node, here are some of the types of nodes available.

    ", array("%teaser" => url("admin/system/modules/node"))); if ($mod == "admin") { - foreach (module_list() as $name) { - if (module_hook($name, "node") && $name != "node") { - $output .= "

    ". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))) ."

    "; - $output .= module_invoke($name, "node", "description"); - } + foreach (node_list() as $type => $module) { + $output .= "

    ". t("Node type: %module", array("%module" => module_invoke($module, "node", "name", $type))). "

    "; + $output .= module_invoke($module, "node", "description", $type); } } break; @@ -219,16 +216,93 @@ function node_teaser($body) { return substr($body, 0, $size); } -function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) { + +/* + * Determines the module that defines the node type of the given node. + * + * @param &$node + * Either a node object, node array, or a string containing the node type. + * @return + * A string containing the name of the defining module. + */ +function node_get_module_name($node) { if (is_array($node)) { - $function = $node["type"] ."_$hook"; + if ($pos = strpos($node["type"], ".")) { + return substr($node["type"], 0, $pos); + } else { + return $node["type"]; + } } else if (is_object($node)) { - $function = $node->type ."_$hook"; + if ($pos = strpos($node->type, ".")) { + return substr($node->type, 0, $pos); + } else { + return $node->type; + } } else if (is_string($node)) { - $function = $node ."_$hook"; + if ($pos = strpos($node, ".")) { + return substr($node, 0, $pos); + } else { + return $node; + } } +} // node_get_module_name + +/* + * Get a list of all the defined node types. + * + * @return + * An associative list in which the keys are node types and the values + * are the names of the modules that define them. + */ +function node_list() { + $types = array(); + foreach (module_list() as $module) { + if (module_hook($module, "node")) { + $module_types = module_invoke($module, "node", "types"); + if ($module_types) { + foreach ($module_types as $type) { + $types[$type] = $module; + } + } else { + $types[$module] = $module; + } + } + } + return $types; +} // node_list + +/* + * Determine whether a node hook exists. + * + * @param &$node + * Either a node object, node array, or a string containing the node type. + * @param $hook + * A string containing the name of the hook. + * @return + * TRUE iff the $hook exists in the node type of $node. + */ +function node_hook(&$node, $hook) { + $function = node_get_module_name($node) ."_$hook"; + + return function_exists($function); +} + +/* + * Invoke a node hook. + * + * @param &$node + * Either a node object, node array, or a string containing the node type. + * @param $hook + * A string containing the name of the hook. + * @param $a2, $a3, $a4 + * Arguments to pass on to the hook, after the $node argument. + * @return + * The returned value of the invoked hook is returned. + */ +function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) { + $function = node_get_module_name($node) ."_$hook"; if (function_exists($function)) { return ($function($node, $a2, $a3, $a4)); @@ -403,7 +477,7 @@ function node_view($node, $main = 0, $page = 0) { ** to display nodes. */ - if (module_hook($node->type, "view")) { + if (node_hook($node, "view")) { return node_invoke($node, "view", $main, $page); } else { @@ -461,20 +535,9 @@ function node_access($op, $node = 0) { $node = array2object($node); - /* - ** Construct a function: - */ - - if ($node->type) { - $type = $node->type; - } - else { - $type = $node; - } - // Can't use node_invoke: // the access hook takes the $op parameter before the $node parameter. - return module_invoke($type, "access", $op, $node); + return module_invoke(node_get_module_name($node), "access", $op, $node); } function node_perm() { @@ -661,7 +724,7 @@ function node_admin_nodes() { $header = array(NULL, t("title"), t("type"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2)); while ($node = db_fetch_object($result)) { - $rows[] = array(form_checkbox(NULL, "status][$node->nid", 1, 0), l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme_mark() : ""), module_invoke($node->type, "node", "name"), format_name($node), ($node->status ? t("published") : t("not published")), l(t("edit node"), "admin/node/edit/$node->nid"), l(t("delete node"), "admin/node/delete/$node->nid")); + $rows[] = array(form_checkbox(NULL, "status][$node->nid", 1, 0), l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme_mark() : ""), module_invoke(node_get_module_name($node), "node", "name", $node->type), format_name($node), ($node->status ? t("published") : t("not published")), l(t("edit node"), "admin/node/edit/$node->nid"), l(t("delete node"), "admin/node/delete/$node->nid")); } if ($pager = theme("pager", NULL, 50, 0)) { @@ -699,23 +762,20 @@ function node_admin_settings($edit) { } $header = array_merge(array(t("type")), array_keys(node_invoke_nodeapi($node, "settings"))); - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $node->type = $name; - $cols = array(); - foreach (node_invoke_nodeapi($node, "settings") as $setting) { - $cols[] = array("data" => $setting, "align" => "center", "width" => 55); - } - $rows[] = array_merge(array(module_invoke($name, "node", "name")), $cols); + foreach (node_list() as $type => $module) { + $node->type = $type; + $cols = array(); + foreach (node_invoke_nodeapi($node, "settings") as $setting) { + $cols[] = array("data" => $setting, "align" => "center", "width" => 55); } + $rows[] = array_merge(array(module_invoke($module, "node", "name", $type)), $cols); } $output .= theme("table", $header, $rows); /* This is an idea for the future. - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $node->type = $name; + foreach (node_list() as $type => $module) { + $node->type = $type; // Create theme("table", ) data: $header = array_keys(node_invoke_nodeapi($node, "settings")); @@ -724,7 +784,7 @@ function node_admin_settings($edit) { $cols[] = array("data" => $setting, "align" => "center", "width" => 75); } - $output .= "

    ". module_invoke($name, "node", "name") ."

    "; + $output .= "

    ". module_invoke($module, "node", "name", $type) ."

    "; $output .= theme("table", $header, array($cols)); $output .= "

    "; } @@ -1090,7 +1150,7 @@ function node_form($edit, $error = NULL) { // Can't use node_invoke: // $error and $param must be passed by reference. - $function = $edit->type ."_form"; + $function = node_get_module_name($edit) ."_form"; if (function_exists($function)) { $form .= $function($edit, $error, $param); } @@ -1218,11 +1278,11 @@ function node_add($type) { ** Compile a list with the different node types and their explanation: */ - foreach (module_list() as $name) { - if (module_hook($name, "node") && node_access("create", $name)) { + foreach (node_list() as $type => $module) { + if (node_access("create", $type)) { $output .= "
  • "; - $output .= " ". l(module_invoke($name, "node", "name"), "node/add/$name", array("title" => t("Add a new %s.", array("%s" => module_invoke($name, "node", "name"))))); - $output .= "
    ". module_invoke($name, "node", "description") ."
    "; + $output .= " ". l(module_invoke($module, "node", "name", $type), "node/add/$type", array("title" => t("Add a new %s.", array("%s" => module_invoke($module, "node", "name", $type))))); + $output .= "
    ". module_invoke($module, "node", "description", $type) ."
    "; $output .= "
  • "; } } @@ -1296,30 +1356,19 @@ function node_preview($node, $error = NULL) { $node->teaser = node_teaser($node->body); - /* - ** Apply the required filters: - */ - - if ($node->nid) { - $view = array2object(array_merge(object2array($node), module_invoke($node->type, "save", "update", $node))); - } - else { - $view = array2object(array_merge(object2array($node), module_invoke($node->type, "save", "create", $node))); - } - /* ** Display a preview of the node: */ - if ($view->teaser && $view->teaser != $view->body) { + if ($node->teaser && $node->teaser != $node->body) { $output = "

    ". t("Preview trimmed version") ."

    "; - $output .= node_view($view, 1); + $output .= node_view($node, 1); $output .= "

    ". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '<!--break-->' (without the quotes) to fine-tune where your post gets split.") ."

    "; $output .= "

    ". t("Preview full version") ."

    "; - $output .= node_view($view, 0); + $output .= node_view($node, 0); } else { - $output .= node_view($view, 0); + $output .= node_view($node, 0); } $output .= node_form($node, $error); @@ -1362,7 +1411,7 @@ function node_submit($node) { if (node_access("update", $node)) { $node->nid = node_save($node); watchdog("special", "$node->type: updated '$node->title'", l(t("view post"), "node/view/$node->nid")); - $msg = t("the %name was updated.", array ("%name" => module_invoke($node->type, "node", "name"))); + $msg = t("the %name was updated.", array ("%name" => module_invoke(node_get_module_name($node), "node", "name", $node->type))); } } else { @@ -1456,7 +1505,7 @@ function node_page() { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } - $name = module_invoke(arg(2), "node", "name"); + $name = module_invoke(node_get_module_name(arg(2)), "node", "name", arg(2)); switch ($op) { case "add": diff --git a/modules/page.module b/modules/page.module index 99b2b8aae84debb348d216378c392c4852c2d9a7..4432601d0438e177d0780db748b45712fc4a287b 100644 --- a/modules/page.module +++ b/modules/page.module @@ -6,9 +6,9 @@ function page_help($section = "admin/help#page") { switch ($section) { case 'admin/help#page': - $output .= "

    The page module is used to create a static page. Unlike a story, a static page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the link text field.

    "; - $output .= "

    Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to a site administrator.

    "; - $output = t($output); + $output .= t(" +

    The page module is used to create a static page. Unlike a story, a static page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the link text field.

    +

    Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to a site administrator.

    "); break; case 'admin/system/modules#description': $output = t("Enables the creation of a static pages that can be added to the navigation system."); diff --git a/modules/page/page.module b/modules/page/page.module index 99b2b8aae84debb348d216378c392c4852c2d9a7..4432601d0438e177d0780db748b45712fc4a287b 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -6,9 +6,9 @@ function page_help($section = "admin/help#page") { switch ($section) { case 'admin/help#page': - $output .= "

    The page module is used to create a static page. Unlike a story, a static page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the link text field.

    "; - $output .= "

    Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to a site administrator.

    "; - $output = t($output); + $output .= t(" +

    The page module is used to create a static page. Unlike a story, a static page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the link text field.

    +

    Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to a site administrator.

    "); break; case 'admin/system/modules#description': $output = t("Enables the creation of a static pages that can be added to the navigation system."); diff --git a/modules/path.module b/modules/path.module index 9d5c9c06ffc3711586876e6c3c1ab3245040e2be..73493a2c5a2911264e491d1c89903d2429f41ac5 100644 --- a/modules/path.module +++ b/modules/path.module @@ -115,7 +115,8 @@ function path_help($section = "admin/help#path") { $output = t("Enter the path you wish to create the alias for, followed by the name of the new alias. Each path can be associated with only one alias."); break; case "admin/help#path": - $output = t("

    Background

    + $output = t(" +

    Background

    A very powerful feature of Drupal is the ability to have control over all paths. The path module is the tool that provides this functionality and is part of the basic Drupal installation, although it is not enabled by default. Some examples of re-mapping paths are:

     user/login => login
    diff --git a/modules/path/path.module b/modules/path/path.module
    index 9d5c9c06ffc3711586876e6c3c1ab3245040e2be..73493a2c5a2911264e491d1c89903d2429f41ac5 100644
    --- a/modules/path/path.module
    +++ b/modules/path/path.module
    @@ -115,7 +115,8 @@ function path_help($section = "admin/help#path") {
           $output = t("Enter the path you wish to create the alias for, followed by the name of the new alias. Each path can be associated with only one alias.");
           break;
         case "admin/help#path":
    -      $output = t("

    Background

    + $output = t(" +

    Background

    A very powerful feature of Drupal is the ability to have control over all paths. The path module is the tool that provides this functionality and is part of the basic Drupal installation, although it is not enabled by default. Some examples of re-mapping paths are:

     user/login => login
    diff --git a/modules/ping.module b/modules/ping.module
    index 3389f0cd559ef51fed6624f62db8ee1eadfabe5e..c60173b63b4214d07accfc7cac2d30f7668c8a61 100644
    --- a/modules/ping.module
    +++ b/modules/ping.module
    @@ -6,14 +6,12 @@ function ping_help($section = "admin/help#ping") {
     
       switch ($section) {
         case 'admin/help#ping':
    -      $output .= "

    Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:

    "; - $output .= "

    %weblogs, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs system. The ping module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the %weblogs-XML.

    "; - $output .= "

    %weblogs-RSS, a web site that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, %weblogs-RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs-RSS-changes system. The ping module automatically notifies %weblogs-RSS when your site is updated.

    "; - $output .= "

    %blo-gs, a directory of recently updated weblogs and tools for tracking interesting weblogs, in the spirit of services like %weblogs, %blogtracker and %blogrolling. To get your Drupal site listed, %blo-gs must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %blo-gs system. The ping module automatically notifies blo.gs when your site is updated. To do so, Drupal implements the %blo-gs-XML.

    "; - // for optional modules that ping other sites - // $output .= module_invoke_all("ping_help"); - $output .= "

    The ping feature requires crontab.

    "; - $output = t($output, array("%weblogs" => "Weblogs.com", "%weblogs-XML" => "". t("XML-RPC interface of weblogs.com") ."", "%weblogs-RSS" => "". t("Weblogs.Com for RSS") ."", "%weblogs-RSS-changes" => "". t("the weblogs.com for RSS") ."", "%blo-gs" => "blo.gs", "%blogtracker" => "blogtracker", "%blogrolling" => "blogtolling.com", "%blo-gs-XML" => "". t("XML-RPC interface of blo.gs") ."" )); + $output .= t(" +

    Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:

    +

    %weblogs, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs system. The ping module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the %weblogs-XML.

    +

    %weblogs-RSS, a web site that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, %weblogs-RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs-RSS-changes system. The ping module automatically notifies %weblogs-RSS when your site is updated.

    +

    %blo-gs, a directory of recently updated weblogs and tools for tracking interesting weblogs, in the spirit of services like %weblogs, %blogtracker and %blogrolling. To get your Drupal site listed, %blo-gs must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %blo-gs system. The ping module automatically notifies blo.gs when your site is updated. To do so, Drupal implements the %blo-gs-XML.

    +

    The ping feature requires crontab.

    ", array("%weblogs" => "Weblogs.com", "%weblogs-XML" => "". t("XML-RPC interface of weblogs.com") ."", "%weblogs-RSS" => "". t("Weblogs.Com for RSS") ."", "%weblogs-RSS-changes" => "". t("the weblogs.com for RSS") ."", "%blo-gs" => "blo.gs", "%blogtracker" => "blogtracker", "%blogrolling" => "blogtolling.com", "%blo-gs-XML" => "". t("XML-RPC interface of blo.gs") ."")); break; case 'admin/system/modules#description': diff --git a/modules/ping/ping.module b/modules/ping/ping.module index 3389f0cd559ef51fed6624f62db8ee1eadfabe5e..c60173b63b4214d07accfc7cac2d30f7668c8a61 100644 --- a/modules/ping/ping.module +++ b/modules/ping/ping.module @@ -6,14 +6,12 @@ function ping_help($section = "admin/help#ping") { switch ($section) { case 'admin/help#ping': - $output .= "

    Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:

    "; - $output .= "

    %weblogs, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs system. The ping module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the %weblogs-XML.

    "; - $output .= "

    %weblogs-RSS, a web site that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, %weblogs-RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs-RSS-changes system. The ping module automatically notifies %weblogs-RSS when your site is updated.

    "; - $output .= "

    %blo-gs, a directory of recently updated weblogs and tools for tracking interesting weblogs, in the spirit of services like %weblogs, %blogtracker and %blogrolling. To get your Drupal site listed, %blo-gs must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %blo-gs system. The ping module automatically notifies blo.gs when your site is updated. To do so, Drupal implements the %blo-gs-XML.

    "; - // for optional modules that ping other sites - // $output .= module_invoke_all("ping_help"); - $output .= "

    The ping feature requires crontab.

    "; - $output = t($output, array("%weblogs" => "Weblogs.com", "%weblogs-XML" => "". t("XML-RPC interface of weblogs.com") ."", "%weblogs-RSS" => "". t("Weblogs.Com for RSS") ."", "%weblogs-RSS-changes" => "". t("the weblogs.com for RSS") ."", "%blo-gs" => "blo.gs", "%blogtracker" => "blogtracker", "%blogrolling" => "blogtolling.com", "%blo-gs-XML" => "". t("XML-RPC interface of blo.gs") ."" )); + $output .= t(" +

    Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:

    +

    %weblogs, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs system. The ping module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the %weblogs-XML.

    +

    %weblogs-RSS, a web site that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, %weblogs-RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs-RSS-changes system. The ping module automatically notifies %weblogs-RSS when your site is updated.

    +

    %blo-gs, a directory of recently updated weblogs and tools for tracking interesting weblogs, in the spirit of services like %weblogs, %blogtracker and %blogrolling. To get your Drupal site listed, %blo-gs must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %blo-gs system. The ping module automatically notifies blo.gs when your site is updated. To do so, Drupal implements the %blo-gs-XML.

    +

    The ping feature requires crontab.

    ", array("%weblogs" => "Weblogs.com", "%weblogs-XML" => "". t("XML-RPC interface of weblogs.com") ."", "%weblogs-RSS" => "". t("Weblogs.Com for RSS") ."", "%weblogs-RSS-changes" => "". t("the weblogs.com for RSS") ."", "%blo-gs" => "blo.gs", "%blogtracker" => "blogtracker", "%blogrolling" => "blogtolling.com", "%blo-gs-XML" => "". t("XML-RPC interface of blo.gs") ."")); break; case 'admin/system/modules#description': diff --git a/modules/poll.module b/modules/poll.module index edab210b4308490e82dc36b1ccd33ac85fb61b19..5dd9aa1fcbe2caa7a2a5c1c8956a15d84c9ff6c1 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -143,15 +143,15 @@ function poll_help($section = "admin/help#poll") { switch ($section) { case 'admin/help#poll': - $output .= "

    Users with the correct permissions can create and/or vote on polls.

    "; - $output .= ""; - $output .= "

    Creating a poll is much like creating any other node. Click \"create poll\" in your user box. The title of the poll should be the question, then enter the answers and the \"base\" vote counts. You can also choose the time period over which the vote will run.

    The Poll item in the navigation links will take you to a page where you can see all the current polls, vote on them (if you haven't already) and view the results.

    "; - $output = t($output, array("%permissions" => url("admin/user/permission"), "%poll" => url("poll"))); + $output .= t(" +

    Users with the correct permissions can create and/or vote on polls.

    + +

    Creating a poll is much like creating any other node. Click \"create poll\" in your user box. The title of the poll should be the question, then enter the answers and the \"base\" vote counts. You can also choose the time period over which the vote will run.

    The Poll item in the navigation links will take you to a page where you can see all the current polls, vote on them (if you haven't already) and view the results.

    ", array("%permissions" => url("admin/user/permission"), "%poll" => url("poll"))); break; case 'admin/system/modules#description': $output = t("Enables your site to capture votes on different topics in the form of multiple choice questions."); diff --git a/modules/poll/poll.module b/modules/poll/poll.module index edab210b4308490e82dc36b1ccd33ac85fb61b19..5dd9aa1fcbe2caa7a2a5c1c8956a15d84c9ff6c1 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -143,15 +143,15 @@ function poll_help($section = "admin/help#poll") { switch ($section) { case 'admin/help#poll': - $output .= "

    Users with the correct permissions can create and/or vote on polls.

    "; - $output .= ""; - $output .= "

    Creating a poll is much like creating any other node. Click \"create poll\" in your user box. The title of the poll should be the question, then enter the answers and the \"base\" vote counts. You can also choose the time period over which the vote will run.

    The Poll item in the navigation links will take you to a page where you can see all the current polls, vote on them (if you haven't already) and view the results.

    "; - $output = t($output, array("%permissions" => url("admin/user/permission"), "%poll" => url("poll"))); + $output .= t(" +

    Users with the correct permissions can create and/or vote on polls.

    + +

    Creating a poll is much like creating any other node. Click \"create poll\" in your user box. The title of the poll should be the question, then enter the answers and the \"base\" vote counts. You can also choose the time period over which the vote will run.

    The Poll item in the navigation links will take you to a page where you can see all the current polls, vote on them (if you haven't already) and view the results.

    ", array("%permissions" => url("admin/user/permission"), "%poll" => url("poll"))); break; case 'admin/system/modules#description': $output = t("Enables your site to capture votes on different topics in the form of multiple choice questions."); diff --git a/modules/search.module b/modules/search.module index 3a3b6695dd344fc49aa7dc91fa67780b8bd0baf9..8bd9ad261a01847f5c5f484fbcdb054796e04757 100644 --- a/modules/search.module +++ b/modules/search.module @@ -6,11 +6,11 @@ function search_help($section = "admin/help#search") { switch ($section) { case 'admin/help#search': - $output = "Search guidelines"; - $output .= "

    The search page allows you to search the web site's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.

    "; - $output .= "Words excluded from the search"; - $output .= "

    Words that frequently occur, typically called 'noise words', are ignored. Example words are 'a', 'at', 'and', 'are', 'as', 'how', 'where', etc. Words shorter than %number letters are also ignored.

    "; - $output = t($output, array("%number" => variable_get("minimum_word_size", 2))); + $output = t(" + Search guidelines +

    The search page allows you to search the web site's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.

    + Words excluded from the search +

    Words that frequently occur, typically called 'noise words', are ignored. Example words are 'a', 'at', 'and', 'are', 'as', 'how', 'where', etc. Words shorter than %number letters are also ignored.

    ", array("%number" => variable_get("minimum_word_size", 2))); break; case 'admin/system/modules#description': $output = t("Enables site wide keyword searching."); diff --git a/modules/search/search.module b/modules/search/search.module index 3a3b6695dd344fc49aa7dc91fa67780b8bd0baf9..8bd9ad261a01847f5c5f484fbcdb054796e04757 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -6,11 +6,11 @@ function search_help($section = "admin/help#search") { switch ($section) { case 'admin/help#search': - $output = "Search guidelines"; - $output .= "

    The search page allows you to search the web site's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.

    "; - $output .= "Words excluded from the search"; - $output .= "

    Words that frequently occur, typically called 'noise words', are ignored. Example words are 'a', 'at', 'and', 'are', 'as', 'how', 'where', etc. Words shorter than %number letters are also ignored.

    "; - $output = t($output, array("%number" => variable_get("minimum_word_size", 2))); + $output = t(" + Search guidelines +

    The search page allows you to search the web site's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.

    + Words excluded from the search +

    Words that frequently occur, typically called 'noise words', are ignored. Example words are 'a', 'at', 'and', 'are', 'as', 'how', 'where', etc. Words shorter than %number letters are also ignored.

    ", array("%number" => variable_get("minimum_word_size", 2))); break; case 'admin/system/modules#description': $output = t("Enables site wide keyword searching."); diff --git a/modules/statistics.module b/modules/statistics.module index 23ae79d2d409c0737697c8f2c51bb9e813ac2909..625f7c64e8781f418afc8001f22ecd6111256249 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -98,57 +98,60 @@ function statistics_help($section = "admin/help#statistics") { switch ($section) { case 'admin/help#statistics': - $output .= "

    Introduction

    "; - $output .= "

    The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes disabled by default.

    "; - $output .= "

    The module counts how many times, and from where -- using HTTP referrer -- each of your posts is viewed. Once we have that count the module can do the following with it:"; - $output .= "

    "; - $output .= "

    Notes on using the statistics:

    "; - $output .= ""; - $output .= "

    As with any new module, the statistics module needs to be enabled before you can use it. Also refer to the permissions section, as this module supports four separate permissions.

    "; - $output .= "

    referrers log

    This admin page shows you site-wide referrer statistics. You can see 'all' statistics, 'external' statistics or 'internal' statistics. Default is 'all'.

    "; - $output .= "

    access log

    This admin page gives you an at-a-glance look at your most popular content. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.

    "; - $output .= "

    Configuring the statistics module

    There are some configuration options added to the main administer » configuration section:

    "; - $output .= ""; - $output .= "

    Popular content block

    "; - $output .= "

    This module creates a block that can display the day's top viewed content, the all time top viewed content, and the last content viewed. Each of these links can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.

    "; - $output .= "

    Don't forget to enable the block.

    "; - - $output .= "

    Popular content page

    "; - $output .= "

    This module creates a user page that can display summaries of the day's most popular viewed content, the all time most popular content, and the last content viewed. Each of these summaries can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. You can also assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.

    "; - $output .= "

    Permissions

    This module has four permissions that need to be configured in the permissions section.

    "; - $output .= ""; - $output .= "

    If 'administer statistics' and 'access statistics' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).

    "; - $output .= "

    Statistics module (for developers)

    Accessing statistics

    To get a node's \"view statistics\" make a call to the function statistics_get(\$nid). When you pass in a Node ID (\$nid), the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.

    "; - $output .= ""; - $output .= "

    The module automatically adds '# reads' to each node's link section (if enabled).

    "; - $output .= "

    Most popular content

    The statistics module provides a function 'statistics_title_list(\$dbfield, \$dbrows)' to return an array of links to any of the following: the top viewed content of all time, the top viewed content of today, and the last viewed content. You can pass in:

    "; - $output .= ""; - $output .= "

    \$dbrows is the number or rows you want returned in your array.

    "; - $output = t($output, array("%modules" => url("admin/system/modules"), "%permissions" => url("admin/user/permission"), "%referers" => url("admin/statistics/referrers"), "%access" => url("admin/statistics/log"), "%configuration" => url("admin/system/modules/statistics"), "%block" => url("admin/system/block"))); + $output .= t(" +

    Introduction

    +

    The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes disabled by default.

    +

    The module counts how many times, and from where -- using HTTP referrer -- each of your posts is viewed. Once we have that count the module can do the following with it: +

    +

    Notes on using the statistics:

    + +

    As with any new module, the statistics module needs to be enabled before you can use it. Also refer to the permissions section, as this module supports four separate permissions.

    +

    referrers log

    +

    This admin page shows you site-wide referrer statistics. You can see 'all' statistics, 'external' statistics or 'internal' statistics. Default is 'all'.

    +

    access log

    +

    This admin page gives you an at-a-glance look at your most popular content. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.

    +

    Configuring the statistics module

    +

    There are some configuration options added to the main administer » configuration section:

    + +

    Popular content block

    +

    This module creates a block that can display the day's top viewed content, the all time top viewed content, and the last content viewed. Each of these links can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.

    +

    Don't forget to enable the block.

    +

    Popular content page

    +

    This module creates a user page that can display summaries of the day's most popular viewed content, the all time most popular content, and the last content viewed. Each of these summaries can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. You can also assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.

    +

    Permissions

    This module has four permissions that need to be configured in the permissions section.

    + +

    If 'administer statistics' and 'access statistics' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).

    +

    Statistics module (for developers)

    Accessing statistics

    To get a node's \"view statistics\" make a call to the function statistics_get(\$nid). When you pass in a Node ID (\$nid), the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.

    + +

    The module automatically adds '# reads' to each node's link section (if enabled).

    +

    Most popular content

    +

    The statistics module provides a function 'statistics_title_list(\$dbfield, \$dbrows)' to return an array of links to any of the following: the top viewed content of all time, the top viewed content of today, and the last viewed content. You can pass in:

    + +

    \$dbrows is the number or rows you want returned in your array.

    ", array("%modules" => url("admin/system/modules"), "%permissions" => url("admin/user/permission"), "%referers" => url("admin/statistics/referrers"), "%access" => url("admin/statistics/log"), "%configuration" => url("admin/system/modules/statistics"), "%block" => url("admin/system/block"))); break; case 'admin/system/modules#description': $output = t("Logs access statistics for your site."); diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 23ae79d2d409c0737697c8f2c51bb9e813ac2909..625f7c64e8781f418afc8001f22ecd6111256249 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -98,57 +98,60 @@ function statistics_help($section = "admin/help#statistics") { switch ($section) { case 'admin/help#statistics': - $output .= "

    Introduction

    "; - $output .= "

    The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes disabled by default.

    "; - $output .= "

    The module counts how many times, and from where -- using HTTP referrer -- each of your posts is viewed. Once we have that count the module can do the following with it:"; - $output .= "

    "; - $output .= "

    Notes on using the statistics:

    "; - $output .= ""; - $output .= "

    As with any new module, the statistics module needs to be enabled before you can use it. Also refer to the permissions section, as this module supports four separate permissions.

    "; - $output .= "

    referrers log

    This admin page shows you site-wide referrer statistics. You can see 'all' statistics, 'external' statistics or 'internal' statistics. Default is 'all'.

    "; - $output .= "

    access log

    This admin page gives you an at-a-glance look at your most popular content. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.

    "; - $output .= "

    Configuring the statistics module

    There are some configuration options added to the main administer » configuration section:

    "; - $output .= ""; - $output .= "

    Popular content block

    "; - $output .= "

    This module creates a block that can display the day's top viewed content, the all time top viewed content, and the last content viewed. Each of these links can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.

    "; - $output .= "

    Don't forget to enable the block.

    "; - - $output .= "

    Popular content page

    "; - $output .= "

    This module creates a user page that can display summaries of the day's most popular viewed content, the all time most popular content, and the last content viewed. Each of these summaries can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. You can also assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.

    "; - $output .= "

    Permissions

    This module has four permissions that need to be configured in the permissions section.

    "; - $output .= ""; - $output .= "

    If 'administer statistics' and 'access statistics' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).

    "; - $output .= "

    Statistics module (for developers)

    Accessing statistics

    To get a node's \"view statistics\" make a call to the function statistics_get(\$nid). When you pass in a Node ID (\$nid), the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.

    "; - $output .= ""; - $output .= "

    The module automatically adds '# reads' to each node's link section (if enabled).

    "; - $output .= "

    Most popular content

    The statistics module provides a function 'statistics_title_list(\$dbfield, \$dbrows)' to return an array of links to any of the following: the top viewed content of all time, the top viewed content of today, and the last viewed content. You can pass in:

    "; - $output .= ""; - $output .= "

    \$dbrows is the number or rows you want returned in your array.

    "; - $output = t($output, array("%modules" => url("admin/system/modules"), "%permissions" => url("admin/user/permission"), "%referers" => url("admin/statistics/referrers"), "%access" => url("admin/statistics/log"), "%configuration" => url("admin/system/modules/statistics"), "%block" => url("admin/system/block"))); + $output .= t(" +

    Introduction

    +

    The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes disabled by default.

    +

    The module counts how many times, and from where -- using HTTP referrer -- each of your posts is viewed. Once we have that count the module can do the following with it: +

    +

    Notes on using the statistics:

    + +

    As with any new module, the statistics module needs to be enabled before you can use it. Also refer to the permissions section, as this module supports four separate permissions.

    +

    referrers log

    +

    This admin page shows you site-wide referrer statistics. You can see 'all' statistics, 'external' statistics or 'internal' statistics. Default is 'all'.

    +

    access log

    +

    This admin page gives you an at-a-glance look at your most popular content. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.

    +

    Configuring the statistics module

    +

    There are some configuration options added to the main administer » configuration section:

    + +

    Popular content block

    +

    This module creates a block that can display the day's top viewed content, the all time top viewed content, and the last content viewed. Each of these links can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.

    +

    Don't forget to enable the block.

    +

    Popular content page

    +

    This module creates a user page that can display summaries of the day's most popular viewed content, the all time most popular content, and the last content viewed. Each of these summaries can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. You can also assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.

    +

    Permissions

    This module has four permissions that need to be configured in the permissions section.

    + +

    If 'administer statistics' and 'access statistics' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).

    +

    Statistics module (for developers)

    Accessing statistics

    To get a node's \"view statistics\" make a call to the function statistics_get(\$nid). When you pass in a Node ID (\$nid), the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.

    + +

    The module automatically adds '# reads' to each node's link section (if enabled).

    +

    Most popular content

    +

    The statistics module provides a function 'statistics_title_list(\$dbfield, \$dbrows)' to return an array of links to any of the following: the top viewed content of all time, the top viewed content of today, and the last viewed content. You can pass in:

    + +

    \$dbrows is the number or rows you want returned in your array.

    ", array("%modules" => url("admin/system/modules"), "%permissions" => url("admin/user/permission"), "%referers" => url("admin/statistics/referrers"), "%access" => url("admin/statistics/log"), "%configuration" => url("admin/system/modules/statistics"), "%block" => url("admin/system/block"))); break; case 'admin/system/modules#description': $output = t("Logs access statistics for your site."); diff --git a/modules/story.module b/modules/story.module index 2c05c783849fe33fcd20f5bf2271af949e5f3afc..a66bc6788828ef9d98b0f139789b114c16cc6330 100644 --- a/modules/story.module +++ b/modules/story.module @@ -12,9 +12,9 @@ function story_help($section = "admin/help#story") { $output = t("Stories are like newspaper articles. They tend to follow a publishing flow of submit -> moderate -> post to the main page -> comments. Below you may fix a minimum word count for stories and also write some submission or content guidelines for users wanting to post a story."); break; case 'admin/help#story': - $output = "

    The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of submit -> moderate -> post to the main page -> comments. Administrators are able to shortcut this flow as desired.

    "; - $output .= "In administer » configuration » modules » story you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories."; - $output = t($output, array("%story-config" => url("admin/system/modules/story"))); + $output = t(" +

    The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of submit -> moderate -> post to the main page -> comments. Administrators are able to shortcut this flow as desired.

    + In administer » configuration » modules » story you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories.", array("%story-config" => url("admin/system/modules/story"))); break; case 'node/add/story': $output = variable_get('story_help', ''); diff --git a/modules/story/story.module b/modules/story/story.module index 2c05c783849fe33fcd20f5bf2271af949e5f3afc..a66bc6788828ef9d98b0f139789b114c16cc6330 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -12,9 +12,9 @@ function story_help($section = "admin/help#story") { $output = t("Stories are like newspaper articles. They tend to follow a publishing flow of submit -> moderate -> post to the main page -> comments. Below you may fix a minimum word count for stories and also write some submission or content guidelines for users wanting to post a story."); break; case 'admin/help#story': - $output = "

    The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of submit -> moderate -> post to the main page -> comments. Administrators are able to shortcut this flow as desired.

    "; - $output .= "In administer » configuration » modules » story you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories."; - $output = t($output, array("%story-config" => url("admin/system/modules/story"))); + $output = t(" +

    The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of submit -> moderate -> post to the main page -> comments. Administrators are able to shortcut this flow as desired.

    + In administer » configuration » modules » story you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories.", array("%story-config" => url("admin/system/modules/story"))); break; case 'node/add/story': $output = variable_get('story_help', ''); diff --git a/modules/system.module b/modules/system.module index a7d1734532f183abd5320a592613df1c9507ab58..bdef196cd420a5914f16ce5821489ef094edf489 100644 --- a/modules/system.module +++ b/modules/system.module @@ -16,22 +16,18 @@ function system_help($section = "admin/help#system") { $output = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new permissions might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the throttle configuration page after having enabled the throttle module.", array("%permissions" => url("admin/user/permission"), "%throttle" => url("admin/system/modules/throttle"))); break; case 'admin/help#system': - $output .= "

    Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.

    "; - $output .= "

    Cron

    "; - // Start of system_help_cron - $output .= "

    Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period measured in seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.

    "; - $output .= "

    Whenever %cron-link is accessed, cron will run: it calls the _cron hook in each module allowing the module to run tasks if they have not been executed in the last n seconds, where n is the period of that task. When all the tasks are finished, cron is done.

    "; - $output .= "

    The recommended way to set up your cron system is to set up a Unix/Linux crontab entry (see \"man crontab\") that frequently visits %cron-link. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try its best to run the tasks as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.

    "; - $output .= "

    If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit %cron-link.

    "; - $output .= "

    For the Unix/Linux crontab itself, use a browser like lynx or wget but make sure the process terminates: either use /usr/bin/lynx -source %base_url/cron.php or /usr/bin/wget -o /dev/null -O /dev/null %cron-link. Take a look at the example scripts in the scripts-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be:"; - $output .= "

         00 * * * * /home/www/drupal/scripts/cron-lynx.sh
    "; - $output .= "Note that it is essential to access cron.php using a browser on the web site's domain; do not run it using command line PHP and avoid using localhost or 127.0.0.1 or some of the environment varibles will not be set correctly and features may not work as expected.

    "; - // End of system_help_cron - $output .= "

    Cache

    "; - // Start of system_help_cache - $output .= "

    Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached.

    "; - // End of system_help_cache - $output = t($output, array("%base_url" => $base_url, "%cron-link" => "$base_url/cron.php", "%lynx" => "http://lynx.browser.org", "%wget" => "http://www.gnu.org/software/wget/wget.html" )); + $output .= t(" +

    Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.

    +

    Cron

    +

    Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period measured in seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.

    +

    Whenever %cron-link is accessed, cron will run: it calls the _cron hook in each module allowing the module to run tasks if they have not been executed in the last n seconds, where n is the period of that task. When all the tasks are finished, cron is done.

    +

    The recommended way to set up your cron system is to set up a Unix/Linux crontab entry (see \"man crontab\") that frequently visits %cron-link. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try its best to run the tasks as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.

    +

    If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit %cron-link.

    +

    For the Unix/Linux crontab itself, use a browser like lynx or wget but make sure the process terminates: either use /usr/bin/lynx -source %base_url/cron.php or /usr/bin/wget -o /dev/null -O /dev/null %cron-link. Take a look at the example scripts in the scripts-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be: +

         00 * * * * /home/www/drupal/scripts/cron-lynx.sh
    + Note that it is essential to access cron.php using a browser on the web site's domain; do not run it using command line PHP and avoid using localhost or 127.0.0.1 or some of the environment varibles will not be set correctly and features may not work as expected.

    +

    Cache

    +

    Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached.

    ", array("%base_url" => $base_url, "%cron-link" => "$base_url/cron.php", "%lynx" => "http://lynx.browser.org", "%wget" => "http://www.gnu.org/software/wget/wget.html" )); break; case 'admin/system/modules#description': $output = t("Configuration system that lets administrators modify the workings of the site."); diff --git a/modules/system/system.module b/modules/system/system.module index a7d1734532f183abd5320a592613df1c9507ab58..bdef196cd420a5914f16ce5821489ef094edf489 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -16,22 +16,18 @@ function system_help($section = "admin/help#system") { $output = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new permissions might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the throttle configuration page after having enabled the throttle module.", array("%permissions" => url("admin/user/permission"), "%throttle" => url("admin/system/modules/throttle"))); break; case 'admin/help#system': - $output .= "

    Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.

    "; - $output .= "

    Cron

    "; - // Start of system_help_cron - $output .= "

    Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period measured in seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.

    "; - $output .= "

    Whenever %cron-link is accessed, cron will run: it calls the _cron hook in each module allowing the module to run tasks if they have not been executed in the last n seconds, where n is the period of that task. When all the tasks are finished, cron is done.

    "; - $output .= "

    The recommended way to set up your cron system is to set up a Unix/Linux crontab entry (see \"man crontab\") that frequently visits %cron-link. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try its best to run the tasks as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.

    "; - $output .= "

    If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit %cron-link.

    "; - $output .= "

    For the Unix/Linux crontab itself, use a browser like lynx or wget but make sure the process terminates: either use /usr/bin/lynx -source %base_url/cron.php or /usr/bin/wget -o /dev/null -O /dev/null %cron-link. Take a look at the example scripts in the scripts-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be:"; - $output .= "

         00 * * * * /home/www/drupal/scripts/cron-lynx.sh
    "; - $output .= "Note that it is essential to access cron.php using a browser on the web site's domain; do not run it using command line PHP and avoid using localhost or 127.0.0.1 or some of the environment varibles will not be set correctly and features may not work as expected.

    "; - // End of system_help_cron - $output .= "

    Cache

    "; - // Start of system_help_cache - $output .= "

    Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached.

    "; - // End of system_help_cache - $output = t($output, array("%base_url" => $base_url, "%cron-link" => "$base_url/cron.php", "%lynx" => "http://lynx.browser.org", "%wget" => "http://www.gnu.org/software/wget/wget.html" )); + $output .= t(" +

    Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.

    +

    Cron

    +

    Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period measured in seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.

    +

    Whenever %cron-link is accessed, cron will run: it calls the _cron hook in each module allowing the module to run tasks if they have not been executed in the last n seconds, where n is the period of that task. When all the tasks are finished, cron is done.

    +

    The recommended way to set up your cron system is to set up a Unix/Linux crontab entry (see \"man crontab\") that frequently visits %cron-link. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try its best to run the tasks as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.

    +

    If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit %cron-link.

    +

    For the Unix/Linux crontab itself, use a browser like lynx or wget but make sure the process terminates: either use /usr/bin/lynx -source %base_url/cron.php or /usr/bin/wget -o /dev/null -O /dev/null %cron-link. Take a look at the example scripts in the scripts-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be: +

         00 * * * * /home/www/drupal/scripts/cron-lynx.sh
    + Note that it is essential to access cron.php using a browser on the web site's domain; do not run it using command line PHP and avoid using localhost or 127.0.0.1 or some of the environment varibles will not be set correctly and features may not work as expected.

    +

    Cache

    +

    Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached.

    ", array("%base_url" => $base_url, "%cron-link" => "$base_url/cron.php", "%lynx" => "http://lynx.browser.org", "%wget" => "http://www.gnu.org/software/wget/wget.html" )); break; case 'admin/system/modules#description': $output = t("Configuration system that lets administrators modify the workings of the site."); diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 07f4639c0a42987bc979b0f4c46d4d2002442175..c7726e0398018af9f382175d71081f308ee9a982 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -65,10 +65,8 @@ function taxonomy_link($type, $node = NULL) { */ function taxonomy_form_vocabulary($edit = array()) { - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $nodetypes[$name] = module_invoke($name, "node", "name"); - } + foreach (node_list() as $type => $module) { + $nodetypes[$type] = module_invoke($module, "node", "name", $type); } $form .= form_textfield(t("Vocabulary name"), "name", $edit["name"], 50, 64, t("Required") .". ". t("The name for this vocabulary. Example: 'Topic'") ."."); @@ -282,7 +280,11 @@ function taxonomy_overview() { foreach ($vocabularies as $vocabulary) { $links = array(); - $rows[] = array($vocabulary->name, array("data" => module_invoke($vocabulary->nodes, "node", "name"), "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); + $types = array(); + foreach(explode(",", $vocabulary->nodes) as $type) { + $types[] = module_invoke(node_get_module_name($type), "node", "name", $type); + } + $rows[] = array($vocabulary->name, array("data" => implode(", ", $types), "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); $tree = taxonomy_get_tree($vocabulary->vid); if ($tree) { @@ -848,32 +850,39 @@ function taxonomy_help($section = "admin/help#taxonomy") { $output = t("When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node type (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories."); break; case 'admin/help#taxonomy': - $output .= "

    Background

    Taxonomy is the study of classification. Drupal's taxonomy module allows you to define categories which are used to classify content. The module supports hierarchical classification and association between terms, allowing for truly flexible information retrieval and classification. For more details about classification types and insight into the development of the taxonomy.module, see this drupal.org discussion.

    "; - $output .= "

    An example taxonomy: food

    "; - $output .= "

    Notes

    "; - $output .= "

    Vocabularies

    When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot's sections. For more complex implementations, you might create a hierarchical list of categories such as Food taxonomy shown above.

    "; - $output .= "

    Setting up a vocabulary

    When setting up a controlled vocabulary, if you select the hierarchy option, you will be defining a taxonomy or a thesaurus. If you select the related terms option, you are allowing the definition of related terms, think see also, as in a thesaurus. Selecting multiple select will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.

    "; - $output .= "

    When setting up a controlled vocabulary you are asked for:

    "; - $output .= "

    Adding terms to a vocabulary

    Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for related terms, hierarchy and multiple select. These options are:

    "; - $output .= "

    "; - $output .= "

    Displaying nodes organized by term(s)

    In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, taxonomy/page/or/1,2. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the querystring). You may learn the term ID for a given term by hovering over that term in the taxonomy overview page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either or, which chooses nodes tagged with any of the given term IDs, or and, which chooses nodes tagged with all of the given Term IDs. Thus or is less specific than and. Finally add a comma seperated list of term IDs.

    "; - $output .= "

    RSS feeds

    Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for a sample RSS feed is node/feed/or/1,2. Built like a Taxonomy URL, see above it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.

    "; - $output = t($output, array("%classification-types" => "http://www.eleganthack.com/archives/002165.html#002165", "%drupal-dis" => "http://www.drupal.org/node/view/55", "%slashdot" => "http://www.slashdot.com/", "%taxo-example" => url("taxonomy/page/or/1,2"), "%taxo-overview" => url("admin/taxonomy"), "%userland-rss" => "http://backend.userland.com/stories/rss", "%sample-rss" => url("node/feed/or/1,2"), "%taxo-help" => url("admin/taxonomy/help", NULL, "taxonomy-url") )); + $output .= t(" +

    Background

    +

    Taxonomy is the study of classification. Drupal's taxonomy module allows you to define categories which are used to classify content. The module supports hierarchical classification and association between terms, allowing for truly flexible information retrieval and classification. For more details about classification types and insight into the development of the taxonomy.module, see this drupal.org discussion.

    +

    An example taxonomy: food

    + +

    Notes

    +

    Vocabularies

    +

    When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot's sections. For more complex implementations, you might create a hierarchical list of categories such as Food taxonomy shown above.

    +

    Setting up a vocabulary

    +

    When setting up a controlled vocabulary, if you select the hierarchy option, you will be defining a taxonomy or a thesaurus. If you select the related terms option, you are allowing the definition of related terms, think see also, as in a thesaurus. Selecting multiple select will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.

    +

    When setting up a controlled vocabulary you are asked for:

    +

    Adding terms to a vocabulary

    +

    Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for related terms, hierarchy and multiple select. These options are:

    +

    +

    Displaying nodes organized by term(s)

    +

    In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, taxonomy/page/or/1,2. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the querystring). You may learn the term ID for a given term by hovering over that term in the taxonomy overview page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either or, which chooses nodes tagged with any of the given term IDs, or and, which chooses nodes tagged with all of the given Term IDs. Thus or is less specific than and. Finally add a comma seperated list of term IDs.

    +

    RSS feeds

    +

    Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for a sample RSS feed is node/feed/or/1,2. Built like a Taxonomy URL, see above it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.

    ", array("%classification-types" => "http://www.eleganthack.com/archives/002165.html#002165", "%drupal-dis" => "http://www.drupal.org/node/view/55", "%slashdot" => "http://www.slashdot.com/", "%taxo-example" => url("taxonomy/page/or/1,2"), "%taxo-overview" => url("admin/taxonomy"), "%userland-rss" => "http://backend.userland.com/stories/rss", "%sample-rss" => url("node/feed/or/1,2"), "%taxo-help" => url("admin/taxonomy/help", NULL, "taxonomy-url"))); break; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 07f4639c0a42987bc979b0f4c46d4d2002442175..c7726e0398018af9f382175d71081f308ee9a982 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -65,10 +65,8 @@ function taxonomy_link($type, $node = NULL) { */ function taxonomy_form_vocabulary($edit = array()) { - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $nodetypes[$name] = module_invoke($name, "node", "name"); - } + foreach (node_list() as $type => $module) { + $nodetypes[$type] = module_invoke($module, "node", "name", $type); } $form .= form_textfield(t("Vocabulary name"), "name", $edit["name"], 50, 64, t("Required") .". ". t("The name for this vocabulary. Example: 'Topic'") ."."); @@ -282,7 +280,11 @@ function taxonomy_overview() { foreach ($vocabularies as $vocabulary) { $links = array(); - $rows[] = array($vocabulary->name, array("data" => module_invoke($vocabulary->nodes, "node", "name"), "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); + $types = array(); + foreach(explode(",", $vocabulary->nodes) as $type) { + $types[] = module_invoke(node_get_module_name($type), "node", "name", $type); + } + $rows[] = array($vocabulary->name, array("data" => implode(", ", $types), "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); $tree = taxonomy_get_tree($vocabulary->vid); if ($tree) { @@ -848,32 +850,39 @@ function taxonomy_help($section = "admin/help#taxonomy") { $output = t("When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node type (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories."); break; case 'admin/help#taxonomy': - $output .= "

    Background

    Taxonomy is the study of classification. Drupal's taxonomy module allows you to define categories which are used to classify content. The module supports hierarchical classification and association between terms, allowing for truly flexible information retrieval and classification. For more details about classification types and insight into the development of the taxonomy.module, see this drupal.org discussion.

    "; - $output .= "

    An example taxonomy: food

    "; - $output .= "

    Notes

    "; - $output .= "

    Vocabularies

    When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot's sections. For more complex implementations, you might create a hierarchical list of categories such as Food taxonomy shown above.

    "; - $output .= "

    Setting up a vocabulary

    When setting up a controlled vocabulary, if you select the hierarchy option, you will be defining a taxonomy or a thesaurus. If you select the related terms option, you are allowing the definition of related terms, think see also, as in a thesaurus. Selecting multiple select will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.

    "; - $output .= "

    When setting up a controlled vocabulary you are asked for:

    "; - $output .= "

    Adding terms to a vocabulary

    Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for related terms, hierarchy and multiple select. These options are:

    "; - $output .= "

    "; - $output .= "

    Displaying nodes organized by term(s)

    In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, taxonomy/page/or/1,2. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the querystring). You may learn the term ID for a given term by hovering over that term in the taxonomy overview page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either or, which chooses nodes tagged with any of the given term IDs, or and, which chooses nodes tagged with all of the given Term IDs. Thus or is less specific than and. Finally add a comma seperated list of term IDs.

    "; - $output .= "

    RSS feeds

    Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for a sample RSS feed is node/feed/or/1,2. Built like a Taxonomy URL, see above it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.

    "; - $output = t($output, array("%classification-types" => "http://www.eleganthack.com/archives/002165.html#002165", "%drupal-dis" => "http://www.drupal.org/node/view/55", "%slashdot" => "http://www.slashdot.com/", "%taxo-example" => url("taxonomy/page/or/1,2"), "%taxo-overview" => url("admin/taxonomy"), "%userland-rss" => "http://backend.userland.com/stories/rss", "%sample-rss" => url("node/feed/or/1,2"), "%taxo-help" => url("admin/taxonomy/help", NULL, "taxonomy-url") )); + $output .= t(" +

    Background

    +

    Taxonomy is the study of classification. Drupal's taxonomy module allows you to define categories which are used to classify content. The module supports hierarchical classification and association between terms, allowing for truly flexible information retrieval and classification. For more details about classification types and insight into the development of the taxonomy.module, see this drupal.org discussion.

    +

    An example taxonomy: food

    + +

    Notes

    +

    Vocabularies

    +

    When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot's sections. For more complex implementations, you might create a hierarchical list of categories such as Food taxonomy shown above.

    +

    Setting up a vocabulary

    +

    When setting up a controlled vocabulary, if you select the hierarchy option, you will be defining a taxonomy or a thesaurus. If you select the related terms option, you are allowing the definition of related terms, think see also, as in a thesaurus. Selecting multiple select will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.

    +

    When setting up a controlled vocabulary you are asked for:

    +

    Adding terms to a vocabulary

    +

    Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for related terms, hierarchy and multiple select. These options are:

    +

    +

    Displaying nodes organized by term(s)

    +

    In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, taxonomy/page/or/1,2. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the querystring). You may learn the term ID for a given term by hovering over that term in the taxonomy overview page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either or, which chooses nodes tagged with any of the given term IDs, or and, which chooses nodes tagged with all of the given Term IDs. Thus or is less specific than and. Finally add a comma seperated list of term IDs.

    +

    RSS feeds

    +

    Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for a sample RSS feed is node/feed/or/1,2. Built like a Taxonomy URL, see above it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.

    ", array("%classification-types" => "http://www.eleganthack.com/archives/002165.html#002165", "%drupal-dis" => "http://www.drupal.org/node/view/55", "%slashdot" => "http://www.slashdot.com/", "%taxo-example" => url("taxonomy/page/or/1,2"), "%taxo-overview" => url("admin/taxonomy"), "%userland-rss" => "http://backend.userland.com/stories/rss", "%sample-rss" => url("node/feed/or/1,2"), "%taxo-help" => url("admin/taxonomy/help", NULL, "taxonomy-url"))); break; } diff --git a/modules/throttle.module b/modules/throttle.module index 15e8c2e10f0cac7459c0d035e3ff0f1abda3f674..c92cddfee7f37bc1f6dd3c23c707ac6627fce8aa 100644 --- a/modules/throttle.module +++ b/modules/throttle.module @@ -62,30 +62,39 @@ function throttle_help($section = "admin/help#throttle") { case "admin/system/modules/throttle": return t("If your site gets linked to by a popular website, or otherwise comes under a \"Denial of Service\" (DoS) attack, your webserver might become overwhelmed. This module provides a mechanism for automatically detecting a surge in incoming traffic. This mechanism is utilized by other Drupal models to automatically optimize their performance by temporarily disabling CPU-intensive functionality. To use the auto-throttle, the access log must be enabled. It is advised that you carefully read the explainations below and then properly tune this module based on your site's requirements and your webserver's capabilities.", array("%access" => url("admin/system/modules/statistics"))); case "admin/help#throttle": - $output .= "

    Introduction

    This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the statistics module. The auto-throttle mechanism allows your site to automatically adapt to different server levels.

    "; - $output .= "

    This module also adds a block that displays the current status of the throttle. You must have \"access throttle block\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.

    "; - $output .= "

    The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages generated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.

    "; - $output .= "

    As with any module, the throttle module needs to be enabled before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.

    "; - $output .= "

    Configuring the throttle module

    The configuration section for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.

    "; - $output .= "

    enable auto-throttle:

    This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the statistics module for the auto-throttling mechanism to have any effect.
    "; - $output .= "

    auto-throttle multiplier:

    This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.

    "; - $output .= "

    For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.

    "; - $output .= "

    auto-throttle probability limiter:

    This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.

    "; - $output .= "

    As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1%. As database queries are \"expensive\", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.

    "; - $output .= "

    Throttle block

    This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"access throttle block\" permission bit required to view this block. It does not display information that would interest a normal site end-user.

    "; - $output .= "

    Don't forget to enable the block.

    "; - $output .= "

    Permissions

    This module has one permission that needs to be configured in user permissions.

    "; - $output .= ""; - $output .= "

    For programmers: throttle_status()

    The function throttle_status() will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.

    "; - $output .= "

    To implement the throttle, you should do something like this:"; - $output .= "

    +      $output .= t("
    +      

    Introduction

    +

    This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the statistics module. The auto-throttle mechanism allows your site to automatically adapt to different server levels.

    +

    This module also adds a block that displays the current status of the throttle. You must have \"access throttle block\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.

    +

    The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages generated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.

    +

    As with any module, the throttle module needs to be enabled before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.

    +

    Configuring the throttle module

    +

    The configuration section for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.

    +

    enable auto-throttle:

    +
    This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the statistics module for the auto-throttling mechanism to have any effect.
    +

    auto-throttle multiplier:

    +

    This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.

    +

    For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.

    +

    auto-throttle probability limiter:

    +

    This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.

    +

    As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1%. As database queries are \"expensive\", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.

    +

    Throttle block

    +

    This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"access throttle block\" permission bit required to view this block. It does not display information that would interest a normal site end-user.

    +

    Don't forget to enable the block.

    +

    Permissions

    +

    This module has one permission that needs to be configured in user permissions.

    +
    • access throttle block - enable for user roles that get to view the throttle block.
    +

    For programmers: throttle_status()

    +

    The function throttle_status() will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.

    +

    To implement the throttle, you should do something like this: +

            if (module_invoke(\"throttle\", \"status\") >= \$my_throttle_value) {
               // my throttle limit was reached, disable stuff
             }
             else {
               // throttle limit not reached, execute normally
    -       }

    "; - $output = t($output, array("%statistics-module" => url("admin/statistics"), "%throttle-block" => url("admin/user/permission"), "%modules-enable" => url("admin/system/modules"), "%throttle-config" => url("admin/system/modules/throttle"), "%statistics-config" => url("admin/system/modules/statistics"), "%throttle-access" => url("admin/user/permission"), "%throttle-block-enable" => url("admin/block"), "%permissions" => url("admin/user/permission"))); + }
    +

    ", array("%statistics-module" => url("admin/statistics"), "%throttle-block" => url("admin/user/permission"), "%modules-enable" => url("admin/system/modules"), "%throttle-config" => url("admin/system/modules/throttle"), "%statistics-config" => url("admin/system/modules/statistics"), "%throttle-access" => url("admin/user/permission"), "%throttle-block-enable" => url("admin/block"), "%permissions" => url("admin/user/permission"))); break; } diff --git a/modules/throttle/throttle.module b/modules/throttle/throttle.module index 15e8c2e10f0cac7459c0d035e3ff0f1abda3f674..c92cddfee7f37bc1f6dd3c23c707ac6627fce8aa 100644 --- a/modules/throttle/throttle.module +++ b/modules/throttle/throttle.module @@ -62,30 +62,39 @@ function throttle_help($section = "admin/help#throttle") { case "admin/system/modules/throttle": return t("If your site gets linked to by a popular website, or otherwise comes under a \"Denial of Service\" (DoS) attack, your webserver might become overwhelmed. This module provides a mechanism for automatically detecting a surge in incoming traffic. This mechanism is utilized by other Drupal models to automatically optimize their performance by temporarily disabling CPU-intensive functionality. To use the auto-throttle, the access log must be enabled. It is advised that you carefully read the explainations below and then properly tune this module based on your site's requirements and your webserver's capabilities.", array("%access" => url("admin/system/modules/statistics"))); case "admin/help#throttle": - $output .= "

    Introduction

    This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the statistics module. The auto-throttle mechanism allows your site to automatically adapt to different server levels.

    "; - $output .= "

    This module also adds a block that displays the current status of the throttle. You must have \"access throttle block\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.

    "; - $output .= "

    The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages generated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.

    "; - $output .= "

    As with any module, the throttle module needs to be enabled before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.

    "; - $output .= "

    Configuring the throttle module

    The configuration section for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.

    "; - $output .= "

    enable auto-throttle:

    This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the statistics module for the auto-throttling mechanism to have any effect.
    "; - $output .= "

    auto-throttle multiplier:

    This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.

    "; - $output .= "

    For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.

    "; - $output .= "

    auto-throttle probability limiter:

    This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.

    "; - $output .= "

    As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1%. As database queries are \"expensive\", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.

    "; - $output .= "

    Throttle block

    This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"access throttle block\" permission bit required to view this block. It does not display information that would interest a normal site end-user.

    "; - $output .= "

    Don't forget to enable the block.

    "; - $output .= "

    Permissions

    This module has one permission that needs to be configured in user permissions.

    "; - $output .= ""; - $output .= "

    For programmers: throttle_status()

    The function throttle_status() will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.

    "; - $output .= "

    To implement the throttle, you should do something like this:"; - $output .= "

    +      $output .= t("
    +      

    Introduction

    +

    This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the statistics module. The auto-throttle mechanism allows your site to automatically adapt to different server levels.

    +

    This module also adds a block that displays the current status of the throttle. You must have \"access throttle block\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.

    +

    The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages generated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.

    +

    As with any module, the throttle module needs to be enabled before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.

    +

    Configuring the throttle module

    +

    The configuration section for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.

    +

    enable auto-throttle:

    +
    This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the statistics module for the auto-throttling mechanism to have any effect.
    +

    auto-throttle multiplier:

    +

    This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.

    +

    For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.

    +

    auto-throttle probability limiter:

    +

    This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.

    +

    As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1%. As database queries are \"expensive\", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.

    +

    Throttle block

    +

    This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"access throttle block\" permission bit required to view this block. It does not display information that would interest a normal site end-user.

    +

    Don't forget to enable the block.

    +

    Permissions

    +

    This module has one permission that needs to be configured in user permissions.

    +
    • access throttle block - enable for user roles that get to view the throttle block.
    +

    For programmers: throttle_status()

    +

    The function throttle_status() will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.

    +

    To implement the throttle, you should do something like this: +

            if (module_invoke(\"throttle\", \"status\") >= \$my_throttle_value) {
               // my throttle limit was reached, disable stuff
             }
             else {
               // throttle limit not reached, execute normally
    -       }

    "; - $output = t($output, array("%statistics-module" => url("admin/statistics"), "%throttle-block" => url("admin/user/permission"), "%modules-enable" => url("admin/system/modules"), "%throttle-config" => url("admin/system/modules/throttle"), "%statistics-config" => url("admin/system/modules/statistics"), "%throttle-access" => url("admin/user/permission"), "%throttle-block-enable" => url("admin/block"), "%permissions" => url("admin/user/permission"))); + }
    +

    ", array("%statistics-module" => url("admin/statistics"), "%throttle-block" => url("admin/user/permission"), "%modules-enable" => url("admin/system/modules"), "%throttle-config" => url("admin/system/modules/throttle"), "%statistics-config" => url("admin/system/modules/statistics"), "%throttle-access" => url("admin/user/permission"), "%throttle-block-enable" => url("admin/block"), "%permissions" => url("admin/user/permission"))); break; } diff --git a/modules/user.module b/modules/user.module index 4b15e2705510b7a7b7224da708935d20b16ff2bf..2048c6685923f23b1aaec58865441b8235edc788 100644 --- a/modules/user.module +++ b/modules/user.module @@ -1595,12 +1595,12 @@ function user_help($section = "admin/help#user") { $output .= t("In this area you will define the permissions for each user role (role names are defined on the user roles page). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifying a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => url("admin/user/role"))); break; case 'admin/user/role': - $output .= "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names of the various roles. To delete a role choose \"edit role\".
    By default, Drupal comes with two user roles:"; - $output .= ""; - $output = t($output, array("%permission" => url("admin/user/permission"))); + $output .= t(" + Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names of the various roles. To delete a role choose \"edit role\".
    By default, Drupal comes with two user roles: + ", array("%permission" => url("admin/user/permission"))); break; case 'admin/user/search': $output .= t("Enter a simple pattern ( '*' may be user as a wildcard match) to search for a username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'."); @@ -1614,11 +1614,10 @@ function user_help($section = "admin/help#user") { case 'user/help#user': $site = variable_get("site_name", "this website"); - $output .= "

    Distributed authentication

    "; - $output .= "

    One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called distributed authentication, and is unique to Drupal, the software which powers %site.

    "; - $output .= "

    Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of Delphi Forums. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the remote.delphiforums.com server behind the scenes (usually using XML-RPC, HTTP POST, or SOAP) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.

    "; - - $output = t($output, array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "$site", "%drupal" => "http://www.drupal.org", "%delphi-forums" => "http://www.delphiforums.com", "%xml" => "http://www.xmlrpc.com", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org")); + $output .= t(" +

    Distributed authentication

    +

    One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called distributed authentication, and is unique to Drupal, the software which powers %site.

    +

    Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of Delphi Forums. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the remote.delphiforums.com server behind the scenes (usually using XML-RPC, HTTP POST, or SOAP) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.

    ", array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "$site", "%drupal" => "http://www.drupal.org", "%delphi-forums" => "http://www.delphiforums.com", "%xml" => "http://www.xmlrpc.com", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org")); foreach (module_list() as $module) { if (module_hook($module, "auth")) { @@ -1630,152 +1629,147 @@ function user_help($section = "admin/help#user") { case 'admin/help#user': // Start of user_help_admin - $output .= "

    Introduction

    Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using roles you can setup fine grained permissions allowing each role to do only what you want them to. Each user is assigned to a role. By default there are two roles \"anonymous\" - a user who has not logged in, and \"authorized\" a user who has signed up and who has been authorized. As anonymous users, participants suffer numerous disadvantages, for example they cannot sign their names to nodes, and their moderated posts beginning at a lower score.

    "; - $output .= "

    In contrast, those with a user account can use their own name or handle and are granted various privileges: the most important is probably the ability to moderate new submissions, to rate comments, and to fine-tune the site to their personal liking, with saved personal settings. Drupal themes make fine tuning quite a pleasure.

    "; - $output .= "

    Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a Jabber ID, DelphiForums ID, or one from a Drupal powered website. See the distributed authentication help for more information on this innovative feature."; - $output .= "The local username and password, hashed with Message Digest 5 (MD5), are stored in your database. When you enter a password it is also hashed with MD5 and compaired with what is in the database. If the hashes match, the username and password are correct. Once a user authenticated session is started, and until that session is over, the user won't have to re-authenticate. To keep track of the individual sessions, Drupal relies on PHP sessions. A visitor accessing your website is assigned an unique ID, the so-called session ID, which is stored in a cookie. For security's sake, the cookie does not contain personal information but acts as a key to retrieve the information stored on your server. When a visitor accesses your site, Drupal will check whether a specific session ID has been sent with the request. If this is the case, the prior saved environment is recreated.

    "; - $output .= "

    User preferences and profiles

    Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"my account\" link. Of course, a user must be logged into reach those pages. There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, and distributed authentication names. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in account administration on behalf of their users.

    "; - $output .= "

    Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the developers guide. For an example, see the jabber_user() function in /modules/jabber.module.

    "; - //end of user_help_admin - - //start of user_help_admin_da - $output .= "

    Distributed authentication

    "; - $output .= "

    One of the more tedious moments in visiting a new website is filling out the registration form. The reg form provides helpful information to the website owner, but not much value for the user. The value for the end user is usually the ability to post a messages or receive personalized news, etc. Distributed authentication (DA) gives the user what they want without having to fill out the reg form. Removing this obstacle yields more registered and active users for the website.

    "; - $output .= "

    DA enables a new user to input a username and password into the login box and immediately be recognized, even if that user never registered on your site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that your new user 'Joe' is already a registered member of Delphi Forums. If your Drupal has the delphi module installed, then Drupal will inform Joe on the registration and login screens that he may login with his Delphi ID instead of registering with your Drupal instance. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then communicates with remote.delphiforums.com (usually using %xml, %http-post, or %soap) behind the scenes and asks "is this password for username=joe?" If Delphi replies yes, then Drupal will create a new local account for joe and log joe into it. Joe may keep on logging into your Drupal instance in the same manner, and he will be logged into the same joe@remote.delphiforums.com account.

    "; - $output .= "

    One key element of DA is the 'authmap' table, which maps a user's authname (e.g. joe@remote.delphiforums.com) to his local UID (i.e. user identification number). This map is checked whenever a user successfully logs into an external authentication source. Once Drupal knows that the current user is definately joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID and logs Joe into that account.

    "; - $output .= "

    To disable distributed authentication, simply disable or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.

    "; - $output .= "

    Drupal is setup so that it is very easy to add support for any external authentication source. You currently have the following authentication modules installed ...

    "; - $output .= "%module-list"; - // end of user_help_admin_da - - // start of user_help_devel_da - $output .= "

    Writing distributed authentication modules

    Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the blogger authentication module, and hopefully provide all the details you'll need to write your own auth module. If you want to download the full text of this module, visit the module in the contributions repository.

    "; - $output .= "

    Code review

    "; - $output .= "
    function blogger_auth(\$name, \$pass, \$server) {
    -  // user did not present a Blogger ID so don't bother trying.
    -  if (\$server !== "blogger.com") {
    -    return 0;
    -  }
    -  //provided to Drupal by Ev@Blogger
    -  \$appkey = "6D4A2D6811A6E1F75148DC1155D33C0C958107BC"
    +      $output .= t("
    +      

    Introduction

    +

    Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using roles you can setup fine grained permissions allowing each role to do only what you want them to. Each user is assigned to a role. By default there are two roles \"anonymous\" - a user who has not logged in, and \"authorized\" a user who has signed up and who has been authorized. As anonymous users, participants suffer numerous disadvantages, for example they cannot sign their names to nodes, and their moderated posts beginning at a lower score.

    +

    In contrast, those with a user account can use their own name or handle and are granted various privileges: the most important is probably the ability to moderate new submissions, to rate comments, and to fine-tune the site to their personal liking, with saved personal settings. Drupal themes make fine tuning quite a pleasure.

    +

    Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a Jabber ID, DelphiForums ID, or one from a Drupal powered website. See the distributed authentication help for more information on this innovative feature. + The local username and password, hashed with Message Digest 5 (MD5), are stored in your database. When you enter a password it is also hashed with MD5 and compaired with what is in the database. If the hashes match, the username and password are correct. Once a user authenticated session is started, and until that session is over, the user won't have to re-authenticate. To keep track of the individual sessions, Drupal relies on PHP sessions. A visitor accessing your website is assigned an unique ID, the so-called session ID, which is stored in a cookie. For security's sake, the cookie does not contain personal information but acts as a key to retrieve the information stored on your server. When a visitor accesses your site, Drupal will check whether a specific session ID has been sent with the request. If this is the case, the prior saved environment is recreated.

    +

    User preferences and profiles

    Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"my account\" link. Of course, a user must be logged into reach those pages. There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, and distributed authentication names. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in account administration on behalf of their users.

    +

    Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the developers guide. For an example, see the jabber_user() function in /modules/jabber.module.

    + +

    Distributed authentication

    +

    One of the more tedious moments in visiting a new website is filling out the registration form. The reg form provides helpful information to the website owner, but not much value for the user. The value for the end user is usually the ability to post a messages or receive personalized news, etc. Distributed authentication (DA) gives the user what they want without having to fill out the reg form. Removing this obstacle yields more registered and active users for the website.

    +

    DA enables a new user to input a username and password into the login box and immediately be recognized, even if that user never registered on your site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that your new user 'Joe' is already a registered member of Delphi Forums. If your Drupal has the delphi module installed, then Drupal will inform Joe on the registration and login screens that he may login with his Delphi ID instead of registering with your Drupal instance. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then communicates with remote.delphiforums.com (usually using %xml, %http-post, or %soap) behind the scenes and asks "is this password for username=joe?" If Delphi replies yes, then Drupal will create a new local account for joe and log joe into it. Joe may keep on logging into your Drupal instance in the same manner, and he will be logged into the same joe@remote.delphiforums.com account.

    +

    One key element of DA is the 'authmap' table, which maps a user's authname (e.g. joe@remote.delphiforums.com) to his local UID (i.e. user identification number). This map is checked whenever a user successfully logs into an external authentication source. Once Drupal knows that the current user is definately joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID and logs Joe into that account.

    +

    To disable distributed authentication, simply disable or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.

    +

    Drupal is setup so that it is very easy to add support for any external authentication source. You currently have the following authentication modules installed ...

    + %module-list + +

    Writing distributed authentication modules

    +

    Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the blogger authentication module, and hopefully provide all the details you'll need to write your own auth module. If you want to download the full text of this module, visit the module in the contributions repository.

    +

    Code review

    +
    function blogger_auth(\$name, \$pass, \$server) {
    +        // user did not present a Blogger ID so don't bother trying.
    +        if (\$server !== "blogger.com") {
    +          return 0;
    +        }
    +        //provided to Drupal by Ev@Blogger
    +        \$appkey = "6D4A2D6811A6E1F75148DC1155D33C0C958107BC"
     
    -  \$message = new xmlrpcmsg("blogger.getUsersBlogs",
    +        \$message = new xmlrpcmsg("blogger.getUsersBlogs",
                                array(new xmlrpcval(\$appkey, "string"),
                                new xmlrpcval(\$name, "string"),
                                new xmlrpcval(\$pass, "string")));
    -  \$client = new xmlrpc_client("/api/RPC2", "plant.blogger.com");
    -  // \$client->setDebug(1);
    -  \$result = \$client->send(\$message, 5);
    -  // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
    -  if (\$result && !stristr(\$result->serialize(), "fault")) {
    -    // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    -    return 1;
    -  }
    -  else if (\$result) {
    -    // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    -    return 0;
    -  }
    -  else {
    -    // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    -    return 0;
    -  }
    -}
    "; - $output .= "

    The _auth function is the heart of any authentication module. This function is called whenever a user is attempting to login using your authentication module. For successful authentications, this function returns TRUE. Otherwise, it returns FALSE. This function always accepts 3 parameters, as shown above. These parameters are passed by the user system (user module). The user system parses the username as typed by the user into 2 substrings - \$name and \$server. The parsing rules are:

    "; - $output .= "
    _auth function parameters
    \$nameThe substring before the final '@' character in the username field
    \$passThe whole string submitted by the user in the password field
    \$serverThe substring after the final '@' symbol in the username field
    "; - $output .= "

    So now lets use that \$name, \$pass, and \$server which was passed to our _auth function. Blogger authenticates users via XML-RPC. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just trusts the module.

    "; - $output .= "

    The lines above illustrate a typical XML-RPC method call. Here we build up a message and send it to Blogger, storing the response in a variable called \$response. The message we pass conforms to the published Blogger XML-RPC Application Programmers Interface (API). Your module will no doubt implement a different API. One peculiarity of this module is that we don't actually use the \$server parameter. Blogger only accepts authentication at plant.blogger.com, so we hard-code that value into the xmlrpc_client() function. A more typical example might be the jabber module, which uses the \$server parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the \$client->send() call. This is a timeout value in seconds. All authentication modules should implement a timeout on their external calls. This makes sure to return control to the user module if your registration database has become inoperable or unreachable.

    "; - $output .= "
    -  if (\$result && !stristr(\$result->serialize(), "fault")) {
    -    // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    -    return 1;
    -  }
    -  else if (\$result) {
    -    // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    -    return 0;
    -  }
    -  else {
    -    // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    -    return 0;
    -  }
    -
    "; - $output .= "

    This second half of the _auth function examines the \$response from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.

    "; - $output .= "
    function blogger_page() {
    -
    -  print theme("header");
    -  print theme("box", "Blogger", blogger_help(\"user/help\"));
    -  print theme("footer");
    -}
    "; - $output .= "

    The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for blogger.

    "; - $output .= "
    function blogger_help(\$section) {
    -  \$output = "";
    -
    -  switch (\$section) {
    -    case 'user/help':
    -      \$site = variable_get("site_name", "this web site");
    - \$output .= "<p>You may login to %site using a <b>Blogger ID</b> and password. "; - \$output .= "A Blogger ID consists of your Blogger username followed by <i>@blogger.com</i>. "; - \$output .= "So a valid blogger ID is <i>mwlily</i>@<b>blogger.com</b>. If you are a Blogger member, go ahead and login now.</p>"; - \$output .= "<p>Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. "; - \$output .= "Blogger will publish to your current web site or help you create one. "; - \$output .= "<a href=\"http://www.blogger.com/about.pyra\">Learn more about it</a>."; - \$output = t(\$output, array(\"%site\" => \"<i>\$site</i>\")); - } - - return output; -}
    "; - $output .= "

    The _help function is prominently linked within Drupal, so you'll want to write the best possible user help here. You'll want to tell users what a proper username looks like and you may also want to advertise a bit about your service at the end. Note that your help text is passed through a t() function in the last line. This is Drupal's localization function. Translators may localize your help text just like any other text in Drupal.

    "; - $output .= "

    Publishing your module

    Once you've written and tested your authentication module, you'll usually want to share it with the world. The best way to do this is to add the module to the Drupal contributions CVS repository. You'll need to request priveleges to this repository - see the CVS README file for the details. Then you should announce your contribution on the drupal-devel and drupal-support mailing lists. You might also want to post a story on Drupal.org.

    "; - // end of user_help_devel_da - - // start of user_help_devel_userhook - $output .= "

    module_user()

    The _user() hook provides a mechanism for inserting text and form fields into the registration, user account view/edit, and administer » accounts pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the profile module. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.

    "; - - $output .= "

    Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called julia.module. That file does the following:

      "; - $output .= "
    • new members must agree to Julia's Privacy Policy on the reg page.
    • "; - $output .= "
    • members may list their favorite ingredients on their public user profile page
    • "; - $output .= "

    "; - $output .= "

    Julia achieves this with the following code. The comments below should help you understand what is going on.

    "; - - $output .= "
    -function julia_user(\$type, \$edit, &\$user) {
    -    // What type of registration action are we taking?
    -    switch (\$type) {
    -      case t(\"register_form\"):
    -        // Add two items to the resigtration form.
    -        \$output .= form_item(\"Privacy Policy\",
    -                             \"Julia would never sell your user information. She is just a nice \".
    -                             \"old French chef who lives near me in Cambridge, Massachussetts USA.\");
    -        \$output .= form_checkbox(\"Accept Julia's Kitchen privacy policy.\",
    -                                 julia_accept, 1, \$edit[\"julia_accept\"]);
    -        return \$output;
    -      case t(\"register_validate\"):
    -        // The user has filled out the form and checked the \"accept\" box.
    -        if (\$edit[\"julia_accept\"] == \"1\") {
    -          // on success return the values you want to store
    -          return array(\"julia_accept\" => 1);
    +        \$client = new xmlrpc_client("/api/RPC2", "plant.blogger.com");
    +        // \$client->setDebug(1);
    +        \$result = \$client->send(\$message, 5);
    +        // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
    +        if (\$result && !stristr(\$result->serialize(), "fault")) {
    +          // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    +          return 1;
    +        }
    +        else if (\$result) {
    +          // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    +          return 0;
             }
             else {
    -          // on error return an error message
    -          return \"You must accept the Julia's Kitchen privacy policy to register.\";
    +          // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    +          return 0;
             }
    -      case t(\"view_public\"):
    -        // when others look at user data
    -        return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    -      case t(\"view_private\"):
    -        // when user tries to view his own user page.
    -        return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    -      case t(\"edit_form\"):
    -        // when user tries to edit his own user page.
    -        return form_textfield(\"Favorite Ingredient\", \"julia_favingredient\",
    -                             \$user->julia_favingredient, 50, 65,
    -                             \"Tell everyone your secret spice\");
    -      case t(\"edit_validate\"): // Make sure the data they edited is \"valid\".
    -        return user_save(\$user, array(\"julia_favingredient\" => \$edit[\"julia_favingredient\"]));
    -    }
    -  }
    -
    "; - // end of user_help_devel_userhook - $output = t($output, array("%user-role" => url("admin/user/role"), "%user-permission" => url("admin/user/permission"), "%jabber" => "http://www.jabber.org", "%delphiforums" => "http://www.delphiforums.com", "%drupal" => "http://www.drupal.org", "%da-auth" => url("user/help#da"), "%php-sess" => "http://www.php.net/manual/en/ref.session.php", "%user-prefs" => url("user/edit"), "%admin-user" => url("admin/user"), "%da-devel" => "http://www.drupal.org/node/view/316", "%xml" => "http://www.xmlrpc.org", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org", "%dis-module" => url("admin/system/modules"), "%blogger" => "http://www.blogger.com", "%blogger-source" => "http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Bloggar/?cvsroot=contrib", "%contrib-cvs" => "http://cvs.drupal.org/viewcvs/contributions/?cvsroot=contrib", "%blogger-api" => "http://plant.blogger.com/API", "%cvs" => "http://cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&cvsroot=contrib&content-type=text/vnd.viewcvs-markup", "%drupal-lists" => "http://drupal.org/mailing-lists", "%drupal-org" => "http://www.drupal.org", "%registration" => url("user/register"), "%user-acct" => url("user"), "%user-admin" => url("admin/user"), "%profile-module" => "http://cvs.drupal.org/viewcvs/drupal/modules/profile.module")); + }
    +

    The _auth function is the heart of any authentication module. This function is called whenever a user is attempting to login using your authentication module. For successful authentications, this function returns TRUE. Otherwise, it returns FALSE. This function always accepts 3 parameters, as shown above. These parameters are passed by the user system (user module). The user system parses the username as typed by the user into 2 substrings - \$name and \$server. The parsing rules are:

    +
    _auth function parameters
    \$nameThe substring before the final '@' character in the username field
    \$passThe whole string submitted by the user in the password field
    \$serverThe substring after the final '@' symbol in the username field
    +

    So now lets use that \$name, \$pass, and \$server which was passed to our _auth function. Blogger authenticates users via XML-RPC. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just trusts the module.

    +

    The lines above illustrate a typical XML-RPC method call. Here we build up a message and send it to Blogger, storing the response in a variable called \$response. The message we pass conforms to the published Blogger XML-RPC Application Programmers Interface (API). Your module will no doubt implement a different API. One peculiarity of this module is that we don't actually use the \$server parameter. Blogger only accepts authentication at plant.blogger.com, so we hard-code that value into the xmlrpc_client() function. A more typical example might be the jabber module, which uses the \$server parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the \$client->send() call. This is a timeout value in seconds. All authentication modules should implement a timeout on their external calls. This makes sure to return control to the user module if your registration database has become inoperable or unreachable.

    +
    +      if (\$result && !stristr(\$result->serialize(), "fault")) {
    +        // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    +        return 1;
    +      }
    +      else if (\$result) {
    +        // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    +        return 0;
    +      }
    +      else {
    +        // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    +        return 0;
    +      }
    +      
    +

    This second half of the _auth function examines the \$response from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.

    +
    function blogger_page() {
    +        print theme("header");
    +        print theme("box", "Blogger", blogger_help(\"user/help\"));
    +        print theme("footer");
    +      }
    +

    The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for blogger.

    +
    function blogger_help(\$section) {
    +        \$output = "";
    +
    +        switch (\$section) {
    +          case 'user/help':
    +          \$site = variable_get("site_name", "this web site");
    + \$output .= "<p>You may login to %site using a <b>Blogger ID</b> and password. "; + \$output .= "A Blogger ID consists of your Blogger username followed by <i>@blogger.com</i>. "; + \$output .= "So a valid blogger ID is <i>mwlily</i>@<b>blogger.com</b>. If you are a Blogger member, go ahead and login now.</p>"; + \$output .= "<p>Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. "; + \$output .= "Blogger will publish to your current web site or help you create one. "; + \$output .= "<a href=\"http://www.blogger.com/about.pyra\">Learn more about it</a>."; + \$output = t(\$output, array(\"%site\" => \"<i>\$site</i>\")); + } + + return output; + }
    +

    The _help function is prominently linked within Drupal, so you'll want to write the best possible user help here. You'll want to tell users what a proper username looks like and you may also want to advertise a bit about your service at the end. Note that your help text is passed through a t() function in the last line. This is Drupal's localization function. Translators may localize your help text just like any other text in Drupal.

    +

    Publishing your module

    +

    Once you've written and tested your authentication module, you'll usually want to share it with the world. The best way to do this is to add the module to the Drupal contributions CVS repository. You'll need to request priveleges to this repository - see the CVS README file for the details. Then you should announce your contribution on the drupal-devel and drupal-support mailing lists. You might also want to post a story on Drupal.org.

    + +

    module_user()

    +

    The _user() hook provides a mechanism for inserting text and form fields into the registration, user account view/edit, and administer » accounts pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the profile module. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.

    + +

    Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called julia.module. That file does the following:

    +

    Julia achieves this with the following code. The comments below should help you understand what is going on.

    + +
    +      function julia_user(\$type, \$edit, &\$user) {
    +        // What type of registration action are we taking?
    +        switch (\$type) {
    +          case t(\"register_form\"):
    +            // Add two items to the resigtration form.
    +            \$output .= form_item(\"Privacy Policy\", \"Julia would never sell your user information. She is just a nice \".
    +                                  \"old French chef who lives near me in Cambridge, Massachussetts USA.\");
    +            \$output .= form_checkbox(\"Accept Julia's Kitchen privacy policy.\",
    +                                      julia_accept, 1, \$edit[\"julia_accept\"]);
    +            return \$output;
    +          case t(\"register_validate\"):
    +            // The user has filled out the form and checked the \"accept\" box.
    +            if (\$edit[\"julia_accept\"] == \"1\") {
    +              // on success return the values you want to store
    +              return array(\"julia_accept\" => 1);
    +            }
    +            else {
    +              // on error return an error message
    +              return \"You must accept the Julia's Kitchen privacy policy to register.\";
    +            }
    +          case t(\"view_public\"):
    +            // when others look at user data
    +            return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    +          case t(\"view_private\"):
    +            // when user tries to view his own user page.
    +            return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    +          case t(\"edit_form\"):
    +            // when user tries to edit his own user page.
    +            return form_textfield(\"Favorite Ingredient\", \"julia_favingredient\",
    +                                  \$user->julia_favingredient, 50, 65,
    +                                  \"Tell everyone your secret spice\");
    +          case t(\"edit_validate\"): // Make sure the data they edited is \"valid\".
    +            return user_save(\$user, array(\"julia_favingredient\" => \$edit[\"julia_favingredient\"]));
    +        }
    +      }
    +    
    ", array("%user-role" => url("admin/user/role"), "%user-permission" => url("admin/user/permission"), "%jabber" => "http://www.jabber.org", "%delphiforums" => "http://www.delphiforums.com", "%drupal" => "http://www.drupal.org", "%da-auth" => url("user/help#da"), "%php-sess" => "http://www.php.net/manual/en/ref.session.php", "%user-prefs" => url("user/edit"), "%admin-user" => url("admin/user"), "%da-devel" => "http://www.drupal.org/node/view/316", "%xml" => "http://www.xmlrpc.org", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org", "%dis-module" => url("admin/system/modules"), "%blogger" => "http://www.blogger.com", "%blogger-source" => "http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Bloggar/?cvsroot=contrib", "%contrib-cvs" => "http://cvs.drupal.org/viewcvs/contributions/?cvsroot=contrib", "%blogger-api" => "http://plant.blogger.com/API", "%cvs" => "http://cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&cvsroot=contrib&content-type=text/vnd.viewcvs-markup", "%drupal-lists" => "http://drupal.org/mailing-lists", "%drupal-org" => "http://www.drupal.org", "%registration" => url("user/register"), "%user-acct" => url("user"), "%user-admin" => url("admin/user"), "%profile-module" => "http://cvs.drupal.org/viewcvs/drupal/modules/profile.module")); foreach (module_list() as $module) { if (module_hook($module, "auth")) { @@ -1795,3 +1789,4 @@ function user_help_page() { } ?> + diff --git a/modules/user/user.module b/modules/user/user.module index 4b15e2705510b7a7b7224da708935d20b16ff2bf..2048c6685923f23b1aaec58865441b8235edc788 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1595,12 +1595,12 @@ function user_help($section = "admin/help#user") { $output .= t("In this area you will define the permissions for each user role (role names are defined on the user roles page). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifying a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => url("admin/user/role"))); break; case 'admin/user/role': - $output .= "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names of the various roles. To delete a role choose \"edit role\".
    By default, Drupal comes with two user roles:"; - $output .= ""; - $output = t($output, array("%permission" => url("admin/user/permission"))); + $output .= t(" + Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names of the various roles. To delete a role choose \"edit role\".
    By default, Drupal comes with two user roles: + ", array("%permission" => url("admin/user/permission"))); break; case 'admin/user/search': $output .= t("Enter a simple pattern ( '*' may be user as a wildcard match) to search for a username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'."); @@ -1614,11 +1614,10 @@ function user_help($section = "admin/help#user") { case 'user/help#user': $site = variable_get("site_name", "this website"); - $output .= "

    Distributed authentication

    "; - $output .= "

    One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called distributed authentication, and is unique to Drupal, the software which powers %site.

    "; - $output .= "

    Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of Delphi Forums. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the remote.delphiforums.com server behind the scenes (usually using XML-RPC, HTTP POST, or SOAP) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.

    "; - - $output = t($output, array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "$site", "%drupal" => "http://www.drupal.org", "%delphi-forums" => "http://www.delphiforums.com", "%xml" => "http://www.xmlrpc.com", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org")); + $output .= t(" +

    Distributed authentication

    +

    One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called distributed authentication, and is unique to Drupal, the software which powers %site.

    +

    Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of Delphi Forums. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the remote.delphiforums.com server behind the scenes (usually using XML-RPC, HTTP POST, or SOAP) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.

    ", array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "$site", "%drupal" => "http://www.drupal.org", "%delphi-forums" => "http://www.delphiforums.com", "%xml" => "http://www.xmlrpc.com", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org")); foreach (module_list() as $module) { if (module_hook($module, "auth")) { @@ -1630,152 +1629,147 @@ function user_help($section = "admin/help#user") { case 'admin/help#user': // Start of user_help_admin - $output .= "

    Introduction

    Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using roles you can setup fine grained permissions allowing each role to do only what you want them to. Each user is assigned to a role. By default there are two roles \"anonymous\" - a user who has not logged in, and \"authorized\" a user who has signed up and who has been authorized. As anonymous users, participants suffer numerous disadvantages, for example they cannot sign their names to nodes, and their moderated posts beginning at a lower score.

    "; - $output .= "

    In contrast, those with a user account can use their own name or handle and are granted various privileges: the most important is probably the ability to moderate new submissions, to rate comments, and to fine-tune the site to their personal liking, with saved personal settings. Drupal themes make fine tuning quite a pleasure.

    "; - $output .= "

    Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a Jabber ID, DelphiForums ID, or one from a Drupal powered website. See the distributed authentication help for more information on this innovative feature."; - $output .= "The local username and password, hashed with Message Digest 5 (MD5), are stored in your database. When you enter a password it is also hashed with MD5 and compaired with what is in the database. If the hashes match, the username and password are correct. Once a user authenticated session is started, and until that session is over, the user won't have to re-authenticate. To keep track of the individual sessions, Drupal relies on PHP sessions. A visitor accessing your website is assigned an unique ID, the so-called session ID, which is stored in a cookie. For security's sake, the cookie does not contain personal information but acts as a key to retrieve the information stored on your server. When a visitor accesses your site, Drupal will check whether a specific session ID has been sent with the request. If this is the case, the prior saved environment is recreated.

    "; - $output .= "

    User preferences and profiles

    Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"my account\" link. Of course, a user must be logged into reach those pages. There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, and distributed authentication names. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in account administration on behalf of their users.

    "; - $output .= "

    Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the developers guide. For an example, see the jabber_user() function in /modules/jabber.module.

    "; - //end of user_help_admin - - //start of user_help_admin_da - $output .= "

    Distributed authentication

    "; - $output .= "

    One of the more tedious moments in visiting a new website is filling out the registration form. The reg form provides helpful information to the website owner, but not much value for the user. The value for the end user is usually the ability to post a messages or receive personalized news, etc. Distributed authentication (DA) gives the user what they want without having to fill out the reg form. Removing this obstacle yields more registered and active users for the website.

    "; - $output .= "

    DA enables a new user to input a username and password into the login box and immediately be recognized, even if that user never registered on your site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that your new user 'Joe' is already a registered member of Delphi Forums. If your Drupal has the delphi module installed, then Drupal will inform Joe on the registration and login screens that he may login with his Delphi ID instead of registering with your Drupal instance. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then communicates with remote.delphiforums.com (usually using %xml, %http-post, or %soap) behind the scenes and asks "is this password for username=joe?" If Delphi replies yes, then Drupal will create a new local account for joe and log joe into it. Joe may keep on logging into your Drupal instance in the same manner, and he will be logged into the same joe@remote.delphiforums.com account.

    "; - $output .= "

    One key element of DA is the 'authmap' table, which maps a user's authname (e.g. joe@remote.delphiforums.com) to his local UID (i.e. user identification number). This map is checked whenever a user successfully logs into an external authentication source. Once Drupal knows that the current user is definately joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID and logs Joe into that account.

    "; - $output .= "

    To disable distributed authentication, simply disable or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.

    "; - $output .= "

    Drupal is setup so that it is very easy to add support for any external authentication source. You currently have the following authentication modules installed ...

    "; - $output .= "%module-list"; - // end of user_help_admin_da - - // start of user_help_devel_da - $output .= "

    Writing distributed authentication modules

    Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the blogger authentication module, and hopefully provide all the details you'll need to write your own auth module. If you want to download the full text of this module, visit the module in the contributions repository.

    "; - $output .= "

    Code review

    "; - $output .= "
    function blogger_auth(\$name, \$pass, \$server) {
    -  // user did not present a Blogger ID so don't bother trying.
    -  if (\$server !== "blogger.com") {
    -    return 0;
    -  }
    -  //provided to Drupal by Ev@Blogger
    -  \$appkey = "6D4A2D6811A6E1F75148DC1155D33C0C958107BC"
    +      $output .= t("
    +      

    Introduction

    +

    Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using roles you can setup fine grained permissions allowing each role to do only what you want them to. Each user is assigned to a role. By default there are two roles \"anonymous\" - a user who has not logged in, and \"authorized\" a user who has signed up and who has been authorized. As anonymous users, participants suffer numerous disadvantages, for example they cannot sign their names to nodes, and their moderated posts beginning at a lower score.

    +

    In contrast, those with a user account can use their own name or handle and are granted various privileges: the most important is probably the ability to moderate new submissions, to rate comments, and to fine-tune the site to their personal liking, with saved personal settings. Drupal themes make fine tuning quite a pleasure.

    +

    Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a Jabber ID, DelphiForums ID, or one from a Drupal powered website. See the distributed authentication help for more information on this innovative feature. + The local username and password, hashed with Message Digest 5 (MD5), are stored in your database. When you enter a password it is also hashed with MD5 and compaired with what is in the database. If the hashes match, the username and password are correct. Once a user authenticated session is started, and until that session is over, the user won't have to re-authenticate. To keep track of the individual sessions, Drupal relies on PHP sessions. A visitor accessing your website is assigned an unique ID, the so-called session ID, which is stored in a cookie. For security's sake, the cookie does not contain personal information but acts as a key to retrieve the information stored on your server. When a visitor accesses your site, Drupal will check whether a specific session ID has been sent with the request. If this is the case, the prior saved environment is recreated.

    +

    User preferences and profiles

    Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"my account\" link. Of course, a user must be logged into reach those pages. There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, and distributed authentication names. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in account administration on behalf of their users.

    +

    Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the developers guide. For an example, see the jabber_user() function in /modules/jabber.module.

    + +

    Distributed authentication

    +

    One of the more tedious moments in visiting a new website is filling out the registration form. The reg form provides helpful information to the website owner, but not much value for the user. The value for the end user is usually the ability to post a messages or receive personalized news, etc. Distributed authentication (DA) gives the user what they want without having to fill out the reg form. Removing this obstacle yields more registered and active users for the website.

    +

    DA enables a new user to input a username and password into the login box and immediately be recognized, even if that user never registered on your site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that your new user 'Joe' is already a registered member of Delphi Forums. If your Drupal has the delphi module installed, then Drupal will inform Joe on the registration and login screens that he may login with his Delphi ID instead of registering with your Drupal instance. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then communicates with remote.delphiforums.com (usually using %xml, %http-post, or %soap) behind the scenes and asks "is this password for username=joe?" If Delphi replies yes, then Drupal will create a new local account for joe and log joe into it. Joe may keep on logging into your Drupal instance in the same manner, and he will be logged into the same joe@remote.delphiforums.com account.

    +

    One key element of DA is the 'authmap' table, which maps a user's authname (e.g. joe@remote.delphiforums.com) to his local UID (i.e. user identification number). This map is checked whenever a user successfully logs into an external authentication source. Once Drupal knows that the current user is definately joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID and logs Joe into that account.

    +

    To disable distributed authentication, simply disable or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.

    +

    Drupal is setup so that it is very easy to add support for any external authentication source. You currently have the following authentication modules installed ...

    + %module-list + +

    Writing distributed authentication modules

    +

    Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the blogger authentication module, and hopefully provide all the details you'll need to write your own auth module. If you want to download the full text of this module, visit the module in the contributions repository.

    +

    Code review

    +
    function blogger_auth(\$name, \$pass, \$server) {
    +        // user did not present a Blogger ID so don't bother trying.
    +        if (\$server !== "blogger.com") {
    +          return 0;
    +        }
    +        //provided to Drupal by Ev@Blogger
    +        \$appkey = "6D4A2D6811A6E1F75148DC1155D33C0C958107BC"
     
    -  \$message = new xmlrpcmsg("blogger.getUsersBlogs",
    +        \$message = new xmlrpcmsg("blogger.getUsersBlogs",
                                array(new xmlrpcval(\$appkey, "string"),
                                new xmlrpcval(\$name, "string"),
                                new xmlrpcval(\$pass, "string")));
    -  \$client = new xmlrpc_client("/api/RPC2", "plant.blogger.com");
    -  // \$client->setDebug(1);
    -  \$result = \$client->send(\$message, 5);
    -  // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
    -  if (\$result && !stristr(\$result->serialize(), "fault")) {
    -    // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    -    return 1;
    -  }
    -  else if (\$result) {
    -    // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    -    return 0;
    -  }
    -  else {
    -    // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    -    return 0;
    -  }
    -}
    "; - $output .= "

    The _auth function is the heart of any authentication module. This function is called whenever a user is attempting to login using your authentication module. For successful authentications, this function returns TRUE. Otherwise, it returns FALSE. This function always accepts 3 parameters, as shown above. These parameters are passed by the user system (user module). The user system parses the username as typed by the user into 2 substrings - \$name and \$server. The parsing rules are:

    "; - $output .= "
    _auth function parameters
    \$nameThe substring before the final '@' character in the username field
    \$passThe whole string submitted by the user in the password field
    \$serverThe substring after the final '@' symbol in the username field
    "; - $output .= "

    So now lets use that \$name, \$pass, and \$server which was passed to our _auth function. Blogger authenticates users via XML-RPC. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just trusts the module.

    "; - $output .= "

    The lines above illustrate a typical XML-RPC method call. Here we build up a message and send it to Blogger, storing the response in a variable called \$response. The message we pass conforms to the published Blogger XML-RPC Application Programmers Interface (API). Your module will no doubt implement a different API. One peculiarity of this module is that we don't actually use the \$server parameter. Blogger only accepts authentication at plant.blogger.com, so we hard-code that value into the xmlrpc_client() function. A more typical example might be the jabber module, which uses the \$server parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the \$client->send() call. This is a timeout value in seconds. All authentication modules should implement a timeout on their external calls. This makes sure to return control to the user module if your registration database has become inoperable or unreachable.

    "; - $output .= "
    -  if (\$result && !stristr(\$result->serialize(), "fault")) {
    -    // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    -    return 1;
    -  }
    -  else if (\$result) {
    -    // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    -    return 0;
    -  }
    -  else {
    -    // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    -    return 0;
    -  }
    -
    "; - $output .= "

    This second half of the _auth function examines the \$response from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.

    "; - $output .= "
    function blogger_page() {
    -
    -  print theme("header");
    -  print theme("box", "Blogger", blogger_help(\"user/help\"));
    -  print theme("footer");
    -}
    "; - $output .= "

    The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for blogger.

    "; - $output .= "
    function blogger_help(\$section) {
    -  \$output = "";
    -
    -  switch (\$section) {
    -    case 'user/help':
    -      \$site = variable_get("site_name", "this web site");
    - \$output .= "<p>You may login to %site using a <b>Blogger ID</b> and password. "; - \$output .= "A Blogger ID consists of your Blogger username followed by <i>@blogger.com</i>. "; - \$output .= "So a valid blogger ID is <i>mwlily</i>@<b>blogger.com</b>. If you are a Blogger member, go ahead and login now.</p>"; - \$output .= "<p>Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. "; - \$output .= "Blogger will publish to your current web site or help you create one. "; - \$output .= "<a href=\"http://www.blogger.com/about.pyra\">Learn more about it</a>."; - \$output = t(\$output, array(\"%site\" => \"<i>\$site</i>\")); - } - - return output; -}
    "; - $output .= "

    The _help function is prominently linked within Drupal, so you'll want to write the best possible user help here. You'll want to tell users what a proper username looks like and you may also want to advertise a bit about your service at the end. Note that your help text is passed through a t() function in the last line. This is Drupal's localization function. Translators may localize your help text just like any other text in Drupal.

    "; - $output .= "

    Publishing your module

    Once you've written and tested your authentication module, you'll usually want to share it with the world. The best way to do this is to add the module to the Drupal contributions CVS repository. You'll need to request priveleges to this repository - see the CVS README file for the details. Then you should announce your contribution on the drupal-devel and drupal-support mailing lists. You might also want to post a story on Drupal.org.

    "; - // end of user_help_devel_da - - // start of user_help_devel_userhook - $output .= "

    module_user()

    The _user() hook provides a mechanism for inserting text and form fields into the registration, user account view/edit, and administer » accounts pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the profile module. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.

    "; - - $output .= "

    Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called julia.module. That file does the following:

      "; - $output .= "
    • new members must agree to Julia's Privacy Policy on the reg page.
    • "; - $output .= "
    • members may list their favorite ingredients on their public user profile page
    • "; - $output .= "

    "; - $output .= "

    Julia achieves this with the following code. The comments below should help you understand what is going on.

    "; - - $output .= "
    -function julia_user(\$type, \$edit, &\$user) {
    -    // What type of registration action are we taking?
    -    switch (\$type) {
    -      case t(\"register_form\"):
    -        // Add two items to the resigtration form.
    -        \$output .= form_item(\"Privacy Policy\",
    -                             \"Julia would never sell your user information. She is just a nice \".
    -                             \"old French chef who lives near me in Cambridge, Massachussetts USA.\");
    -        \$output .= form_checkbox(\"Accept Julia's Kitchen privacy policy.\",
    -                                 julia_accept, 1, \$edit[\"julia_accept\"]);
    -        return \$output;
    -      case t(\"register_validate\"):
    -        // The user has filled out the form and checked the \"accept\" box.
    -        if (\$edit[\"julia_accept\"] == \"1\") {
    -          // on success return the values you want to store
    -          return array(\"julia_accept\" => 1);
    +        \$client = new xmlrpc_client("/api/RPC2", "plant.blogger.com");
    +        // \$client->setDebug(1);
    +        \$result = \$client->send(\$message, 5);
    +        // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
    +        if (\$result && !stristr(\$result->serialize(), "fault")) {
    +          // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    +          return 1;
    +        }
    +        else if (\$result) {
    +          // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    +          return 0;
             }
             else {
    -          // on error return an error message
    -          return \"You must accept the Julia's Kitchen privacy policy to register.\";
    +          // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    +          return 0;
             }
    -      case t(\"view_public\"):
    -        // when others look at user data
    -        return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    -      case t(\"view_private\"):
    -        // when user tries to view his own user page.
    -        return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    -      case t(\"edit_form\"):
    -        // when user tries to edit his own user page.
    -        return form_textfield(\"Favorite Ingredient\", \"julia_favingredient\",
    -                             \$user->julia_favingredient, 50, 65,
    -                             \"Tell everyone your secret spice\");
    -      case t(\"edit_validate\"): // Make sure the data they edited is \"valid\".
    -        return user_save(\$user, array(\"julia_favingredient\" => \$edit[\"julia_favingredient\"]));
    -    }
    -  }
    -
    "; - // end of user_help_devel_userhook - $output = t($output, array("%user-role" => url("admin/user/role"), "%user-permission" => url("admin/user/permission"), "%jabber" => "http://www.jabber.org", "%delphiforums" => "http://www.delphiforums.com", "%drupal" => "http://www.drupal.org", "%da-auth" => url("user/help#da"), "%php-sess" => "http://www.php.net/manual/en/ref.session.php", "%user-prefs" => url("user/edit"), "%admin-user" => url("admin/user"), "%da-devel" => "http://www.drupal.org/node/view/316", "%xml" => "http://www.xmlrpc.org", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org", "%dis-module" => url("admin/system/modules"), "%blogger" => "http://www.blogger.com", "%blogger-source" => "http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Bloggar/?cvsroot=contrib", "%contrib-cvs" => "http://cvs.drupal.org/viewcvs/contributions/?cvsroot=contrib", "%blogger-api" => "http://plant.blogger.com/API", "%cvs" => "http://cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&cvsroot=contrib&content-type=text/vnd.viewcvs-markup", "%drupal-lists" => "http://drupal.org/mailing-lists", "%drupal-org" => "http://www.drupal.org", "%registration" => url("user/register"), "%user-acct" => url("user"), "%user-admin" => url("admin/user"), "%profile-module" => "http://cvs.drupal.org/viewcvs/drupal/modules/profile.module")); + }
    +

    The _auth function is the heart of any authentication module. This function is called whenever a user is attempting to login using your authentication module. For successful authentications, this function returns TRUE. Otherwise, it returns FALSE. This function always accepts 3 parameters, as shown above. These parameters are passed by the user system (user module). The user system parses the username as typed by the user into 2 substrings - \$name and \$server. The parsing rules are:

    +
    _auth function parameters
    \$nameThe substring before the final '@' character in the username field
    \$passThe whole string submitted by the user in the password field
    \$serverThe substring after the final '@' symbol in the username field
    +

    So now lets use that \$name, \$pass, and \$server which was passed to our _auth function. Blogger authenticates users via XML-RPC. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just trusts the module.

    +

    The lines above illustrate a typical XML-RPC method call. Here we build up a message and send it to Blogger, storing the response in a variable called \$response. The message we pass conforms to the published Blogger XML-RPC Application Programmers Interface (API). Your module will no doubt implement a different API. One peculiarity of this module is that we don't actually use the \$server parameter. Blogger only accepts authentication at plant.blogger.com, so we hard-code that value into the xmlrpc_client() function. A more typical example might be the jabber module, which uses the \$server parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the \$client->send() call. This is a timeout value in seconds. All authentication modules should implement a timeout on their external calls. This makes sure to return control to the user module if your registration database has become inoperable or unreachable.

    +
    +      if (\$result && !stristr(\$result->serialize(), "fault")) {
    +        // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
    +        return 1;
    +      }
    +      else if (\$result) {
    +        // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
    +        return 0;
    +      }
    +      else {
    +        // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
    +        return 0;
    +      }
    +      
    +

    This second half of the _auth function examines the \$response from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.

    +
    function blogger_page() {
    +        print theme("header");
    +        print theme("box", "Blogger", blogger_help(\"user/help\"));
    +        print theme("footer");
    +      }
    +

    The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for blogger.

    +
    function blogger_help(\$section) {
    +        \$output = "";
    +
    +        switch (\$section) {
    +          case 'user/help':
    +          \$site = variable_get("site_name", "this web site");
    + \$output .= "<p>You may login to %site using a <b>Blogger ID</b> and password. "; + \$output .= "A Blogger ID consists of your Blogger username followed by <i>@blogger.com</i>. "; + \$output .= "So a valid blogger ID is <i>mwlily</i>@<b>blogger.com</b>. If you are a Blogger member, go ahead and login now.</p>"; + \$output .= "<p>Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. "; + \$output .= "Blogger will publish to your current web site or help you create one. "; + \$output .= "<a href=\"http://www.blogger.com/about.pyra\">Learn more about it</a>."; + \$output = t(\$output, array(\"%site\" => \"<i>\$site</i>\")); + } + + return output; + }
    +

    The _help function is prominently linked within Drupal, so you'll want to write the best possible user help here. You'll want to tell users what a proper username looks like and you may also want to advertise a bit about your service at the end. Note that your help text is passed through a t() function in the last line. This is Drupal's localization function. Translators may localize your help text just like any other text in Drupal.

    +

    Publishing your module

    +

    Once you've written and tested your authentication module, you'll usually want to share it with the world. The best way to do this is to add the module to the Drupal contributions CVS repository. You'll need to request priveleges to this repository - see the CVS README file for the details. Then you should announce your contribution on the drupal-devel and drupal-support mailing lists. You might also want to post a story on Drupal.org.

    + +

    module_user()

    +

    The _user() hook provides a mechanism for inserting text and form fields into the registration, user account view/edit, and administer » accounts pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the profile module. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.

    + +

    Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called julia.module. That file does the following:

    +

    Julia achieves this with the following code. The comments below should help you understand what is going on.

    + +
    +      function julia_user(\$type, \$edit, &\$user) {
    +        // What type of registration action are we taking?
    +        switch (\$type) {
    +          case t(\"register_form\"):
    +            // Add two items to the resigtration form.
    +            \$output .= form_item(\"Privacy Policy\", \"Julia would never sell your user information. She is just a nice \".
    +                                  \"old French chef who lives near me in Cambridge, Massachussetts USA.\");
    +            \$output .= form_checkbox(\"Accept Julia's Kitchen privacy policy.\",
    +                                      julia_accept, 1, \$edit[\"julia_accept\"]);
    +            return \$output;
    +          case t(\"register_validate\"):
    +            // The user has filled out the form and checked the \"accept\" box.
    +            if (\$edit[\"julia_accept\"] == \"1\") {
    +              // on success return the values you want to store
    +              return array(\"julia_accept\" => 1);
    +            }
    +            else {
    +              // on error return an error message
    +              return \"You must accept the Julia's Kitchen privacy policy to register.\";
    +            }
    +          case t(\"view_public\"):
    +            // when others look at user data
    +            return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    +          case t(\"view_private\"):
    +            // when user tries to view his own user page.
    +            return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
    +          case t(\"edit_form\"):
    +            // when user tries to edit his own user page.
    +            return form_textfield(\"Favorite Ingredient\", \"julia_favingredient\",
    +                                  \$user->julia_favingredient, 50, 65,
    +                                  \"Tell everyone your secret spice\");
    +          case t(\"edit_validate\"): // Make sure the data they edited is \"valid\".
    +            return user_save(\$user, array(\"julia_favingredient\" => \$edit[\"julia_favingredient\"]));
    +        }
    +      }
    +    
    ", array("%user-role" => url("admin/user/role"), "%user-permission" => url("admin/user/permission"), "%jabber" => "http://www.jabber.org", "%delphiforums" => "http://www.delphiforums.com", "%drupal" => "http://www.drupal.org", "%da-auth" => url("user/help#da"), "%php-sess" => "http://www.php.net/manual/en/ref.session.php", "%user-prefs" => url("user/edit"), "%admin-user" => url("admin/user"), "%da-devel" => "http://www.drupal.org/node/view/316", "%xml" => "http://www.xmlrpc.org", "%http-post" => "http://www.w3.org/Protocols/", "%soap" => "http://www.soapware.org", "%dis-module" => url("admin/system/modules"), "%blogger" => "http://www.blogger.com", "%blogger-source" => "http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Bloggar/?cvsroot=contrib", "%contrib-cvs" => "http://cvs.drupal.org/viewcvs/contributions/?cvsroot=contrib", "%blogger-api" => "http://plant.blogger.com/API", "%cvs" => "http://cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&cvsroot=contrib&content-type=text/vnd.viewcvs-markup", "%drupal-lists" => "http://drupal.org/mailing-lists", "%drupal-org" => "http://www.drupal.org", "%registration" => url("user/register"), "%user-acct" => url("user"), "%user-admin" => url("admin/user"), "%profile-module" => "http://cvs.drupal.org/viewcvs/drupal/modules/profile.module")); foreach (module_list() as $module) { if (module_hook($module, "auth")) { @@ -1795,3 +1789,4 @@ function user_help_page() { } ?> + diff --git a/modules/watchdog.module b/modules/watchdog.module index ab51af984119b251a4d7b62fdf71b68da74b855f..0ba8a131af19000180d6731ccd38ce8984e814dc 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -6,9 +6,9 @@ function watchdog_help($section = "admin/help#watchdog") { switch ($section) { case 'admin/help#watchdog': - $output .= "

    Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.

    "; - $output .= "

    To ease administration, the watchdog will automatically discard old log entries, as configured. Needs \"cron.php\" to discard the entries.

    "; - $output = t($output, array("%watchdog" => url("admin/watchdog"), "%log-entry" => url("admin/system/modules/watchdog"))); + $output .= t(" +

    Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.

    +

    To ease administration, the watchdog will automatically discard old log entries, as configured. Needs \"cron.php\" to discard the entries.

    ", array("%watchdog" => url("admin/watchdog"), "%log-entry" => url("admin/system/modules/watchdog"))); break; case 'admin/watchdog': $output = t("The watchdog module monitors your web site, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on."); diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index ab51af984119b251a4d7b62fdf71b68da74b855f..0ba8a131af19000180d6731ccd38ce8984e814dc 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -6,9 +6,9 @@ function watchdog_help($section = "admin/help#watchdog") { switch ($section) { case 'admin/help#watchdog': - $output .= "

    Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.

    "; - $output .= "

    To ease administration, the watchdog will automatically discard old log entries, as configured. Needs \"cron.php\" to discard the entries.

    "; - $output = t($output, array("%watchdog" => url("admin/watchdog"), "%log-entry" => url("admin/system/modules/watchdog"))); + $output .= t(" +

    Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.

    +

    To ease administration, the watchdog will automatically discard old log entries, as configured. Needs \"cron.php\" to discard the entries.

    ", array("%watchdog" => url("admin/watchdog"), "%log-entry" => url("admin/system/modules/watchdog"))); break; case 'admin/watchdog': $output = t("The watchdog module monitors your web site, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.");