o Permission improvements:
+ Removed the "post content" permission and replaced it by more fine-grained permissions such as "maintain static pages", "maintain personal blog", "maintain stories", etc. o Usability improvements to teasers: + Teaser forms are no more. Teasers are extracted automatically but can also be instructed using a delimiter "---". Furthermore, when a post it too short for a teaser, the user won't be bother with teaser stuff anymore. + Added an option to set the teaser length, or to disable teasers all together. + When previewing a post, both the short (if any) and the full version of a post are shown. This addresses a common complaint; for example, when writing a book page there was no way you could preview the short version of your post. + Forum posts can be teasered now. This is particularly helpful in the context of drupal.org where we promote forum topics. o Bugfix: replaced all PHP short tags (<?) with long tags (<?php). o Bugfix: removed hard-coded dependence on comment module. o Bugfix: when the queue module was disabled, it was not possible to approve updated book pages. o Bugfix: applied modified version of Marco's node_teaser() fix.4.2.x
parent
eceead1819
commit
7ce686c152
14
CHANGELOG
14
CHANGELOG
|
@ -1,4 +1,13 @@
|
|||
Drupal x.x.x, 2002-xx-xx
|
||||
Drupal x.x.x, xxxx-xx-xx (to be released)
|
||||
------------------------
|
||||
|
||||
- node system improvements:
|
||||
* replaced the "post content" permission by more fine-grained permissions.
|
||||
* improved content submission:
|
||||
+ improved teasers: teasers are now optional, teaser length can be configured, teaser and body are edited in a single textarea, users will no longer be bother with teasers when the post is too short for a teaser.
|
||||
+ added the ability to preview both the short and the full version of your posts.
|
||||
|
||||
Drupal 4.1.0, xxxx-xx-xx (to be released)
|
||||
------------------------
|
||||
|
||||
- collaboratively revised and expanded the Drupal documentation.
|
||||
|
@ -21,6 +30,7 @@ Drupal x.x.x, 2002-xx-xx
|
|||
- replaced weblogs.module by ping.module:
|
||||
* added support for normal and RSS notifications of http://blo.gs/.
|
||||
* added support for RSS ping-notifications of http://weblogs.com/.
|
||||
- removed the rating module
|
||||
- themes:
|
||||
* removed a significant portion of hard-coded mark-up.
|
||||
|
||||
|
@ -53,7 +63,7 @@ Drupal 4.0.0, 2002-06-15
|
|||
* blocks can now be enabled and/or be set by the user.
|
||||
* blocks can be set to only show up on some pages.
|
||||
* merged box module with block module.
|
||||
- rewrote large parts of the node system:
|
||||
- node system improvements:
|
||||
* fixed node retrieval based on titles.
|
||||
* blogs can be updated.
|
||||
* teasers (abstracts) on all node types.
|
||||
|
|
|
@ -57,7 +57,7 @@ function import_update() {
|
|||
function import_format_item($item, $feed = 0) {
|
||||
global $theme, $user;
|
||||
|
||||
if ($user->uid && user_access("post content")) {
|
||||
if ($user->uid && user_access("maintain personal blog")) {
|
||||
$output .= lm("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@ function import_page_last() {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
|
||||
|
@ -604,7 +604,7 @@ function import_page_feed($fid) {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
|
||||
|
@ -641,7 +641,7 @@ function import_page_bundle($bid) {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
|
||||
|
|
|
@ -57,7 +57,7 @@ function import_update() {
|
|||
function import_format_item($item, $feed = 0) {
|
||||
global $theme, $user;
|
||||
|
||||
if ($user->uid && user_access("post content")) {
|
||||
if ($user->uid && user_access("maintain personal blog")) {
|
||||
$output .= lm("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@ function import_page_last() {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
|
||||
|
@ -604,7 +604,7 @@ function import_page_feed($fid) {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
|
||||
|
@ -641,7 +641,7 @@ function import_page_bundle($bid) {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
|
||||
|
|
|
@ -22,6 +22,10 @@ function blog_node($field) {
|
|||
return $info[$field];
|
||||
}
|
||||
|
||||
function blog_perm() {
|
||||
return array("maintain personal blog");
|
||||
}
|
||||
|
||||
function blog_access($op, $node) {
|
||||
global $user;
|
||||
|
||||
|
@ -30,15 +34,15 @@ function blog_access($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return $user->uid;
|
||||
return user_access("maintain personal blog") && $user->uid;
|
||||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return ($user->uid == $node->uid);
|
||||
return user_access("maintain personal blog") && ($user->uid == $node->uid);
|
||||
}
|
||||
|
||||
if ($op == "delete") {
|
||||
return ($user->uid == $node->uid);
|
||||
return user_access("maintain personal blog") && ($user->uid == $node->uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,10 +72,15 @@ function blog_save($op, $node) {
|
|||
|
||||
if ($op == "create") {
|
||||
if (user_access("administer nodes")) {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
/*
|
||||
** When an administrator creates blog entries through the admin
|
||||
** pages, they will not be changed unless explicitly specified.
|
||||
*/
|
||||
|
||||
return array();
|
||||
}
|
||||
else {
|
||||
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
|
||||
return array("promote" => 0, "moderate" => 1, "status" => 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +95,7 @@ function blog_save($op, $node) {
|
|||
** pages, they will not be changed unless explicitly specified.
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
return array();
|
||||
}
|
||||
else {
|
||||
/*
|
||||
|
@ -94,7 +103,7 @@ function blog_save($op, $node) {
|
|||
** and will queue it in the moderation queue for promotion.
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "score" => 0, "teaser" => filter($node->teaser), "votes" => 0, "users" => 0);
|
||||
return array("promote" => 0, "moderate" => 1, "score" => 0, "votes" => 0, "users" => 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,10 +214,6 @@ function blog_form(&$node, &$help, &$error) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("blog", $node));
|
||||
}
|
||||
|
@ -260,11 +265,11 @@ function blog_link($type, $node = 0, $main) {
|
|||
$links[] = lm(t("user blogs"), array("mod" => "blog"), "", array("title" => t("Read the latest blog entries.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("create blog entry"), array("mod" => "node", "op" => "add", "type" => "blog"), "", array("title" => t("Add a new personal blog entry.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.view" && user_access("access content")) {
|
||||
if ($type == "menu.view" && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("view personal blog"), array("mod" => "blog", "op" => "view", "id" => $user->uid), "", array("title" => t("Read your latest blog entries.")));
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@ function blog_node($field) {
|
|||
return $info[$field];
|
||||
}
|
||||
|
||||
function blog_perm() {
|
||||
return array("maintain personal blog");
|
||||
}
|
||||
|
||||
function blog_access($op, $node) {
|
||||
global $user;
|
||||
|
||||
|
@ -30,15 +34,15 @@ function blog_access($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return $user->uid;
|
||||
return user_access("maintain personal blog") && $user->uid;
|
||||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return ($user->uid == $node->uid);
|
||||
return user_access("maintain personal blog") && ($user->uid == $node->uid);
|
||||
}
|
||||
|
||||
if ($op == "delete") {
|
||||
return ($user->uid == $node->uid);
|
||||
return user_access("maintain personal blog") && ($user->uid == $node->uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,10 +72,15 @@ function blog_save($op, $node) {
|
|||
|
||||
if ($op == "create") {
|
||||
if (user_access("administer nodes")) {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
/*
|
||||
** When an administrator creates blog entries through the admin
|
||||
** pages, they will not be changed unless explicitly specified.
|
||||
*/
|
||||
|
||||
return array();
|
||||
}
|
||||
else {
|
||||
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
|
||||
return array("promote" => 0, "moderate" => 1, "status" => 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +95,7 @@ function blog_save($op, $node) {
|
|||
** pages, they will not be changed unless explicitly specified.
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
return array();
|
||||
}
|
||||
else {
|
||||
/*
|
||||
|
@ -94,7 +103,7 @@ function blog_save($op, $node) {
|
|||
** and will queue it in the moderation queue for promotion.
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "score" => 0, "teaser" => filter($node->teaser), "votes" => 0, "users" => 0);
|
||||
return array("promote" => 0, "moderate" => 1, "score" => 0, "votes" => 0, "users" => 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,10 +214,6 @@ function blog_form(&$node, &$help, &$error) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("blog", $node));
|
||||
}
|
||||
|
@ -260,11 +265,11 @@ function blog_link($type, $node = 0, $main) {
|
|||
$links[] = lm(t("user blogs"), array("mod" => "blog"), "", array("title" => t("Read the latest blog entries.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("create blog entry"), array("mod" => "node", "op" => "add", "type" => "blog"), "", array("title" => t("Add a new personal blog entry.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.view" && user_access("access content")) {
|
||||
if ($type == "menu.view" && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("view personal blog"), array("mod" => "blog", "op" => "view", "id" => $user->uid), "", array("title" => t("Read your latest blog entries.")));
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,6 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
|
|||
}
|
||||
|
||||
if ($user->uid && user_access("access Blogger API")) {
|
||||
if (user_access("post content")) {
|
||||
|
||||
/*
|
||||
** Check for title tags, if not generate one.
|
||||
|
@ -170,20 +169,18 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
|
|||
$title = bloggerapi_title($cparams[4]);
|
||||
}
|
||||
|
||||
$teaser = node_teaser($cparams[4]);
|
||||
|
||||
/*
|
||||
** Maps params to node array or call another function
|
||||
*/
|
||||
|
||||
switch ($method) {
|
||||
case "newPost":
|
||||
return array("type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
|
||||
return array("type" => "blog", "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
|
||||
break;
|
||||
case "editPost":
|
||||
$node = node_load(array("nid" => $cparams[1]));
|
||||
if ($node->uid == $user->uid) {
|
||||
return array("nid" => $cparams[1], "type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
|
||||
return array("nid" => $cparams[1], "type" => "blog", "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
|
||||
}
|
||||
else {
|
||||
return bloggerapi_error("Error updating node");
|
||||
|
@ -211,7 +208,7 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
else {
|
||||
return bloggerapi_error("Error in the authentication process");
|
||||
}
|
||||
}
|
||||
|
@ -381,7 +378,7 @@ function bloggerapi_help() {
|
|||
<h3>Introduction</h3>
|
||||
|
||||
<p><a href="http://www.blogger.com">Blogger</a>, the well-known public weblog service, provides an application programing interface (API) to allow remote procedure calls (RPC) to the Blogger service. Drupal supports this <a href="http://plant.blogger.com/api/index.html">Blogger API</a>, which means that many remote clients (e.g. <a href="radio.userland.com">Radio</a>, <a href="http://simon.kittle.info/textrouter">TextRouter</a>, <a href="http://blogbuddy.sourceforge.net/">Blogbuddy</a>, <a href="http://www.wbloggar.com/">w.bloggar</a>, <a href="http://www.tswoam.co.uk/index.php?n_go=16">PerlyBlog</a>), may post to Drupal. These clients provide a bevy of interesting capabilities like offline composing, spellcheck, and WYSIWYG editing; many folks prefer to blog with a client application over typical web forms. By supporting the Blogger API, Drupal grows grander than a web site engine, it's a <i>content accepting machine</i>™.
|
||||
<p>The <a href="http://plant.blogger.com/api/index.html">Blogger RPC API</a> uses the <a href="http://www.xmlrpc.com">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href="http://www.userland.com">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href="http://www.weblogs.com">weblogs.com</a> of blog updates and making/accepting <? echo lm("Distributed Authentication", array("mod" => "user", "op" => "help")) ?> requests)</p>
|
||||
<p>The <a href="http://plant.blogger.com/api/index.html">Blogger RPC API</a> uses the <a href="http://www.xmlrpc.com">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href="http://www.userland.com">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href="http://www.weblogs.com">weblogs.com</a> of blog updates and making/accepting <?php echo lm("Distributed Authentication", array("mod" => "user", "op" => "help")) ?> requests)</p>
|
||||
|
||||
<h3>Blogger API implementation</h3>
|
||||
|
||||
|
@ -404,7 +401,7 @@ function bloggerapi_help() {
|
|||
|
||||
<h3>Installation and usage</h3>
|
||||
|
||||
<p>To install the Blogger API module, enable the module in the <i>site configuration - modules</i> tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the <i>user management</i> tab in the administration menu. Check the checkbox behind the line "access Blogger API" for the roles that are allowed to use the Blogger API. Make sure those roles have the right to "post content" as well.</p>
|
||||
<p>To install the Blogger API module, enable the module in the <i>site configuration - modules</i> tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the <i>user management</i> tab in the administration menu. Check the checkbox behind the line "access Blogger API" for the roles that are allowed to use the Blogger API.</p>
|
||||
<p>Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.</p>
|
||||
|
||||
<h3>Setup of the client</h3>
|
||||
|
|
|
@ -15,6 +15,10 @@ function book_node($field) {
|
|||
return $info[$field];
|
||||
}
|
||||
|
||||
function book_perm() {
|
||||
return array("maintain books");
|
||||
}
|
||||
|
||||
function book_access($op, $node) {
|
||||
global $user;
|
||||
|
||||
|
@ -35,7 +39,7 @@ function book_access($op, $node) {
|
|||
** of the book module this is considered to be a good/safe idea.
|
||||
*/
|
||||
|
||||
return $user->uid;
|
||||
return user_access("maintain books");
|
||||
}
|
||||
|
||||
if ($op == "update") {
|
||||
|
@ -49,7 +53,7 @@ function book_access($op, $node) {
|
|||
** are allowed.
|
||||
*/
|
||||
|
||||
return $user->uid && !$node->moderate && !$node->format && $node->revision;
|
||||
return user_access("maintain books") && !$node->moderate && !$node->format && $node->revision;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,10 +66,10 @@ function book_save($op, $node) {
|
|||
|
||||
if ($op == "create") {
|
||||
if (user_access("administer nodes")) {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "parent", "weight", "log");
|
||||
return array("teaser" => $node->body, "format", "parent", "weight", "log");
|
||||
}
|
||||
else {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight", "log");
|
||||
return array("teaser" => $node->body, "format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight", "log");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +84,7 @@ function book_save($op, $node) {
|
|||
** new revision unless we are explicitly instructed to.
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "parent", "weight", "log");
|
||||
return array("teaser" => $node->body, "format", "parent", "weight", "log");
|
||||
}
|
||||
else {
|
||||
/*
|
||||
|
@ -89,7 +93,7 @@ function book_save($op, $node) {
|
|||
** and are not promoted by default. See also: book_load().
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight", "log");
|
||||
return array("teaser" => $node->body, "created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight", "log");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,11 +104,11 @@ function book_link($type, $node = 0, $main = 0) {
|
|||
$links[] = lm(t("collaborative book"), array("mod" => "book"), "", array("title" => t("Read and contribute to the collaborative books.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("maintain books")) {
|
||||
$links[] = lm(t("create book page"), array("mod" => "node", "op" => "add", "type" => "book"), "", array("title" => t("Add a new book page.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer nodes")) {
|
||||
if ($type == "admin" && user_access("maintain books")) {
|
||||
$links[] = la(t("collaborative book"), array("mod" => "book"));
|
||||
}
|
||||
|
||||
|
@ -191,11 +195,6 @@ function book_form(&$node, &$help, &$error) {
|
|||
$node->body = addslashes($node->body);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("book", $node));
|
||||
|
@ -763,11 +762,11 @@ function book_help() {
|
|||
|
||||
<p>Book pages are a special, powerful node type. These nodes are specifically designed to be included in a book. Their special power comes from the bilility 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 usually stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that become desirable.</p>
|
||||
|
||||
<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <? echo la("permissions", array("mod" => "user", "op" => "permission")) ?> 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><root></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 <i>create book page</i> link.</p>
|
||||
<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <?php echo la("permissions", array("mod" => "user", "op" => "permission")) ?> 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><root></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 <i>create book page</i> link.</p>
|
||||
|
||||
<p>Administrators may review the hierarchy of their books by clicking on the <? echo la("collaborative book link", array("mod" => "book")) ?> 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, he may leave behind child nodes.
|
||||
These nodes are now <i>orphans</i>. Administrators should periodically <? echo la("review their books for orphans", array("mod" => "book", "op" => "orphan")) ?> and reaffiliate those pages as desired. Finally, administrators may also
|
||||
<? echo la("export their books", array("mod" => "book", "op" => "print")) ?> to a single, flat HTML page which is suitable for printing.</p>
|
||||
<p>Administrators may review the hierarchy of their books by clicking on the <?php echo la("collaborative book link", array("mod" => "book")) ?> 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, he may leave behind child nodes.
|
||||
These nodes are now <i>orphans</i>. Administrators should periodically <?php echo la("review their books for orphans", array("mod" => "book", "op" => "orphan")) ?> and reaffiliate those pages as desired. Finally, administrators may also
|
||||
<?php echo la("export their books", array("mod" => "book", "op" => "print")) ?> to a single, flat HTML page which is suitable for printing.</p>
|
||||
|
||||
<a name="faq"></a><h3>Maintain a FAQ using a collaborative book</i></h3>
|
||||
|
||||
|
@ -782,7 +781,7 @@ These nodes are now <i>orphans</i>. Administrators should periodically <? echo l
|
|||
<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. And remember that all future comments and edits will automatically be reflected in your book.</li>
|
||||
<li>You may wish to edit the title and teaser 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 help users navigate quickly to the information that they seek.</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 <i>Create book page</i> link.</li>
|
||||
<li>If you don't see the <i>administer</i> link, then you probably have insufficient <? echo la("permissions", array("mod" => "user", "op" => "permission")) ?>.</li>
|
||||
<li>If you don't see the <i>administer</i> link, then you probably have insufficient <?php echo la("permissions", array("mod" => "user", "op" => "permission")) ?>.</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>
|
||||
<?php
|
||||
|
|
|
@ -15,6 +15,10 @@ function book_node($field) {
|
|||
return $info[$field];
|
||||
}
|
||||
|
||||
function book_perm() {
|
||||
return array("maintain books");
|
||||
}
|
||||
|
||||
function book_access($op, $node) {
|
||||
global $user;
|
||||
|
||||
|
@ -35,7 +39,7 @@ function book_access($op, $node) {
|
|||
** of the book module this is considered to be a good/safe idea.
|
||||
*/
|
||||
|
||||
return $user->uid;
|
||||
return user_access("maintain books");
|
||||
}
|
||||
|
||||
if ($op == "update") {
|
||||
|
@ -49,7 +53,7 @@ function book_access($op, $node) {
|
|||
** are allowed.
|
||||
*/
|
||||
|
||||
return $user->uid && !$node->moderate && !$node->format && $node->revision;
|
||||
return user_access("maintain books") && !$node->moderate && !$node->format && $node->revision;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,10 +66,10 @@ function book_save($op, $node) {
|
|||
|
||||
if ($op == "create") {
|
||||
if (user_access("administer nodes")) {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "parent", "weight", "log");
|
||||
return array("teaser" => $node->body, "format", "parent", "weight", "log");
|
||||
}
|
||||
else {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight", "log");
|
||||
return array("teaser" => $node->body, "format", "moderate" => 1, "parent", "promote" => 0, "status" => 1, "weight", "log");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +84,7 @@ function book_save($op, $node) {
|
|||
** new revision unless we are explicitly instructed to.
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "parent", "weight", "log");
|
||||
return array("teaser" => $node->body, "format", "parent", "weight", "log");
|
||||
}
|
||||
else {
|
||||
/*
|
||||
|
@ -89,7 +93,7 @@ function book_save($op, $node) {
|
|||
** and are not promoted by default. See also: book_load().
|
||||
*/
|
||||
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight", "log");
|
||||
return array("teaser" => $node->body, "created" => time(), "format", "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight", "log");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,11 +104,11 @@ function book_link($type, $node = 0, $main = 0) {
|
|||
$links[] = lm(t("collaborative book"), array("mod" => "book"), "", array("title" => t("Read and contribute to the collaborative books.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("maintain books")) {
|
||||
$links[] = lm(t("create book page"), array("mod" => "node", "op" => "add", "type" => "book"), "", array("title" => t("Add a new book page.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer nodes")) {
|
||||
if ($type == "admin" && user_access("maintain books")) {
|
||||
$links[] = la(t("collaborative book"), array("mod" => "book"));
|
||||
}
|
||||
|
||||
|
@ -191,11 +195,6 @@ function book_form(&$node, &$help, &$error) {
|
|||
$node->body = addslashes($node->body);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("book", $node));
|
||||
|
@ -763,11 +762,11 @@ function book_help() {
|
|||
|
||||
<p>Book pages are a special, powerful node type. These nodes are specifically designed to be included in a book. Their special power comes from the bilility 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 usually stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that become desirable.</p>
|
||||
|
||||
<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <? echo la("permissions", array("mod" => "user", "op" => "permission")) ?> 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><root></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 <i>create book page</i> link.</p>
|
||||
<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <?php echo la("permissions", array("mod" => "user", "op" => "permission")) ?> 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><root></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 <i>create book page</i> link.</p>
|
||||
|
||||
<p>Administrators may review the hierarchy of their books by clicking on the <? echo la("collaborative book link", array("mod" => "book")) ?> 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, he may leave behind child nodes.
|
||||
These nodes are now <i>orphans</i>. Administrators should periodically <? echo la("review their books for orphans", array("mod" => "book", "op" => "orphan")) ?> and reaffiliate those pages as desired. Finally, administrators may also
|
||||
<? echo la("export their books", array("mod" => "book", "op" => "print")) ?> to a single, flat HTML page which is suitable for printing.</p>
|
||||
<p>Administrators may review the hierarchy of their books by clicking on the <?php echo la("collaborative book link", array("mod" => "book")) ?> 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, he may leave behind child nodes.
|
||||
These nodes are now <i>orphans</i>. Administrators should periodically <?php echo la("review their books for orphans", array("mod" => "book", "op" => "orphan")) ?> and reaffiliate those pages as desired. Finally, administrators may also
|
||||
<?php echo la("export their books", array("mod" => "book", "op" => "print")) ?> to a single, flat HTML page which is suitable for printing.</p>
|
||||
|
||||
<a name="faq"></a><h3>Maintain a FAQ using a collaborative book</i></h3>
|
||||
|
||||
|
@ -782,7 +781,7 @@ These nodes are now <i>orphans</i>. Administrators should periodically <? echo l
|
|||
<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. And remember that all future comments and edits will automatically be reflected in your book.</li>
|
||||
<li>You may wish to edit the title and teaser 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 help users navigate quickly to the information that they seek.</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 <i>Create book page</i> link.</li>
|
||||
<li>If you don't see the <i>administer</i> link, then you probably have insufficient <? echo la("permissions", array("mod" => "user", "op" => "permission")) ?>.</li>
|
||||
<li>If you don't see the <i>administer</i> link, then you probably have insufficient <?php echo la("permissions", array("mod" => "user", "op" => "permission")) ?>.</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>
|
||||
<?php
|
||||
|
|
|
@ -18,12 +18,12 @@ function forum_access($op, $node) {
|
|||
return $node->status;
|
||||
}
|
||||
if ($op == "create") {
|
||||
return user_access("post content");
|
||||
return user_access("create forum topics");
|
||||
}
|
||||
}
|
||||
|
||||
function forum_perm() {
|
||||
return array("post forum topics without approval");
|
||||
return array("create forum topics");
|
||||
}
|
||||
|
||||
function forum_conf_options() {
|
||||
|
@ -53,11 +53,7 @@ function forum_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
if (user_access("post forum topics without approval")) {
|
||||
$moderation = array("body" => filter($node->body), "moderate" => 0, "status" => 1);
|
||||
} else {
|
||||
$moderation = array("body" => filter($node->body), "moderate" => 1, "status" => 0);
|
||||
}
|
||||
return array_merge($moderation, array("tid", "icon_num", "shadow"));
|
||||
}
|
||||
|
||||
|
@ -120,11 +116,6 @@ function forum_link($type, $node = 0, $main = 0) {
|
|||
$links[] = lm(t("forum"), array("mod" => "forum"));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
// I had complains that having this link leads people not to choose a forum, and always post in the first forum.
|
||||
#$links[] = lm(t("create forum topic"), array("mod" => "node", "op" => "add", "type" => "forum"), "", array("title" => t("Start a new forum topic.")));
|
||||
}
|
||||
|
||||
if (!$main && $type == "node" && $node->type == "forum") {
|
||||
// get previous and next topic
|
||||
|
||||
|
@ -650,8 +641,8 @@ function forum_topic_list($topics, $num_topics, $sortby, $forum_per_page, $offse
|
|||
$output .= "<td width=\"33%\"> </td>";
|
||||
}
|
||||
|
||||
if (user_access("post content")) {
|
||||
$output .= "<td width=\"33%\"><div align=\"center\" style=\"font-style: bold;\">". lm(t("start new topic"), array("mod" => "node", "op" => "add", "type" => "forum", "tid" => $tid)) ."</div></td>";
|
||||
if (user_access("create forum topics")) {
|
||||
$output .= "<td width=\"33%\"><div align=\"center\" style=\"font-style: bold;\">". lm(t("create new forum topic"), array("mod" => "node", "op" => "add", "type" => "forum", "tid" => $tid)) ."</div></td>";
|
||||
}
|
||||
|
||||
if (count($topics) >= $forum_per_page) {
|
||||
|
|
|
@ -18,12 +18,12 @@ function forum_access($op, $node) {
|
|||
return $node->status;
|
||||
}
|
||||
if ($op == "create") {
|
||||
return user_access("post content");
|
||||
return user_access("create forum topics");
|
||||
}
|
||||
}
|
||||
|
||||
function forum_perm() {
|
||||
return array("post forum topics without approval");
|
||||
return array("create forum topics");
|
||||
}
|
||||
|
||||
function forum_conf_options() {
|
||||
|
@ -53,11 +53,7 @@ function forum_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
if (user_access("post forum topics without approval")) {
|
||||
$moderation = array("body" => filter($node->body), "moderate" => 0, "status" => 1);
|
||||
} else {
|
||||
$moderation = array("body" => filter($node->body), "moderate" => 1, "status" => 0);
|
||||
}
|
||||
return array_merge($moderation, array("tid", "icon_num", "shadow"));
|
||||
}
|
||||
|
||||
|
@ -120,11 +116,6 @@ function forum_link($type, $node = 0, $main = 0) {
|
|||
$links[] = lm(t("forum"), array("mod" => "forum"));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
// I had complains that having this link leads people not to choose a forum, and always post in the first forum.
|
||||
#$links[] = lm(t("create forum topic"), array("mod" => "node", "op" => "add", "type" => "forum"), "", array("title" => t("Start a new forum topic.")));
|
||||
}
|
||||
|
||||
if (!$main && $type == "node" && $node->type == "forum") {
|
||||
// get previous and next topic
|
||||
|
||||
|
@ -650,8 +641,8 @@ function forum_topic_list($topics, $num_topics, $sortby, $forum_per_page, $offse
|
|||
$output .= "<td width=\"33%\"> </td>";
|
||||
}
|
||||
|
||||
if (user_access("post content")) {
|
||||
$output .= "<td width=\"33%\"><div align=\"center\" style=\"font-style: bold;\">". lm(t("start new topic"), array("mod" => "node", "op" => "add", "type" => "forum", "tid" => $tid)) ."</div></td>";
|
||||
if (user_access("create forum topics")) {
|
||||
$output .= "<td width=\"33%\"><div align=\"center\" style=\"font-style: bold;\">". lm(t("create new forum topic"), array("mod" => "node", "op" => "add", "type" => "forum", "tid" => $tid)) ."</div></td>";
|
||||
}
|
||||
|
||||
if (count($topics) >= $forum_per_page) {
|
||||
|
|
|
@ -57,7 +57,7 @@ function import_update() {
|
|||
function import_format_item($item, $feed = 0) {
|
||||
global $theme, $user;
|
||||
|
||||
if ($user->uid && user_access("post content")) {
|
||||
if ($user->uid && user_access("maintain personal blog")) {
|
||||
$output .= lm("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@ function import_page_last() {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
|
||||
|
@ -604,7 +604,7 @@ function import_page_feed($fid) {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
|
||||
|
@ -641,7 +641,7 @@ function import_page_bundle($bid) {
|
|||
|
||||
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
|
||||
while ($item = db_fetch_object($result)) {
|
||||
if (module_exist("blog") && user_access("post content")) {
|
||||
if (module_exist("blog") && user_access("maintain personal blog")) {
|
||||
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
|
||||
}
|
||||
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
|
||||
|
|
|
@ -28,7 +28,7 @@ function node_title_list($result, $title = NULL) {
|
|||
}
|
||||
|
||||
while ($node = db_fetch_object($result)) {
|
||||
$number = comment_num_all($node->nid);
|
||||
$number = module_invoke("comment", "num_all", $node->nid);
|
||||
$name = strip_tags(format_name($node)); // required for anonymous users to work
|
||||
$items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => t("Author: %name, comments: %number", array("%name" => $name, "%number" => $number))));
|
||||
}
|
||||
|
@ -38,7 +38,16 @@ function node_title_list($result, $title = NULL) {
|
|||
|
||||
function node_teaser($body) {
|
||||
|
||||
$size = 400;
|
||||
$size = variable_get("teaser_length", 600);
|
||||
|
||||
/*
|
||||
** If the size is zero, teasers are disabled so we
|
||||
** return the entire body.
|
||||
*/
|
||||
|
||||
if ($size == 0) {
|
||||
return $body;
|
||||
}
|
||||
|
||||
/*
|
||||
** If we have a short body, return the entire body:
|
||||
|
@ -49,19 +58,59 @@ function node_teaser($body) {
|
|||
}
|
||||
|
||||
/*
|
||||
** If we have a long body, try not to split paragraphs:
|
||||
** If a valid delimiter has been specified, use it to
|
||||
** chop of the teaser.
|
||||
*/
|
||||
|
||||
$delimiter = strpos($body, "---");
|
||||
if ($delimiter > 100 && $delimiter < $size) {
|
||||
return substr($body, 0, $delimiter);
|
||||
}
|
||||
|
||||
/*
|
||||
** In some cases no delimiter has been specified (eg.
|
||||
** when posting using the Blogger API) in which case
|
||||
** we try to split at paragraph boundaries.
|
||||
*/
|
||||
|
||||
if ($length = strpos($body, "\n", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "<br />", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "<br>", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "</p>", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** If we have a long body, try not to split sentences:
|
||||
** When even the first paragraph is too long, try to
|
||||
** split at the end of the next sentence.
|
||||
*/
|
||||
|
||||
return substr($body, 0, strpos($body, ". ", $size) + 1);
|
||||
if ($length = strpos($body, ". ", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "! ", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "? ", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** Nevermind, we split it the hard way ...
|
||||
*/
|
||||
|
||||
return substr($body, 0, $size);
|
||||
}
|
||||
|
||||
function node_invoke($node, $name, $arg = 0) {
|
||||
|
@ -228,6 +277,13 @@ function node_view($node, $main = 0) {
|
|||
|
||||
$node = array2object($node);
|
||||
|
||||
/*
|
||||
** Remove the delimiter (if any) that seperates the teaser from the
|
||||
** body.
|
||||
*/
|
||||
|
||||
$node->body = str_replace("---", "", $node->body);
|
||||
|
||||
/*
|
||||
** The "view" hook can be implemented to overwrite the default function
|
||||
** to display nodes.
|
||||
|
@ -251,7 +307,6 @@ function node_access($op, $node = 0) {
|
|||
if (user_access("administer nodes")) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
|
||||
/*
|
||||
** Convert the node to an object if necessary:
|
||||
|
@ -278,11 +333,10 @@ function node_access($op, $node = 0) {
|
|||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function node_perm() {
|
||||
return array("administer nodes", "access content", "post content");
|
||||
return array("administer nodes", "access content");
|
||||
}
|
||||
|
||||
function node_search($keys) {
|
||||
|
@ -312,7 +366,8 @@ function node_search($keys) {
|
|||
}
|
||||
|
||||
function node_conf_options() {
|
||||
$output .= form_select(t("Default number of nodes to display"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of nodes to display on the main page."));
|
||||
$output .= form_select(t("Number of posts on main page"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of posts to display on the main page."));
|
||||
$output .= form_select(t("Length of trimmed posts"), "teaser_length", variable_get("teaser_length", 600), array(0 => t("Unlimited"), 200 => t("200 characters"), 400 => t("400 characters"), 600 => t("600 characters"), 800 => t("800 characters"), 1000 => t("1000 characters"), 1200 => t("1200 characters"), 1400 => t("1400 characters"), 1600 => t("1600 characters"), 1800 => t("1800 characters"), 2000 => t("2000 characters")), t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'."));
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -410,7 +465,7 @@ function node_link($type, $node = 0, $main = 0) {
|
|||
$links[] = la(t("content management"), array("mod" => "node"));
|
||||
}
|
||||
|
||||
if ($type == "page" && user_access("post content")) {
|
||||
if ($type == "page") {
|
||||
$links[] = lm(t("submit"), array("mod" => "node", "op" => "add"), "", array("title" => t("Submit or suggest new content.")));
|
||||
}
|
||||
|
||||
|
@ -802,7 +857,6 @@ function node_validate($node, &$error) {
|
|||
else {
|
||||
$error["date"] = theme_invoke("theme_error", t("You have to specifiy a valid date."));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -836,14 +890,6 @@ function node_form($edit, $error = NULL) {
|
|||
$edit = node_validate($edit, $error);
|
||||
}
|
||||
|
||||
/*
|
||||
** Generate a teaser when necessary:
|
||||
*/
|
||||
|
||||
if ($edit->body && !$edit->teaser) {
|
||||
$edit->teaser = node_teaser($edit->body);
|
||||
}
|
||||
|
||||
/*
|
||||
** Get the node specific bits:
|
||||
*/
|
||||
|
@ -922,11 +968,7 @@ function node_form($edit, $error = NULL) {
|
|||
$output .= form_textfield(t("Authored by"), "name", $edit->name, 20, 60, $error["name"]);
|
||||
$output .= form_textfield(t("Authored on"), "date", $edit->date, 20, 25, $error["date"]);
|
||||
$output .= "<br />";
|
||||
$output .= form_select(t("Set public/published"), "status", $edit->status, array(t("Disabled"), t("Enabled")));
|
||||
// TODO: move this to the queue.module
|
||||
if (module_exist("queue")) {
|
||||
$output .= form_select(t("Queue for moderation"), "moderate", $edit->moderate, array(t("Disabled"), t("Enabled")));
|
||||
}
|
||||
$output .= form_select(t("Moderation status"), "moderate", $edit->moderate, array(t("Approved"), t("Awaiting approval")));
|
||||
$output .= form_select(t("Promote to front page"), "promote", $edit->promote, array(t("Disabled"), t("Enabled")));
|
||||
$output .= form_select(t("Static on front page"), "static", $edit->static, array(t("Disabled"), t("Enabled")));
|
||||
// TODO: move this to the comment.module
|
||||
|
@ -946,10 +988,6 @@ function node_form($edit, $error = NULL) {
|
|||
function node_add($type) {
|
||||
global $user, $edit;
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
/*
|
||||
** If a node type has been specified, validate it existence. If no
|
||||
** (valid) node type has been provied, display a node type overview.
|
||||
|
@ -972,7 +1010,7 @@ function node_add($type) {
|
|||
*/
|
||||
|
||||
foreach (module_list() as $name) {
|
||||
if (module_hook($name, "node") && node_access("create", array("type" => $name))) {
|
||||
if (module_hook($name, "node") && node_access("create", $name)) {
|
||||
$output .= "<li>";
|
||||
$output .= " ". lm(module_invoke($name, "node", "name"), array("mod" => "node", "op" => "add", "type" => $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>";
|
||||
|
@ -990,10 +1028,6 @@ function node_add($type) {
|
|||
function node_edit($id) {
|
||||
global $user;
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
$node = node_load(array("nid" => $id));
|
||||
|
||||
if (node_access("update", $node)) {
|
||||
|
@ -1008,10 +1042,6 @@ function node_edit($id) {
|
|||
|
||||
function node_preview($node, $error = NULL) {
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert the array to an object:
|
||||
*/
|
||||
|
@ -1048,22 +1078,38 @@ function node_preview($node, $error = NULL) {
|
|||
$node->created = time();
|
||||
}
|
||||
|
||||
/*
|
||||
** Exctract a teaser:
|
||||
*/
|
||||
|
||||
$node->teaser = node_teaser($node->body);
|
||||
|
||||
/*
|
||||
** Apply the required filters:
|
||||
*/
|
||||
|
||||
$node = object2array($node);
|
||||
if ($node->nid) {
|
||||
$view = array_merge($node, module_invoke($node->type, "save", "update", $node));
|
||||
$node = array_merge($node, module_invoke($node->type, "save", "update", $node));
|
||||
}
|
||||
else {
|
||||
$view = array_merge($node, module_invoke($node->type, "save", "create", $node));
|
||||
$node = array_merge($node, module_invoke($node->type, "save", "create", $node));
|
||||
}
|
||||
$node = array2object($node);
|
||||
|
||||
/*
|
||||
** Display a preview of the node:
|
||||
** Display a prenode of the node:
|
||||
*/
|
||||
|
||||
node_view($view);
|
||||
if ($node->teaser && $node->teaser != $node->body) {
|
||||
print "<h3>". t("Preview full version") ."</h3>";
|
||||
node_view($node, 0);
|
||||
print "<h3>". t("Preview trimmed version") ."</h3>";
|
||||
node_view($node, 1);
|
||||
print "<p><i>". t("The trimmed version of your post shows how your post would look like when promoted to the main page or when exported for syndication. You can insert a delimiter '---' (without the quotes) to fine-tune where your post gets split. However note that delimiter will be ignored when misplaced.") ."</i></p>";
|
||||
}
|
||||
else {
|
||||
node_view($node, 0);
|
||||
}
|
||||
|
||||
return node_form($node, $error);
|
||||
}
|
||||
|
@ -1071,8 +1117,6 @@ function node_preview($node, $error = NULL) {
|
|||
function node_submit($node) {
|
||||
global $user, $theme;
|
||||
|
||||
if (user_access("post content")) {
|
||||
|
||||
/*
|
||||
** Fixup the node when required:
|
||||
*/
|
||||
|
@ -1093,6 +1137,12 @@ function node_submit($node) {
|
|||
|
||||
$node = node_revision_create($node);
|
||||
|
||||
/*
|
||||
** Prepare the node's body:
|
||||
*/
|
||||
|
||||
$node->body = filter($node->body);
|
||||
|
||||
if ($node->nid) {
|
||||
|
||||
/*
|
||||
|
@ -1108,10 +1158,10 @@ function node_submit($node) {
|
|||
*/
|
||||
|
||||
if (user_access("administer nodes")) {
|
||||
$fields = array("nid", "uid", "body", "comment", "created", "promote", "static", "moderate", "revisions", "status", "teaser", "title", "type" => $node->type);
|
||||
$fields = array("nid", "uid", "body", "comment", "created", "promote", "static", "moderate", "revisions", "status", "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
else {
|
||||
$fields = array("nid", "uid" => ($user->uid ? $user->uid : 0), "body", "teaser", "title", "type" => $node->type);
|
||||
$fields = array("nid", "uid" => ($user->uid ? $user->uid : 0), "body", "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
|
||||
$nid = node_save($node, array_merge($fields, module_invoke($node->type, "save", "update", $node)));
|
||||
|
@ -1155,10 +1205,10 @@ function node_submit($node) {
|
|||
*/
|
||||
|
||||
if (user_access("administer nodes")) {
|
||||
$fields = array("uid", "body", "comment", "created", "promote", "static", "moderate", "status", "teaser", "title", "type" => $node->type);
|
||||
$fields = array("uid", "body", "comment", "created", "promote", "static", "moderate", "status", "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
else {
|
||||
$fields = array("uid" => ($user->uid ? $user->uid : 0), "body", "comment" => 2, "teaser", "title", "type" => $node->type);
|
||||
$fields = array("uid" => ($user->uid ? $user->uid : 0), "body", "comment" => 2, "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
|
||||
$nid = node_save($node, array_merge($fields, module_invoke($node->type, "save", "create", $node)));
|
||||
|
@ -1204,20 +1254,12 @@ function node_submit($node) {
|
|||
}
|
||||
|
||||
$output .= "<p>". $theme->links($links) ."</p>";
|
||||
}
|
||||
else {
|
||||
$output = message_access();
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function node_delete($edit) {
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
$node = node_load(array("nid" => $edit["nid"]));
|
||||
|
||||
if (node_access("delete", $node)) {
|
||||
|
|
|
@ -28,7 +28,7 @@ function node_title_list($result, $title = NULL) {
|
|||
}
|
||||
|
||||
while ($node = db_fetch_object($result)) {
|
||||
$number = comment_num_all($node->nid);
|
||||
$number = module_invoke("comment", "num_all", $node->nid);
|
||||
$name = strip_tags(format_name($node)); // required for anonymous users to work
|
||||
$items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => t("Author: %name, comments: %number", array("%name" => $name, "%number" => $number))));
|
||||
}
|
||||
|
@ -38,7 +38,16 @@ function node_title_list($result, $title = NULL) {
|
|||
|
||||
function node_teaser($body) {
|
||||
|
||||
$size = 400;
|
||||
$size = variable_get("teaser_length", 600);
|
||||
|
||||
/*
|
||||
** If the size is zero, teasers are disabled so we
|
||||
** return the entire body.
|
||||
*/
|
||||
|
||||
if ($size == 0) {
|
||||
return $body;
|
||||
}
|
||||
|
||||
/*
|
||||
** If we have a short body, return the entire body:
|
||||
|
@ -49,19 +58,59 @@ function node_teaser($body) {
|
|||
}
|
||||
|
||||
/*
|
||||
** If we have a long body, try not to split paragraphs:
|
||||
** If a valid delimiter has been specified, use it to
|
||||
** chop of the teaser.
|
||||
*/
|
||||
|
||||
$delimiter = strpos($body, "---");
|
||||
if ($delimiter > 100 && $delimiter < $size) {
|
||||
return substr($body, 0, $delimiter);
|
||||
}
|
||||
|
||||
/*
|
||||
** In some cases no delimiter has been specified (eg.
|
||||
** when posting using the Blogger API) in which case
|
||||
** we try to split at paragraph boundaries.
|
||||
*/
|
||||
|
||||
if ($length = strpos($body, "\n", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "<br />", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "<br>", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "</p>", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** If we have a long body, try not to split sentences:
|
||||
** When even the first paragraph is too long, try to
|
||||
** split at the end of the next sentence.
|
||||
*/
|
||||
|
||||
return substr($body, 0, strpos($body, ". ", $size) + 1);
|
||||
if ($length = strpos($body, ". ", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "! ", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
if ($length = strpos($body, "? ", $size)) {
|
||||
return substr($body, 0, $length + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** Nevermind, we split it the hard way ...
|
||||
*/
|
||||
|
||||
return substr($body, 0, $size);
|
||||
}
|
||||
|
||||
function node_invoke($node, $name, $arg = 0) {
|
||||
|
@ -228,6 +277,13 @@ function node_view($node, $main = 0) {
|
|||
|
||||
$node = array2object($node);
|
||||
|
||||
/*
|
||||
** Remove the delimiter (if any) that seperates the teaser from the
|
||||
** body.
|
||||
*/
|
||||
|
||||
$node->body = str_replace("---", "", $node->body);
|
||||
|
||||
/*
|
||||
** The "view" hook can be implemented to overwrite the default function
|
||||
** to display nodes.
|
||||
|
@ -251,7 +307,6 @@ function node_access($op, $node = 0) {
|
|||
if (user_access("administer nodes")) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
|
||||
/*
|
||||
** Convert the node to an object if necessary:
|
||||
|
@ -278,11 +333,10 @@ function node_access($op, $node = 0) {
|
|||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function node_perm() {
|
||||
return array("administer nodes", "access content", "post content");
|
||||
return array("administer nodes", "access content");
|
||||
}
|
||||
|
||||
function node_search($keys) {
|
||||
|
@ -312,7 +366,8 @@ function node_search($keys) {
|
|||
}
|
||||
|
||||
function node_conf_options() {
|
||||
$output .= form_select(t("Default number of nodes to display"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of nodes to display on the main page."));
|
||||
$output .= form_select(t("Number of posts on main page"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of posts to display on the main page."));
|
||||
$output .= form_select(t("Length of trimmed posts"), "teaser_length", variable_get("teaser_length", 600), array(0 => t("Unlimited"), 200 => t("200 characters"), 400 => t("400 characters"), 600 => t("600 characters"), 800 => t("800 characters"), 1000 => t("1000 characters"), 1200 => t("1200 characters"), 1400 => t("1400 characters"), 1600 => t("1600 characters"), 1800 => t("1800 characters"), 2000 => t("2000 characters")), t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'."));
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -410,7 +465,7 @@ function node_link($type, $node = 0, $main = 0) {
|
|||
$links[] = la(t("content management"), array("mod" => "node"));
|
||||
}
|
||||
|
||||
if ($type == "page" && user_access("post content")) {
|
||||
if ($type == "page") {
|
||||
$links[] = lm(t("submit"), array("mod" => "node", "op" => "add"), "", array("title" => t("Submit or suggest new content.")));
|
||||
}
|
||||
|
||||
|
@ -802,7 +857,6 @@ function node_validate($node, &$error) {
|
|||
else {
|
||||
$error["date"] = theme_invoke("theme_error", t("You have to specifiy a valid date."));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -836,14 +890,6 @@ function node_form($edit, $error = NULL) {
|
|||
$edit = node_validate($edit, $error);
|
||||
}
|
||||
|
||||
/*
|
||||
** Generate a teaser when necessary:
|
||||
*/
|
||||
|
||||
if ($edit->body && !$edit->teaser) {
|
||||
$edit->teaser = node_teaser($edit->body);
|
||||
}
|
||||
|
||||
/*
|
||||
** Get the node specific bits:
|
||||
*/
|
||||
|
@ -922,11 +968,7 @@ function node_form($edit, $error = NULL) {
|
|||
$output .= form_textfield(t("Authored by"), "name", $edit->name, 20, 60, $error["name"]);
|
||||
$output .= form_textfield(t("Authored on"), "date", $edit->date, 20, 25, $error["date"]);
|
||||
$output .= "<br />";
|
||||
$output .= form_select(t("Set public/published"), "status", $edit->status, array(t("Disabled"), t("Enabled")));
|
||||
// TODO: move this to the queue.module
|
||||
if (module_exist("queue")) {
|
||||
$output .= form_select(t("Queue for moderation"), "moderate", $edit->moderate, array(t("Disabled"), t("Enabled")));
|
||||
}
|
||||
$output .= form_select(t("Moderation status"), "moderate", $edit->moderate, array(t("Approved"), t("Awaiting approval")));
|
||||
$output .= form_select(t("Promote to front page"), "promote", $edit->promote, array(t("Disabled"), t("Enabled")));
|
||||
$output .= form_select(t("Static on front page"), "static", $edit->static, array(t("Disabled"), t("Enabled")));
|
||||
// TODO: move this to the comment.module
|
||||
|
@ -946,10 +988,6 @@ function node_form($edit, $error = NULL) {
|
|||
function node_add($type) {
|
||||
global $user, $edit;
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
/*
|
||||
** If a node type has been specified, validate it existence. If no
|
||||
** (valid) node type has been provied, display a node type overview.
|
||||
|
@ -972,7 +1010,7 @@ function node_add($type) {
|
|||
*/
|
||||
|
||||
foreach (module_list() as $name) {
|
||||
if (module_hook($name, "node") && node_access("create", array("type" => $name))) {
|
||||
if (module_hook($name, "node") && node_access("create", $name)) {
|
||||
$output .= "<li>";
|
||||
$output .= " ". lm(module_invoke($name, "node", "name"), array("mod" => "node", "op" => "add", "type" => $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>";
|
||||
|
@ -990,10 +1028,6 @@ function node_add($type) {
|
|||
function node_edit($id) {
|
||||
global $user;
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
$node = node_load(array("nid" => $id));
|
||||
|
||||
if (node_access("update", $node)) {
|
||||
|
@ -1008,10 +1042,6 @@ function node_edit($id) {
|
|||
|
||||
function node_preview($node, $error = NULL) {
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert the array to an object:
|
||||
*/
|
||||
|
@ -1048,22 +1078,38 @@ function node_preview($node, $error = NULL) {
|
|||
$node->created = time();
|
||||
}
|
||||
|
||||
/*
|
||||
** Exctract a teaser:
|
||||
*/
|
||||
|
||||
$node->teaser = node_teaser($node->body);
|
||||
|
||||
/*
|
||||
** Apply the required filters:
|
||||
*/
|
||||
|
||||
$node = object2array($node);
|
||||
if ($node->nid) {
|
||||
$view = array_merge($node, module_invoke($node->type, "save", "update", $node));
|
||||
$node = array_merge($node, module_invoke($node->type, "save", "update", $node));
|
||||
}
|
||||
else {
|
||||
$view = array_merge($node, module_invoke($node->type, "save", "create", $node));
|
||||
$node = array_merge($node, module_invoke($node->type, "save", "create", $node));
|
||||
}
|
||||
$node = array2object($node);
|
||||
|
||||
/*
|
||||
** Display a preview of the node:
|
||||
** Display a prenode of the node:
|
||||
*/
|
||||
|
||||
node_view($view);
|
||||
if ($node->teaser && $node->teaser != $node->body) {
|
||||
print "<h3>". t("Preview full version") ."</h3>";
|
||||
node_view($node, 0);
|
||||
print "<h3>". t("Preview trimmed version") ."</h3>";
|
||||
node_view($node, 1);
|
||||
print "<p><i>". t("The trimmed version of your post shows how your post would look like when promoted to the main page or when exported for syndication. You can insert a delimiter '---' (without the quotes) to fine-tune where your post gets split. However note that delimiter will be ignored when misplaced.") ."</i></p>";
|
||||
}
|
||||
else {
|
||||
node_view($node, 0);
|
||||
}
|
||||
|
||||
return node_form($node, $error);
|
||||
}
|
||||
|
@ -1071,8 +1117,6 @@ function node_preview($node, $error = NULL) {
|
|||
function node_submit($node) {
|
||||
global $user, $theme;
|
||||
|
||||
if (user_access("post content")) {
|
||||
|
||||
/*
|
||||
** Fixup the node when required:
|
||||
*/
|
||||
|
@ -1093,6 +1137,12 @@ function node_submit($node) {
|
|||
|
||||
$node = node_revision_create($node);
|
||||
|
||||
/*
|
||||
** Prepare the node's body:
|
||||
*/
|
||||
|
||||
$node->body = filter($node->body);
|
||||
|
||||
if ($node->nid) {
|
||||
|
||||
/*
|
||||
|
@ -1108,10 +1158,10 @@ function node_submit($node) {
|
|||
*/
|
||||
|
||||
if (user_access("administer nodes")) {
|
||||
$fields = array("nid", "uid", "body", "comment", "created", "promote", "static", "moderate", "revisions", "status", "teaser", "title", "type" => $node->type);
|
||||
$fields = array("nid", "uid", "body", "comment", "created", "promote", "static", "moderate", "revisions", "status", "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
else {
|
||||
$fields = array("nid", "uid" => ($user->uid ? $user->uid : 0), "body", "teaser", "title", "type" => $node->type);
|
||||
$fields = array("nid", "uid" => ($user->uid ? $user->uid : 0), "body", "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
|
||||
$nid = node_save($node, array_merge($fields, module_invoke($node->type, "save", "update", $node)));
|
||||
|
@ -1155,10 +1205,10 @@ function node_submit($node) {
|
|||
*/
|
||||
|
||||
if (user_access("administer nodes")) {
|
||||
$fields = array("uid", "body", "comment", "created", "promote", "static", "moderate", "status", "teaser", "title", "type" => $node->type);
|
||||
$fields = array("uid", "body", "comment", "created", "promote", "static", "moderate", "status", "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
else {
|
||||
$fields = array("uid" => ($user->uid ? $user->uid : 0), "body", "comment" => 2, "teaser", "title", "type" => $node->type);
|
||||
$fields = array("uid" => ($user->uid ? $user->uid : 0), "body", "comment" => 2, "teaser" => node_teaser($node->body), "title", "type" => $node->type);
|
||||
}
|
||||
|
||||
$nid = node_save($node, array_merge($fields, module_invoke($node->type, "save", "create", $node)));
|
||||
|
@ -1204,20 +1254,12 @@ function node_submit($node) {
|
|||
}
|
||||
|
||||
$output .= "<p>". $theme->links($links) ."</p>";
|
||||
}
|
||||
else {
|
||||
$output = message_access();
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function node_delete($edit) {
|
||||
|
||||
if (!user_access("post content")) {
|
||||
return message_access();
|
||||
}
|
||||
|
||||
$node = node_load(array("nid" => $edit["nid"]));
|
||||
|
||||
if (node_access("delete", $node)) {
|
||||
|
|
|
@ -2,19 +2,23 @@
|
|||
// $Id$
|
||||
|
||||
function page_help() {
|
||||
$output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>administer nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</p>";
|
||||
$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 -> moderate -> post -> comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of static pages (i.e. requires the <i>administer nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</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 the Site Page author.</p>";
|
||||
return $output;
|
||||
}
|
||||
|
||||
function page_system($field){
|
||||
function page_system($field) {
|
||||
$system["description"] = t("Enables the creation of a static pages that can be added to the navigation system.");
|
||||
return $system[$field];
|
||||
}
|
||||
|
||||
function page_perm() {
|
||||
return array("maintain static pages");
|
||||
}
|
||||
|
||||
function page_node($field) {
|
||||
$info["name"] = t("site page");
|
||||
$info["description"] = t("If you just want to add a page with a link in the menu to your site, this would be the best choice. Unlike a story, a site page by-passes the submission queue.");
|
||||
$info["name"] = t("static page");
|
||||
$info["description"] = t("If you just want to add a page with a link in the menu to your site, this would be the best choice. Unlike a story, a static page by-passes the submission queue.");
|
||||
|
||||
return $info[$field];
|
||||
}
|
||||
|
@ -23,6 +27,18 @@ function page_access($op, $node) {
|
|||
if ($op == "view") {
|
||||
return $node->status;
|
||||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return user_access("maintain static pages");
|
||||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return user_access("maintain static pages");
|
||||
}
|
||||
|
||||
if ($op == "delete") {
|
||||
return user_access("maintain static pages");
|
||||
}
|
||||
}
|
||||
|
||||
function page_save($op, $node) {
|
||||
|
@ -32,7 +48,7 @@ function page_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "link", "description");
|
||||
return array("teaser" => $node->body, "format", "link", "description");
|
||||
}
|
||||
|
||||
if ($op == "decline") {
|
||||
|
@ -40,7 +56,7 @@ function page_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "link", "description");
|
||||
return array("teaser" => $node->body, "format", "link", "description");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,8 +86,8 @@ function page_link($type) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("administer nodes")) {
|
||||
$links[] = lm(t("create site page"), array("mod" => "node", "op" => "add", "type" => "page"), "", array("title" => t("Add a new site page.")));
|
||||
if ($type == "menu.create" && user_access("maintain static pages")) {
|
||||
$links[] = lm(t("create static page"), array("mod" => "node", "op" => "add", "type" => "page"), "", array("title" => t("Add a new static page.")));
|
||||
}
|
||||
|
||||
return $links ? $links : array();
|
||||
|
@ -139,11 +155,6 @@ function page_form(&$node, &$help, &$error) {
|
|||
$node->body = addslashes($node->body);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("page", $node));
|
||||
|
|
|
@ -2,19 +2,23 @@
|
|||
// $Id$
|
||||
|
||||
function page_help() {
|
||||
$output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>administer nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</p>";
|
||||
$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 -> moderate -> post -> comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of static pages (i.e. requires the <i>administer nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</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 the Site Page author.</p>";
|
||||
return $output;
|
||||
}
|
||||
|
||||
function page_system($field){
|
||||
function page_system($field) {
|
||||
$system["description"] = t("Enables the creation of a static pages that can be added to the navigation system.");
|
||||
return $system[$field];
|
||||
}
|
||||
|
||||
function page_perm() {
|
||||
return array("maintain static pages");
|
||||
}
|
||||
|
||||
function page_node($field) {
|
||||
$info["name"] = t("site page");
|
||||
$info["description"] = t("If you just want to add a page with a link in the menu to your site, this would be the best choice. Unlike a story, a site page by-passes the submission queue.");
|
||||
$info["name"] = t("static page");
|
||||
$info["description"] = t("If you just want to add a page with a link in the menu to your site, this would be the best choice. Unlike a story, a static page by-passes the submission queue.");
|
||||
|
||||
return $info[$field];
|
||||
}
|
||||
|
@ -23,6 +27,18 @@ function page_access($op, $node) {
|
|||
if ($op == "view") {
|
||||
return $node->status;
|
||||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return user_access("maintain static pages");
|
||||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return user_access("maintain static pages");
|
||||
}
|
||||
|
||||
if ($op == "delete") {
|
||||
return user_access("maintain static pages");
|
||||
}
|
||||
}
|
||||
|
||||
function page_save($op, $node) {
|
||||
|
@ -32,7 +48,7 @@ function page_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "link", "description");
|
||||
return array("teaser" => $node->body, "format", "link", "description");
|
||||
}
|
||||
|
||||
if ($op == "decline") {
|
||||
|
@ -40,7 +56,7 @@ function page_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "link", "description");
|
||||
return array("teaser" => $node->body, "format", "link", "description");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,8 +86,8 @@ function page_link($type) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("administer nodes")) {
|
||||
$links[] = lm(t("create site page"), array("mod" => "node", "op" => "add", "type" => "page"), "", array("title" => t("Add a new site page.")));
|
||||
if ($type == "menu.create" && user_access("maintain static pages")) {
|
||||
$links[] = lm(t("create static page"), array("mod" => "node", "op" => "add", "type" => "page"), "", array("title" => t("Add a new static page.")));
|
||||
}
|
||||
|
||||
return $links ? $links : array();
|
||||
|
@ -139,11 +155,6 @@ function page_form(&$node, &$help, &$error) {
|
|||
$node->body = addslashes($node->body);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("page", $node));
|
||||
|
|
|
@ -38,7 +38,7 @@ function poll_access($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return 1;
|
||||
return user_access("create polls");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ function poll_insert($node) {
|
|||
}
|
||||
|
||||
function poll_link($type, $node = 0, $main) {
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("create polls")) {
|
||||
$links[] = lm(t("create poll"), array("mod" => "node", "op" => "add", "type" => "poll"), "", array("title" => t("Add a new poll.")));
|
||||
}
|
||||
else if ($type == "page" && user_access("access content")) {
|
||||
|
@ -229,7 +229,7 @@ function poll_page() {
|
|||
}
|
||||
|
||||
function poll_perm() {
|
||||
return array("vote on polls");
|
||||
return array("create polls", "vote on polls");
|
||||
}
|
||||
|
||||
function poll_save($op, $node) {
|
||||
|
|
|
@ -38,7 +38,7 @@ function poll_access($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return 1;
|
||||
return user_access("create polls");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ function poll_insert($node) {
|
|||
}
|
||||
|
||||
function poll_link($type, $node = 0, $main) {
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("create polls")) {
|
||||
$links[] = lm(t("create poll"), array("mod" => "node", "op" => "add", "type" => "poll"), "", array("title" => t("Add a new poll.")));
|
||||
}
|
||||
else if ($type == "page" && user_access("access content")) {
|
||||
|
@ -229,7 +229,7 @@ function poll_page() {
|
|||
}
|
||||
|
||||
function poll_perm() {
|
||||
return array("vote on polls");
|
||||
return array("create polls", "vote on polls");
|
||||
}
|
||||
|
||||
function poll_save($op, $node) {
|
||||
|
|
|
@ -155,7 +155,7 @@ function queue_view($nid) {
|
|||
$theme->box(t("Moderate"), $output);
|
||||
}
|
||||
if ($node->comment && variable_get("queue_show_comments", 1)) {
|
||||
comment_render($node);
|
||||
module_invoke("comment", "render", $node);
|
||||
}
|
||||
$theme->footer();
|
||||
}
|
||||
|
|
|
@ -26,13 +26,17 @@ function story_node($field) {
|
|||
return $info[$field];
|
||||
}
|
||||
|
||||
function story_perm() {
|
||||
return array("create stories");
|
||||
}
|
||||
|
||||
function story_access($op, $node) {
|
||||
if ($op == "view") {
|
||||
return $node->status;
|
||||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return 1;
|
||||
return user_access("create stories");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,10 +48,10 @@ function story_save($op, $node) {
|
|||
|
||||
if ($op == "create") {
|
||||
if (user_access("administer nodes")) {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
return array();
|
||||
}
|
||||
else {
|
||||
return array("body" => filter($node->body), "moderate" => 1, "teaser" => filter($node->teaser));
|
||||
return array("moderate" => 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,12 +60,12 @@ function story_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
function story_link($type) {
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("create stories")) {
|
||||
$links[] = lm(t("create story"), array("mod" => "node", "op" => "add", "type" => "story"), "", array("title" => t("Add a new story.")));
|
||||
}
|
||||
|
||||
|
@ -91,10 +95,6 @@ function story_form(&$node, &$help, &$error) {
|
|||
|
||||
}
|
||||
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("story", $node));
|
||||
}
|
||||
|
|
|
@ -26,13 +26,17 @@ function story_node($field) {
|
|||
return $info[$field];
|
||||
}
|
||||
|
||||
function story_perm() {
|
||||
return array("create stories");
|
||||
}
|
||||
|
||||
function story_access($op, $node) {
|
||||
if ($op == "view") {
|
||||
return $node->status;
|
||||
}
|
||||
|
||||
if ($op == "create") {
|
||||
return 1;
|
||||
return user_access("create stories");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,10 +48,10 @@ function story_save($op, $node) {
|
|||
|
||||
if ($op == "create") {
|
||||
if (user_access("administer nodes")) {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
return array();
|
||||
}
|
||||
else {
|
||||
return array("body" => filter($node->body), "moderate" => 1, "teaser" => filter($node->teaser));
|
||||
return array("moderate" => 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,12 +60,12 @@ function story_save($op, $node) {
|
|||
}
|
||||
|
||||
if ($op == "update") {
|
||||
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
function story_link($type) {
|
||||
if ($type == "menu.create" && user_access("post content")) {
|
||||
if ($type == "menu.create" && user_access("create stories")) {
|
||||
$links[] = lm(t("create story"), array("mod" => "node", "op" => "add", "type" => "story"), "", array("title" => t("Add a new story.")));
|
||||
}
|
||||
|
||||
|
@ -91,10 +95,6 @@ function story_form(&$node, &$help, &$error) {
|
|||
|
||||
}
|
||||
|
||||
if ($node->teaser) {
|
||||
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
|
||||
}
|
||||
|
||||
if (function_exists("taxonomy_node_form")) {
|
||||
$output .= implode("", taxonomy_node_form("story", $node));
|
||||
}
|
||||
|
|
|
@ -725,7 +725,7 @@ function taxonomy_help() {
|
|||
<i><a name="synonyms"></a>Synonyms</i><br />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>).<br />
|
||||
|
||||
<h3>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 URL. For example, see <a href="<?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?>"><?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?></a>. Taxonomy URLs always contain a term ID or list of term IDs at the end of the URL (aka <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <? echo la("taxonomy overview", array("mod" => "taxonomy")) ?> page in the Admin and noting the number after the querystring parameter called <i>tid</i>. If you wish to see nodes from a collection of term IDs, separate each term ID with a comma. Also, the name of the querystring parameter may be <i>or</i> or <i>and</i>: <i>or</i> shows nodes which appear in <b>any</b> of the term IDs while <i>and</i> shows nodes in <b>all</b> the specified term IDs. Thus, <i>or</i> is less specific than <i>and</i>.</p>
|
||||
<p>In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed URL. For example, see <a href="<?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?>"><?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?></a>. Taxonomy URLs always contain a term ID or list of term IDs at the end of the URL (aka <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <?php echo la("taxonomy overview", array("mod" => "taxonomy")) ?> page in the Admin and noting the number after the querystring parameter called <i>tid</i>. If you wish to see nodes from a collection of term IDs, separate each term ID with a comma. Also, the name of the querystring parameter may be <i>or</i> or <i>and</i>: <i>or</i> shows nodes which appear in <b>any</b> of the term IDs while <i>and</i> shows nodes in <b>all</b> the specified term IDs. Thus, <i>or</i> is less specific than <i>and</i>.</p>
|
||||
|
||||
<h3>RSS feeds</h3>
|
||||
<p>Every term, or collection of terms, provides an <a href="http://backend.userland.com/stories/rss091">RSS</a> feed to which interested users may subscribe. The URL format for an sample RSS feed is <a href="<?php print path_uri().drupal_url(array("mod" => "node", "op" => "feed", "or" => "1,2"), "module"); ?>"><?php print path_uri().drupal_url(array("mod" => "node", "op" => "feed", "or" => "1,2"), "module"); ?></a>.</p>
|
||||
|
|
|
@ -725,7 +725,7 @@ function taxonomy_help() {
|
|||
<i><a name="synonyms"></a>Synonyms</i><br />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>).<br />
|
||||
|
||||
<h3>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 URL. For example, see <a href="<?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?>"><?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?></a>. Taxonomy URLs always contain a term ID or list of term IDs at the end of the URL (aka <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <? echo la("taxonomy overview", array("mod" => "taxonomy")) ?> page in the Admin and noting the number after the querystring parameter called <i>tid</i>. If you wish to see nodes from a collection of term IDs, separate each term ID with a comma. Also, the name of the querystring parameter may be <i>or</i> or <i>and</i>: <i>or</i> shows nodes which appear in <b>any</b> of the term IDs while <i>and</i> shows nodes in <b>all</b> the specified term IDs. Thus, <i>or</i> is less specific than <i>and</i>.</p>
|
||||
<p>In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed URL. For example, see <a href="<?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?>"><?php print path_uri().drupal_url(array("mod" => "node", "or" => "1,2"), "module"); ?></a>. Taxonomy URLs always contain a term ID or list of term IDs at the end of the URL (aka <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <?php echo la("taxonomy overview", array("mod" => "taxonomy")) ?> page in the Admin and noting the number after the querystring parameter called <i>tid</i>. If you wish to see nodes from a collection of term IDs, separate each term ID with a comma. Also, the name of the querystring parameter may be <i>or</i> or <i>and</i>: <i>or</i> shows nodes which appear in <b>any</b> of the term IDs while <i>and</i> shows nodes in <b>all</b> the specified term IDs. Thus, <i>or</i> is less specific than <i>and</i>.</p>
|
||||
|
||||
<h3>RSS feeds</h3>
|
||||
<p>Every term, or collection of terms, provides an <a href="http://backend.userland.com/stories/rss091">RSS</a> feed to which interested users may subscribe. The URL format for an sample RSS feed is <a href="<?php print path_uri().drupal_url(array("mod" => "node", "op" => "feed", "or" => "1,2"), "module"); ?>"><?php print path_uri().drupal_url(array("mod" => "node", "op" => "feed", "or" => "1,2"), "module"); ?></a>.</p>
|
||||
|
|
Loading…
Reference in New Issue