summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-11 20:01:13 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-11 20:01:13 +0000
commitc56ee67e29e89f5158801ba7bbe8f574a93215b4 (patch)
tree4004e19edda73708f7af1baffeb39318b3984509 /modules
parent8f315f4506220c50715ba81444326cc7fd936ed9 (diff)
downloadbrdo-c56ee67e29e89f5158801ba7bbe8f574a93215b4.tar.gz
brdo-c56ee67e29e89f5158801ba7bbe8f574a93215b4.tar.bz2
- Changed field_set(), field_get() and field_merge() to use ',' and
'=' instead of ';' and ':'. It is considered to be more readable. --> A _first_ step towards and improved index.module. Stay tuned for more. + Important: If you update from CVS - apply the queries in 2.00-to-x.xx.sql! - Changed all 'attribute' to 'attributes'. + Important: If you update from CVS - apply the queries in 2.00-to-x.xx.sql! + Important: This might require to ieni-wieni small update to your custom themes and/or node-related modules: - themes: node_index($node->attribute) -> node_index($node) - node modules: attribute -> attributes
Diffstat (limited to 'modules')
-rw-r--r--modules/account.module4
-rw-r--r--modules/aggregator.module38
-rw-r--r--modules/aggregator/aggregator.module38
-rw-r--r--modules/import.module38
-rw-r--r--modules/index.module6
-rw-r--r--modules/node.module10
-rw-r--r--modules/node/node.module10
-rw-r--r--modules/poll.module4
-rw-r--r--modules/poll/poll.module4
-rw-r--r--modules/queue.module1
-rw-r--r--modules/story.module4
-rw-r--r--modules/story/story.module4
12 files changed, 80 insertions, 81 deletions
diff --git a/modules/account.module b/modules/account.module
index 200cf7c22..62a9cb85d 100644
--- a/modules/account.module
+++ b/modules/account.module
@@ -95,9 +95,9 @@ function account_overview($query = array()) {
}
function account_access($account) {
- $data = explode(";", $account->access);
+ $data = explode(",", $account->access);
foreach ($data as $array) {
- $access = explode(":", $array);
+ $access = explode("=", $array);
if ($access[0]) $output .= " $access[0]";
}
return $output;
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 8545ad000..460084c44 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -17,11 +17,11 @@ function import_cron() {
}
}
-function import_bundle($attribute, $limit = 100) {
- if ($attribute) {
+function import_bundle($attributes, $limit = 100) {
+ if ($attributes) {
// compose query:
- $keys = explode(",", $attribute);
- foreach ($keys as $key) $where[] = "attribute LIKE '%". trim($key) ."%'";
+ $keys = explode(",", $attributes);
+ foreach ($keys as $key) $where[] = "attributes LIKE '%". trim($key) ."%'";
$result = db_query("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY timestamp DESC LIMIT $limit");
@@ -36,7 +36,7 @@ function import_bundle($attribute, $limit = 100) {
function import_view_bundle() {
$result = db_query("SELECT * FROM bundle ORDER BY title");
while ($bundle = db_fetch_object($result)) {
- $output .= "<B>$bundle->title</B><UL>". import_bundle($bundle->attribute) ."</UL>";
+ $output .= "<B>$bundle->title</B><UL>". import_bundle($bundle->attributes) ."</UL>";
}
return $output;
}
@@ -46,7 +46,7 @@ function import_block() {
while ($bundle = db_fetch_object($result)) {
$i++;
$blocks[$i][subject] = $bundle->title;
- $blocks[$i][content] = import_bundle($bundle->attribute, 10);
+ $blocks[$i][content] = import_bundle($bundle->attributes, 10);
$blocks[$i][info] = "$bundle->title bundle";
}
return $blocks;
@@ -81,7 +81,7 @@ function import_update($feed) {
$d = eregi("<description>(.*)</description>", $item, $description);
if ($l || $t || $a || $d) {
- import_save_item(array(fid => $feed[fid], title => $title[0], link => $link[0], author => $author[0], description => $description[0], attribute => $feed[attribute]));
+ import_save_item(array(fid => $feed[fid], title => $title[0], link => $link[0], author => $author[0], description => $description[0], attributes => $feed[attributes]));
}
}
@@ -97,14 +97,14 @@ function import_update($feed) {
function import_save_item($edit) {
if ($edit[iid] && $edit[title]) {
- db_query("UPDATE item SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', author = '". check_input($edit[author]) ."', description = '". check_input($edit[description]) ."', attribute = '". check_input($edit[attribute]) ."' WHERE iid = '$edit[iid]'");
+ db_query("UPDATE item SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', author = '". check_input($edit[author]) ."', description = '". check_input($edit[description]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE iid = '$edit[iid]'");
}
else if ($edit[iid]) {
db_query("DELETE FROM item WHERE iid = '". check_input($edit[iid]) ."'");
}
else {
if (!db_fetch_object(db_query("SELECT iid FROM item WHERE link = '". check_input($edit[link]) ."'"))) {
- db_query("INSERT INTO item (fid, title, link, author, description, attribute, timestamp) VALUES ('". check_input($edit[fid]) ."', '". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[author]) ."', '". check_input($edit[description]) ."', '". check_input($edit[attribute]) ."', '". time() ."')");
+ db_query("INSERT INTO item (fid, title, link, author, description, attributes, timestamp) VALUES ('". check_input($edit[fid]) ."', '". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[author]) ."', '". check_input($edit[description]) ."', '". check_input($edit[attributes]) ."', '". time() ."')");
}
}
}
@@ -113,7 +113,7 @@ function import_form_bundle($edit = array()) {
global $REQUEST_URI;
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the bundle.");
- $form .= form_textfield("Attributes", "attribute", $edit[attribute], 50, 128, "A comma-seperated list of keywords describing the bundle.");
+ $form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the bundle.");
$form .= form_submit("Submit");
@@ -127,13 +127,13 @@ function import_form_bundle($edit = array()) {
function import_save_bundle($edit) {
if ($edit[bid] && $edit[title]) {
- db_query("UPDATE bundle SET title = '". check_input($edit[title]) ."', attribute = '". check_input($edit[attribute]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
+ db_query("UPDATE bundle SET title = '". check_input($edit[title]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
}
else if ($edit[bid]) {
db_query("DELETE FROM bundle WHERE bid = '". check_input($edit[bid]) ."'");
}
else {
- db_query("INSERT INTO bundle (title, attribute) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[attribute]) ."')");
+ db_query("INSERT INTO bundle (title, attributes) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[attributes]) ."')");
}
module_rehash_blocks("import");
@@ -146,7 +146,7 @@ function import_form_feed($edit = array()) {
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the feed; typically the name of the website you syndicate content from.");
$form .= form_textfield("Link", "link", $edit[link], 50, 128, "The fully-qualified URL of the feed.");
- $form .= form_textfield("Attributes", "attribute", $edit[attribute], 50, 128, "A comma-seperated list of keywords describing the feed.");
+ $form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the feed.");
$form .= form_select("Update interval", "refresh", $edit[refresh], $period, "The refresh interval indicating how often you want to update this feed. Requires crontab.");
$form .= form_select("Expiration time", "uncache", $edit[uncache], $period, "The time cached items should be kept. Older items will be automatically discarded. Requires crontab.");
@@ -162,7 +162,7 @@ function import_form_feed($edit = array()) {
function import_save_feed($edit) {
if ($edit[fid] && $edit[title]) {
- db_query("UPDATE feed SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', attribute = '". check_input($edit[attribute]) ."', refresh = '". check_input($edit[refresh]) ."', uncache = '". check_input($edit[uncache]) ."' WHERE fid = '". check_input($edit[fid]) ."'");
+ db_query("UPDATE feed SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', attributes = '". check_input($edit[attributes]) ."', refresh = '". check_input($edit[refresh]) ."', uncache = '". check_input($edit[uncache]) ."' WHERE fid = '". check_input($edit[fid]) ."'");
db_query("DELETE FROM item WHERE fid = '". check_input($edit[fid]) ."'");
}
else if ($edit[fid]) {
@@ -170,13 +170,13 @@ function import_save_feed($edit) {
db_query("DELETE FROM item WHERE fid = '". check_input($edit[fid]) ."'");
}
else {
- db_query("INSERT INTO feed (title, link, attribute, refresh, uncache) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[attribute]) ."', '". check_input($edit[refresh]) ."', '". check_input($edit[uncache]) ."')");
+ db_query("INSERT INTO feed (title, link, attributes, refresh, uncache) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[attributes]) ."', '". check_input($edit[refresh]) ."', '". check_input($edit[uncache]) ."')");
}
}
function import_save_attributes($edit) {
foreach($edit as $iid => $value) {
- db_query("UPDATE item SET attribute = '". check_input($value) ."' WHERE iid = '". check_input($iid) ."'");
+ db_query("UPDATE item SET attributes = '". check_input($value) ."' WHERE iid = '". check_input($iid) ."'");
}
return "attributes has been saved";
}
@@ -196,7 +196,7 @@ function import_view_feed() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>title</TH><TH>attributes</TH><TH>items</TH><TH>last update</TH><TH>next update</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
while ($feed = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($feed->title) ."</TD><TD>". check_output($feed->attribute) ."</TD><TD>". format_plural($feed->items, "item", "items") ."</TD><TD>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</TD><TD>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$feed->fid\">edit feed</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=remove&id=$feed->fid\">remove items</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=update&id=$feed->fid\">update items</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($feed->title) ."</TD><TD>". check_output($feed->attributes) ."</TD><TD>". format_plural($feed->items, "item", "items") ."</TD><TD>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</TD><TD>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$feed->fid\">edit feed</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=remove&id=$feed->fid\">remove items</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=update&id=$feed->fid\">update items</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
@@ -206,7 +206,7 @@ function import_view_feed() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>title</TH><TH>attributes</TH><TH>operations</TH></TR>\n";
while ($bundle = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($bundle->title) ."</TD><TD>". check_output($bundle->attribute) ."</TD><TD><A HREF=\"admin.php?mod=import&type=bundle&op=edit&id=$bundle->bid\">edit bundle</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($bundle->title) ."</TD><TD>". check_output($bundle->attributes) ."</TD><TD><A HREF=\"admin.php?mod=import&type=bundle&op=edit&id=$bundle->bid\">edit bundle</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
@@ -222,7 +222,7 @@ function import_view_item() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>time</TH><TH>feed</TH><TH>item</TH></TR>\n";
while ($item = db_fetch_object($result)) {
- $output .= " <TR><TD VALIGN=\"top\" NOWRAP>". format_date($item->timestamp, "custom", "m/d/y") ."<BR>".format_date($item->timestamp, "custom", "H:i") ."</TD><TD ALIGN=\"center\" VALIGN=\"top\" NOWRAP><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$item->fid\">". check_output($item->feed) ."</A></TD><TD><A HREF=\"". check_output($item->link) ."\">". check_output($item->title) ."</A>". ($item->description ? "<BR><SMALL><I>". check_output($item->description) ."</I></SMALL>" : "") ."<BR><INPUT TYPE=\"text\" NAME=\"edit[$item->iid]\" VALUE=\"". check_form($item->attribute) ."\" SIZE=\"50\"></TD></TR>\n";
+ $output .= " <TR><TD VALIGN=\"top\" NOWRAP>". format_date($item->timestamp, "custom", "m/d/y") ."<BR>".format_date($item->timestamp, "custom", "H:i") ."</TD><TD ALIGN=\"center\" VALIGN=\"top\" NOWRAP><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$item->fid\">". check_output($item->feed) ."</A></TD><TD><A HREF=\"". check_output($item->link) ."\">". check_output($item->title) ."</A>". ($item->description ? "<BR><SMALL><I>". check_output($item->description) ."</I></SMALL>" : "") ."<BR><INPUT TYPE=\"text\" NAME=\"edit[$item->iid]\" VALUE=\"". check_form($item->attributes) ."\" SIZE=\"50\"></TD></TR>\n";
}
$output .= "</TABLE>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save attributes\">\n";
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 8545ad000..460084c44 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -17,11 +17,11 @@ function import_cron() {
}
}
-function import_bundle($attribute, $limit = 100) {
- if ($attribute) {
+function import_bundle($attributes, $limit = 100) {
+ if ($attributes) {
// compose query:
- $keys = explode(",", $attribute);
- foreach ($keys as $key) $where[] = "attribute LIKE '%". trim($key) ."%'";
+ $keys = explode(",", $attributes);
+ foreach ($keys as $key) $where[] = "attributes LIKE '%". trim($key) ."%'";
$result = db_query("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY timestamp DESC LIMIT $limit");
@@ -36,7 +36,7 @@ function import_bundle($attribute, $limit = 100) {
function import_view_bundle() {
$result = db_query("SELECT * FROM bundle ORDER BY title");
while ($bundle = db_fetch_object($result)) {
- $output .= "<B>$bundle->title</B><UL>". import_bundle($bundle->attribute) ."</UL>";
+ $output .= "<B>$bundle->title</B><UL>". import_bundle($bundle->attributes) ."</UL>";
}
return $output;
}
@@ -46,7 +46,7 @@ function import_block() {
while ($bundle = db_fetch_object($result)) {
$i++;
$blocks[$i][subject] = $bundle->title;
- $blocks[$i][content] = import_bundle($bundle->attribute, 10);
+ $blocks[$i][content] = import_bundle($bundle->attributes, 10);
$blocks[$i][info] = "$bundle->title bundle";
}
return $blocks;
@@ -81,7 +81,7 @@ function import_update($feed) {
$d = eregi("<description>(.*)</description>", $item, $description);
if ($l || $t || $a || $d) {
- import_save_item(array(fid => $feed[fid], title => $title[0], link => $link[0], author => $author[0], description => $description[0], attribute => $feed[attribute]));
+ import_save_item(array(fid => $feed[fid], title => $title[0], link => $link[0], author => $author[0], description => $description[0], attributes => $feed[attributes]));
}
}
@@ -97,14 +97,14 @@ function import_update($feed) {
function import_save_item($edit) {
if ($edit[iid] && $edit[title]) {
- db_query("UPDATE item SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', author = '". check_input($edit[author]) ."', description = '". check_input($edit[description]) ."', attribute = '". check_input($edit[attribute]) ."' WHERE iid = '$edit[iid]'");
+ db_query("UPDATE item SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', author = '". check_input($edit[author]) ."', description = '". check_input($edit[description]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE iid = '$edit[iid]'");
}
else if ($edit[iid]) {
db_query("DELETE FROM item WHERE iid = '". check_input($edit[iid]) ."'");
}
else {
if (!db_fetch_object(db_query("SELECT iid FROM item WHERE link = '". check_input($edit[link]) ."'"))) {
- db_query("INSERT INTO item (fid, title, link, author, description, attribute, timestamp) VALUES ('". check_input($edit[fid]) ."', '". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[author]) ."', '". check_input($edit[description]) ."', '". check_input($edit[attribute]) ."', '". time() ."')");
+ db_query("INSERT INTO item (fid, title, link, author, description, attributes, timestamp) VALUES ('". check_input($edit[fid]) ."', '". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[author]) ."', '". check_input($edit[description]) ."', '". check_input($edit[attributes]) ."', '". time() ."')");
}
}
}
@@ -113,7 +113,7 @@ function import_form_bundle($edit = array()) {
global $REQUEST_URI;
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the bundle.");
- $form .= form_textfield("Attributes", "attribute", $edit[attribute], 50, 128, "A comma-seperated list of keywords describing the bundle.");
+ $form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the bundle.");
$form .= form_submit("Submit");
@@ -127,13 +127,13 @@ function import_form_bundle($edit = array()) {
function import_save_bundle($edit) {
if ($edit[bid] && $edit[title]) {
- db_query("UPDATE bundle SET title = '". check_input($edit[title]) ."', attribute = '". check_input($edit[attribute]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
+ db_query("UPDATE bundle SET title = '". check_input($edit[title]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
}
else if ($edit[bid]) {
db_query("DELETE FROM bundle WHERE bid = '". check_input($edit[bid]) ."'");
}
else {
- db_query("INSERT INTO bundle (title, attribute) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[attribute]) ."')");
+ db_query("INSERT INTO bundle (title, attributes) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[attributes]) ."')");
}
module_rehash_blocks("import");
@@ -146,7 +146,7 @@ function import_form_feed($edit = array()) {
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the feed; typically the name of the website you syndicate content from.");
$form .= form_textfield("Link", "link", $edit[link], 50, 128, "The fully-qualified URL of the feed.");
- $form .= form_textfield("Attributes", "attribute", $edit[attribute], 50, 128, "A comma-seperated list of keywords describing the feed.");
+ $form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the feed.");
$form .= form_select("Update interval", "refresh", $edit[refresh], $period, "The refresh interval indicating how often you want to update this feed. Requires crontab.");
$form .= form_select("Expiration time", "uncache", $edit[uncache], $period, "The time cached items should be kept. Older items will be automatically discarded. Requires crontab.");
@@ -162,7 +162,7 @@ function import_form_feed($edit = array()) {
function import_save_feed($edit) {
if ($edit[fid] && $edit[title]) {
- db_query("UPDATE feed SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', attribute = '". check_input($edit[attribute]) ."', refresh = '". check_input($edit[refresh]) ."', uncache = '". check_input($edit[uncache]) ."' WHERE fid = '". check_input($edit[fid]) ."'");
+ db_query("UPDATE feed SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', attributes = '". check_input($edit[attributes]) ."', refresh = '". check_input($edit[refresh]) ."', uncache = '". check_input($edit[uncache]) ."' WHERE fid = '". check_input($edit[fid]) ."'");
db_query("DELETE FROM item WHERE fid = '". check_input($edit[fid]) ."'");
}
else if ($edit[fid]) {
@@ -170,13 +170,13 @@ function import_save_feed($edit) {
db_query("DELETE FROM item WHERE fid = '". check_input($edit[fid]) ."'");
}
else {
- db_query("INSERT INTO feed (title, link, attribute, refresh, uncache) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[attribute]) ."', '". check_input($edit[refresh]) ."', '". check_input($edit[uncache]) ."')");
+ db_query("INSERT INTO feed (title, link, attributes, refresh, uncache) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[attributes]) ."', '". check_input($edit[refresh]) ."', '". check_input($edit[uncache]) ."')");
}
}
function import_save_attributes($edit) {
foreach($edit as $iid => $value) {
- db_query("UPDATE item SET attribute = '". check_input($value) ."' WHERE iid = '". check_input($iid) ."'");
+ db_query("UPDATE item SET attributes = '". check_input($value) ."' WHERE iid = '". check_input($iid) ."'");
}
return "attributes has been saved";
}
@@ -196,7 +196,7 @@ function import_view_feed() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>title</TH><TH>attributes</TH><TH>items</TH><TH>last update</TH><TH>next update</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
while ($feed = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($feed->title) ."</TD><TD>". check_output($feed->attribute) ."</TD><TD>". format_plural($feed->items, "item", "items") ."</TD><TD>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</TD><TD>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$feed->fid\">edit feed</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=remove&id=$feed->fid\">remove items</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=update&id=$feed->fid\">update items</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($feed->title) ."</TD><TD>". check_output($feed->attributes) ."</TD><TD>". format_plural($feed->items, "item", "items") ."</TD><TD>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</TD><TD>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$feed->fid\">edit feed</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=remove&id=$feed->fid\">remove items</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=update&id=$feed->fid\">update items</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
@@ -206,7 +206,7 @@ function import_view_feed() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>title</TH><TH>attributes</TH><TH>operations</TH></TR>\n";
while ($bundle = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($bundle->title) ."</TD><TD>". check_output($bundle->attribute) ."</TD><TD><A HREF=\"admin.php?mod=import&type=bundle&op=edit&id=$bundle->bid\">edit bundle</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($bundle->title) ."</TD><TD>". check_output($bundle->attributes) ."</TD><TD><A HREF=\"admin.php?mod=import&type=bundle&op=edit&id=$bundle->bid\">edit bundle</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
@@ -222,7 +222,7 @@ function import_view_item() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>time</TH><TH>feed</TH><TH>item</TH></TR>\n";
while ($item = db_fetch_object($result)) {
- $output .= " <TR><TD VALIGN=\"top\" NOWRAP>". format_date($item->timestamp, "custom", "m/d/y") ."<BR>".format_date($item->timestamp, "custom", "H:i") ."</TD><TD ALIGN=\"center\" VALIGN=\"top\" NOWRAP><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$item->fid\">". check_output($item->feed) ."</A></TD><TD><A HREF=\"". check_output($item->link) ."\">". check_output($item->title) ."</A>". ($item->description ? "<BR><SMALL><I>". check_output($item->description) ."</I></SMALL>" : "") ."<BR><INPUT TYPE=\"text\" NAME=\"edit[$item->iid]\" VALUE=\"". check_form($item->attribute) ."\" SIZE=\"50\"></TD></TR>\n";
+ $output .= " <TR><TD VALIGN=\"top\" NOWRAP>". format_date($item->timestamp, "custom", "m/d/y") ."<BR>".format_date($item->timestamp, "custom", "H:i") ."</TD><TD ALIGN=\"center\" VALIGN=\"top\" NOWRAP><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$item->fid\">". check_output($item->feed) ."</A></TD><TD><A HREF=\"". check_output($item->link) ."\">". check_output($item->title) ."</A>". ($item->description ? "<BR><SMALL><I>". check_output($item->description) ."</I></SMALL>" : "") ."<BR><INPUT TYPE=\"text\" NAME=\"edit[$item->iid]\" VALUE=\"". check_form($item->attributes) ."\" SIZE=\"50\"></TD></TR>\n";
}
$output .= "</TABLE>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save attributes\">\n";
diff --git a/modules/import.module b/modules/import.module
index 8545ad000..460084c44 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -17,11 +17,11 @@ function import_cron() {
}
}
-function import_bundle($attribute, $limit = 100) {
- if ($attribute) {
+function import_bundle($attributes, $limit = 100) {
+ if ($attributes) {
// compose query:
- $keys = explode(",", $attribute);
- foreach ($keys as $key) $where[] = "attribute LIKE '%". trim($key) ."%'";
+ $keys = explode(",", $attributes);
+ foreach ($keys as $key) $where[] = "attributes LIKE '%". trim($key) ."%'";
$result = db_query("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY timestamp DESC LIMIT $limit");
@@ -36,7 +36,7 @@ function import_bundle($attribute, $limit = 100) {
function import_view_bundle() {
$result = db_query("SELECT * FROM bundle ORDER BY title");
while ($bundle = db_fetch_object($result)) {
- $output .= "<B>$bundle->title</B><UL>". import_bundle($bundle->attribute) ."</UL>";
+ $output .= "<B>$bundle->title</B><UL>". import_bundle($bundle->attributes) ."</UL>";
}
return $output;
}
@@ -46,7 +46,7 @@ function import_block() {
while ($bundle = db_fetch_object($result)) {
$i++;
$blocks[$i][subject] = $bundle->title;
- $blocks[$i][content] = import_bundle($bundle->attribute, 10);
+ $blocks[$i][content] = import_bundle($bundle->attributes, 10);
$blocks[$i][info] = "$bundle->title bundle";
}
return $blocks;
@@ -81,7 +81,7 @@ function import_update($feed) {
$d = eregi("<description>(.*)</description>", $item, $description);
if ($l || $t || $a || $d) {
- import_save_item(array(fid => $feed[fid], title => $title[0], link => $link[0], author => $author[0], description => $description[0], attribute => $feed[attribute]));
+ import_save_item(array(fid => $feed[fid], title => $title[0], link => $link[0], author => $author[0], description => $description[0], attributes => $feed[attributes]));
}
}
@@ -97,14 +97,14 @@ function import_update($feed) {
function import_save_item($edit) {
if ($edit[iid] && $edit[title]) {
- db_query("UPDATE item SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', author = '". check_input($edit[author]) ."', description = '". check_input($edit[description]) ."', attribute = '". check_input($edit[attribute]) ."' WHERE iid = '$edit[iid]'");
+ db_query("UPDATE item SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', author = '". check_input($edit[author]) ."', description = '". check_input($edit[description]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE iid = '$edit[iid]'");
}
else if ($edit[iid]) {
db_query("DELETE FROM item WHERE iid = '". check_input($edit[iid]) ."'");
}
else {
if (!db_fetch_object(db_query("SELECT iid FROM item WHERE link = '". check_input($edit[link]) ."'"))) {
- db_query("INSERT INTO item (fid, title, link, author, description, attribute, timestamp) VALUES ('". check_input($edit[fid]) ."', '". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[author]) ."', '". check_input($edit[description]) ."', '". check_input($edit[attribute]) ."', '". time() ."')");
+ db_query("INSERT INTO item (fid, title, link, author, description, attributes, timestamp) VALUES ('". check_input($edit[fid]) ."', '". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[author]) ."', '". check_input($edit[description]) ."', '". check_input($edit[attributes]) ."', '". time() ."')");
}
}
}
@@ -113,7 +113,7 @@ function import_form_bundle($edit = array()) {
global $REQUEST_URI;
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the bundle.");
- $form .= form_textfield("Attributes", "attribute", $edit[attribute], 50, 128, "A comma-seperated list of keywords describing the bundle.");
+ $form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the bundle.");
$form .= form_submit("Submit");
@@ -127,13 +127,13 @@ function import_form_bundle($edit = array()) {
function import_save_bundle($edit) {
if ($edit[bid] && $edit[title]) {
- db_query("UPDATE bundle SET title = '". check_input($edit[title]) ."', attribute = '". check_input($edit[attribute]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
+ db_query("UPDATE bundle SET title = '". check_input($edit[title]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE bid = '". check_input($edit[bid]) ."'");
}
else if ($edit[bid]) {
db_query("DELETE FROM bundle WHERE bid = '". check_input($edit[bid]) ."'");
}
else {
- db_query("INSERT INTO bundle (title, attribute) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[attribute]) ."')");
+ db_query("INSERT INTO bundle (title, attributes) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[attributes]) ."')");
}
module_rehash_blocks("import");
@@ -146,7 +146,7 @@ function import_form_feed($edit = array()) {
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the feed; typically the name of the website you syndicate content from.");
$form .= form_textfield("Link", "link", $edit[link], 50, 128, "The fully-qualified URL of the feed.");
- $form .= form_textfield("Attributes", "attribute", $edit[attribute], 50, 128, "A comma-seperated list of keywords describing the feed.");
+ $form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the feed.");
$form .= form_select("Update interval", "refresh", $edit[refresh], $period, "The refresh interval indicating how often you want to update this feed. Requires crontab.");
$form .= form_select("Expiration time", "uncache", $edit[uncache], $period, "The time cached items should be kept. Older items will be automatically discarded. Requires crontab.");
@@ -162,7 +162,7 @@ function import_form_feed($edit = array()) {
function import_save_feed($edit) {
if ($edit[fid] && $edit[title]) {
- db_query("UPDATE feed SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', attribute = '". check_input($edit[attribute]) ."', refresh = '". check_input($edit[refresh]) ."', uncache = '". check_input($edit[uncache]) ."' WHERE fid = '". check_input($edit[fid]) ."'");
+ db_query("UPDATE feed SET title = '". check_input($edit[title]) ."', link = '". check_input($edit[link]) ."', attributes = '". check_input($edit[attributes]) ."', refresh = '". check_input($edit[refresh]) ."', uncache = '". check_input($edit[uncache]) ."' WHERE fid = '". check_input($edit[fid]) ."'");
db_query("DELETE FROM item WHERE fid = '". check_input($edit[fid]) ."'");
}
else if ($edit[fid]) {
@@ -170,13 +170,13 @@ function import_save_feed($edit) {
db_query("DELETE FROM item WHERE fid = '". check_input($edit[fid]) ."'");
}
else {
- db_query("INSERT INTO feed (title, link, attribute, refresh, uncache) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[attribute]) ."', '". check_input($edit[refresh]) ."', '". check_input($edit[uncache]) ."')");
+ db_query("INSERT INTO feed (title, link, attributes, refresh, uncache) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[link]) ."', '". check_input($edit[attributes]) ."', '". check_input($edit[refresh]) ."', '". check_input($edit[uncache]) ."')");
}
}
function import_save_attributes($edit) {
foreach($edit as $iid => $value) {
- db_query("UPDATE item SET attribute = '". check_input($value) ."' WHERE iid = '". check_input($iid) ."'");
+ db_query("UPDATE item SET attributes = '". check_input($value) ."' WHERE iid = '". check_input($iid) ."'");
}
return "attributes has been saved";
}
@@ -196,7 +196,7 @@ function import_view_feed() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>title</TH><TH>attributes</TH><TH>items</TH><TH>last update</TH><TH>next update</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
while ($feed = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($feed->title) ."</TD><TD>". check_output($feed->attribute) ."</TD><TD>". format_plural($feed->items, "item", "items") ."</TD><TD>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</TD><TD>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$feed->fid\">edit feed</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=remove&id=$feed->fid\">remove items</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=update&id=$feed->fid\">update items</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($feed->title) ."</TD><TD>". check_output($feed->attributes) ."</TD><TD>". format_plural($feed->items, "item", "items") ."</TD><TD>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</TD><TD>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$feed->fid\">edit feed</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=remove&id=$feed->fid\">remove items</A></TD><TD><A HREF=\"admin.php?mod=import&type=feed&op=update&id=$feed->fid\">update items</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
@@ -206,7 +206,7 @@ function import_view_feed() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>title</TH><TH>attributes</TH><TH>operations</TH></TR>\n";
while ($bundle = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($bundle->title) ."</TD><TD>". check_output($bundle->attribute) ."</TD><TD><A HREF=\"admin.php?mod=import&type=bundle&op=edit&id=$bundle->bid\">edit bundle</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($bundle->title) ."</TD><TD>". check_output($bundle->attributes) ."</TD><TD><A HREF=\"admin.php?mod=import&type=bundle&op=edit&id=$bundle->bid\">edit bundle</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
@@ -222,7 +222,7 @@ function import_view_item() {
$output .= "<TABLE BORDER=\"1\" CELLSPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>time</TH><TH>feed</TH><TH>item</TH></TR>\n";
while ($item = db_fetch_object($result)) {
- $output .= " <TR><TD VALIGN=\"top\" NOWRAP>". format_date($item->timestamp, "custom", "m/d/y") ."<BR>".format_date($item->timestamp, "custom", "H:i") ."</TD><TD ALIGN=\"center\" VALIGN=\"top\" NOWRAP><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$item->fid\">". check_output($item->feed) ."</A></TD><TD><A HREF=\"". check_output($item->link) ."\">". check_output($item->title) ."</A>". ($item->description ? "<BR><SMALL><I>". check_output($item->description) ."</I></SMALL>" : "") ."<BR><INPUT TYPE=\"text\" NAME=\"edit[$item->iid]\" VALUE=\"". check_form($item->attribute) ."\" SIZE=\"50\"></TD></TR>\n";
+ $output .= " <TR><TD VALIGN=\"top\" NOWRAP>". format_date($item->timestamp, "custom", "m/d/y") ."<BR>".format_date($item->timestamp, "custom", "H:i") ."</TD><TD ALIGN=\"center\" VALIGN=\"top\" NOWRAP><A HREF=\"admin.php?mod=import&type=feed&op=edit&id=$item->fid\">". check_output($item->feed) ."</A></TD><TD><A HREF=\"". check_output($item->link) ."\">". check_output($item->title) ."</A>". ($item->description ? "<BR><SMALL><I>". check_output($item->description) ."</I></SMALL>" : "") ."<BR><INPUT TYPE=\"text\" NAME=\"edit[$item->iid]\" VALUE=\"". check_form($item->attributes) ."\" SIZE=\"50\"></TD></TR>\n";
}
$output .= "</TABLE>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save attributes\">\n";
diff --git a/modules/index.module b/modules/index.module
index 0d06a7b22..673e00d69 100644
--- a/modules/index.module
+++ b/modules/index.module
@@ -1,7 +1,7 @@
<?php
-// entries => attributes
+// entries => attributess
function index_get_array($id) {
return db_fetch_array(db_query("SELECT * FROM entry WHERE eid = '". check_input($id) ."'"));
@@ -88,8 +88,8 @@ function index_test_2($edit) {
$value1 = field_merge($value1, $edit[$entry->collection]);
}
- foreach (explode(";", $value1) as $data) {
- $entry = explode(":", $data);
+ foreach (explode(",", $value1) as $data) {
+ $entry = explode("=", $data);
if ($entry[1]) $foo[] = "<A HREF=\"index.php?$entry[0]=". urlencode($entry[1]) ."\">$entry[1]</A>";
}
diff --git a/modules/node.module b/modules/node.module
index 6b1df2c82..ffbca0d0c 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -5,7 +5,7 @@ class Node {
global $user;
$this->userid = $node[userid] ? $node[userid] : $user->userid;
$this->title = $node[title];
- $this->timestamp = $node[attribute];
+ $this->timestamp = $node[attributes];
$this->timestamp = $node[timestamp] ? $node[timestamp] : time();
}
}
@@ -83,7 +83,7 @@ function node_overview($query) {
$bg = $color[$i++ % sizeof($color)];
- $output .= " <TR BGCOLOR=\"$bg\"><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">$node->type</TD><TD>". node_status($node->status) ."</TD><TD>". check_output($node->attribute) ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD></TR>\n";
+ $output .= " <TR BGCOLOR=\"$bg\"><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">$node->type</TD><TD>". node_status($node->status) ."</TD><TD>". check_output($node->attributes) ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD></TR>\n";
$output .= " <TR BGCOLOR=\"$bg\"><TD ALIGN=\"right\" COLSPAN=\"6\"><SMALL>". implode(", ", $link) ."</SMALL></TD>\n";
}
$output .= "</TABLE>\n";
@@ -112,7 +112,7 @@ function node_edit_attribute($id) {
$node = node_get_object(array("nid" => $id));
$form .= form_item("Document title", check_output($node->title));
- $form .= form_textfield("Attributes", "attribute", $node->attribute, 50, 128, htmlentities("A list meta attributes. Format: <type>:<value>;<type>:<value>;. Example: 'software:apache;type:webserver;os:linux;'."));
+ $form .= form_textfield("Attributes", "attributes", $node->attributes, 50, 128, htmlentities("A list meta attributes. Format: <type>:<value>;<type>:<value>;. Example: 'software:apache;type:webserver;os:linux;'."));
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
@@ -204,8 +204,8 @@ function node_admin_save($edit) {
$edit[timestamp_hidden] = (strtotime($edit[timestamp_hidden]) > time()) ? strtotime($edit[timestamp_hidden]) : 0;
node_save($edit, array(status, timestamp_posted, timestamp_queued, timestamp_hidden));
}
- else if (isset($edit[attribute])) {
- node_save($edit, array(attribute));
+ else if (isset($edit[attributes])) {
+ node_save($edit, array(attributes));
}
else {
node_save($edit, array(comment, moderate, promote));
diff --git a/modules/node/node.module b/modules/node/node.module
index 6b1df2c82..ffbca0d0c 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -5,7 +5,7 @@ class Node {
global $user;
$this->userid = $node[userid] ? $node[userid] : $user->userid;
$this->title = $node[title];
- $this->timestamp = $node[attribute];
+ $this->timestamp = $node[attributes];
$this->timestamp = $node[timestamp] ? $node[timestamp] : time();
}
}
@@ -83,7 +83,7 @@ function node_overview($query) {
$bg = $color[$i++ % sizeof($color)];
- $output .= " <TR BGCOLOR=\"$bg\"><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">$node->type</TD><TD>". node_status($node->status) ."</TD><TD>". check_output($node->attribute) ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD></TR>\n";
+ $output .= " <TR BGCOLOR=\"$bg\"><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">$node->type</TD><TD>". node_status($node->status) ."</TD><TD>". check_output($node->attributes) ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD></TR>\n";
$output .= " <TR BGCOLOR=\"$bg\"><TD ALIGN=\"right\" COLSPAN=\"6\"><SMALL>". implode(", ", $link) ."</SMALL></TD>\n";
}
$output .= "</TABLE>\n";
@@ -112,7 +112,7 @@ function node_edit_attribute($id) {
$node = node_get_object(array("nid" => $id));
$form .= form_item("Document title", check_output($node->title));
- $form .= form_textfield("Attributes", "attribute", $node->attribute, 50, 128, htmlentities("A list meta attributes. Format: <type>:<value>;<type>:<value>;. Example: 'software:apache;type:webserver;os:linux;'."));
+ $form .= form_textfield("Attributes", "attributes", $node->attributes, 50, 128, htmlentities("A list meta attributes. Format: <type>:<value>;<type>:<value>;. Example: 'software:apache;type:webserver;os:linux;'."));
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
@@ -204,8 +204,8 @@ function node_admin_save($edit) {
$edit[timestamp_hidden] = (strtotime($edit[timestamp_hidden]) > time()) ? strtotime($edit[timestamp_hidden]) : 0;
node_save($edit, array(status, timestamp_posted, timestamp_queued, timestamp_hidden));
}
- else if (isset($edit[attribute])) {
- node_save($edit, array(attribute));
+ else if (isset($edit[attributes])) {
+ node_save($edit, array(attributes));
}
else {
node_save($edit, array(comment, moderate, promote));
diff --git a/modules/poll.module b/modules/poll.module
index cd9e0e306..df4c64b57 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -232,10 +232,10 @@ function poll_save($edit) {
global $status, $user;
if (!$edit[nid]) {
- $nid = node_save($edit, array(active => 1, attribute => node_attributes_save($edit), author => $user->id, cid, comment => variable_get("poll_comment", 0), moderate => variable_get("poll_moderate", ""), promote => variable_get("poll_promote", 0), runtime, score => 0, status => variable_get("poll_status", $status[queued]), tid, timestamp => time(), title, type => "poll", votes => 0, voters => ""));
+ $nid = node_save($edit, array(active => 1, attributes => node_attributes_save($edit), author => $user->id, cid, comment => variable_get("poll_comment", 0), moderate => variable_get("poll_moderate", ""), promote => variable_get("poll_promote", 0), runtime, score => 0, status => variable_get("poll_status", $status[queued]), tid, timestamp => time(), title, type => "poll", votes => 0, voters => ""));
}
else if (user_access($user)) {
- $nid = node_save($edit, array(active, attribute => node_attributes_save($edit), cid, tid, runtime, title, type => "poll"));
+ $nid = node_save($edit, array(active, attributes => node_attributes_save($edit), cid, tid, runtime, title, type => "poll"));
db_query("DELETE FROM poll_choices WHERE nid='" . $nid . "'");
}
if ($nid) {
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index cd9e0e306..df4c64b57 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -232,10 +232,10 @@ function poll_save($edit) {
global $status, $user;
if (!$edit[nid]) {
- $nid = node_save($edit, array(active => 1, attribute => node_attributes_save($edit), author => $user->id, cid, comment => variable_get("poll_comment", 0), moderate => variable_get("poll_moderate", ""), promote => variable_get("poll_promote", 0), runtime, score => 0, status => variable_get("poll_status", $status[queued]), tid, timestamp => time(), title, type => "poll", votes => 0, voters => ""));
+ $nid = node_save($edit, array(active => 1, attributes => node_attributes_save($edit), author => $user->id, cid, comment => variable_get("poll_comment", 0), moderate => variable_get("poll_moderate", ""), promote => variable_get("poll_promote", 0), runtime, score => 0, status => variable_get("poll_status", $status[queued]), tid, timestamp => time(), title, type => "poll", votes => 0, voters => ""));
}
else if (user_access($user)) {
- $nid = node_save($edit, array(active, attribute => node_attributes_save($edit), cid, tid, runtime, title, type => "poll"));
+ $nid = node_save($edit, array(active, attributes => node_attributes_save($edit), cid, tid, runtime, title, type => "poll"));
db_query("DELETE FROM poll_choices WHERE nid='" . $nid . "'");
}
if ($nid) {
diff --git a/modules/queue.module b/modules/queue.module
index 2241952f8..b91dab326 100644
--- a/modules/queue.module
+++ b/modules/queue.module
@@ -10,7 +10,6 @@ function queue_cron() {
db_query("UPDATE node SET status = '$status[dumped]' WHERE status = '$status[queued]' AND ". time() ." - timestamp > ". variable_get("queue_clear", 604800));
}
-
function queue_menu() {
return array("<A HREF=\"module.php?mod=queue\">". t("moderation queue") ."</A> (<FONT COLOR=\"red\">". queue_count() ."</FONT>)");
}
diff --git a/modules/story.module b/modules/story.module
index 3e6f428ce..1325c0d3f 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -73,10 +73,10 @@ function story_save($edit) {
global $status, $user;
if (!$edit[nid]) {
- node_save($edit, array(abstract, attribute => node_attributes_save($edit), author => $user->id, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0));
+ node_save($edit, array(abstract, attributes => node_attributes_save($edit), author => $user->id, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0));
}
else if (user_access($user)) {
- node_save($edit, array(abstract, attribute => node_attributes_save($edit), body, title, type => "story"));
+ node_save($edit, array(abstract, attributes => node_attributes_save($edit), body, title, type => "story"));
}
}
diff --git a/modules/story/story.module b/modules/story/story.module
index 3e6f428ce..1325c0d3f 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -73,10 +73,10 @@ function story_save($edit) {
global $status, $user;
if (!$edit[nid]) {
- node_save($edit, array(abstract, attribute => node_attributes_save($edit), author => $user->id, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0));
+ node_save($edit, array(abstract, attributes => node_attributes_save($edit), author => $user->id, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0));
}
else if (user_access($user)) {
- node_save($edit, array(abstract, attribute => node_attributes_save($edit), body, title, type => "story"));
+ node_save($edit, array(abstract, attributes => node_attributes_save($edit), body, title, type => "story"));
}
}