if($iid&&$item=db_fetch_object(db_query("SELECT i.*, f.title as ftitle, f.link as flink FROM item i, feed f WHERE i.iid = '".check_input($iid)."' AND i.fid = f.fid"))){
$output=form_textarea(t("Body"),"body",$edit->body,60,15,t("Allowed HTML tags").": ".htmlspecialchars(variable_get("allowed_html","")));
$output=form_textarea(t("Body"),"body",$node->body,60,15,$error["body"]?$error["body"]:t("Allowed HTML tags").": ".htmlspecialchars(variable_get("allowed_html","")));
if($iid&&$item=db_fetch_object(db_query("SELECT i.*, f.title as ftitle, f.link as flink FROM item i, feed f WHERE i.iid = '".check_input($iid)."' AND i.fid = f.fid"))){
$output=form_textarea(t("Body"),"body",$edit->body,60,15,t("Allowed HTML tags").": ".htmlspecialchars(variable_get("allowed_html","")));
$output=form_textarea(t("Body"),"body",$node->body,60,15,$error["body"]?$error["body"]:t("Allowed HTML tags").": ".htmlspecialchars(variable_get("allowed_html","")));
$output.=form_select("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),"The default maximum number of nodes to display on the main page.");
$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("Minimum number of words in a node"),"minimum_node_size",variable_get("minimum_node_size",0),array(0=>"0 words",10=>"10 words",25=>"25 words",50=>"50 words",75=>"75 words",100=>"100 words",125=>"125 words",150=>"150 words",175=>"175 words",200=>"200 words"),t("The minimum number of words a node should have. This can be useful to stop test post."));
return$output;
}
...
...
@@ -283,7 +285,7 @@ function node_feed() {
}
functionnode_fixup($edit){
functionnode_validate($node,$error){
global$user;
...
...
@@ -291,13 +293,13 @@ function node_fixup($edit) {
** Convert the node to an object if necessary:
*/
$edit=node_object($edit);
$node=node_object($node);
/*
** Validate the title field:
*/
if(($edit->nid||$edit->body)&&!$edit->title){
if(($node->nid||$node->body)&&!$node->title){
$error["title"]="<div style=\"color: red;\">".t("You have to specify a valid title.")."</div>";
}
...
...
@@ -307,47 +309,56 @@ function node_fixup($edit) {
$output.=form_select("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),"The default maximum number of nodes to display on the main page.");
$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("Minimum number of words in a node"),"minimum_node_size",variable_get("minimum_node_size",0),array(0=>"0 words",10=>"10 words",25=>"25 words",50=>"50 words",75=>"75 words",100=>"100 words",125=>"125 words",150=>"150 words",175=>"175 words",200=>"200 words"),t("The minimum number of words a node should have. This can be useful to stop test post."));
return$output;
}
...
...
@@ -283,7 +285,7 @@ function node_feed() {
}
functionnode_fixup($edit){
functionnode_validate($node,$error){
global$user;
...
...
@@ -291,13 +293,13 @@ function node_fixup($edit) {
** Convert the node to an object if necessary:
*/
$edit=node_object($edit);
$node=node_object($node);
/*
** Validate the title field:
*/
if(($edit->nid||$edit->body)&&!$edit->title){
if(($node->nid||$node->body)&&!$node->title){
$error["title"]="<div style=\"color: red;\">".t("You have to specify a valid title.")."</div>";
}
...
...
@@ -307,47 +309,56 @@ function node_fixup($edit) {
$error["body"]="<div style=\"color: red;\">".t("The body of your story is too short.")."</div>";
}
}
$output=form_textarea(t("Body"),"body",$node->body,60,15,$error["body"]?$error["body"]:t("Allowed HTML tags").": ".htmlspecialchars(variable_get("allowed_html","")));
$error["body"]="<div style=\"color: red;\">".t("The body of your story is too short.")."</div>";
}
}
$output=form_textarea(t("Body"),"body",$node->body,60,15,$error["body"]?$error["body"]:t("Allowed HTML tags").": ".htmlspecialchars(variable_get("allowed_html","")));