$result=db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = f.nid AND f.tid = %d AND n.status = 1 GROUP BY n.nid, n.title, n.body, n.created ORDER BY "._forum_get_topic_order(isset($user->sortby)?$user->sortby:variable_get("forum_order",1)),$node->tid);
$result=db_query("SELECT n.nid, n.title, n.body, n.path, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = f.nid AND f.tid = %d AND n.status = 1 GROUP BY n.nid, n.title, n.body, n.created ORDER BY "._forum_get_topic_order(isset($user->sortby)?$user->sortby:variable_get("forum_order",1)),$node->tid);
$result=db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = f.nid AND f.tid = %d AND n.status = 1 GROUP BY n.nid, n.title, n.body, n.created ORDER BY "._forum_get_topic_order(isset($user->sortby)?$user->sortby:variable_get("forum_order",1)),$node->tid);
$result=db_query("SELECT n.nid, n.title, n.body, n.path, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = f.nid AND f.tid = %d AND n.status = 1 GROUP BY n.nid, n.title, n.body, n.created ORDER BY "._forum_get_topic_order(isset($user->sortby)?$user->sortby:variable_get("forum_order",1)),$node->tid);
$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 per page on overview pages such as 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'."));
$output.=form_select(t("Preview post"),"node_preview",variable_get("node_preview",0),array(t("Optional"),t("Required")),t("Must users preview posts before submitting?"));
$output.=form_textfield(t("Path alias"),"path",($edit->path=="node/view/$edit->nid")?"":$edit->path,60,250,$error["path"]?$error["path"]:t("Optionally specify an alternative URL by which this node can be accessed. For example, type 'about/' when writing an about page."));
}
/*
** Add the node specific fields:
*/
...
...
@@ -1100,11 +1170,13 @@ function node_form($edit, $error = NULL) {
$output.=form_submit(t("Preview"));
if($edit->title&&$edit->type&&!$error){
$output.=form_submit(t("Submit"));
}
elseif(!variable_get("node_preview",0)){
$output.=form_submit(t("Submit"));
if(!$error){
if($edit->title&&$edit->type){
$output.=form_submit(t("Submit"));
}
elseif(!variable_get("node_preview",0)){
$output.=form_submit(t("Submit"));
}
}
if($edit->nid&&node_access("delete",$edit)){
...
...
@@ -1285,7 +1357,7 @@ function node_submit($node) {
$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 per page on overview pages such as 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'."));
$output.=form_select(t("Preview post"),"node_preview",variable_get("node_preview",0),array(t("Optional"),t("Required")),t("Must users preview posts before submitting?"));
$output.=form_textfield(t("Path alias"),"path",($edit->path=="node/view/$edit->nid")?"":$edit->path,60,250,$error["path"]?$error["path"]:t("Optionally specify an alternative URL by which this node can be accessed. For example, type 'about/' when writing an about page."));
}
/*
** Add the node specific fields:
*/
...
...
@@ -1100,11 +1170,13 @@ function node_form($edit, $error = NULL) {
$output.=form_submit(t("Preview"));
if($edit->title&&$edit->type&&!$error){
$output.=form_submit(t("Submit"));
}
elseif(!variable_get("node_preview",0)){
$output.=form_submit(t("Submit"));
if(!$error){
if($edit->title&&$edit->type){
$output.=form_submit(t("Submit"));
}
elseif(!variable_get("node_preview",0)){
$output.=form_submit(t("Submit"));
}
}
if($edit->nid&&node_access("delete",$edit)){
...
...
@@ -1285,7 +1357,7 @@ function node_submit($node) {
$result=db_query("SELECT n.nid, n.title, p.link, p.description FROM {page} p INNER JOIN {node} n ON p.nid = n.nid WHERE n.status = '1' AND p.link != '' ORDER BY p.link");
$result=db_query("SELECT n.nid, n.title, n.path, p.link, p.description FROM {page} p INNER JOIN {node} n ON p.nid = n.nid WHERE n.status = '1' AND p.link != '' ORDER BY p.link");
$result=db_query("SELECT n.nid, n.title, p.link, p.description FROM {page} p INNER JOIN {node} n ON p.nid = n.nid WHERE n.status = '1' AND p.link != '' ORDER BY p.link");
$result=db_query("SELECT n.nid, n.title, n.path, p.link, p.description FROM {page} p INNER JOIN {node} n ON p.nid = n.nid WHERE n.status = '1' AND p.link != '' ORDER BY p.link");