summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/aggregator.module98
-rw-r--r--modules/aggregator/aggregator.module98
-rw-r--r--modules/block.module3
-rw-r--r--modules/block/block.module3
-rw-r--r--modules/blog.module10
-rw-r--r--modules/blog/blog.module10
-rw-r--r--modules/book.module28
-rw-r--r--modules/book/book.module28
-rw-r--r--modules/comment.module124
-rw-r--r--modules/comment/comment.module124
-rw-r--r--modules/drupal.module3
-rw-r--r--modules/drupal/drupal.module3
-rw-r--r--modules/forum.module60
-rw-r--r--modules/forum/forum.module60
-rw-r--r--modules/help.module34
-rw-r--r--modules/help/help.module34
-rw-r--r--modules/node.module209
-rw-r--r--modules/node/node.module209
-rw-r--r--modules/page.module6
-rw-r--r--modules/page/page.module6
-rw-r--r--modules/path.module3
-rw-r--r--modules/path/path.module3
-rw-r--r--modules/ping.module14
-rw-r--r--modules/ping/ping.module14
-rw-r--r--modules/poll.module18
-rw-r--r--modules/poll/poll.module18
-rw-r--r--modules/search.module10
-rw-r--r--modules/search/search.module10
-rw-r--r--modules/statistics.module105
-rw-r--r--modules/statistics/statistics.module105
-rw-r--r--modules/story.module6
-rw-r--r--modules/story/story.module6
-rw-r--r--modules/system.module28
-rw-r--r--modules/system/system.module28
-rw-r--r--modules/taxonomy.module71
-rw-r--r--modules/taxonomy/taxonomy.module71
-rw-r--r--modules/throttle.module47
-rw-r--r--modules/throttle/throttle.module47
-rw-r--r--modules/user.module295
-rw-r--r--modules/user/user.module295
-rw-r--r--modules/watchdog.module6
-rw-r--r--modules/watchdog/watchdog.module6
42 files changed, 1236 insertions, 1120 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 818f9816d..4c66501a3 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -4,55 +4,55 @@
function aggregator_help($section) {
switch ($section) {
case 'admin/help#aggregator':
- $output = "<p>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 <a href=\"%amphetadesk\">Amphetadesk</a>.</p>";
- $output .= "<p>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.</p>";
- $output .= "<h3>What do I need to subscribe to a feed?</h3>";
- $output .= "<p>The standard method of syndication is using the XML-based <a href=\"%rss\">Rich Site Summary</a> (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: <a href=\"%slashdot-rss\">Slashdot RSS</a>.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>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 <a href=\"%syndic8\">Syndic8</a>.</p>";
- $output .= "<p>To learn much more about RSS, read Mark Pilgrim's <a href=\"%rss-what\">What is RSS</a> and WebReference.com's <a href=\"%rss-evolution\">The Evolution of RSS</a>.</p>";
- $output .= "<p>NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.</p>";
- $output .= "<h3>Configuring news feeds</h3>";
- $output .= "<p>To subscribe to an RSS feed on another site, use the <a href=\"%admin-news\">RSS/RDF</a> shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.</p>";
- $output .= "<p>Once there, select <a href=\"%new-feed\">new feed</a> from the left hand menu. Drupal will then ask for the following:</p>";
- $output .= "<ul>";
- $output .= "<li><strong>Title</strong> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>";
- $output .= " <li><strong>URL</strong> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>";
- $output .= "<li><strong>Attributes</strong> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>";
- $output .= "<li><strong>Update interval</strong> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using <a href=\"%update-items\">update items</a>.</li>";
- $output .= "</ul>";
- $output .= "<p>Once you submit your new feed, check to see if it is working properly. Select <a href=\"%update-items\">update items</a> on the <a href=\"%admin-news\">RSS/RDF</a> page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.</p>";
- $output .= "<h3>Adding bundles</h3>";
- $output .= "<p>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.</p>";
- $output .= "<p>When adding a bundle, Drupal will ask for:</p>";
- $output .= "<ul>";
- $output .= " <li><strong>Title</strong> -- The title will be used in the <i>news by topics</i> listing in your news aggregator and with the customized block created for the bundle.</li>";
- $output .= " <li><strong>Attributes</strong> -- Enter one or more of the attributes used to categorize the news feeds already created. Separate multiple attributes with commas. Be careful to use the same spelling. Don't have any feeds with attributes for the bundle? After creating the bundle, edit existing feeds or create new ones and tag them with the attribute.</li>";
- $output .= "</ul>";
- $output .= "<h3>Using the news aggregator</h3>";
- $output .= "<p>The news aggregator has a number of ways that it displays your subscribed content:</p>";
- $output .= "<ul>";
- $output .= " <li><strong>Latest news</strong> -- Displays all incoming content in the order received with:";
- $output .= " <ul>";
- $output .= " <li>The title of the original post.</li>";
- $output .= " <li>The name of the source, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>";
- $output .= " <li>A description, the first few paragraphs or summary of the originating post (if any).</li>";
- $output .= " <li>A <i>blog it</i> link. Users can select this link to have Drupal automatically prepare a blog post for the specific item.</li>";
- $output .= " <li>A <i>feed</i> link, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>";
- $output .= " </ul>";
- $output .= " </li>";
- $output .= " <li><strong>News by source</strong> -- Organizes incoming content by feed, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>";
- $output .= " <li><strong>News by topic</strong> -- Organizes incoming content by bundles, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>";
- $output .= " <li><strong>News sources</strong> -- Displays an alphabetical listing of all subscribed feeds and a description. The title acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>";
- $output .= "</ul>";
- $output .= "<h3>RSS feed blocks</h3>";
- $output .= "<p>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.</p>";
- $output .= "<h3>Subscription list</h3>";
- $output .= "<p>Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.</p>";
- $output .= "<h3>Technical details</h3>";
- $output .= "<p>When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.</p>";
- $output .= "<p>If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.</p>";
- return t($output, array("%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>", "%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>", "%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rdf</a>", "%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>", "%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>", "%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("
+ <p>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 <a href=\"%amphetadesk\">Amphetadesk</a>.</p>
+ <p>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.</p>
+ <h3>What do I need to subscribe to a feed?</h3>
+ <p>The standard method of syndication is using the XML-based <a href=\"%rss\">Rich Site Summary</a> (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: <a href=\"%slashdot-rss\">Slashdot RSS</a>.</p>
+ <p>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.</p>
+ <p>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 <a href=\"%syndic8\">Syndic8</a>.</p>
+ <p>To learn much more about RSS, read Mark Pilgrim's <a href=\"%rss-what\">What is RSS</a> and WebReference.com's <a href=\"%rss-evolution\">The Evolution of RSS</a>.</p>
+ <p>NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.</p>
+ <h3>Configuring news feeds</h3>
+ <p>To subscribe to an RSS feed on another site, use the <a href=\"%admin-news\">RSS/RDF</a> shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.</p>
+ <p>Once there, select <a href=\"%new-feed\">new feed</a> from the left hand menu. Drupal will then ask for the following:</p>
+ <ul>
+ <li><strong>Title</strong> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>
+ <li><strong>URL</strong> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>
+ <li><strong>Attributes</strong> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>
+ <li><strong>Update interval</strong> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using <a href=\"%update-items\">update items</a>.</li>
+ </ul>
+ <p>Once you submit your new feed, check to see if it is working properly. Select <a href=\"%update-items\">update items</a> on the <a href=\"%admin-news\">RSS/RDF</a> page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.</p>
+ <h3>Adding bundles</h3>
+ <p>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.</p>
+ <p>When adding a bundle, Drupal will ask for:</p>
+ <ul>
+ <li><strong>Title</strong> -- The title will be used in the <i>news by topics</i> listing in your news aggregator and with the customized block created for the bundle.</li>
+ <li><strong>Attributes</strong> -- Enter one or more of the attributes used to categorize the news feeds already created. Separate multiple attributes with commas. Be careful to use the same spelling. Don't have any feeds with attributes for the bundle? After creating the bundle, edit existing feeds or create new ones and tag them with the attribute.</li>
+ </ul>
+ <h3>Using the news aggregator</h3>
+ <p>The news aggregator has a number of ways that it displays your subscribed content:</p>
+ <ul>
+ <li><strong>Latest news</strong> -- Displays all incoming content in the order received with:
+ <ul>
+ <li>The title of the original post.</li>
+ <li>The name of the source, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>
+ <li>A description, the first few paragraphs or summary of the originating post (if any).</li>
+ <li>A <i>blog it</i> link. Users can select this link to have Drupal automatically prepare a blog post for the specific item.</li>
+ <li>A <i>feed</i> link, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>
+ </ul>
+ </li>
+ <li><strong>News by source</strong> -- Organizes incoming content by feed, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>
+ <li><strong>News by topic</strong> -- Organizes incoming content by bundles, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>
+ <li><strong>News sources</strong> -- Displays an alphabetical listing of all subscribed feeds and a description. The title acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>
+ </ul>
+ <h3>RSS feed blocks</h3>
+ <p>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.</p>
+ <h3>Subscription list</h3>
+ <p>Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.</p>
+ <h3>Technical details</h3>
+ <p>When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.</p>
+ <p>If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.</p>", array("%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>", "%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>", "%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rdf</a>", "%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>", "%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>", "%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 818f9816d..4c66501a3 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 = "<p>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 <a href=\"%amphetadesk\">Amphetadesk</a>.</p>";
- $output .= "<p>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.</p>";
- $output .= "<h3>What do I need to subscribe to a feed?</h3>";
- $output .= "<p>The standard method of syndication is using the XML-based <a href=\"%rss\">Rich Site Summary</a> (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: <a href=\"%slashdot-rss\">Slashdot RSS</a>.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>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 <a href=\"%syndic8\">Syndic8</a>.</p>";
- $output .= "<p>To learn much more about RSS, read Mark Pilgrim's <a href=\"%rss-what\">What is RSS</a> and WebReference.com's <a href=\"%rss-evolution\">The Evolution of RSS</a>.</p>";
- $output .= "<p>NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.</p>";
- $output .= "<h3>Configuring news feeds</h3>";
- $output .= "<p>To subscribe to an RSS feed on another site, use the <a href=\"%admin-news\">RSS/RDF</a> shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.</p>";
- $output .= "<p>Once there, select <a href=\"%new-feed\">new feed</a> from the left hand menu. Drupal will then ask for the following:</p>";
- $output .= "<ul>";
- $output .= "<li><strong>Title</strong> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>";
- $output .= " <li><strong>URL</strong> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>";
- $output .= "<li><strong>Attributes</strong> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>";
- $output .= "<li><strong>Update interval</strong> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using <a href=\"%update-items\">update items</a>.</li>";
- $output .= "</ul>";
- $output .= "<p>Once you submit your new feed, check to see if it is working properly. Select <a href=\"%update-items\">update items</a> on the <a href=\"%admin-news\">RSS/RDF</a> page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.</p>";
- $output .= "<h3>Adding bundles</h3>";
- $output .= "<p>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.</p>";
- $output .= "<p>When adding a bundle, Drupal will ask for:</p>";
- $output .= "<ul>";
- $output .= " <li><strong>Title</strong> -- The title will be used in the <i>news by topics</i> listing in your news aggregator and with the customized block created for the bundle.</li>";
- $output .= " <li><strong>Attributes</strong> -- Enter one or more of the attributes used to categorize the news feeds already created. Separate multiple attributes with commas. Be careful to use the same spelling. Don't have any feeds with attributes for the bundle? After creating the bundle, edit existing feeds or create new ones and tag them with the attribute.</li>";
- $output .= "</ul>";
- $output .= "<h3>Using the news aggregator</h3>";
- $output .= "<p>The news aggregator has a number of ways that it displays your subscribed content:</p>";
- $output .= "<ul>";
- $output .= " <li><strong>Latest news</strong> -- Displays all incoming content in the order received with:";
- $output .= " <ul>";
- $output .= " <li>The title of the original post.</li>";
- $output .= " <li>The name of the source, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>";
- $output .= " <li>A description, the first few paragraphs or summary of the originating post (if any).</li>";
- $output .= " <li>A <i>blog it</i> link. Users can select this link to have Drupal automatically prepare a blog post for the specific item.</li>";
- $output .= " <li>A <i>feed</i> link, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>";
- $output .= " </ul>";
- $output .= " </li>";
- $output .= " <li><strong>News by source</strong> -- Organizes incoming content by feed, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>";
- $output .= " <li><strong>News by topic</strong> -- Organizes incoming content by bundles, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>";
- $output .= " <li><strong>News sources</strong> -- Displays an alphabetical listing of all subscribed feeds and a description. The title acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>";
- $output .= "</ul>";
- $output .= "<h3>RSS feed blocks</h3>";
- $output .= "<p>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.</p>";
- $output .= "<h3>Subscription list</h3>";
- $output .= "<p>Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.</p>";
- $output .= "<h3>Technical details</h3>";
- $output .= "<p>When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.</p>";
- $output .= "<p>If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.</p>";
- return t($output, array("%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>", "%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>", "%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rdf</a>", "%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>", "%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>", "%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("
+ <p>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 <a href=\"%amphetadesk\">Amphetadesk</a>.</p>
+ <p>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.</p>
+ <h3>What do I need to subscribe to a feed?</h3>
+ <p>The standard method of syndication is using the XML-based <a href=\"%rss\">Rich Site Summary</a> (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: <a href=\"%slashdot-rss\">Slashdot RSS</a>.</p>
+ <p>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.</p>
+ <p>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 <a href=\"%syndic8\">Syndic8</a>.</p>
+ <p>To learn much more about RSS, read Mark Pilgrim's <a href=\"%rss-what\">What is RSS</a> and WebReference.com's <a href=\"%rss-evolution\">The Evolution of RSS</a>.</p>
+ <p>NOTE: Enable your site's XML syndication button by turning on the Syndicate block in block management.</p>
+ <h3>Configuring news feeds</h3>
+ <p>To subscribe to an RSS feed on another site, use the <a href=\"%admin-news\">RSS/RDF</a> shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.</p>
+ <p>Once there, select <a href=\"%new-feed\">new feed</a> from the left hand menu. Drupal will then ask for the following:</p>
+ <ul>
+ <li><strong>Title</strong> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>
+ <li><strong>URL</strong> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>
+ <li><strong>Attributes</strong> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>
+ <li><strong>Update interval</strong> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using <a href=\"%update-items\">update items</a>.</li>
+ </ul>
+ <p>Once you submit your new feed, check to see if it is working properly. Select <a href=\"%update-items\">update items</a> on the <a href=\"%admin-news\">RSS/RDF</a> page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.</p>
+ <h3>Adding bundles</h3>
+ <p>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.</p>
+ <p>When adding a bundle, Drupal will ask for:</p>
+ <ul>
+ <li><strong>Title</strong> -- The title will be used in the <i>news by topics</i> listing in your news aggregator and with the customized block created for the bundle.</li>
+ <li><strong>Attributes</strong> -- Enter one or more of the attributes used to categorize the news feeds already created. Separate multiple attributes with commas. Be careful to use the same spelling. Don't have any feeds with attributes for the bundle? After creating the bundle, edit existing feeds or create new ones and tag them with the attribute.</li>
+ </ul>
+ <h3>Using the news aggregator</h3>
+ <p>The news aggregator has a number of ways that it displays your subscribed content:</p>
+ <ul>
+ <li><strong>Latest news</strong> -- Displays all incoming content in the order received with:
+ <ul>
+ <li>The title of the original post.</li>
+ <li>The name of the source, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>
+ <li>A description, the first few paragraphs or summary of the originating post (if any).</li>
+ <li>A <i>blog it</i> link. Users can select this link to have Drupal automatically prepare a blog post for the specific item.</li>
+ <li>A <i>feed</i> link, which acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>
+ </ul>
+ </li>
+ <li><strong>News by source</strong> -- Organizes incoming content by feed, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>
+ <li><strong>News by topic</strong> -- Organizes incoming content by bundles, displaying titles which link to the originating post. Also has an icon which acts as blog it link.</li>
+ <li><strong>News sources</strong> -- Displays an alphabetical listing of all subscribed feeds and a description. The title acts as a link to an individual feed page, listing information about that feed and incoming content for that feed only.</li>
+ </ul>
+ <h3>RSS feed blocks</h3>
+ <p>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.</p>
+ <h3>Subscription list</h3>
+ <p>Drupal automatically generates an OPML feed file that is available by selecting the XML icon on the News Sources page.</p>
+ <h3>Technical details</h3>
+ <p>When fetching feeds Drupal supports conditional GETs, this reduces the bandwidth usage for feeds that have not been updated since the last check.</p>
+ <p>If a feed is permanently moved to a new location Drupal will automatically update the feed URL to the new address.</p>", array("%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>", "%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>", "%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rdf</a>", "%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>", "%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>", "%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 b5172058a..4b2738e07 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("<p>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.</p>
+ $output = t("
+<p>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.</p>
<p>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.</p><p>Whether a block is visible in the first place depends on four things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li><li>If the block has its throttle box checked, the user will only see the block if the site throttle level is low.</li></ul>
<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <strong>weight</strong> 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.</p>
<p>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!</p>
diff --git a/modules/block/block.module b/modules/block/block.module
index b5172058a..4b2738e07 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("<p>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.</p>
+ $output = t("
+<p>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.</p>
<p>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.</p><p>Whether a block is visible in the first place depends on four things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li><li>If the block has its throttle box checked, the user will only see the block if the site throttle level is low.</li></ul>
<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <strong>weight</strong> 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.</p>
<p>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!</p>
diff --git a/modules/blog.module b/modules/blog.module
index f06b2117e..3d4dfd04e 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -70,11 +70,11 @@ function blog_help($section) {
switch ($section) {
case 'admin/help#blog':
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <strong>(b)</strong> 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.</p>";
- $output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>"));
+ $output .= t("
+ <p>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.</p>
+ <p>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.</p>
+ <p>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.</p>
+ <p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <strong>(b)</strong> 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.</p>", array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>"));
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 f06b2117e..3d4dfd04e 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 .= "<p>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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <strong>(b)</strong> 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.</p>";
- $output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>"));
+ $output .= t("
+ <p>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.</p>
+ <p>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.</p>
+ <p>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.</p>
+ <p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <strong>(b)</strong> 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.</p>", array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>"));
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 56ba8e6d6..e9b239904 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 .= "<h1 id=\"$node->nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title</h1>";
@@ -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 .= "<h1 id=\"$node->nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title</h1>";
@@ -880,17 +880,17 @@ function book_help($section = "admin/help#book") {
switch ($section) {
case 'admin/help#book':
- $output .= "<p>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.</p>";
- $output .= "<p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>";
- $output .= "<p>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 <i>log message</i> 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.</p>";
- $output .= "<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <a href=\"%permissions\">permissions</a> 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 <i>&lt;root&gt;</i>. 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 <i>edit book outline</i> 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 <a href=\"%create\">submit content &raquo; book page</a> link.</p>";
- $output .= "<p>Administrators may review the hierarchy of their books by clicking on the <a href=\"%collaborative-book\">collaborative book</a> 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 <i>orphans</i>. Administrators should periodically <a href=\"%orphans-book\">review their books for orphans</a> and reaffiliate those pages as desired. Finally, administrators may also <a href=\"%export-book\">export their books</a> to a single, flat HTML page which is suitable for printing.</p>";
- $output .= "<h3>Maintaining a FAQ using a collaborative book</h3>";
- $output .= "<p>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!</p>";
- $output .= "<p>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 <a href=\"%create\">submit content &raquo; book page</a> 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 <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> 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.</p>";
- $output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.</p>";
- $output .= "<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <a href=\"%create\">submit content &raquo; book page</a> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient <a href=\"%permissions\">permissions</a>.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>";
- $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("
+ <p>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.</p>
+ <p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>
+ <p>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 <i>log message</i> 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.</p>
+ <p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <a href=\"%permissions\">permissions</a> 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 <i>&lt;root&gt;</i>. 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 <i>edit book outline</i> 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 <a href=\"%create\">submit content &raquo; book page</a> link.</p>
+ <p>Administrators may review the hierarchy of their books by clicking on the <a href=\"%collaborative-book\">collaborative book</a> 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 <i>orphans</i>. Administrators should periodically <a href=\"%orphans-book\">review their books for orphans</a> and reaffiliate those pages as desired. Finally, administrators may also <a href=\"%export-book\">export their books</a> to a single, flat HTML page which is suitable for printing.</p>
+ <h3>Maintaining a FAQ using a collaborative book</h3>
+ <p>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!</p>
+ <p>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 <a href=\"%create\">submit content &raquo; book page</a> 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 <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> 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.</p>
+ <p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.</p>
+ <p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <a href=\"%create\">submit content &raquo; book page</a> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient <a href=\"%permissions\">permissions</a>.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>", 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 56ba8e6d6..e9b239904 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 .= "<h1 id=\"$node->nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title</h1>";
@@ -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 .= "<h1 id=\"$node->nid\" name=\"$node->nid\" class=\"book-h$depth\">$node->title</h1>";
@@ -880,17 +880,17 @@ function book_help($section = "admin/help#book") {
switch ($section) {
case 'admin/help#book':
- $output .= "<p>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.</p>";
- $output .= "<p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>";
- $output .= "<p>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 <i>log message</i> 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.</p>";
- $output .= "<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <a href=\"%permissions\">permissions</a> 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 <i>&lt;root&gt;</i>. 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 <i>edit book outline</i> 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 <a href=\"%create\">submit content &raquo; book page</a> link.</p>";
- $output .= "<p>Administrators may review the hierarchy of their books by clicking on the <a href=\"%collaborative-book\">collaborative book</a> 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 <i>orphans</i>. Administrators should periodically <a href=\"%orphans-book\">review their books for orphans</a> and reaffiliate those pages as desired. Finally, administrators may also <a href=\"%export-book\">export their books</a> to a single, flat HTML page which is suitable for printing.</p>";
- $output .= "<h3>Maintaining a FAQ using a collaborative book</h3>";
- $output .= "<p>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!</p>";
- $output .= "<p>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 <a href=\"%create\">submit content &raquo; book page</a> 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 <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> 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.</p>";
- $output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.</p>";
- $output .= "<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <a href=\"%create\">submit content &raquo; book page</a> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient <a href=\"%permissions\">permissions</a>.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>";
- $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("
+ <p>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.</p>
+ <p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>
+ <p>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 <i>log message</i> 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.</p>
+ <p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <a href=\"%permissions\">permissions</a> 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 <i>&lt;root&gt;</i>. 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 <i>edit book outline</i> 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 <a href=\"%create\">submit content &raquo; book page</a> link.</p>
+ <p>Administrators may review the hierarchy of their books by clicking on the <a href=\"%collaborative-book\">collaborative book</a> 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 <i>orphans</i>. Administrators should periodically <a href=\"%orphans-book\">review their books for orphans</a> and reaffiliate those pages as desired. Finally, administrators may also <a href=\"%export-book\">export their books</a> to a single, flat HTML page which is suitable for printing.</p>
+ <h3>Maintaining a FAQ using a collaborative book</h3>
+ <p>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!</p>
+ <p>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 <a href=\"%create\">submit content &raquo; book page</a> 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 <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> 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.</p>
+ <p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.</p>
+ <p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <a href=\"%create\">submit content &raquo; book page</a> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient <a href=\"%permissions\">permissions</a>.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>", 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 9150a9806..7bd5b5240 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 .= "<p>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.</p>";
- $output .= "<h3>User control of comment display</h3>";
- $output .= "<p>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:</p>";
- $output .= "<ul>";
- $output .= "<li><strong>Threaded</strong> -- Displays the posts grouped according to conversations and subconversations, much like the subject view of an email client.</li>";
- $output .= "<li><strong>Flat</strong> -- Displays the posts in chronological order, in the order in which they are posted.</li>";
- $output .= "<li><strong>Expanded</strong> -- Displays the title and text for each post.</li>";
- $output .= "<li><strong>Collapsed</strong> -- Displays only the title for each post.</li>";
- $output .= "</ul>";
- $output .= "<p>When a user chooses <i>save settings</i>, 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 <a href=\"%comment-config\">administer &raquo; configuration &raquo; modules &raquo; comment</a>.</p>";
- $output .= "<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>";
-
- $output .= "<h3>Additional comment configurations</h3>";
- $output .= "<p>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 <a href=\"%site-config\">administer &raquo; configuration</a> under <i>Submission settings</i>.</p>";
- $output .= "<p>Administrators can control access to various comment module functions through <a href=\"%user-permissions\">administer &raquo; accounts &raquo; permissions</a>. 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.</p>";
- $output .= "<p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>";
- $output .= "<ul>";
- $output .= "<li><strong>Access comments</strong> -- Allows users to view comments.</li>";
- $output .= "<li><strong>Administrate comments</strong> -- Allows users complete control over configuring, editing and deleting all comments on the site. Best reserved for <strong>very</strong> trusted users.</li>";
- $output .= "<li><strong>Moderate comments</strong> -- Allows users to rate comment postings (see more on moderation below).</li>";
- $output .= "<li><strong>Post comments</strong> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site.</li>";
- $output .= "<li><strong>Post comments without approval</strong> -- Allows users to directly post comments. This bypasses the administrator moderation queue.</li>";
- $output .= "</ul>";
-
- $output .= "<h3>Notification of new comments</h3>";
- $output .= "<p>Drupal provides specific features to inform site members when new comments have been posted:</p>";
- $output .= "<ul>";
- $output .= "<li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>";
- $output .= "<li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. There is a link to the <a href=\"%tracker\">recent posts</a> page in the navigation block. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>";
- $output .= "<li>Some administrators may want to <a href=\"%download-notify\">download</a>, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>";
- $output .= "</ul>";
-
- $output .= "<h3>Comment moderation</h3>";
- $output .= "<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>";
- $output .= "<p>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.</p>";
- $output .= "<p>To enable moderation, the administrator must grant <a href=\"%permission\">moderate comments</a> permissions. Then, a number of options in <a href=\"%comment-moderation\">administer &raquo; comments &raquo; moderation</a> must be configured.</p>";
-
- $output .= "<h4>Moderation votes</h4>";
- $output .= "<p>The first step is to create moderation labels which allow users to rate a comment. Go to <a href=\"%comment-votes\">administer &raquo; comments &raquo; moderation &raquo; votes</a>. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>";
- $output .= "<ul>";
- $output .= "<li>Excellent +3</li>";
- $output .= "<li>Insightful +2</li>";
- $output .= "<li>Caught My Attention +1</li>";
- $output .= "<li>Useful +1</li>";
- $output .= "<li>Redundant -1</li>";
- $output .= "<li>Flame -3</li>";
- $output .= "</ul>";
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
-
- $output .= "<h4>Moderator vote/values matrix</h4>";
-
- $output .= "<p>Next go to <a href=\"%comment-matrix\">administer &raquo; comments &raquo; moderation &raquo; matrix</a>. 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.</p>";
- $output .= "<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>";
- $output .= "<h4>Creating comment thresholds</h4>";
- $output .= "<p>In <a href=\"%comment-thresholds\">administer &raquo; comments &raquo; moderation &raquo; thresholds</a>, 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.</p>";
- $output .= "<p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>";
- $output .= "<p>To see a common example of how thresholds work, you might visit <a href=\"%slashdot\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>";
-
- $output .= "<h4>Initial comment scores</h4>";
- $output .= "<p>Finally, you may want to enter some <i>initial comment scores</i>. In <a href=\"%comment-initial\">administer &raquo; comments &raquo; initial comment scores</a> 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 <strong>0</strong> as the default.</p>";
- $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("
+ <p>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.</p>
+ <h3>User control of comment display</h3>
+ <p>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:</p>
+ <ul>
+ <li><strong>Threaded</strong> -- Displays the posts grouped according to conversations and subconversations, much like the subject view of an email client.</li>
+ <li><strong>Flat</strong> -- Displays the posts in chronological order, in the order in which they are posted.</li>
+ <li><strong>Expanded</strong> -- Displays the title and text for each post.</li>
+ <li><strong>Collapsed</strong> -- Displays only the title for each post.</li>
+ </ul>
+ <p>When a user chooses <i>save settings</i>, 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 <a href=\"%comment-config\">administer &raquo; configuration &raquo; modules &raquo; comment</a>.</p>
+ <p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>
+
+ <h3>Additional comment configurations</h3>
+ <p>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 <a href=\"%site-config\">administer &raquo; configuration</a> under <i>Submission settings</i>.</p>
+ <p>Administrators can control access to various comment module functions through <a href=\"%user-permissions\">administer &raquo; accounts &raquo; permissions</a>. 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.</p>
+ <p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>
+ <ul>
+ <li><strong>Access comments</strong> -- Allows users to view comments.</li>
+ <li><strong>Administrate comments</strong> -- Allows users complete control over configuring, editing and deleting all comments on the site. Best reserved for <strong>very</strong> trusted users.</li>
+ <li><strong>Moderate comments</strong> -- Allows users to rate comment postings (see more on moderation below).</li>
+ <li><strong>Post comments</strong> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site.</li>
+ <li><strong>Post comments without approval</strong> -- Allows users to directly post comments. This bypasses the administrator moderation queue.</li>
+ </ul>
+
+ <h3>Notification of new comments</h3>
+ <p>Drupal provides specific features to inform site members when new comments have been posted:</p>
+ <ul>
+ <li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>
+ <li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. There is a link to the <a href=\"%tracker\">recent posts</a> page in the navigation block. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>
+ <li>Some administrators may want to <a href=\"%download-notify\">download</a>, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>
+ </ul>
+
+ <h3>Comment moderation</h3>
+ <p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>
+ <p>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.</p>
+ <p>To enable moderation, the administrator must grant <a href=\"%permission\">moderate comments</a> permissions. Then, a number of options in <a href=\"%comment-moderation\">administer &raquo; comments &raquo; moderation</a> must be configured.</p>
+
+ <h4>Moderation votes</h4>
+ <p>The first step is to create moderation labels which allow users to rate a comment. Go to <a href=\"%comment-votes\">administer &raquo; comments &raquo; moderation &raquo; votes</a>. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>
+ <ul>
+ <li>Excellent +3</li>
+ <li>Insightful +2</li>
+ <li>Caught My Attention +1</li>
+ <li>Useful +1</li>
+ <li>Redundant -1</li>
+ <li>Flame -3</li>
+ </ul>
+ <p>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.</p>
+ <p>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.</p>
+
+ <h4>Moderator vote/values matrix</h4>
+
+ <p>Next go to <a href=\"%comment-matrix\">administer &raquo; comments &raquo; moderation &raquo; matrix</a>. 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.</p>
+ <p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>
+ <h4>Creating comment thresholds</h4>
+ <p>In <a href=\"%comment-thresholds\">administer &raquo; comments &raquo; moderation &raquo; thresholds</a>, 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.</p>
+ <p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>
+ <p>To see a common example of how thresholds work, you might visit <a href=\"%slashdot\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>
+
+ <h4>Initial comment scores</h4>
+ <p>Finally, you may want to enter some <i>initial comment scores</i>. In <a href=\"%comment-initial\">administer &raquo; comments &raquo; initial comment scores</a> 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 <strong>0</strong> as the default.</p>", 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 9150a9806..7bd5b5240 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 .= "<p>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.</p>";
- $output .= "<h3>User control of comment display</h3>";
- $output .= "<p>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:</p>";
- $output .= "<ul>";
- $output .= "<li><strong>Threaded</strong> -- Displays the posts grouped according to conversations and subconversations, much like the subject view of an email client.</li>";
- $output .= "<li><strong>Flat</strong> -- Displays the posts in chronological order, in the order in which they are posted.</li>";
- $output .= "<li><strong>Expanded</strong> -- Displays the title and text for each post.</li>";
- $output .= "<li><strong>Collapsed</strong> -- Displays only the title for each post.</li>";
- $output .= "</ul>";
- $output .= "<p>When a user chooses <i>save settings</i>, 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 <a href=\"%comment-config\">administer &raquo; configuration &raquo; modules &raquo; comment</a>.</p>";
- $output .= "<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>";
-
- $output .= "<h3>Additional comment configurations</h3>";
- $output .= "<p>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 <a href=\"%site-config\">administer &raquo; configuration</a> under <i>Submission settings</i>.</p>";
- $output .= "<p>Administrators can control access to various comment module functions through <a href=\"%user-permissions\">administer &raquo; accounts &raquo; permissions</a>. 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.</p>";
- $output .= "<p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>";
- $output .= "<ul>";
- $output .= "<li><strong>Access comments</strong> -- Allows users to view comments.</li>";
- $output .= "<li><strong>Administrate comments</strong> -- Allows users complete control over configuring, editing and deleting all comments on the site. Best reserved for <strong>very</strong> trusted users.</li>";
- $output .= "<li><strong>Moderate comments</strong> -- Allows users to rate comment postings (see more on moderation below).</li>";
- $output .= "<li><strong>Post comments</strong> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site.</li>";
- $output .= "<li><strong>Post comments without approval</strong> -- Allows users to directly post comments. This bypasses the administrator moderation queue.</li>";
- $output .= "</ul>";
-
- $output .= "<h3>Notification of new comments</h3>";
- $output .= "<p>Drupal provides specific features to inform site members when new comments have been posted:</p>";
- $output .= "<ul>";
- $output .= "<li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>";
- $output .= "<li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. There is a link to the <a href=\"%tracker\">recent posts</a> page in the navigation block. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>";
- $output .= "<li>Some administrators may want to <a href=\"%download-notify\">download</a>, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>";
- $output .= "</ul>";
-
- $output .= "<h3>Comment moderation</h3>";
- $output .= "<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>";
- $output .= "<p>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.</p>";
- $output .= "<p>To enable moderation, the administrator must grant <a href=\"%permission\">moderate comments</a> permissions. Then, a number of options in <a href=\"%comment-moderation\">administer &raquo; comments &raquo; moderation</a> must be configured.</p>";
-
- $output .= "<h4>Moderation votes</h4>";
- $output .= "<p>The first step is to create moderation labels which allow users to rate a comment. Go to <a href=\"%comment-votes\">administer &raquo; comments &raquo; moderation &raquo; votes</a>. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>";
- $output .= "<ul>";
- $output .= "<li>Excellent +3</li>";
- $output .= "<li>Insightful +2</li>";
- $output .= "<li>Caught My Attention +1</li>";
- $output .= "<li>Useful +1</li>";
- $output .= "<li>Redundant -1</li>";
- $output .= "<li>Flame -3</li>";
- $output .= "</ul>";
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
-
- $output .= "<h4>Moderator vote/values matrix</h4>";
-
- $output .= "<p>Next go to <a href=\"%comment-matrix\">administer &raquo; comments &raquo; moderation &raquo; matrix</a>. 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.</p>";
- $output .= "<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>";
- $output .= "<h4>Creating comment thresholds</h4>";
- $output .= "<p>In <a href=\"%comment-thresholds\">administer &raquo; comments &raquo; moderation &raquo; thresholds</a>, 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.</p>";
- $output .= "<p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>";
- $output .= "<p>To see a common example of how thresholds work, you might visit <a href=\"%slashdot\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>";
-
- $output .= "<h4>Initial comment scores</h4>";
- $output .= "<p>Finally, you may want to enter some <i>initial comment scores</i>. In <a href=\"%comment-initial\">administer &raquo; comments &raquo; initial comment scores</a> 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 <strong>0</strong> as the default.</p>";
- $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("
+ <p>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.</p>
+ <h3>User control of comment display</h3>
+ <p>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:</p>
+ <ul>
+ <li><strong>Threaded</strong> -- Displays the posts grouped according to conversations and subconversations, much like the subject view of an email client.</li>
+ <li><strong>Flat</strong> -- Displays the posts in chronological order, in the order in which they are posted.</li>
+ <li><strong>Expanded</strong> -- Displays the title and text for each post.</li>
+ <li><strong>Collapsed</strong> -- Displays only the title for each post.</li>
+ </ul>
+ <p>When a user chooses <i>save settings</i>, 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 <a href=\"%comment-config\">administer &raquo; configuration &raquo; modules &raquo; comment</a>.</p>
+ <p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>
+
+ <h3>Additional comment configurations</h3>
+ <p>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 <a href=\"%site-config\">administer &raquo; configuration</a> under <i>Submission settings</i>.</p>
+ <p>Administrators can control access to various comment module functions through <a href=\"%user-permissions\">administer &raquo; accounts &raquo; permissions</a>. 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.</p>
+ <p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>
+ <ul>
+ <li><strong>Access comments</strong> -- Allows users to view comments.</li>
+ <li><strong>Administrate comments</strong> -- Allows users complete control over configuring, editing and deleting all comments on the site. Best reserved for <strong>very</strong> trusted users.</li>
+ <li><strong>Moderate comments</strong> -- Allows users to rate comment postings (see more on moderation below).</li>
+ <li><strong>Post comments</strong> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site.</li>
+ <li><strong>Post comments without approval</strong> -- Allows users to directly post comments. This bypasses the administrator moderation queue.</li>
+ </ul>
+
+ <h3>Notification of new comments</h3>
+ <p>Drupal provides specific features to inform site members when new comments have been posted:</p>
+ <ul>
+ <li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>
+ <li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. There is a link to the <a href=\"%tracker\">recent posts</a> page in the navigation block. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>
+ <li>Some administrators may want to <a href=\"%download-notify\">download</a>, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>
+ </ul>
+
+ <h3>Comment moderation</h3>
+ <p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>
+ <p>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.</p>
+ <p>To enable moderation, the administrator must grant <a href=\"%permission\">moderate comments</a> permissions. Then, a number of options in <a href=\"%comment-moderation\">administer &raquo; comments &raquo; moderation</a> must be configured.</p>
+
+ <h4>Moderation votes</h4>
+ <p>The first step is to create moderation labels which allow users to rate a comment. Go to <a href=\"%comment-votes\">administer &raquo; comments &raquo; moderation &raquo; votes</a>. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>
+ <ul>
+ <li>Excellent +3</li>
+ <li>Insightful +2</li>
+ <li>Caught My Attention +1</li>
+ <li>Useful +1</li>
+ <li>Redundant -1</li>
+ <li>Flame -3</li>
+ </ul>
+ <p>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.</p>
+ <p>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.</p>
+
+ <h4>Moderator vote/values matrix</h4>
+
+ <p>Next go to <a href=\"%comment-matrix\">administer &raquo; comments &raquo; moderation &raquo; matrix</a>. 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.</p>
+ <p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>
+ <h4>Creating comment thresholds</h4>
+ <p>In <a href=\"%comment-thresholds\">administer &raquo; comments &raquo; moderation &raquo; thresholds</a>, 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.</p>
+ <p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>
+ <p>To see a common example of how thresholds work, you might visit <a href=\"%slashdot\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>
+
+ <h4>Initial comment scores</h4>
+ <p>Finally, you may want to enter some <i>initial comment scores</i>. In <a href=\"%comment-initial\">administer &raquo; comments &raquo; initial comment scores</a> 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 <strong>0</strong> as the default.</p>", 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 7975c412e..837ec123f 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("<p>The \"Drupal\" module features a capability whereby other drupal sites may <em>call home</em> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
+ return t("
+<p>The \"Drupal\" module features a capability whereby other drupal sites may <em>call home</em> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
<p>Currently, the main application of this feature is the <a href=\"%drupal-sites\">Drupal sites</a> page. By default, fresh Drupal installations can use <a href=\"%Drupal\">drupal.org</a> as their <em>directory server</em> and report their existence. This reporting occurs via scheduled <a href=\"%xml-rpc\">XML-RPC</a> pings.</p>
<p>Drupal administrators should simply enable this feature to get listed on the <a href=\"%drupal-sites\">Drupal sites</a> page. Just set your site's name, e-mail address, slogan and mission statement on the <a href=\"%site-admin\">site administration</a> page. Then make sure that the field called <em>Drupal XML-RPC server</em> on the <a href=\"%drupal-settings\">administer &raquo; configuration &raquo; modules &raquo; drupal</a> page is set to %drupal-xml-rpc, and enable this feature using the dropdown directly below.</p>
<p>The listing of your site will occur shortly after your site's next <a href=\"%cron-run\">cron run</a>. Note that cron.php should be called using the domain name which you want to have listed at <a href=\"%Drupal\">drupal.org</a>. 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.</p>
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index 7975c412e..837ec123f 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("<p>The \"Drupal\" module features a capability whereby other drupal sites may <em>call home</em> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
+ return t("
+<p>The \"Drupal\" module features a capability whereby other drupal sites may <em>call home</em> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
<p>Currently, the main application of this feature is the <a href=\"%drupal-sites\">Drupal sites</a> page. By default, fresh Drupal installations can use <a href=\"%Drupal\">drupal.org</a> as their <em>directory server</em> and report their existence. This reporting occurs via scheduled <a href=\"%xml-rpc\">XML-RPC</a> pings.</p>
<p>Drupal administrators should simply enable this feature to get listed on the <a href=\"%drupal-sites\">Drupal sites</a> page. Just set your site's name, e-mail address, slogan and mission statement on the <a href=\"%site-admin\">site administration</a> page. Then make sure that the field called <em>Drupal XML-RPC server</em> on the <a href=\"%drupal-settings\">administer &raquo; configuration &raquo; modules &raquo; drupal</a> page is set to %drupal-xml-rpc, and enable this feature using the dropdown directly below.</p>
<p>The listing of your site will occur shortly after your site's next <a href=\"%cron-run\">cron run</a>. Note that cron.php should be called using the domain name which you want to have listed at <a href=\"%Drupal\">drupal.org</a>. 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.</p>
diff --git a/modules/forum.module b/modules/forum.module
index 8a41b4f91..38744796d 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -1,6 +1,33 @@
<?php
// $Id$
+function forum_help($section = "admin/help#forum") {
+ $output = "";
+
+ switch ($section) {
+ case 'admin/help#forum':
+ $output = t("
+ <h3>Creating a forum</h3>
+ <p>The forum module uses taxonomy to organize itself. To create a forum you first have to create a <a href=\"%taxonomy\">taxonomy vocabulary</a>. 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, <a href=\"%taxo-terms\">add some terms</a> 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.\"</p>
+ <p>When you are happy with your vocabulary, go to <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a> and set <strong>Forum vocabulary</strong> 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\" <a href=\"%permission\">permission</a> and to create a topic they must have the \"create forum topics\" <a href=\"%permission\">permission</a>. These permissions can be set in the <a href=\"%permission\">permission</a> pages.</p>
+ <h4>Icons</h4>
+ <p>To disable icons, set the icon path as blank in <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a>.</p>
+ <p>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.</p>", 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 <a href=\"%created\">created</a> 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 <a href=\"%created\">created</a> 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 .= "<h3>Creating a forum</h3>";
- $output .= "<p>The forum module uses taxonomy to organize itself. To create a forum you first have to create a <a href=\"%taxonomy\">taxonomy vocabulary</a>. 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, <a href=\"%taxo-terms\">add some terms</a> 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.\"</p>";
- $output .= "<p>When you are happy with your vocabulary, go to <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a> and set <strong>Forum vocabulary</strong> 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\" <a href=\"%permission\">permission</a> and to create a topic they must have the \"create forum topics\" <a href=\"%permission\">permission</a>. These permissions can be set in the <a href=\"%permission\">permission</a> pages.</p>";
- $output .= "<h4>Icons</h4>";
- $output .= "<p>To disable icons, set the icon path as blank in <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a>.</p>";
- $output .= "<p>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.</p>";
- $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 8a41b4f91..38744796d 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -1,6 +1,33 @@
<?php
// $Id$
+function forum_help($section = "admin/help#forum") {
+ $output = "";
+
+ switch ($section) {
+ case 'admin/help#forum':
+ $output = t("
+ <h3>Creating a forum</h3>
+ <p>The forum module uses taxonomy to organize itself. To create a forum you first have to create a <a href=\"%taxonomy\">taxonomy vocabulary</a>. 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, <a href=\"%taxo-terms\">add some terms</a> 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.\"</p>
+ <p>When you are happy with your vocabulary, go to <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a> and set <strong>Forum vocabulary</strong> 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\" <a href=\"%permission\">permission</a> and to create a topic they must have the \"create forum topics\" <a href=\"%permission\">permission</a>. These permissions can be set in the <a href=\"%permission\">permission</a> pages.</p>
+ <h4>Icons</h4>
+ <p>To disable icons, set the icon path as blank in <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a>.</p>
+ <p>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.</p>", 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 <a href=\"%created\">created</a> 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 <a href=\"%created\">created</a> 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 .= "<h3>Creating a forum</h3>";
- $output .= "<p>The forum module uses taxonomy to organize itself. To create a forum you first have to create a <a href=\"%taxonomy\">taxonomy vocabulary</a>. 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, <a href=\"%taxo-terms\">add some terms</a> 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.\"</p>";
- $output .= "<p>When you are happy with your vocabulary, go to <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a> and set <strong>Forum vocabulary</strong> 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\" <a href=\"%permission\">permission</a> and to create a topic they must have the \"create forum topics\" <a href=\"%permission\">permission</a>. These permissions can be set in the <a href=\"%permission\">permission</a> pages.</p>";
- $output .= "<h4>Icons</h4>";
- $output .= "<p>To disable icons, set the icon path as blank in <a href=\"%forums\">administer &raquo; configutation &raquo; modules &raquo; forum</a>.</p>";
- $output .= "<p>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.</p>";
- $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 5020ab590..56fd28d47 100644
--- a/modules/help.module
+++ b/modules/help.module
@@ -10,23 +10,23 @@ function help_link($type) {
function help_glossary() {
- $output .= "<h3>Glossary</h3><dl>";
- $output .= "<dt>Block</dt><dd>A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.</dd>";
- $output .= "<dt>Comment</dt><dd>A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.</dd>";
- $output .= "<dt>Moderation</dt><dd>The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.<dl>";
- $output .= "<dt>Approved</dt><dd>A moderated post which has been accepted by the moderators for publication. (See published).</dd>";
- $output .= "<dt>Waiting</dt><dd>A moderated post which is still being voted on to be accepted for publication. (See published.)</dd>";
- $output .= "<dt>Moderators</dt><dd>The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).</dd></dl></dd>";
- $output .= "<dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extention of a node.</dd>";
- $output .= "<dt>Public</dt><dd>See published.</dd>";
- $output .= "<dt>Published</dt><dd>A node that is viewable by everyone. (See unpublished.)</dd>";
- $output .= "<dt>Role</dt><dd>A classification users are placed into for the purpose of setting users' permissions.</dd>";
- $output .= "<dt>Taxonomy</dt><dd>A division of a collection of things into ordered, classified groups. (See <a href=\"%taxonomy\">taxonomy help</a>.)</dd>";
- $output .= "<dt>Unpublished</dt><dd>A node that is only viewable by administrators and moderators.</dd>";
- $output .= "<dt>User</dt><dd>A person who has an account at your Drupal site, and is logged in with that account.</dd>";
- $output .= "<dt>Visitor</dt><dd>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 <u>not</u> logged in with that account. Also termed \"anonymous user\".</dd>";
- $output .= "</dl>";
- $output = t($output, array("%taxonomy" => url("admin/taxonomy/help")));
+ $output .= t("
+ <h3>Glossary</h3><dl>
+ <dt>Block</dt><dd>A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.</dd>
+ <dt>Comment</dt><dd>A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.</dd>
+ <dt>Moderation</dt><dd>The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.<dl>
+ <dt>Approved</dt><dd>A moderated post which has been accepted by the moderators for publication. (See published).</dd>
+ <dt>Waiting</dt><dd>A moderated post which is still being voted on to be accepted for publication. (See published.)</dd>
+ <dt>Moderators</dt><dd>The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).</dd></dl></dd>
+ <dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extention of a node.</dd>
+ <dt>Public</dt><dd>See published.</dd>
+ <dt>Published</dt><dd>A node that is viewable by everyone. (See unpublished.)</dd>
+ <dt>Role</dt><dd>A classification users are placed into for the purpose of setting users' permissions.</dd>
+ <dt>Taxonomy</dt><dd>A division of a collection of things into ordered, classified groups. (See <a href=\"%taxonomy\">taxonomy help</a>.)</dd>
+ <dt>Unpublished</dt><dd>A node that is only viewable by administrators and moderators.</dd>
+ <dt>User</dt><dd>A person who has an account at your Drupal site, and is logged in with that account.</dd>
+ <dt>Visitor</dt><dd>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 <u>not</u> logged in with that account. Also termed \"anonymous user\".</dd>
+ </dl>", array("%taxonomy" => url("admin/taxonomy/help")));
print theme("page", $output);
}
diff --git a/modules/help/help.module b/modules/help/help.module
index 5020ab590..56fd28d47 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -10,23 +10,23 @@ function help_link($type) {
function help_glossary() {
- $output .= "<h3>Glossary</h3><dl>";
- $output .= "<dt>Block</dt><dd>A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.</dd>";
- $output .= "<dt>Comment</dt><dd>A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.</dd>";
- $output .= "<dt>Moderation</dt><dd>The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.<dl>";
- $output .= "<dt>Approved</dt><dd>A moderated post which has been accepted by the moderators for publication. (See published).</dd>";
- $output .= "<dt>Waiting</dt><dd>A moderated post which is still being voted on to be accepted for publication. (See published.)</dd>";
- $output .= "<dt>Moderators</dt><dd>The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).</dd></dl></dd>";
- $output .= "<dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extention of a node.</dd>";
- $output .= "<dt>Public</dt><dd>See published.</dd>";
- $output .= "<dt>Published</dt><dd>A node that is viewable by everyone. (See unpublished.)</dd>";
- $output .= "<dt>Role</dt><dd>A classification users are placed into for the purpose of setting users' permissions.</dd>";
- $output .= "<dt>Taxonomy</dt><dd>A division of a collection of things into ordered, classified groups. (See <a href=\"%taxonomy\">taxonomy help</a>.)</dd>";
- $output .= "<dt>Unpublished</dt><dd>A node that is only viewable by administrators and moderators.</dd>";
- $output .= "<dt>User</dt><dd>A person who has an account at your Drupal site, and is logged in with that account.</dd>";
- $output .= "<dt>Visitor</dt><dd>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 <u>not</u> logged in with that account. Also termed \"anonymous user\".</dd>";
- $output .= "</dl>";
- $output = t($output, array("%taxonomy" => url("admin/taxonomy/help")));
+ $output .= t("
+ <h3>Glossary</h3><dl>
+ <dt>Block</dt><dd>A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.</dd>
+ <dt>Comment</dt><dd>A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.</dd>
+ <dt>Moderation</dt><dd>The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.<dl>
+ <dt>Approved</dt><dd>A moderated post which has been accepted by the moderators for publication. (See published).</dd>
+ <dt>Waiting</dt><dd>A moderated post which is still being voted on to be accepted for publication. (See published.)</dd>
+ <dt>Moderators</dt><dd>The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).</dd></dl></dd>
+ <dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extention of a node.</dd>
+ <dt>Public</dt><dd>See published.</dd>
+ <dt>Published</dt><dd>A node that is viewable by everyone. (See unpublished.)</dd>
+ <dt>Role</dt><dd>A classification users are placed into for the purpose of setting users' permissions.</dd>
+ <dt>Taxonomy</dt><dd>A division of a collection of things into ordered, classified groups. (See <a href=\"%taxonomy\">taxonomy help</a>.)</dd>
+ <dt>Unpublished</dt><dd>A node that is only viewable by administrators and moderators.</dd>
+ <dt>User</dt><dd>A person who has an account at your Drupal site, and is logged in with that account.</dd>
+ <dt>Visitor</dt><dd>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 <u>not</u> logged in with that account. Also termed \"anonymous user\".</dd>
+ </dl>", array("%taxonomy" => url("admin/taxonomy/help")));
print theme("page", $output);
}
diff --git a/modules/node.module b/modules/node.module
index 61ee57c88..7b0bd1cb0 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 .= "<h3>Nodes</h3>";
- $output .= "<p>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:<dl>";
- $output .= "<dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>";
- $output .= "<dt>A Teaser</dt><dd>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 <a href=\"%teaser\">click here</a>). The teaser can be changed if you don't like what Drupal grabs.</dd>";
- $output .= "<dt>The Body</dt><dd>The main text that comprises your content.</dd>";
- $output .= "<dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>";
- $output .= "<dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>";
- $output .= "<dt>Authored on</dt><dd>The date the node was written.</dd>";
- $output .= "<dt>Changed</dt><dd>The last time this node was changed.</dd>";
- $output .= "<dt>Static on front page</dt><dd>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 <a href=\"%teaser\">click here</a>), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>";
- $output .= "<dt>Allow user comments</dt><dd>A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>";
- $output .= "<dt>Attributes</dt><dd>A way to sort nodes.</dd>";
- $output .= "<dt>Revisions</dt><dd>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.</dd>";
- $output .= "<dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>";
- $output .= "<dt>In moderation queue</dt><dd>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.</dd>";
- $output .= "<dt>Votes</dt><dd>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 .= "<dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>";
- $output .= "<dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>";
- $output .= "<dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>";
- $output .= "<p>Now that you know what is in a node, here are some of the types of nodes available.</p>";
-
- $output = t($output, array("%teaser" => url("admin/system/modules/node")));
+ $output .= t("
+ <h3>Nodes</h3>
+ <p>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:<dl>
+ <dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>
+ <dt>A Teaser</dt><dd>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 <a href=\"%teaser\">click here</a>). The teaser can be changed if you don't like what Drupal grabs.</dd>
+ <dt>The Body</dt><dd>The main text that comprises your content.</dd>
+ <dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>
+ <dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>
+ <dt>Authored on</dt><dd>The date the node was written.</dd>
+ <dt>Changed</dt><dd>The last time this node was changed.</dd>
+ <dt>Static on front page</dt><dd>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 <a href=\"%teaser\">click here</a>), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>
+ <dt>Allow user comments</dt><dd>A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>
+ <dt>Attributes</dt><dd>A way to sort nodes.</dd>
+ <dt>Revisions</dt><dd>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.</dd>
+ <dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>
+ <dt>In moderation queue</dt><dd>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.</dd>
+ <dt>Votes</dt><dd>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.
+ <dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>
+ <dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>
+ <dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>
+ <p>Now that you know what is in a node, here are some of the types of nodes available.</p>", array("%teaser" => url("admin/system/modules/node")));
if ($mod == "admin") {
- foreach (module_list() as $name) {
- if (module_hook($name, "node") && $name != "node") {
- $output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))) ."</h3>";
- $output .= module_invoke($name, "node", "description");
- }
+ foreach (node_list() as $type => $module) {
+ $output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($module, "node", "name", $type))). "</h3>";
+ $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 .= "<h2>". module_invoke($name, "node", "name") ."</h2>";
+ $output .= "<h2>". module_invoke($module, "node", "name", $type) ."</h2>";
$output .= theme("table", $header, array($cols));
$output .= "<br /><br />";
}
@@ -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 .= "<li>";
- $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 .= " <div style=\"margin-left: 20px;\">". module_invoke($name, "node", "description") ."</div>";
+ $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 .= " <div style=\"margin-left: 20px;\">". module_invoke($module, "node", "description", $type) ."</div>";
$output .= "</li>";
}
}
@@ -1297,29 +1357,18 @@ 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 = "<h3>". t("Preview trimmed version") ."</h3>";
- $output .= node_view($view, 1);
+ $output .= node_view($node, 1);
$output .= "<p><i>". 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 '&lt;!--break--&gt' (without the quotes) to fine-tune where your post gets split.") ."</i></p>";
$output .= "<h3>". t("Preview full version") ."</h3>";
- $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 61ee57c88..7b0bd1cb0 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 .= "<h3>Nodes</h3>";
- $output .= "<p>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:<dl>";
- $output .= "<dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>";
- $output .= "<dt>A Teaser</dt><dd>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 <a href=\"%teaser\">click here</a>). The teaser can be changed if you don't like what Drupal grabs.</dd>";
- $output .= "<dt>The Body</dt><dd>The main text that comprises your content.</dd>";
- $output .= "<dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>";
- $output .= "<dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>";
- $output .= "<dt>Authored on</dt><dd>The date the node was written.</dd>";
- $output .= "<dt>Changed</dt><dd>The last time this node was changed.</dd>";
- $output .= "<dt>Static on front page</dt><dd>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 <a href=\"%teaser\">click here</a>), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>";
- $output .= "<dt>Allow user comments</dt><dd>A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>";
- $output .= "<dt>Attributes</dt><dd>A way to sort nodes.</dd>";
- $output .= "<dt>Revisions</dt><dd>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.</dd>";
- $output .= "<dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>";
- $output .= "<dt>In moderation queue</dt><dd>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.</dd>";
- $output .= "<dt>Votes</dt><dd>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 .= "<dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>";
- $output .= "<dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>";
- $output .= "<dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>";
- $output .= "<p>Now that you know what is in a node, here are some of the types of nodes available.</p>";
-
- $output = t($output, array("%teaser" => url("admin/system/modules/node")));
+ $output .= t("
+ <h3>Nodes</h3>
+ <p>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:<dl>
+ <dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>
+ <dt>A Teaser</dt><dd>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 <a href=\"%teaser\">click here</a>). The teaser can be changed if you don't like what Drupal grabs.</dd>
+ <dt>The Body</dt><dd>The main text that comprises your content.</dd>
+ <dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>
+ <dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>
+ <dt>Authored on</dt><dd>The date the node was written.</dd>
+ <dt>Changed</dt><dd>The last time this node was changed.</dd>
+ <dt>Static on front page</dt><dd>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 <a href=\"%teaser\">click here</a>), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>
+ <dt>Allow user comments</dt><dd>A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>
+ <dt>Attributes</dt><dd>A way to sort nodes.</dd>
+ <dt>Revisions</dt><dd>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.</dd>
+ <dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>
+ <dt>In moderation queue</dt><dd>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.</dd>
+ <dt>Votes</dt><dd>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.
+ <dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>
+ <dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>
+ <dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>
+ <p>Now that you know what is in a node, here are some of the types of nodes available.</p>", array("%teaser" => url("admin/system/modules/node")));
if ($mod == "admin") {
- foreach (module_list() as $name) {
- if (module_hook($name, "node") && $name != "node") {
- $output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))) ."</h3>";
- $output .= module_invoke($name, "node", "description");
- }
+ foreach (node_list() as $type => $module) {
+ $output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($module, "node", "name", $type))). "</h3>";
+ $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 .= "<h2>". module_invoke($name, "node", "name") ."</h2>";
+ $output .= "<h2>". module_invoke($module, "node", "name", $type) ."</h2>";
$output .= theme("table", $header, array($cols));
$output .= "<br /><br />";
}
@@ -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 .= "<li>";
- $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 .= " <div style=\"margin-left: 20px;\">". module_invoke($name, "node", "description") ."</div>";
+ $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 .= " <div style=\"margin-left: 20px;\">". module_invoke($module, "node", "description", $type) ."</div>";
$output .= "</li>";
}
}
@@ -1297,29 +1357,18 @@ 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 = "<h3>". t("Preview trimmed version") ."</h3>";
- $output .= node_view($view, 1);
+ $output .= node_view($node, 1);
$output .= "<p><i>". 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 '&lt;!--break--&gt' (without the quotes) to fine-tune where your post gets split.") ."</i></p>";
$output .= "<h3>". t("Preview full version") ."</h3>";
- $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 99b2b8aae..4432601d0 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 .= "<p>The page module is used to create a <i>static page</i>. 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 -&gt; moderate -&gt; post -&gt; 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.</p>";
- $output .= "<p>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.</p>";
- $output = t($output);
+ $output .= t("
+ <p>The page module is used to create a <i>static page</i>. 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 -&gt; moderate -&gt; post -&gt; 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.</p>
+ <p>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.</p>");
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 99b2b8aae..4432601d0 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 .= "<p>The page module is used to create a <i>static page</i>. 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 -&gt; moderate -&gt; post -&gt; 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.</p>";
- $output .= "<p>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.</p>";
- $output = t($output);
+ $output .= t("
+ <p>The page module is used to create a <i>static page</i>. 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 -&gt; moderate -&gt; post -&gt; 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.</p>
+ <p>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.</p>");
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 9d5c9c06f..73493a2c5 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("<h3>Background</h3>
+ $output = t("
+<h3>Background</h3>
<p>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:</p>
<pre>
user/login => login
diff --git a/modules/path/path.module b/modules/path/path.module
index 9d5c9c06f..73493a2c5 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("<h3>Background</h3>
+ $output = t("
+<h3>Background</h3>
<p>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:</p>
<pre>
user/login => login
diff --git a/modules/ping.module b/modules/ping.module
index 3389f0cd5..c60173b63 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 .= "<p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:</p>";
- $output .= "<p>%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.</p>";
- $output .= "<p>%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.</p>";
- $output .= "<p>%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.</p>";
- // for optional modules that ping other sites
- // $output .= module_invoke_all("ping_help");
- $output .= "<p>The ping feature requires crontab.</p>";
- $output = t($output, array("%weblogs" => "<a href=\"http://www.weblogs.com/\">Weblogs.com</a>", "%weblogs-XML" => "<a href=\"http://www.xmlrpc.com/weblogsCom/\">". t("XML-RPC interface of weblogs.com") ."</a>", "%weblogs-RSS" => "<a href=\"http://www.xmlrpc.com/weblogsComForRSS\">". t("Weblogs.Com for RSS") ."</a>", "%weblogs-RSS-changes" => "<a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">". t("the weblogs.com for RSS") ."</a>", "%blo-gs" => "<a href=\"http://blo.gs/\">blo.gs</a>", "%blogtracker" => "<a href=\"http://www.dansanderson.com/blogtracker\">blogtracker</a>", "%blogrolling" => "<a href=\"http://www.blogrolling.com\">blogtolling.com</a>", "%blo-gs-XML" => "<a href=\"http://blo.gs/ping.php\">". t("XML-RPC interface of blo.gs") ."</a>" ));
+ $output .= t("
+ <p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:</p>
+ <p>%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.</p>
+ <p>%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.</p>
+ <p>%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.</p>
+ <p>The ping feature requires crontab.</p>", array("%weblogs" => "<a href=\"http://www.weblogs.com/\">Weblogs.com</a>", "%weblogs-XML" => "<a href=\"http://www.xmlrpc.com/weblogsCom/\">". t("XML-RPC interface of weblogs.com") ."</a>", "%weblogs-RSS" => "<a href=\"http://www.xmlrpc.com/weblogsComForRSS\">". t("Weblogs.Com for RSS") ."</a>", "%weblogs-RSS-changes" => "<a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">". t("the weblogs.com for RSS") ."</a>", "%blo-gs" => "<a href=\"http://blo.gs/\">blo.gs</a>", "%blogtracker" => "<a href=\"http://www.dansanderson.com/blogtracker\">blogtracker</a>", "%blogrolling" => "<a href=\"http://www.blogrolling.com\">blogtolling.com</a>", "%blo-gs-XML" => "<a href=\"http://blo.gs/ping.php\">". t("XML-RPC interface of blo.gs") ."</a>"));
break;
case 'admin/system/modules#description':
diff --git a/modules/ping/ping.module b/modules/ping/ping.module
index 3389f0cd5..c60173b63 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 .= "<p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:</p>";
- $output .= "<p>%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.</p>";
- $output .= "<p>%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.</p>";
- $output .= "<p>%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.</p>";
- // for optional modules that ping other sites
- // $output .= module_invoke_all("ping_help");
- $output .= "<p>The ping feature requires crontab.</p>";
- $output = t($output, array("%weblogs" => "<a href=\"http://www.weblogs.com/\">Weblogs.com</a>", "%weblogs-XML" => "<a href=\"http://www.xmlrpc.com/weblogsCom/\">". t("XML-RPC interface of weblogs.com") ."</a>", "%weblogs-RSS" => "<a href=\"http://www.xmlrpc.com/weblogsComForRSS\">". t("Weblogs.Com for RSS") ."</a>", "%weblogs-RSS-changes" => "<a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">". t("the weblogs.com for RSS") ."</a>", "%blo-gs" => "<a href=\"http://blo.gs/\">blo.gs</a>", "%blogtracker" => "<a href=\"http://www.dansanderson.com/blogtracker\">blogtracker</a>", "%blogrolling" => "<a href=\"http://www.blogrolling.com\">blogtolling.com</a>", "%blo-gs-XML" => "<a href=\"http://blo.gs/ping.php\">". t("XML-RPC interface of blo.gs") ."</a>" ));
+ $output .= t("
+ <p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:</p>
+ <p>%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.</p>
+ <p>%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.</p>
+ <p>%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.</p>
+ <p>The ping feature requires crontab.</p>", array("%weblogs" => "<a href=\"http://www.weblogs.com/\">Weblogs.com</a>", "%weblogs-XML" => "<a href=\"http://www.xmlrpc.com/weblogsCom/\">". t("XML-RPC interface of weblogs.com") ."</a>", "%weblogs-RSS" => "<a href=\"http://www.xmlrpc.com/weblogsComForRSS\">". t("Weblogs.Com for RSS") ."</a>", "%weblogs-RSS-changes" => "<a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">". t("the weblogs.com for RSS") ."</a>", "%blo-gs" => "<a href=\"http://blo.gs/\">blo.gs</a>", "%blogtracker" => "<a href=\"http://www.dansanderson.com/blogtracker\">blogtracker</a>", "%blogrolling" => "<a href=\"http://www.blogrolling.com\">blogtolling.com</a>", "%blo-gs-XML" => "<a href=\"http://blo.gs/ping.php\">". t("XML-RPC interface of blo.gs") ."</a>"));
break;
case 'admin/system/modules#description':
diff --git a/modules/poll.module b/modules/poll.module
index edab210b4..5dd9aa1fc 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 .= "<p>Users with the correct <a href=\"%permissions\">permissions</a> can create and/or vote on polls.</p>";
- $output .= "<ul>";
- $output .= "<li> To create a poll a user needs the \"create polls\" permission.</li>";
- $output .= "<li>To vote on a poll question a user must have the \"vote on polls\" permission.</li>";
- $output .= "<li>To view the results one needs the \"access content\" permission.</li>";
- $output .= "<li>To administer polls you need the \"administer nodes\" permission.</li>";
- $output .= "</ul>";
- $output .= "<p>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.</p><p>The <a href=\"%poll\">Poll</a> 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.</p>";
- $output = t($output, array("%permissions" => url("admin/user/permission"), "%poll" => url("poll")));
+ $output .= t("
+ <p>Users with the correct <a href=\"%permissions\">permissions</a> can create and/or vote on polls.</p>
+ <ul>
+ <li> To create a poll a user needs the \"create polls\" permission.</li>
+ <li>To vote on a poll question a user must have the \"vote on polls\" permission.</li>
+ <li>To view the results one needs the \"access content\" permission.</li>
+ <li>To administer polls you need the \"administer nodes\" permission.</li>
+ </ul>
+ <p>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.</p><p>The <a href=\"%poll\">Poll</a> 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.</p>", 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 edab210b4..5dd9aa1fc 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 .= "<p>Users with the correct <a href=\"%permissions\">permissions</a> can create and/or vote on polls.</p>";
- $output .= "<ul>";
- $output .= "<li> To create a poll a user needs the \"create polls\" permission.</li>";
- $output .= "<li>To vote on a poll question a user must have the \"vote on polls\" permission.</li>";
- $output .= "<li>To view the results one needs the \"access content\" permission.</li>";
- $output .= "<li>To administer polls you need the \"administer nodes\" permission.</li>";
- $output .= "</ul>";
- $output .= "<p>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.</p><p>The <a href=\"%poll\">Poll</a> 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.</p>";
- $output = t($output, array("%permissions" => url("admin/user/permission"), "%poll" => url("poll")));
+ $output .= t("
+ <p>Users with the correct <a href=\"%permissions\">permissions</a> can create and/or vote on polls.</p>
+ <ul>
+ <li> To create a poll a user needs the \"create polls\" permission.</li>
+ <li>To vote on a poll question a user must have the \"vote on polls\" permission.</li>
+ <li>To view the results one needs the \"access content\" permission.</li>
+ <li>To administer polls you need the \"administer nodes\" permission.</li>
+ </ul>
+ <p>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.</p><p>The <a href=\"%poll\">Poll</a> 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.</p>", 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 3a3b6695d..8bd9ad261 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 = "<strong>Search guidelines</strong>";
- $output .= "<p>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.</p>";
- $output .= "<strong>Words excluded from the search</strong>";
- $output .= "<p>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.</p>";
- $output = t($output, array("%number" => variable_get("minimum_word_size", 2)));
+ $output = t("
+ <strong>Search guidelines</strong>
+ <p>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.</p>
+ <strong>Words excluded from the search</strong>
+ <p>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.</p>", 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 3a3b6695d..8bd9ad261 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 = "<strong>Search guidelines</strong>";
- $output .= "<p>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.</p>";
- $output .= "<strong>Words excluded from the search</strong>";
- $output .= "<p>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.</p>";
- $output = t($output, array("%number" => variable_get("minimum_word_size", 2)));
+ $output = t("
+ <strong>Search guidelines</strong>
+ <p>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.</p>
+ <strong>Words excluded from the search</strong>
+ <p>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.</p>", 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 23ae79d2d..625f7c64e 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 .= "<h3>Introduction</h3>";
- $output .= "<p>The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes <strong>disabled</strong> by default.<p>";
- $output .= "<p>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 .= "<ul>";
- $output .= "<li>The count can be displayed in the node's link section next to \"# comments\".</li>";
- $output .= "<li>A configurable block can be added which can display the day's top stories, the all time top stories, and the last stories read. Each section in the block has a title, which you can change, as well as being able to change how many node titles will be displayed</li>";
- $output .= "<li>A configurable user page can be added, which can display the day's top stories, the all time top stories, and the last stories read. You can individually configure how many posts are displayed in each section.</li>";
- $output .= "<li>A configurable block can be added that displays the count of how many users, as well as a list of their names, and guests are currently accessing your site.</li>";
- $output .= "</ul>";
- $output .= "<p>Notes on using the statistics:</p>";
- $output .= "<ul>";
- $output .= "<li>If you enable the view counters for content, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</li>";
- $output .= "<li>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</li>";
- $output .= "</ul>";
- $output .= "<p>As with any new module, the statistics module needs to be <a href=\"%modules\">enabled</a> before you can use it. Also refer to the <a href=\"%permissions\">permissions section</a>, as this module supports four separate permissions.</p>";
- $output .= "<h3><a href=\"%referers\">referrers log</a></h3><p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'all'.</p>";
- $output .= "<h3><a href=\"%access\">access log</a></h3><p>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.</p>";
- $output .= "<h3>Configuring the statistics module</h3><p>There are some configuration options added to the main <a href=\"%configuration\">administer &raquo; configuration</a> section:</p>";
- $output .= "<ul>";
- $output .= "<li><i>enable access log</i> -- allows you to turn the access log on and off. This log is used to store data about every page accessed, such as the remote host's IP address, where they came from (referrer), what node theyve viewed, and their user name. Enabling the log adds one database call per page displayed by Drupal.</li>";
- $output .= "<li><i>discard access logs older than</i> -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"</li>";
- $output .= "<li><i>enable node view counter</i> -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.</li>";
- $output .= "<li><i>display node view counters</i> -- allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</li>";
- $output .= "</ul>";
- $output .= "<h3>Popular content block</h3>";
- $output .= "<p>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.</p>";
- $output .= "<p>Don't forget to <a href=\"%block\">enable the block</a>.</p>";
-
- $output .= "<h3>Popular content page</h3>";
- $output .= "<p>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.</p>";
- $output .= "<h3>Permissions</h3><p>This module has four permissions that need to be configured in the <a href=\"%permissions\">permissions section</a>.</p>";
- $output .= "<ul>";
- $output .= "<li><i>access statistics</i> - enable for user roles that get to see view counts for individual content. (This does not define access to the block)</li>";
- $output .= "<li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li><li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li>";
- $output .= "</ul>";
- $output .= "<p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>";
- $output .= "<h2>Statistics module (for developers)</h2><h3>Accessing statistics</h3><p>To get a node's \"view statistics\" make a call to the function <i>statistics_get(\$nid)</i>. 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.</p>";
- $output .= "<ul>";
- $output .= "<li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li>";
- $output .= "<li>The <i>daycount</i> is a count of the total number of times that node has been viewed \"today\". For the daycount to be reset, cron must be enabled.</li>";
- $output .= "<li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li>";
- $output .= "</ul>";
- $output .= "<p>The module automatically adds '# reads' to each node's link section (if enabled).</p>";
- $output .= "<h3>Most popular content</h3><p>The statistics module provides a function '<i>statistics_title_list(\$dbfield, \$dbrows)</i>' 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:</p>";
- $output .= "<ul>";
- $output .= "<li><i>totalcount</i> - This will return an array with links to the top viewed content of all time.<br />Example: <code>statistics_title_list(\"totalcount\", \"5\");</code><br /><br /></li>";
- $output .= "<li><i>daycount</i> - This will return an array with links to the top viewed content for today.<br />Example: <code>statistics_title_list(\"daycount\",\"5\");</code><br /><br /></li>";
- $output .= "<li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />Example: <code>statistics_title_list(\"timestamp\",\"5\");</code></li>";
- $output .= "</ul>";
- $output .= "<p>\$dbrows is the number or rows you want returned in your array.</p>";
- $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("
+ <h3>Introduction</h3>
+ <p>The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes <strong>disabled</strong> by default.<p>
+ <p>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:
+ <ul>
+ <li>The count can be displayed in the node's link section next to \"# comments\".</li>
+ <li>A configurable block can be added which can display the day's top stories, the all time top stories, and the last stories read. Each section in the block has a title, which you can change, as well as being able to change how many node titles will be displayed</li>
+ <li>A configurable user page can be added, which can display the day's top stories, the all time top stories, and the last stories read. You can individually configure how many posts are displayed in each section.</li>
+ <li>A configurable block can be added that displays the count of how many users, as well as a list of their names, and guests are currently accessing your site.</li>
+ </ul>
+ <p>Notes on using the statistics:</p>
+ <ul>
+ <li>If you enable the view counters for content, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</li>
+ <li>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</li>
+ </ul>
+ <p>As with any new module, the statistics module needs to be <a href=\"%modules\">enabled</a> before you can use it. Also refer to the <a href=\"%permissions\">permissions section</a>, as this module supports four separate permissions.</p>
+ <h3><a href=\"%referers\">referrers log</a></h3>
+ <p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'all'.</p>
+ <h3><a href=\"%access\">access log</a></h3>
+ <p>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.</p>
+ <h3>Configuring the statistics module</h3>
+ <p>There are some configuration options added to the main <a href=\"%configuration\">administer &raquo; configuration</a> section:</p>
+ <ul>
+ <li><i>enable access log</i> -- allows you to turn the access log on and off. This log is used to store data about every page accessed, such as the remote host's IP address, where they came from (referrer), what node theyve viewed, and their user name. Enabling the log adds one database call per page displayed by Drupal.</li>
+ <li><i>discard access logs older than</i> -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"</li>
+ <li><i>enable node view counter</i> -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.</li>
+ <li><i>display node view counters</i> -- allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</li>
+ </ul>
+ <h3>Popular content block</h3>
+ <p>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.</p>
+ <p>Don't forget to <a href=\"%block\">enable the block</a>.</p>
+ <h3>Popular content page</h3>
+ <p>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.</p>
+ <h3>Permissions</h3><p>This module has four permissions that need to be configured in the <a href=\"%permissions\">permissions section</a>.</p>
+ <ul>
+ <li><i>access statistics</i> - enable for user roles that get to see view counts for individual content. (This does not define access to the block)</li>
+ <li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li><li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li>
+ </ul>
+ <p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>
+ <h2>Statistics module (for developers)</h2><h3>Accessing statistics</h3><p>To get a node's \"view statistics\" make a call to the function <i>statistics_get(\$nid)</i>. 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.</p>
+ <ul>
+ <li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li>
+ <li>The <i>daycount</i> is a count of the total number of times that node has been viewed \"today\". For the daycount to be reset, cron must be enabled.</li>
+ <li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li>
+ </ul>
+ <p>The module automatically adds '# reads' to each node's link section (if enabled).</p>
+ <h3>Most popular content</h3>
+ <p>The statistics module provides a function '<i>statistics_title_list(\$dbfield, \$dbrows)</i>' 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:</p>
+ <ul>
+ <li><i>totalcount</i> - This will return an array with links to the top viewed content of all time.<br />Example: <code>statistics_title_list(\"totalcount\", \"5\");</code><br /><br /></li>
+ <li><i>daycount</i> - This will return an array with links to the top viewed content for today.<br />Example: <code>statistics_title_list(\"daycount\",\"5\");</code><br /><br /></li>
+ <li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />Example: <code>statistics_title_list(\"timestamp\",\"5\");</code></li>
+ </ul>
+ <p>\$dbrows is the number or rows you want returned in your array.</p>", 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 23ae79d2d..625f7c64e 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 .= "<h3>Introduction</h3>";
- $output .= "<p>The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes <strong>disabled</strong> by default.<p>";
- $output .= "<p>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 .= "<ul>";
- $output .= "<li>The count can be displayed in the node's link section next to \"# comments\".</li>";
- $output .= "<li>A configurable block can be added which can display the day's top stories, the all time top stories, and the last stories read. Each section in the block has a title, which you can change, as well as being able to change how many node titles will be displayed</li>";
- $output .= "<li>A configurable user page can be added, which can display the day's top stories, the all time top stories, and the last stories read. You can individually configure how many posts are displayed in each section.</li>";
- $output .= "<li>A configurable block can be added that displays the count of how many users, as well as a list of their names, and guests are currently accessing your site.</li>";
- $output .= "</ul>";
- $output .= "<p>Notes on using the statistics:</p>";
- $output .= "<ul>";
- $output .= "<li>If you enable the view counters for content, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</li>";
- $output .= "<li>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</li>";
- $output .= "</ul>";
- $output .= "<p>As with any new module, the statistics module needs to be <a href=\"%modules\">enabled</a> before you can use it. Also refer to the <a href=\"%permissions\">permissions section</a>, as this module supports four separate permissions.</p>";
- $output .= "<h3><a href=\"%referers\">referrers log</a></h3><p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'all'.</p>";
- $output .= "<h3><a href=\"%access\">access log</a></h3><p>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.</p>";
- $output .= "<h3>Configuring the statistics module</h3><p>There are some configuration options added to the main <a href=\"%configuration\">administer &raquo; configuration</a> section:</p>";
- $output .= "<ul>";
- $output .= "<li><i>enable access log</i> -- allows you to turn the access log on and off. This log is used to store data about every page accessed, such as the remote host's IP address, where they came from (referrer), what node theyve viewed, and their user name. Enabling the log adds one database call per page displayed by Drupal.</li>";
- $output .= "<li><i>discard access logs older than</i> -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"</li>";
- $output .= "<li><i>enable node view counter</i> -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.</li>";
- $output .= "<li><i>display node view counters</i> -- allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</li>";
- $output .= "</ul>";
- $output .= "<h3>Popular content block</h3>";
- $output .= "<p>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.</p>";
- $output .= "<p>Don't forget to <a href=\"%block\">enable the block</a>.</p>";
-
- $output .= "<h3>Popular content page</h3>";
- $output .= "<p>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.</p>";
- $output .= "<h3>Permissions</h3><p>This module has four permissions that need to be configured in the <a href=\"%permissions\">permissions section</a>.</p>";
- $output .= "<ul>";
- $output .= "<li><i>access statistics</i> - enable for user roles that get to see view counts for individual content. (This does not define access to the block)</li>";
- $output .= "<li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li><li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li>";
- $output .= "</ul>";
- $output .= "<p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>";
- $output .= "<h2>Statistics module (for developers)</h2><h3>Accessing statistics</h3><p>To get a node's \"view statistics\" make a call to the function <i>statistics_get(\$nid)</i>. 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.</p>";
- $output .= "<ul>";
- $output .= "<li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li>";
- $output .= "<li>The <i>daycount</i> is a count of the total number of times that node has been viewed \"today\". For the daycount to be reset, cron must be enabled.</li>";
- $output .= "<li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li>";
- $output .= "</ul>";
- $output .= "<p>The module automatically adds '# reads' to each node's link section (if enabled).</p>";
- $output .= "<h3>Most popular content</h3><p>The statistics module provides a function '<i>statistics_title_list(\$dbfield, \$dbrows)</i>' 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:</p>";
- $output .= "<ul>";
- $output .= "<li><i>totalcount</i> - This will return an array with links to the top viewed content of all time.<br />Example: <code>statistics_title_list(\"totalcount\", \"5\");</code><br /><br /></li>";
- $output .= "<li><i>daycount</i> - This will return an array with links to the top viewed content for today.<br />Example: <code>statistics_title_list(\"daycount\",\"5\");</code><br /><br /></li>";
- $output .= "<li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />Example: <code>statistics_title_list(\"timestamp\",\"5\");</code></li>";
- $output .= "</ul>";
- $output .= "<p>\$dbrows is the number or rows you want returned in your array.</p>";
- $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("
+ <h3>Introduction</h3>
+ <p>The statistics module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes <strong>disabled</strong> by default.<p>
+ <p>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:
+ <ul>
+ <li>The count can be displayed in the node's link section next to \"# comments\".</li>
+ <li>A configurable block can be added which can display the day's top stories, the all time top stories, and the last stories read. Each section in the block has a title, which you can change, as well as being able to change how many node titles will be displayed</li>
+ <li>A configurable user page can be added, which can display the day's top stories, the all time top stories, and the last stories read. You can individually configure how many posts are displayed in each section.</li>
+ <li>A configurable block can be added that displays the count of how many users, as well as a list of their names, and guests are currently accessing your site.</li>
+ </ul>
+ <p>Notes on using the statistics:</p>
+ <ul>
+ <li>If you enable the view counters for content, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</li>
+ <li>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</li>
+ </ul>
+ <p>As with any new module, the statistics module needs to be <a href=\"%modules\">enabled</a> before you can use it. Also refer to the <a href=\"%permissions\">permissions section</a>, as this module supports four separate permissions.</p>
+ <h3><a href=\"%referers\">referrers log</a></h3>
+ <p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'all'.</p>
+ <h3><a href=\"%access\">access log</a></h3>
+ <p>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.</p>
+ <h3>Configuring the statistics module</h3>
+ <p>There are some configuration options added to the main <a href=\"%configuration\">administer &raquo; configuration</a> section:</p>
+ <ul>
+ <li><i>enable access log</i> -- allows you to turn the access log on and off. This log is used to store data about every page accessed, such as the remote host's IP address, where they came from (referrer), what node theyve viewed, and their user name. Enabling the log adds one database call per page displayed by Drupal.</li>
+ <li><i>discard access logs older than</i> -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"</li>
+ <li><i>enable node view counter</i> -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.</li>
+ <li><i>display node view counters</i> -- allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</li>
+ </ul>
+ <h3>Popular content block</h3>
+ <p>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.</p>
+ <p>Don't forget to <a href=\"%block\">enable the block</a>.</p>
+ <h3>Popular content page</h3>
+ <p>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.</p>
+ <h3>Permissions</h3><p>This module has four permissions that need to be configured in the <a href=\"%permissions\">permissions section</a>.</p>
+ <ul>
+ <li><i>access statistics</i> - enable for user roles that get to see view counts for individual content. (This does not define access to the block)</li>
+ <li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li><li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li>
+ </ul>
+ <p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>
+ <h2>Statistics module (for developers)</h2><h3>Accessing statistics</h3><p>To get a node's \"view statistics\" make a call to the function <i>statistics_get(\$nid)</i>. 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.</p>
+ <ul>
+ <li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li>
+ <li>The <i>daycount</i> is a count of the total number of times that node has been viewed \"today\". For the daycount to be reset, cron must be enabled.</li>
+ <li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li>
+ </ul>
+ <p>The module automatically adds '# reads' to each node's link section (if enabled).</p>
+ <h3>Most popular content</h3>
+ <p>The statistics module provides a function '<i>statistics_title_list(\$dbfield, \$dbrows)</i>' 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:</p>
+ <ul>
+ <li><i>totalcount</i> - This will return an array with links to the top viewed content of all time.<br />Example: <code>statistics_title_list(\"totalcount\", \"5\");</code><br /><br /></li>
+ <li><i>daycount</i> - This will return an array with links to the top viewed content for today.<br />Example: <code>statistics_title_list(\"daycount\",\"5\");</code><br /><br /></li>
+ <li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />Example: <code>statistics_title_list(\"timestamp\",\"5\");</code></li>
+ </ul>
+ <p>\$dbrows is the number or rows you want returned in your array.</p>", 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 2c05c7838..a66bc6788 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 <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. 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 = "<p>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 <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. Administrators are able to shortcut this flow as desired.</p>";
- $output .= "In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> 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("
+ <p>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 <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. Administrators are able to shortcut this flow as desired.</p>
+ In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> 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 2c05c7838..a66bc6788 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 <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. 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 = "<p>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 <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. Administrators are able to shortcut this flow as desired.</p>";
- $output .= "In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> 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("
+ <p>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 <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. Administrators are able to shortcut this flow as desired.</p>
+ In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> 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 a7d173453..bdef196cd 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 <a href=\"%permissions\">permissions</a> 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 <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.", array("%permissions" => url("admin/user/permission"), "%throttle" => url("admin/system/modules/throttle")));
break;
case 'admin/help#system':
- $output .= "<p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.</p>";
- $output .= "<h3><a id=\"cron\">Cron</a></h3>";
- // Start of system_help_cron
- $output .= "<p>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.</p>";
- $output .= "<p>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 <i>n</i> seconds, where n is the period of that task. When all the tasks are finished, cron is done.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>For the Unix/Linux crontab itself, use a browser like <a href=\"%lynx\">lynx</a> or <a href=\"%wget\">wget</a> but make sure the process terminates: either use <code>/usr/bin/lynx -source %base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null %cron-link</code>. Take a look at the example scripts in the <code>scripts</code>-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 .= "<pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>";
- $output .= "Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment varibles will not be set correctly and features may not work as expected.</p>";
- // End of system_help_cron
- $output .= "<h3><a id=\"cache\">Cache</a></h3>";
- // Start of system_help_cache
- $output .= "<p>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.</p>";
- // End of system_help_cache
- $output = t($output, array("%base_url" => $base_url, "%cron-link" => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", "%lynx" => "http://lynx.browser.org", "%wget" => "http://www.gnu.org/software/wget/wget.html" ));
+ $output .= t("
+ <p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.</p>
+ <h3><a id=\"cron\">Cron</a></h3>
+ <p>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.</p>
+ <p>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 <i>n</i> seconds, where n is the period of that task. When all the tasks are finished, cron is done.</p>
+ <p>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.</p>
+ <p>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.</p>
+ <p>For the Unix/Linux crontab itself, use a browser like <a href=\"%lynx\">lynx</a> or <a href=\"%wget\">wget</a> but make sure the process terminates: either use <code>/usr/bin/lynx -source %base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null %cron-link</code>. Take a look at the example scripts in the <code>scripts</code>-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be:
+ <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>
+ Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment varibles will not be set correctly and features may not work as expected.</p>
+ <h3><a id=\"cache\">Cache</a></h3>
+ <p>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.</p>", array("%base_url" => $base_url, "%cron-link" => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", "%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 a7d173453..bdef196cd 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 <a href=\"%permissions\">permissions</a> 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 <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.", array("%permissions" => url("admin/user/permission"), "%throttle" => url("admin/system/modules/throttle")));
break;
case 'admin/help#system':
- $output .= "<p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.</p>";
- $output .= "<h3><a id=\"cron\">Cron</a></h3>";
- // Start of system_help_cron
- $output .= "<p>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.</p>";
- $output .= "<p>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 <i>n</i> seconds, where n is the period of that task. When all the tasks are finished, cron is done.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>For the Unix/Linux crontab itself, use a browser like <a href=\"%lynx\">lynx</a> or <a href=\"%wget\">wget</a> but make sure the process terminates: either use <code>/usr/bin/lynx -source %base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null %cron-link</code>. Take a look at the example scripts in the <code>scripts</code>-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 .= "<pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>";
- $output .= "Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment varibles will not be set correctly and features may not work as expected.</p>";
- // End of system_help_cron
- $output .= "<h3><a id=\"cache\">Cache</a></h3>";
- // Start of system_help_cache
- $output .= "<p>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.</p>";
- // End of system_help_cache
- $output = t($output, array("%base_url" => $base_url, "%cron-link" => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", "%lynx" => "http://lynx.browser.org", "%wget" => "http://www.gnu.org/software/wget/wget.html" ));
+ $output .= t("
+ <p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.</p>
+ <h3><a id=\"cron\">Cron</a></h3>
+ <p>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.</p>
+ <p>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 <i>n</i> seconds, where n is the period of that task. When all the tasks are finished, cron is done.</p>
+ <p>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.</p>
+ <p>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.</p>
+ <p>For the Unix/Linux crontab itself, use a browser like <a href=\"%lynx\">lynx</a> or <a href=\"%wget\">wget</a> but make sure the process terminates: either use <code>/usr/bin/lynx -source %base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null %cron-link</code>. Take a look at the example scripts in the <code>scripts</code>-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be:
+ <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>
+ Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment varibles will not be set correctly and features may not work as expected.</p>
+ <h3><a id=\"cache\">Cache</a></h3>
+ <p>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.</p>", array("%base_url" => $base_url, "%cron-link" => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", "%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 07f4639c0..c7726e039 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 .= "<h3>Background</h3><p>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 <a href=\"%classification-types\">classification types</a> and insight into the development of the <i>taxonomy.module</i>, see this <a href=\"%drupal-dis\">drupal.org discussion</a>.</p>";
- $output .= "<h3>An example taxonomy: food</h3><ul><li>Dairy<ul><li>Milk</li></ul></li><li>Drink<ul><li>Alchohol<ul><li>Beer</li><li>Wine</li></ul></li><li>Pop</li><li>Milk</li></ul></li><li>Meat<ul><li>Beef</li><li>Chicken</li><li>Lamb</li></ul></li><li>Spices<ul><li>Sugar</li></ul></li></ul>";
- $output .= "<p><strong>Notes</strong></p><ul><li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>multiple parents</i> for a term.</li><li>In Drupal the order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in a taxonomy may be controlled with the <i>weight</i> parameter.</li></ul>";
- $output .= "<h3>Vocabularies</h3><p>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 <a href=\"%slashdot\">Slashdot</a>'s sections. For more complex implementations, you might create a hierarchical list of categories such as <i>Food</i> taxonomy shown above.</p>";
- $output .= "<h4>Setting up a vocabulary</h4><p>When setting up a controlled vocabulary, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select the <i>related terms</i> option, you are allowing the definition of related terms, think <i>see also</i>, as in a thesaurus. Selecting <i>multiple select</i> 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.</p>";
- $output .= "<p>When setting up a controlled vocabulary you are asked for: <ul>";
- $output .= "<li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li>";
- $output .= "<li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li>";
- $output .= "<li><strong>Types</strong> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li>";
- $output .= "<li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>";
- $output .= "<li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li>";
- $output .= "<li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li>";
- $output .= "<li><strong>Required</strong> -- Each node has to have a term in this vocabulary associated with it.</li>";
- $output .= "<li><strong>Weight</strong> -- The over all weight for this vocabulary in listings with multiple vocabularies.</li>";
- $output .= "</ul></p>";
- $output .= "<h4>Adding terms to a vocabulary</h4><p>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 <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i>. These options are:</p>";
- $output .= "<p><ul>";
- $output .= "<li><strong>Term name</strong> (Required) -- The name for this term. Example: <i>Milk</i></li>";
- $output .= "<li><strong>Description</strong> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li>";
- $output .= "<li><strong><a id=\"parent\"></a>Parent</strong> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li>";
- $output .= "<li><strong><a id=\"synonyms\"></a>Synonyms</strong> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>)</li>";
- $output .= "<li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li>";
- $output .= "</ul></p>";
- $output .= "<h3><a id=\"taxonomy-url\"></a>Displaying nodes organized by term(s)</h3><p>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, <a href=\"%taxo-example\">taxonomy/page/or/1,2</a>. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <a href=\"%taxo-overview\">taxonomy overview</a> 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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
- $output .= "<h3>RSS feeds</h3><p>Every term, or collection of terms, provides an <a href=\"%userland-rss\">RSS</a> feed to which interested users may subscribe. The URL format for a sample RSS feed is <a href=\"%sample-rss\">node/feed/or/1,2</a>. Built like a Taxonomy URL, <a href=\"%taxo-help\">see above</a> it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>";
- $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("
+ <h3>Background</h3>
+ <p>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 <a href=\"%classification-types\">classification types</a> and insight into the development of the <i>taxonomy.module</i>, see this <a href=\"%drupal-dis\">drupal.org discussion</a>.</p>
+ <h3>An example taxonomy: food</h3>
+ <ul><li>Dairy<ul><li>Milk</li></ul></li><li>Drink<ul><li>Alchohol<ul><li>Beer</li><li>Wine</li></ul></li><li>Pop</li><li>Milk</li></ul></li><li>Meat<ul><li>Beef</li><li>Chicken</li><li>Lamb</li></ul></li><li>Spices<ul><li>Sugar</li></ul></li></ul>
+ <p><strong>Notes</strong></p><ul><li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>multiple parents</i> for a term.</li><li>In Drupal the order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in a taxonomy may be controlled with the <i>weight</i> parameter.</li></ul>
+ <h3>Vocabularies</h3>
+ <p>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 <a href=\"%slashdot\">Slashdot</a>'s sections. For more complex implementations, you might create a hierarchical list of categories such as <i>Food</i> taxonomy shown above.</p>
+ <h4>Setting up a vocabulary</h4>
+ <p>When setting up a controlled vocabulary, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select the <i>related terms</i> option, you are allowing the definition of related terms, think <i>see also</i>, as in a thesaurus. Selecting <i>multiple select</i> 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.</p>
+ <p>When setting up a controlled vocabulary you are asked for: <ul>
+ <li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li>
+ <li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li>
+ <li><strong>Types</strong> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li>
+ <li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>
+ <li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li>
+ <li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li>
+ <li><strong>Required</strong> -- Each node has to have a term in this vocabulary associated with it.</li>
+ <li><strong>Weight</strong> -- The over all weight for this vocabulary in listings with multiple vocabularies.</li>
+ </ul></p>
+ <h4>Adding terms to a vocabulary</h4>
+ <p>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 <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i>. These options are:</p>
+ <p><ul>
+ <li><strong>Term name</strong> (Required) -- The name for this term. Example: <i>Milk</i></li>
+ <li><strong>Description</strong> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li>
+ <li><strong><a id=\"parent\"></a>Parent</strong> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li>
+ <li><strong><a id=\"synonyms\"></a>Synonyms</strong> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>)</li>
+ <li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li>
+ </ul></p>
+ <h3><a id=\"taxonomy-url\"></a>Displaying nodes organized by term(s)</h3>
+ <p>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, <a href=\"%taxo-example\">taxonomy/page/or/1,2</a>. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <a href=\"%taxo-overview\">taxonomy overview</a> 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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>
+ <h3>RSS feeds</h3>
+ <p>Every term, or collection of terms, provides an <a href=\"%userland-rss\">RSS</a> feed to which interested users may subscribe. The URL format for a sample RSS feed is <a href=\"%sample-rss\">node/feed/or/1,2</a>. Built like a Taxonomy URL, <a href=\"%taxo-help\">see above</a> it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>", 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 07f4639c0..c7726e039 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 .= "<h3>Background</h3><p>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 <a href=\"%classification-types\">classification types</a> and insight into the development of the <i>taxonomy.module</i>, see this <a href=\"%drupal-dis\">drupal.org discussion</a>.</p>";
- $output .= "<h3>An example taxonomy: food</h3><ul><li>Dairy<ul><li>Milk</li></ul></li><li>Drink<ul><li>Alchohol<ul><li>Beer</li><li>Wine</li></ul></li><li>Pop</li><li>Milk</li></ul></li><li>Meat<ul><li>Beef</li><li>Chicken</li><li>Lamb</li></ul></li><li>Spices<ul><li>Sugar</li></ul></li></ul>";
- $output .= "<p><strong>Notes</strong></p><ul><li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>multiple parents</i> for a term.</li><li>In Drupal the order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in a taxonomy may be controlled with the <i>weight</i> parameter.</li></ul>";
- $output .= "<h3>Vocabularies</h3><p>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 <a href=\"%slashdot\">Slashdot</a>'s sections. For more complex implementations, you might create a hierarchical list of categories such as <i>Food</i> taxonomy shown above.</p>";
- $output .= "<h4>Setting up a vocabulary</h4><p>When setting up a controlled vocabulary, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select the <i>related terms</i> option, you are allowing the definition of related terms, think <i>see also</i>, as in a thesaurus. Selecting <i>multiple select</i> 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.</p>";
- $output .= "<p>When setting up a controlled vocabulary you are asked for: <ul>";
- $output .= "<li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li>";
- $output .= "<li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li>";
- $output .= "<li><strong>Types</strong> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li>";
- $output .= "<li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>";
- $output .= "<li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li>";
- $output .= "<li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li>";
- $output .= "<li><strong>Required</strong> -- Each node has to have a term in this vocabulary associated with it.</li>";
- $output .= "<li><strong>Weight</strong> -- The over all weight for this vocabulary in listings with multiple vocabularies.</li>";
- $output .= "</ul></p>";
- $output .= "<h4>Adding terms to a vocabulary</h4><p>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 <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i>. These options are:</p>";
- $output .= "<p><ul>";
- $output .= "<li><strong>Term name</strong> (Required) -- The name for this term. Example: <i>Milk</i></li>";
- $output .= "<li><strong>Description</strong> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li>";
- $output .= "<li><strong><a id=\"parent\"></a>Parent</strong> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li>";
- $output .= "<li><strong><a id=\"synonyms\"></a>Synonyms</strong> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>)</li>";
- $output .= "<li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li>";
- $output .= "</ul></p>";
- $output .= "<h3><a id=\"taxonomy-url\"></a>Displaying nodes organized by term(s)</h3><p>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, <a href=\"%taxo-example\">taxonomy/page/or/1,2</a>. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <a href=\"%taxo-overview\">taxonomy overview</a> 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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
- $output .= "<h3>RSS feeds</h3><p>Every term, or collection of terms, provides an <a href=\"%userland-rss\">RSS</a> feed to which interested users may subscribe. The URL format for a sample RSS feed is <a href=\"%sample-rss\">node/feed/or/1,2</a>. Built like a Taxonomy URL, <a href=\"%taxo-help\">see above</a> it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>";
- $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("
+ <h3>Background</h3>
+ <p>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 <a href=\"%classification-types\">classification types</a> and insight into the development of the <i>taxonomy.module</i>, see this <a href=\"%drupal-dis\">drupal.org discussion</a>.</p>
+ <h3>An example taxonomy: food</h3>
+ <ul><li>Dairy<ul><li>Milk</li></ul></li><li>Drink<ul><li>Alchohol<ul><li>Beer</li><li>Wine</li></ul></li><li>Pop</li><li>Milk</li></ul></li><li>Meat<ul><li>Beef</li><li>Chicken</li><li>Lamb</li></ul></li><li>Spices<ul><li>Sugar</li></ul></li></ul>
+ <p><strong>Notes</strong></p><ul><li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>multiple parents</i> for a term.</li><li>In Drupal the order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in a taxonomy may be controlled with the <i>weight</i> parameter.</li></ul>
+ <h3>Vocabularies</h3>
+ <p>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 <a href=\"%slashdot\">Slashdot</a>'s sections. For more complex implementations, you might create a hierarchical list of categories such as <i>Food</i> taxonomy shown above.</p>
+ <h4>Setting up a vocabulary</h4>
+ <p>When setting up a controlled vocabulary, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select the <i>related terms</i> option, you are allowing the definition of related terms, think <i>see also</i>, as in a thesaurus. Selecting <i>multiple select</i> 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.</p>
+ <p>When setting up a controlled vocabulary you are asked for: <ul>
+ <li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li>
+ <li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li>
+ <li><strong>Types</strong> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li>
+ <li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>
+ <li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li>
+ <li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li>
+ <li><strong>Required</strong> -- Each node has to have a term in this vocabulary associated with it.</li>
+ <li><strong>Weight</strong> -- The over all weight for this vocabulary in listings with multiple vocabularies.</li>
+ </ul></p>
+ <h4>Adding terms to a vocabulary</h4>
+ <p>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 <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i>. These options are:</p>
+ <p><ul>
+ <li><strong>Term name</strong> (Required) -- The name for this term. Example: <i>Milk</i></li>
+ <li><strong>Description</strong> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li>
+ <li><strong><a id=\"parent\"></a>Parent</strong> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li>
+ <li><strong><a id=\"synonyms\"></a>Synonyms</strong> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>)</li>
+ <li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li>
+ </ul></p>
+ <h3><a id=\"taxonomy-url\"></a>Displaying nodes organized by term(s)</h3>
+ <p>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, <a href=\"%taxo-example\">taxonomy/page/or/1,2</a>. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <a href=\"%taxo-overview\">taxonomy overview</a> 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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>
+ <h3>RSS feeds</h3>
+ <p>Every term, or collection of terms, provides an <a href=\"%userland-rss\">RSS</a> feed to which interested users may subscribe. The URL format for a sample RSS feed is <a href=\"%sample-rss\">node/feed/or/1,2</a>. Built like a Taxonomy URL, <a href=\"%taxo-help\">see above</a> it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>", 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 15e8c2e10..c92cddfee 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 .= "<h3>Introduction</h3><p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the <a href=\"%statistics-module\">statistics module</a>. The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>";
- $output .= "<p>This module also adds a block that displays the current status of the throttle. You must have \"<a href=\"%throttle-block\">access throttle block</a>\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>As with any module, the throttle module needs to be <a href=\"%modules-enable\">enabled</a> before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>";
- $output .= "<h3>Configuring the throttle module</h3><p>The <a href=\"%throttle-config\">configuration section</a> for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>";
- $output .= "<h4>enable auto-throttle:</h4><blockquote>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 <a href=\"%statistics-config\">statistics module</a> for the auto-throttling mechanism to have any effect.</blockquote>";
- $output .= "<h4>auto-throttle multiplier:</h4><blockquote><p>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.</p>";
- $output .= "<p>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.</p></blockquote>";
- $output .= "<h4>auto-throttle probability limiter:</h4><blockquote><p>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.</p>";
- $output .= "<p>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.</p></blockquote>";
- $output .= "<h3>Throttle block</h3><p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"<a href=\"%throttle-access\">access throttle block</a>\" permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>";
- $output .= "<p>Don't forget to <a href=\"%throttle-block-enable\">enable the block</a>.</p>";
- $output .= "<h3>Permissions</h3><p>This module has one permission that needs to be configured in <a href=\"%permissions\">user permissions</a>.</p>";
- $output .= "<ul><li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li></ul>";
- $output .= "<h3>For programmers: throttle_status()</h3><p>The function <code>throttle_status()</code> 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.</p>";
- $output .= "<p>To implement the throttle, you should do something like this:";
- $output .= "<pre>
+ $output .= t("
+ <h3>Introduction</h3>
+ <p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the <a href=\"%statistics-module\">statistics module</a>. The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>
+ <p>This module also adds a block that displays the current status of the throttle. You must have \"<a href=\"%throttle-block\">access throttle block</a>\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>
+ <p>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.</p>
+ <p>As with any module, the throttle module needs to be <a href=\"%modules-enable\">enabled</a> before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>
+ <h3>Configuring the throttle module</h3>
+ <p>The <a href=\"%throttle-config\">configuration section</a> for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>
+ <h4>enable auto-throttle:</h4>
+ <blockquote>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 <a href=\"%statistics-config\">statistics module</a> for the auto-throttling mechanism to have any effect.</blockquote>
+ <h4>auto-throttle multiplier:</h4>
+ <blockquote><p>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.</p>
+ <p>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.</p></blockquote>
+ <h4>auto-throttle probability limiter:</h4>
+ <blockquote><p>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.</p>
+ <p>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.</p></blockquote>
+ <h3>Throttle block</h3>
+ <p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"<a href=\"%throttle-access\">access throttle block</a>\" permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>
+ <p>Don't forget to <a href=\"%throttle-block-enable\">enable the block</a>.</p>
+ <h3>Permissions</h3>
+ <p>This module has one permission that needs to be configured in <a href=\"%permissions\">user permissions</a>.</p>
+ <ul><li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li></ul>
+ <h3>For programmers: throttle_status()</h3>
+ <p>The function <code>throttle_status()</code> 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.</p>
+ <p>To implement the throttle, you should do something like this:
+ <pre>
if (module_invoke(\"throttle\", \"status\") >= \$my_throttle_value) {
// my throttle limit was reached, disable stuff
}
else {
// throttle limit not reached, execute normally
- }</pre></p>";
- $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")));
+ }</pre>
+ </p>", 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 15e8c2e10..c92cddfee 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 .= "<h3>Introduction</h3><p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the <a href=\"%statistics-module\">statistics module</a>. The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>";
- $output .= "<p>This module also adds a block that displays the current status of the throttle. You must have \"<a href=\"%throttle-block\">access throttle block</a>\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>As with any module, the throttle module needs to be <a href=\"%modules-enable\">enabled</a> before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>";
- $output .= "<h3>Configuring the throttle module</h3><p>The <a href=\"%throttle-config\">configuration section</a> for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>";
- $output .= "<h4>enable auto-throttle:</h4><blockquote>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 <a href=\"%statistics-config\">statistics module</a> for the auto-throttling mechanism to have any effect.</blockquote>";
- $output .= "<h4>auto-throttle multiplier:</h4><blockquote><p>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.</p>";
- $output .= "<p>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.</p></blockquote>";
- $output .= "<h4>auto-throttle probability limiter:</h4><blockquote><p>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.</p>";
- $output .= "<p>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.</p></blockquote>";
- $output .= "<h3>Throttle block</h3><p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"<a href=\"%throttle-access\">access throttle block</a>\" permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>";
- $output .= "<p>Don't forget to <a href=\"%throttle-block-enable\">enable the block</a>.</p>";
- $output .= "<h3>Permissions</h3><p>This module has one permission that needs to be configured in <a href=\"%permissions\">user permissions</a>.</p>";
- $output .= "<ul><li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li></ul>";
- $output .= "<h3>For programmers: throttle_status()</h3><p>The function <code>throttle_status()</code> 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.</p>";
- $output .= "<p>To implement the throttle, you should do something like this:";
- $output .= "<pre>
+ $output .= t("
+ <h3>Introduction</h3>
+ <p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the <a href=\"%statistics-module\">statistics module</a>. The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>
+ <p>This module also adds a block that displays the current status of the throttle. You must have \"<a href=\"%throttle-block\">access throttle block</a>\" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>
+ <p>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.</p>
+ <p>As with any module, the throttle module needs to be <a href=\"%modules-enable\">enabled</a> before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>
+ <h3>Configuring the throttle module</h3>
+ <p>The <a href=\"%throttle-config\">configuration section</a> for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>
+ <h4>enable auto-throttle:</h4>
+ <blockquote>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 <a href=\"%statistics-config\">statistics module</a> for the auto-throttling mechanism to have any effect.</blockquote>
+ <h4>auto-throttle multiplier:</h4>
+ <blockquote><p>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.</p>
+ <p>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.</p></blockquote>
+ <h4>auto-throttle probability limiter:</h4>
+ <blockquote><p>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.</p>
+ <p>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.</p></blockquote>
+ <h3>Throttle block</h3>
+ <p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the \"<a href=\"%throttle-access\">access throttle block</a>\" permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>
+ <p>Don't forget to <a href=\"%throttle-block-enable\">enable the block</a>.</p>
+ <h3>Permissions</h3>
+ <p>This module has one permission that needs to be configured in <a href=\"%permissions\">user permissions</a>.</p>
+ <ul><li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li></ul>
+ <h3>For programmers: throttle_status()</h3>
+ <p>The function <code>throttle_status()</code> 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.</p>
+ <p>To implement the throttle, you should do something like this:
+ <pre>
if (module_invoke(\"throttle\", \"status\") >= \$my_throttle_value) {
// my throttle limit was reached, disable stuff
}
else {
// throttle limit not reached, execute normally
- }</pre></p>";
- $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")));
+ }</pre>
+ </p>", 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 4b15e2705..2048c6685 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 <strong>permissions</strong> for each user role (role names are defined on the <a href=\"%role\">user roles page</a>). 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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <strong>names</strong> of the various roles. To delete a role choose \"edit role\".<br />By default, Drupal comes with two user roles:";
- $output .= "<ul>";
- $output .= "<li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li>";
- $output .= "<li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li>";
- $output .= "</ul>";
- $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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <strong>names</strong> of the various roles. To delete a role choose \"edit role\".<br />By default, Drupal comes with two user roles:
+ <ul>
+ <li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li>
+ <li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li>
+ </ul>", 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 .= "<h3>Distributed authentication<a id=\"da\"></a></h3>";
- $output .= "<p>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 <i>distributed authentication</i>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>";
- $output .= "<p>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 <a href=\"%delphi-forums\">Delphi Forums</a>. 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 <i>remote.delphiforums.com</i> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) 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.</p>";
-
- $output = t($output, array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "<i>$site</i>", "%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("
+ <h3>Distributed authentication<a id=\"da\"></a></h3>
+ <p>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 <i>distributed authentication</i>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>
+ <p>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 <a href=\"%delphi-forums\">Delphi Forums</a>. 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 <i>remote.delphiforums.com</i> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) 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.</p>", array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "<i>$site</i>", "%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 .= "<h3>Introduction</h3><p>Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using <a href=\"%user-role\">roles</a> you can setup fine grained <a href=\"%user-permission\">permissions</a> 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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a <a href=\"%jabber\">Jabber ID</a>, <a href=\"%delphiforums\">DelphiForums ID</a>, or one from a <a href=\"%drupal\">Drupal powered</a> website. See the <a href=\"%da-auth\">distributed authentication help</a> 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 <a href=\"%php-sess\">PHP sessions</a>. 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.</p>";
- $output .= "<h3>User preferences and profiles</h3><p>Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"<a href=\"%user-prefs\">my account</a>\" 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 <a href\"%da-auth\">distributed authentication names</a>. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in <a href=\"%admin-user\">account administration</a> on behalf of their users.</p>";
- $output .= "<p>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 <a href=\"%da-devel\">developers guide</a>. For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.</p>";
- //end of user_help_admin
-
- //start of user_help_admin_da
- $output .= "<h3>Distributed authentication<a id=\"da\"></a></h3>";
- $output .= "<p>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.</p>";
- $output .= "<p>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 <a href=\"%xml\">%xml</a>, <a href=\"%http-post\">%http-post</a>, or <a href=\"%soap\">%soap</a>) behind the scenes and asks &quot;is this password for username=joe?&quot; 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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>To disable distributed authentication, simply <a href=\"%dis-module\">disable</a> or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.</p>";
- $output .= "<p>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 ...</p>";
- $output .= "%module-list";
- // end of user_help_admin_da
-
- // start of user_help_devel_da
- $output .= "<h3>Writing distributed authentication modules</h3><p>Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the <a href=\"%blogger\">blogger authentication</a> 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 <a href=\"%blogger-source\">module</a> in the <a href=\"%contrib-cvs\">contributions repository</a>.</p>";
- $output .= "<h4>Code review</h4>";
- $output .= "<pre>function blogger_auth(\$name, \$pass, \$server) {
- // user did not present a Blogger ID so don't bother trying.
- if (\$server !== &quot;blogger.com&quot;) {
- return 0;
- }
- //provided to Drupal by Ev@Blogger
- \$appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;
+ $output .= t("
+ <h3>Introduction</h3>
+ <p>Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using <a href=\"%user-role\">roles</a> you can setup fine grained <a href=\"%user-permission\">permissions</a> 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.</p>
+ <p>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.</p>
+ <p>Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a <a href=\"%jabber\">Jabber ID</a>, <a href=\"%delphiforums\">DelphiForums ID</a>, or one from a <a href=\"%drupal\">Drupal powered</a> website. See the <a href=\"%da-auth\">distributed authentication help</a> 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 <a href=\"%php-sess\">PHP sessions</a>. 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.</p>
+ <h3>User preferences and profiles</h3><p>Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"<a href=\"%user-prefs\">my account</a>\" 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 <a href\"%da-auth\">distributed authentication names</a>. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in <a href=\"%admin-user\">account administration</a> on behalf of their users.</p>
+ <p>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 <a href=\"%da-devel\">developers guide</a>. For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.</p>
+
+ <h3>Distributed authentication<a id=\"da\"></a></h3>
+ <p>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.</p>
+ <p>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 <a href=\"%xml\">%xml</a>, <a href=\"%http-post\">%http-post</a>, or <a href=\"%soap\">%soap</a>) behind the scenes and asks &quot;is this password for username=joe?&quot; 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.</p>
+ <p>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.</p>
+ <p>To disable distributed authentication, simply <a href=\"%dis-module\">disable</a> or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.</p>
+ <p>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 ...</p>
+ %module-list
+
+ <h3>Writing distributed authentication modules</h3>
+ <p>Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the <a href=\"%blogger\">blogger authentication</a> 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 <a href=\"%blogger-source\">module</a> in the <a href=\"%contrib-cvs\">contributions repository</a>.</p>
+ <h4>Code review</h4>
+ <pre>function blogger_auth(\$name, \$pass, \$server) {
+ // user did not present a Blogger ID so don't bother trying.
+ if (\$server !== &quot;blogger.com&quot;) {
+ return 0;
+ }
+ //provided to Drupal by Ev@Blogger
+ \$appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;
- \$message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;,
+ \$message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;,
array(new xmlrpcval(\$appkey, &quot;string&quot;),
new xmlrpcval(\$name, &quot;string&quot;),
new xmlrpcval(\$pass, &quot;string&quot;)));
- \$client = new xmlrpc_client(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
- // \$client->setDebug(1);
- \$result = \$client-&gt;send(\$message, 5);
- // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
- if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
- // 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;
- }
-}</pre>";
- $output .= "<p>The <i>_auth</i> 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:</p>";
- $output .= "<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\" style=\"margin: auto; width: 80%;\"><tr><th colspan=\"2\" style=\"text-align: left;\">_auth function parameters</th></tr><tr><th>\$name</th><td>The substring before the final <i>'@'</i> character in the username field</td></tr><tr><th>\$pass</th><td>The whole string submitted by the user in the password field</td></tr><tr><th>\$server</th><td>The substring after the final <i>'@'</i> symbol in the username field</td></tr></table>";
- $output .= "<p>So now lets use that \$name, \$pass, and \$server which was passed to our <i>_auth</i> function. Blogger authenticates users via <a href=\"%xml\">XML-RPC</a>. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just <strong>trusts</strong> the module.</p>";
- $output .= "<p>The lines above illustrate a typical <a href=\"%xml\">XML-RPC</a> method call. Here we build up a message and send it to Blogger, storing the response in a variable called <i>\$response</i>. The message we pass conforms to the published <a href=\"%blogger-api\">Blogger XML-RPC Application Programmers Interface (API)</a>. 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 <i>plant.blogger.com</i>, so we hard-code that value into the <i>xmlrpc_client()</i> function. A more typical example might be the jabber module, which uses the <i>\$server</i> parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the <i>\$client-&gt;send()</i> 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.</p>";
- $output .= "<pre>
- if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
- // 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;
- }
-</pre>";
- $output .= "<p>This second half of the <i>_auth</i> function examines the <i>\$response</i> 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.</p>";
- $output .= "<pre>function blogger_page() {
-
- print theme(&quot;header&quot;);
- print theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
- print theme(&quot;footer&quot;);
-}</pre>";
- $output .= "<p>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 <i>blogger</i>.</p>";
- $output .= "<pre><code>function blogger_help(\$section) {
- \$output = &quot;&quot;;
-
- switch (\$section) {
- case 'user/help':
- \$site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);<br />
- \$output .= &quot;&lt;p&gt;You may login to %site using a &lt;b&gt;Blogger ID&lt;/b&gt; and password. &quot;;
- \$output .= &quot;A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;. &quot;;
- \$output .= &quot;So a valid blogger ID is &lt;i&gt;mwlily&lt;/i&gt;@&lt;b&gt;blogger.com&lt;/b&gt;. If you are a Blogger member, go ahead and login now.&lt;/p&gt;&quot;;
- \$output .= &quot;&lt;p&gt;Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. &quot;;
- \$output .= &quot;Blogger will publish to your current web site or help you create one. &quot;;
- \$output .= &quot;&lt;a href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
- \$output = t(\$output, array(\"%site\" =&gt; \"&lt;i&gt;\$site&lt;/i&gt;\"));
- }
-
- return output;
-}</code></pre>";
- $output .= "<p>The <i>_help</i> 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.</p>";
- $output .= "<h4>Publishing your module</h4><p>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 <a href=\"%contrib-cvs\">Drupal contributions CVS repository</a>. You'll need to request priveleges to this repository - see <a href=\"%cvs\">the CVS README file</a> for the details. Then you should announce your contribution on the <a href=\"%drupal-lists\">drupal-devel and drupal-support mailing lists</a>. You might also want to post a story on <a href=\"%drupal-org\">Drupal.org</a>.</p>";
- // end of user_help_devel_da
-
- // start of user_help_devel_userhook
- $output .= "<h3><a id=\"userhook\">module_user()</a></h3><p>The <strong>_user()</strong> hook provides a mechanism for inserting text and form fields into the <a href=\"%registration\">registration</a>, <a href=\"%user-acct\">user account view/edit</a>, and <a href=\"%user-admin\">administer &raquo; accounts</a> pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the <a href=\"%profile-module\">profile module</a>. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>";
-
- $output .= "<p>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 <i>julia.module</i>. That file does the following:<ul>";
- $output .= "<li>new members must agree to Julia's Privacy Policy on the reg page.</li>";
- $output .= "<li>members may list their favorite ingredients on their public user profile page</li>";
- $output .= "</ul></p>";
- $output .= "<p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>";
-
- $output .= "<pre>
-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 <i>Julia's Kitchen</i> 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(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
+ // \$client->setDebug(1);
+ \$result = \$client-&gt;send(\$message, 5);
+ // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // 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\"]));
- }
- }
-</pre>";
- // 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&amp;cvsroot=contrib&amp;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"));
+ }</pre>
+ <p>The <i>_auth</i> 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:</p>
+ <table border=\"0\" cellspacing=\"4\" cellpadding=\"4\" style=\"margin: auto; width: 80%;\"><tr><th colspan=\"2\" style=\"text-align: left;\">_auth function parameters</th></tr><tr><th>\$name</th><td>The substring before the final <i>'@'</i> character in the username field</td></tr><tr><th>\$pass</th><td>The whole string submitted by the user in the password field</td></tr><tr><th>\$server</th><td>The substring after the final <i>'@'</i> symbol in the username field</td></tr></table>
+ <p>So now lets use that \$name, \$pass, and \$server which was passed to our <i>_auth</i> function. Blogger authenticates users via <a href=\"%xml\">XML-RPC</a>. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just <strong>trusts</strong> the module.</p>
+ <p>The lines above illustrate a typical <a href=\"%xml\">XML-RPC</a> method call. Here we build up a message and send it to Blogger, storing the response in a variable called <i>\$response</i>. The message we pass conforms to the published <a href=\"%blogger-api\">Blogger XML-RPC Application Programmers Interface (API)</a>. 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 <i>plant.blogger.com</i>, so we hard-code that value into the <i>xmlrpc_client()</i> function. A more typical example might be the jabber module, which uses the <i>\$server</i> parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the <i>\$client-&gt;send()</i> 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.</p>
+ <pre>
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // 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;
+ }
+ </pre>
+ <p>This second half of the <i>_auth</i> function examines the <i>\$response</i> 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.</p>
+ <pre>function blogger_page() {
+ print theme(&quot;header&quot;);
+ print theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
+ print theme(&quot;footer&quot;);
+ }</pre>
+ <p>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 <i>blogger</i>.</p>
+ <pre><code>function blogger_help(\$section) {
+ \$output = &quot;&quot;;
+
+ switch (\$section) {
+ case 'user/help':
+ \$site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);<br />
+ \$output .= &quot;&lt;p&gt;You may login to %site using a &lt;b&gt;Blogger ID&lt;/b&gt; and password. &quot;;
+ \$output .= &quot;A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;. &quot;;
+ \$output .= &quot;So a valid blogger ID is &lt;i&gt;mwlily&lt;/i&gt;@&lt;b&gt;blogger.com&lt;/b&gt;. If you are a Blogger member, go ahead and login now.&lt;/p&gt;&quot;;
+ \$output .= &quot;&lt;p&gt;Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. &quot;;
+ \$output .= &quot;Blogger will publish to your current web site or help you create one. &quot;;
+ \$output .= &quot;&lt;a href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
+ \$output = t(\$output, array(\"%site\" =&gt; \"&lt;i&gt;\$site&lt;/i&gt;\"));
+ }
+
+ return output;
+ }</code></pre>
+ <p>The <i>_help</i> 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.</p>
+ <h4>Publishing your module</h4>
+ <p>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 <a href=\"%contrib-cvs\">Drupal contributions CVS repository</a>. You'll need to request priveleges to this repository - see <a href=\"%cvs\">the CVS README file</a> for the details. Then you should announce your contribution on the <a href=\"%drupal-lists\">drupal-devel and drupal-support mailing lists</a>. You might also want to post a story on <a href=\"%drupal-org\">Drupal.org</a>.</p>
+
+ <h3><a id=\"userhook\">module_user()</a></h3>
+ <p>The <strong>_user()</strong> hook provides a mechanism for inserting text and form fields into the <a href=\"%registration\">registration</a>, <a href=\"%user-acct\">user account view/edit</a>, and <a href=\"%user-admin\">administer &raquo; accounts</a> pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the <a href=\"%profile-module\">profile module</a>. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>
+
+ <p>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 <i>julia.module</i>. That file does the following:<ul>
+ <li>new members must agree to Julia's Privacy Policy on the reg page.</li>
+ <li>members may list their favorite ingredients on their public user profile page</li>
+ </ul></p>
+ <p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>
+
+ <pre>
+ 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 <i>Julia's Kitchen</i> 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\"]));
+ }
+ }
+ </pre>", 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&amp;cvsroot=contrib&amp;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 4b15e2705..2048c6685 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 <strong>permissions</strong> for each user role (role names are defined on the <a href=\"%role\">user roles page</a>). 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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <strong>names</strong> of the various roles. To delete a role choose \"edit role\".<br />By default, Drupal comes with two user roles:";
- $output .= "<ul>";
- $output .= "<li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li>";
- $output .= "<li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li>";
- $output .= "</ul>";
- $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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <strong>names</strong> of the various roles. To delete a role choose \"edit role\".<br />By default, Drupal comes with two user roles:
+ <ul>
+ <li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li>
+ <li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li>
+ </ul>", 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 .= "<h3>Distributed authentication<a id=\"da\"></a></h3>";
- $output .= "<p>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 <i>distributed authentication</i>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>";
- $output .= "<p>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 <a href=\"%delphi-forums\">Delphi Forums</a>. 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 <i>remote.delphiforums.com</i> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) 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.</p>";
-
- $output = t($output, array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "<i>$site</i>", "%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("
+ <h3>Distributed authentication<a id=\"da\"></a></h3>
+ <p>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 <i>distributed authentication</i>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>
+ <p>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 <a href=\"%delphi-forums\">Delphi Forums</a>. 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 <i>remote.delphiforums.com</i> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) 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.</p>", array("%help-links" => (implode(", ", user_auth_help_links())), "%site" => "<i>$site</i>", "%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 .= "<h3>Introduction</h3><p>Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using <a href=\"%user-role\">roles</a> you can setup fine grained <a href=\"%user-permission\">permissions</a> 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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a <a href=\"%jabber\">Jabber ID</a>, <a href=\"%delphiforums\">DelphiForums ID</a>, or one from a <a href=\"%drupal\">Drupal powered</a> website. See the <a href=\"%da-auth\">distributed authentication help</a> 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 <a href=\"%php-sess\">PHP sessions</a>. 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.</p>";
- $output .= "<h3>User preferences and profiles</h3><p>Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"<a href=\"%user-prefs\">my account</a>\" 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 <a href\"%da-auth\">distributed authentication names</a>. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in <a href=\"%admin-user\">account administration</a> on behalf of their users.</p>";
- $output .= "<p>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 <a href=\"%da-devel\">developers guide</a>. For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.</p>";
- //end of user_help_admin
-
- //start of user_help_admin_da
- $output .= "<h3>Distributed authentication<a id=\"da\"></a></h3>";
- $output .= "<p>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.</p>";
- $output .= "<p>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 <a href=\"%xml\">%xml</a>, <a href=\"%http-post\">%http-post</a>, or <a href=\"%soap\">%soap</a>) behind the scenes and asks &quot;is this password for username=joe?&quot; 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.</p>";
- $output .= "<p>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.</p>";
- $output .= "<p>To disable distributed authentication, simply <a href=\"%dis-module\">disable</a> or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.</p>";
- $output .= "<p>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 ...</p>";
- $output .= "%module-list";
- // end of user_help_admin_da
-
- // start of user_help_devel_da
- $output .= "<h3>Writing distributed authentication modules</h3><p>Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the <a href=\"%blogger\">blogger authentication</a> 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 <a href=\"%blogger-source\">module</a> in the <a href=\"%contrib-cvs\">contributions repository</a>.</p>";
- $output .= "<h4>Code review</h4>";
- $output .= "<pre>function blogger_auth(\$name, \$pass, \$server) {
- // user did not present a Blogger ID so don't bother trying.
- if (\$server !== &quot;blogger.com&quot;) {
- return 0;
- }
- //provided to Drupal by Ev@Blogger
- \$appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;
+ $output .= t("
+ <h3>Introduction</h3>
+ <p>Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using <a href=\"%user-role\">roles</a> you can setup fine grained <a href=\"%user-permission\">permissions</a> 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.</p>
+ <p>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.</p>
+ <p>Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a <a href=\"%jabber\">Jabber ID</a>, <a href=\"%delphiforums\">DelphiForums ID</a>, or one from a <a href=\"%drupal\">Drupal powered</a> website. See the <a href=\"%da-auth\">distributed authentication help</a> 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 <a href=\"%php-sess\">PHP sessions</a>. 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.</p>
+ <h3>User preferences and profiles</h3><p>Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the \"<a href=\"%user-prefs\">my account</a>\" 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 <a href\"%da-auth\">distributed authentication names</a>. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in <a href=\"%admin-user\">account administration</a> on behalf of their users.</p>
+ <p>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 <a href=\"%da-devel\">developers guide</a>. For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.</p>
+
+ <h3>Distributed authentication<a id=\"da\"></a></h3>
+ <p>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.</p>
+ <p>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 <a href=\"%xml\">%xml</a>, <a href=\"%http-post\">%http-post</a>, or <a href=\"%soap\">%soap</a>) behind the scenes and asks &quot;is this password for username=joe?&quot; 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.</p>
+ <p>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.</p>
+ <p>To disable distributed authentication, simply <a href=\"%dis-module\">disable</a> or remove all DA modules. For a virgin install, that means removing/disabling the jabber module and the drupal module.</p>
+ <p>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 ...</p>
+ %module-list
+
+ <h3>Writing distributed authentication modules</h3>
+ <p>Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the <a href=\"%blogger\">blogger authentication</a> 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 <a href=\"%blogger-source\">module</a> in the <a href=\"%contrib-cvs\">contributions repository</a>.</p>
+ <h4>Code review</h4>
+ <pre>function blogger_auth(\$name, \$pass, \$server) {
+ // user did not present a Blogger ID so don't bother trying.
+ if (\$server !== &quot;blogger.com&quot;) {
+ return 0;
+ }
+ //provided to Drupal by Ev@Blogger
+ \$appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;
- \$message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;,
+ \$message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;,
array(new xmlrpcval(\$appkey, &quot;string&quot;),
new xmlrpcval(\$name, &quot;string&quot;),
new xmlrpcval(\$pass, &quot;string&quot;)));
- \$client = new xmlrpc_client(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
- // \$client->setDebug(1);
- \$result = \$client-&gt;send(\$message, 5);
- // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
- if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
- // 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;
- }
-}</pre>";
- $output .= "<p>The <i>_auth</i> 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:</p>";
- $output .= "<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\" style=\"margin: auto; width: 80%;\"><tr><th colspan=\"2\" style=\"text-align: left;\">_auth function parameters</th></tr><tr><th>\$name</th><td>The substring before the final <i>'@'</i> character in the username field</td></tr><tr><th>\$pass</th><td>The whole string submitted by the user in the password field</td></tr><tr><th>\$server</th><td>The substring after the final <i>'@'</i> symbol in the username field</td></tr></table>";
- $output .= "<p>So now lets use that \$name, \$pass, and \$server which was passed to our <i>_auth</i> function. Blogger authenticates users via <a href=\"%xml\">XML-RPC</a>. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just <strong>trusts</strong> the module.</p>";
- $output .= "<p>The lines above illustrate a typical <a href=\"%xml\">XML-RPC</a> method call. Here we build up a message and send it to Blogger, storing the response in a variable called <i>\$response</i>. The message we pass conforms to the published <a href=\"%blogger-api\">Blogger XML-RPC Application Programmers Interface (API)</a>. 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 <i>plant.blogger.com</i>, so we hard-code that value into the <i>xmlrpc_client()</i> function. A more typical example might be the jabber module, which uses the <i>\$server</i> parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the <i>\$client-&gt;send()</i> 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.</p>";
- $output .= "<pre>
- if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
- // 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;
- }
-</pre>";
- $output .= "<p>This second half of the <i>_auth</i> function examines the <i>\$response</i> 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.</p>";
- $output .= "<pre>function blogger_page() {
-
- print theme(&quot;header&quot;);
- print theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
- print theme(&quot;footer&quot;);
-}</pre>";
- $output .= "<p>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 <i>blogger</i>.</p>";
- $output .= "<pre><code>function blogger_help(\$section) {
- \$output = &quot;&quot;;
-
- switch (\$section) {
- case 'user/help':
- \$site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);<br />
- \$output .= &quot;&lt;p&gt;You may login to %site using a &lt;b&gt;Blogger ID&lt;/b&gt; and password. &quot;;
- \$output .= &quot;A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;. &quot;;
- \$output .= &quot;So a valid blogger ID is &lt;i&gt;mwlily&lt;/i&gt;@&lt;b&gt;blogger.com&lt;/b&gt;. If you are a Blogger member, go ahead and login now.&lt;/p&gt;&quot;;
- \$output .= &quot;&lt;p&gt;Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. &quot;;
- \$output .= &quot;Blogger will publish to your current web site or help you create one. &quot;;
- \$output .= &quot;&lt;a href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
- \$output = t(\$output, array(\"%site\" =&gt; \"&lt;i&gt;\$site&lt;/i&gt;\"));
- }
-
- return output;
-}</code></pre>";
- $output .= "<p>The <i>_help</i> 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.</p>";
- $output .= "<h4>Publishing your module</h4><p>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 <a href=\"%contrib-cvs\">Drupal contributions CVS repository</a>. You'll need to request priveleges to this repository - see <a href=\"%cvs\">the CVS README file</a> for the details. Then you should announce your contribution on the <a href=\"%drupal-lists\">drupal-devel and drupal-support mailing lists</a>. You might also want to post a story on <a href=\"%drupal-org\">Drupal.org</a>.</p>";
- // end of user_help_devel_da
-
- // start of user_help_devel_userhook
- $output .= "<h3><a id=\"userhook\">module_user()</a></h3><p>The <strong>_user()</strong> hook provides a mechanism for inserting text and form fields into the <a href=\"%registration\">registration</a>, <a href=\"%user-acct\">user account view/edit</a>, and <a href=\"%user-admin\">administer &raquo; accounts</a> pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the <a href=\"%profile-module\">profile module</a>. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>";
-
- $output .= "<p>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 <i>julia.module</i>. That file does the following:<ul>";
- $output .= "<li>new members must agree to Julia's Privacy Policy on the reg page.</li>";
- $output .= "<li>members may list their favorite ingredients on their public user profile page</li>";
- $output .= "</ul></p>";
- $output .= "<p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>";
-
- $output .= "<pre>
-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 <i>Julia's Kitchen</i> 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(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
+ // \$client->setDebug(1);
+ \$result = \$client-&gt;send(\$message, 5);
+ // Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // 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\"]));
- }
- }
-</pre>";
- // 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&amp;cvsroot=contrib&amp;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"));
+ }</pre>
+ <p>The <i>_auth</i> 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:</p>
+ <table border=\"0\" cellspacing=\"4\" cellpadding=\"4\" style=\"margin: auto; width: 80%;\"><tr><th colspan=\"2\" style=\"text-align: left;\">_auth function parameters</th></tr><tr><th>\$name</th><td>The substring before the final <i>'@'</i> character in the username field</td></tr><tr><th>\$pass</th><td>The whole string submitted by the user in the password field</td></tr><tr><th>\$server</th><td>The substring after the final <i>'@'</i> symbol in the username field</td></tr></table>
+ <p>So now lets use that \$name, \$pass, and \$server which was passed to our <i>_auth</i> function. Blogger authenticates users via <a href=\"%xml\">XML-RPC</a>. Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just <strong>trusts</strong> the module.</p>
+ <p>The lines above illustrate a typical <a href=\"%xml\">XML-RPC</a> method call. Here we build up a message and send it to Blogger, storing the response in a variable called <i>\$response</i>. The message we pass conforms to the published <a href=\"%blogger-api\">Blogger XML-RPC Application Programmers Interface (API)</a>. 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 <i>plant.blogger.com</i>, so we hard-code that value into the <i>xmlrpc_client()</i> function. A more typical example might be the jabber module, which uses the <i>\$server</i> parameter to determine where to send the authentication request. Also of note is the '5'th parameter in the <i>\$client-&gt;send()</i> 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.</p>
+ <pre>
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // 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;
+ }
+ </pre>
+ <p>This second half of the <i>_auth</i> function examines the <i>\$response</i> 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.</p>
+ <pre>function blogger_page() {
+ print theme(&quot;header&quot;);
+ print theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
+ print theme(&quot;footer&quot;);
+ }</pre>
+ <p>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 <i>blogger</i>.</p>
+ <pre><code>function blogger_help(\$section) {
+ \$output = &quot;&quot;;
+
+ switch (\$section) {
+ case 'user/help':
+ \$site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);<br />
+ \$output .= &quot;&lt;p&gt;You may login to %site using a &lt;b&gt;Blogger ID&lt;/b&gt; and password. &quot;;
+ \$output .= &quot;A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;. &quot;;
+ \$output .= &quot;So a valid blogger ID is &lt;i&gt;mwlily&lt;/i&gt;@&lt;b&gt;blogger.com&lt;/b&gt;. If you are a Blogger member, go ahead and login now.&lt;/p&gt;&quot;;
+ \$output .= &quot;&lt;p&gt;Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes. &quot;;
+ \$output .= &quot;Blogger will publish to your current web site or help you create one. &quot;;
+ \$output .= &quot;&lt;a href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
+ \$output = t(\$output, array(\"%site\" =&gt; \"&lt;i&gt;\$site&lt;/i&gt;\"));
+ }
+
+ return output;
+ }</code></pre>
+ <p>The <i>_help</i> 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.</p>
+ <h4>Publishing your module</h4>
+ <p>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 <a href=\"%contrib-cvs\">Drupal contributions CVS repository</a>. You'll need to request priveleges to this repository - see <a href=\"%cvs\">the CVS README file</a> for the details. Then you should announce your contribution on the <a href=\"%drupal-lists\">drupal-devel and drupal-support mailing lists</a>. You might also want to post a story on <a href=\"%drupal-org\">Drupal.org</a>.</p>
+
+ <h3><a id=\"userhook\">module_user()</a></h3>
+ <p>The <strong>_user()</strong> hook provides a mechanism for inserting text and form fields into the <a href=\"%registration\">registration</a>, <a href=\"%user-acct\">user account view/edit</a>, and <a href=\"%user-admin\">administer &raquo; accounts</a> pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the <a href=\"%profile-module\">profile module</a>. The profile module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>
+
+ <p>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 <i>julia.module</i>. That file does the following:<ul>
+ <li>new members must agree to Julia's Privacy Policy on the reg page.</li>
+ <li>members may list their favorite ingredients on their public user profile page</li>
+ </ul></p>
+ <p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>
+
+ <pre>
+ 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 <i>Julia's Kitchen</i> 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\"]));
+ }
+ }
+ </pre>", 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&amp;cvsroot=contrib&amp;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 ab51af984..0ba8a131a 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 .= "<p>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 <a href=\"%watchdog\">check the watchdog report</a> on a regular basis as it is often the only way to tell what is going on.</p>";
- $output .= "<p>To ease administration, the watchdog will automatically discard old log entries, <a href=\"%log-entry\">as configured</a>. Needs \"cron.php\" to discard the entries.</p>";
- $output = t($output, array("%watchdog" => url("admin/watchdog"), "%log-entry" => url("admin/system/modules/watchdog")));
+ $output .= t("
+ <p>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 <a href=\"%watchdog\">check the watchdog report</a> on a regular basis as it is often the only way to tell what is going on.</p>
+ <p>To ease administration, the watchdog will automatically discard old log entries, <a href=\"%log-entry\">as configured</a>. Needs \"cron.php\" to discard the entries.</p>", 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 ab51af984..0ba8a131a 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 .= "<p>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 <a href=\"%watchdog\">check the watchdog report</a> on a regular basis as it is often the only way to tell what is going on.</p>";
- $output .= "<p>To ease administration, the watchdog will automatically discard old log entries, <a href=\"%log-entry\">as configured</a>. Needs \"cron.php\" to discard the entries.</p>";
- $output = t($output, array("%watchdog" => url("admin/watchdog"), "%log-entry" => url("admin/system/modules/watchdog")));
+ $output .= t("
+ <p>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 <a href=\"%watchdog\">check the watchdog report</a> on a regular basis as it is often the only way to tell what is going on.</p>
+ <p>To ease administration, the watchdog will automatically discard old log entries, <a href=\"%log-entry\">as configured</a>. Needs \"cron.php\" to discard the entries.</p>", 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.");