diff -r drupal-4.4.1/database/database.mysql drupal4blog/database/database.mysql
130a131
>   anon longtext,
303a305,316
> -- Table structure for table 'blog'
> --
> 
> CREATE TABLE blog (
>   nid int(10) unsigned NOT NULL default '0',
>   extended longtext NOT NULL,
>   excerpt longtext NOT NULL,
>   format tinyint(2) NOT NULL default '0',
>   PRIMARY KEY  (nid)
> ) TYPE=MyISAM;
> 
> --
511a525
>   homepage varchar(128) default '',
581,582c595
< INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0);
< INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
---
> INSERT INTO system VALUES ('modules/blog.module','blog','module','',1,0,0);
583a597,598
> INSERT INTO system VALUES ('modules/trackback.module','trackback','module','',1,0,0);
> 
584a600
> 
588c604
< INSERT INTO permission VALUES (1,'access content',0);
---
> INSERT INTO permission VALUES (1,'access comments, access content, access trackback, post trackback, post comments',0);
591c607,610
< INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
---
> INSERT INTO permission VALUES (2,'access comments, access content, access trackback, post trackback, post comments, post comments without approval',0);
> 
> INSERT INTO role (rid, name) VALUES (3, 'blogger');
> INSERT INTO permission VALUES (3,'access comments, access content, access trackback, administer comments, post trackback, post comments, post comments without approval, create blog entry, edit own blog',0);
597a617
> REPLACE blocks SET module = 'blog', delta = '0', status = '1';
598a619
> INSERT INTO vocabulary VALUES (1, 'Category', 'Categories for Blog Entries', 0, 0, 1, 0, 'blog', 0);
Only in drupal-4.4.1/database: database.pgsql
Only in drupal4blog/database: database.pgsql.not.working.yet
Only in drupal4blog/: files
Only in drupal4blog/modules: .locale.module.swp
diff -r drupal-4.4.1/modules/blog.module drupal4blog/modules/blog.module
5,6c5,12
<   $output = form_textarea(t("Explanation or submission guidelines"), "blog_help", variable_get("blog_help", ""), 70, 4, t("This text is displayed at the top of the blog submission form.  It's useful for helping or instructing your users."));
<   $output .= form_select(t("Minimum number of words in a blog entry"), "minimum_blog_size", variable_get("minimum_blog_size", 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t("The minimum number of words a personal blog entry should contain.  This is useful to rule out submissions that do not meet the site's standards, such as short test posts."));
---
>   $group = form_textarea(t("Explanation or submission guidelines"), "blog_help", variable_get("blog_help", ""), 70, 4, t("This text is displayed at the top of the blog submission form.  It's useful for helping or instructing your users."));
>   $group .= form_select(t("Minimum number of words in a blog entry"), "minimum_blog_size", variable_get("minimum_blog_size", 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t("The minimum number of words a blog entry should contain.  This is useful to rule out submissions that do not meet the site's standards, such as short test posts."));
>   $output = form_group(t('Blog Entry settings'), $group);
> 
>   $group = form_textfield(t("Block title"), "blog_block_title", variable_get("blog_block_title", "Recent Entries"), 70, 180, t("") . " " . t("Title of the Blog block, e.g. Recent Entries"));
>   $group .= form_select(t("Numbers of Entries"), "blog_block_entries", variable_get("blog_block_entries", 10), drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 50)), t("Numbers of last entries to display in block."));
>   $output .= form_group(t('Blog Block settings'), $group);
> 
11c17
<   return t("personal blog entry");
---
>   return t("blog entry");
15c21
<   return array("edit own blog");
---
>   return array("create blog entry", "edit own blog");
26c32
<     return user_access("edit own blog") && $user->uid;
---
>     return user_access("create blog entry");
38a45,72
> /**
>  * Respond to node insertion.
>  */
> function blog_insert($node) {
>   db_query("INSERT INTO {blog} (nid, extended, excerpt, format) VALUES (%d, '%s', '%s', %d)", $node->nid, $node->extended, $node->excerpt, $node->format);
> }
> 
> /**
>  * Respond to node updating.
>  */
> function blog_update($node) {
>   db_query("UPDATE {blog} SET extended = '%s', excerpt = '%s', format = %d WHERE nid = %d", $node->extended, $node->excerpt, $node->format, $node->nid);
> }
> 
> /**
>  * Respond to node deletion
>  */
> function blog_delete(&$node) {
>   db_query("DELETE FROM {blog} WHERE nid = %d", $node->nid);
> }
> 
> /**
>  * Load node-type-specific information.
>  */
> function blog_load($node) {
>   return db_fetch_object(db_query("SELECT extended, excerpt, format FROM {blog} WHERE nid = %d", $node->nid));
> }
> 
40a75,76
>     case "edit_form":
>         return array(t('Homepage') => form_textfield(t("Homepage"), "homepage", $user->homepage, 60, 128, t("Insert your homepage or blog URL. Take note this will be display in your user profile.")));
42a79,82
>       $output = "";
>       if ($user->homepage) {
>           $output .= form_item(t("Homepage"), "<a href=\"$user->homepage\">$user->homepage</a>");
>       }
44c84
<         return form_item(t("Blog"), l(t("view recent blog entries"), "blog/$user->uid", array("title" => t("Read %username's latest blog entries.", array("%username" => $user->name)))));
---
>         $output .= form_item(t("Blog"), l(t("view recent blog entries"), "blog/$user->uid", array("title" => t("Read %username's latest blog entries.", array("%username" => $user->name)))));
45a86
>       return $output;
57c98
<       <p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them).  On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>
---
>       <p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view blog\" link (which displays your blog entries as other people will see them).  On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>
173c214,221
<   $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : filter_tips_short());
---
>   $output .= form_textarea(t("Entry Body"), "body", $node->body, 60, 10, "");
> 
>   $output .= form_textarea(t("Extended Entry"), "extended", $node->extended, 60, 15, "");
> 
>   $output .= form_textarea(t("Excerpt"), "excerpt", $node->excerpt, 60, 5, $error["body"] ? $error["body"] : filter_tips_short());
> 
>   $format_type = array(-1 => "No formatting", 0 => "Convert Line Breaks", 1 => "Simple Wiki");
>   $output .= form_select(t("Text Formatting"), "format", $node->format, $format_type, t("'Convert Line Breaks' enclose your paragraph in &lt;p&gt; and &lt;/p&gt; tag for you which is what most bloggers are used to. 'No formatting' assume you will do all HTML formatting. 'Simple Wiki' supports very basic Wiki Formatting Rules."));
200c248
<   return node_prepare($node, $main);
---
>   return _blog_prepare($node, $main);
226c274
<       menu("blog/". $user->uid, t("my blog"), "blog_page", 1);
---
>       menu("blog/". $user->uid, t("blog archives"), "blog_page", 1);
257c305
<       $block["content"] = node_title_list(db_query_range("SELECT n.title, n.nid FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.nid DESC", 0, 10));
---
>       $block["content"] = node_title_list(db_query_range("SELECT n.title, n.nid FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.nid DESC", 0, variable_get("blog_block_title",10)));
259c307
<       $block["subject"] = t("Blogs");
---
>       $block["subject"] = variable_get("blog_block_title", "Recent Entries");
262a311,404
> }
> 
> 
> /*
>  * modified from check_output() from filter.module
>  */
> function check_output_without_nl2br($text) {
>   if (isset($text)) {
>     // Filter content on output:
>     $filters = filter_list();
> 
>     // Give filters the chance to escape HTML-like data such as code or formulas
>     // (from this point on, the input can be treated as HTML)
>     if (variable_get("filter_html", FILTER_HTML_DONOTHING) != FILTER_HTML_ESCAPE) {
>       foreach ($filters as $module => $filter) {
>         $text = module_invoke($module, "filter", "prepare", $text);
>       }
>     }
> 
>     // HTML handling is done before all regular filtering activities
>     $text = filter_default($text);
> 
>     // Regular filtering
>     foreach ($filters as $module => $filter) {
>       $text = module_invoke($module, "filter", "process", $text);
>     }
>   }
>   else {
>     $text = message_na();
>   }
> 
>   return $text;
> }
> 
> function blog_process_format($node,$str) {
>     if ($node->format < 0) {
>         return check_output_without_nl2br($str);
>     }
> 
>     // Convert Line Breaks
>     if ($node->format == 0) {
>         $paras = preg_split("/\r?\n\r?\n/",$str);
>         foreach ($paras as $id => $p) {
>             $paras[$id] = "<p>". check_output($p) ."</p>";
>         }
>         return implode("\n\n",$paras);
>     }
> 
>     // Simple Wiki
>     if ($node->format == 1) {
>         //include_once "modules/wiki.module";
>         //return _wiki_transform($str);
>         $wiki_search = array(
>             "/('*)'''(.*?)'''/",
>             "/''(.*)''/",
>             "/----+/",
>             "/\[(http|https|ftp|mailto):(\S+)\s+([^\]]+)\]/",
>             "/^(http|https|ftp):\/\/(\S+)(gif|jpg|png|bmp|jpeg)/",
>             "/([^\"\[])(http|https|ftp|mailto):(\S+)/",
>              );
> 
>         $wiki_replace = array(
>             "\\1<strong>\\2</strong>",
>             "<em>\\1</em>",
>             "<hr/>",
>             "<a href=\"\\1:\\2\">\\3</a>",
>             "<img src=\"\\1://\\2\\3\" /><br/>",
>             "\\1<a href=\"\\2:\\3\">\\2:\\3</a>",
>             );
> 
>         $paras = preg_split("/\r?\n\r?\n/",$str);
>         foreach ($paras as $id => $p) {
>             $paras[$id] = "<p>" .  check_output(
>                 preg_replace($wiki_search,$wiki_replace,$p)) . "</p>";
>         }
>         return implode("\n\n",$paras);
>     }
> 
>     return $str;
> }
> 
> function _blog_prepare($node,$main = 0) {
>     $node->readmore = (strlen($node->extended) > 0 
>                    || strlen($node->excerpt > 0));
>     if ($main == 0) {
>         $str = rtrim($node->body) . "\n\n" . rtrim($node->extended);
>         $node->body = blog_process_format($node,$str);
>     } else {
>         if (strlen(rtrim($node->excerpt)) > 0) 
>             $node->teaser = blog_process_format($node,rtrim($node->excerpt));
>         else
>             $node->teaser = blog_process_format($node,rtrim($node->body));
>     }
>     return $node;
diff -r drupal-4.4.1/modules/comment.module drupal4blog/modules/comment.module
11a12
>       <p>(<i>Only for Partial of Full Comment Control</i>)</p>
42a44
>       <p>(<i>Only for Full Comment Control</i>)</p>
47a50
>       <p>(<i>Only for Full Comment Control</i>)</p>
61c64
< 
---
>       <p>(<i>Only for Full Comment Control</i>)</p>
64a68
>       <p>(<i>Only for Full Comment Control</i>)</p>
69a74
>       <p>(<i>Only for Full Comment Control</i>)</p>
117,133c122,147
<   $group  = form_radios(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), _comment_get_modes(), t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together."));
<   $group .= form_radios(t("Default display order"), "comment_default_order", variable_get("comment_default_order", 1), _comment_get_orders(), t("The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference."));
<   $group .= form_select(t("Default comments per page"), "comment_default_per_page", variable_get("comment_default_per_page", "50"), _comment_per_page(), t("Default number of comments for each page: more comments are distributed in several pages."));
<   $group .= form_radios(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Display above the comments"), t("Display below the comments"), t("Display above and below the comments"), t("Do not display")), t("Position of the comment controls box.  The comment controls let the user change the default display mode and display order of comments."));
<   $output = form_group(t('Comment viewing options'), $group);
< 
<   $group  = form_radios(t("Preview comment"), "comment_preview", variable_get("comment_preview", 1), array(t("Optional"), t("Required")), t("Must users preview comments before submitting?"));
<   $group .= form_radios(t("Location of comment submission form"), "comment_form_location", variable_get("comment_form_location", 0), array(t("Display on separate page"), t("Display below post or comments")), t("The location of the comment submission form."));
<   $output .= form_group(t('Comment posting settings'), $group);
< 
<   $result = db_query("SELECT fid, filter FROM {moderation_filters} ");
<   while ($filter = db_fetch_object($result)) {
<     $thresholds[$filter->fid] = ($filter->filter);
<   }
<   if ($thresholds) {
<     $group = form_select(t("Default threshold"), "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, t("Thresholds are values below which comments are hidden. These thresholds are useful for busy sites which want to hide poor comments from most users."));
<     $output .= form_group(t('Comment moderation settings'), $group);
---
>   $group = form_radios(t("Comment Complexity"), "comment_complex", variable_get("comment_complex", 0), array(0 => t("Simple Comment Control"), 1 => t("Partial Comment Control (no moderation)"), 2 => t("Full Comment Control")),t("'Simple Comment Control' is easier to managed and sufficient for most people. 'Partial Comment Control' enables you to configure certain comments display options but no moderation features. 'Full Comment Control' gives you complete control, including moderation features."));
>   $group .=form_radios(t("Anonymous comment options"), "comment_anon", variable_get("comment_anon", 1), array(0 => t("Anonymous users may not enter their contact info"), 1=> t("Anonymous users may leave their contact info"), 2=> t("Anonymous users <b>must</b> leave their contact info")), t("This feature is only useful if you allow anonymous user to post comments. Set this in the ") . l(t("account permission"),"admin/user/permission") . t(" configuration."));
>   $output = form_group(t('Comment control'), $group);
> 
>   $group = "";
>   if (variable_get("comment_complex",0)) {
>     $group  .= form_radios(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), _comment_get_modes(), t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together."));
>     $group .= form_radios(t("Default display order"), "comment_default_order", variable_get("comment_default_order", 1), _comment_get_orders(), t("The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference."));
>     $group .= form_select(t("Default comments per page"), "comment_default_per_page", variable_get("comment_default_per_page", "50"), _comment_per_page(), t("Default number of comments for each page: more comments are distributed in several pages."));
>     $group .= form_radios(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Display above the comments"), t("Display below the comments"), t("Display above and below the comments"), t("Do not display")), t("Position of the comment controls box.  The comment controls let the user change the default display mode and display order of comments."));
>     $output .= form_group(t('Comment viewing options'), $group);
> 
>     $group  = form_radios(t("Preview comment"), "comment_preview", variable_get("comment_preview", 1), array(t("Optional"), t("Required")), t("Must users preview comments before submitting?"));
>     $group .= form_radios(t("Location of comment submission form"), "comment_form_location", variable_get("comment_form_location", 1), array(t("Display on separate page"), t("Display below post or comments")), t("The location of the comment submission form."));
>     $output .= form_group(t('Comment posting settings'), $group);
>   
>     if (variable_get("comment_complex",0)>1) {
>       $result = db_query("SELECT fid, filter FROM {moderation_filters} ");
>       while ($filter = db_fetch_object($result)) {
>         $thresholds[$filter->fid] = ($filter->filter);
>       }
>       if ($thresholds) {
>         $group = form_select(t("Default threshold"), "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, t("Thresholds are values below which comments are hidden. These thresholds are useful for busy sites which want to hide poor comments from most users."));
>         $output .= form_group(t('Comment moderation settings'), $group);
>       }
>     }
189a204,208
> 
>   if (!$comment->uid && variable_get("comment_anon",1))
>       $comment->name = _comment_anon_namefix($comment,
>                        unserialize($comment->anon));
> 
207a227,229
>       if (!$comment->uid && variable_get("comment_anon",1))
>         $comment->name = _comment_anon_namefix($comment,
>                            unserialize($comment->anon));
252a275,278
>   if (!$user->uid 
>    && variable_get("comment_anon",1))
>       $comment->name = _comment_anon_namefix($comment,$edit);
> 
262a289,291
>     if (!$comment->uid && variable_get("comment_anon",1))
>           $comment->name = _comment_anon_namefix($comment,
>                             unserialize($comment->anon));
431c460,468
<         db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $edit["cid"], $edit["nid"], $edit["pid"], $user->uid, $edit["subject"], $edit["comment"], $_SERVER['REMOTE_ADDR'], time(), $status, $score, $users, $thread);
---
>         $anon = "";
>         if (variable_get("comment_anon",1)) {
>             $anon = serialize(array(
>                 'anon_name' => trim(strip_tags($edit['anon_name'])),
>                 'anon_mail' => trim(strip_tags($edit['anon_mail'])),
>                 'anon_url' => trim(strip_tags($edit['anon_url']))));
>         }
> 
>         db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, anon, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s', '%s')", $edit["cid"], $edit["nid"], $edit["pid"], $user->uid, $edit["subject"], $edit["comment"], $_SERVER['REMOTE_ADDR'], time(), $status, $score, $users, $anon, $thread);
534a572
>       if (variable_get("comment_complex",0) == 0) $mode = 2;
563a602,604
>         if (!$comment->uid && variable_get("comment_anon",1))
>             $comment->name = _comment_anon_namefix($comment,
>                             unserialize($comment->anon));
578c619,624
<       $query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = '". check_query($nid) ."' AND c.status = 0";
---
>       $query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.status, c.anon, c.users, c.thread FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = '". check_query($nid);
>       
>       if (!user_access("administer comments"))
>           $query .= "' AND c.status = 0";
>       else
>           $query .= "' AND (c.status = 0 OR c.status = 1)";
674c720
<       if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) {
---
>       if (db_num_rows($result) && ((variable_get("comment_controls", 0) == 0 && variable_get("comment_complex",0)) || variable_get("comment_controls", 0) == 2)) {
685a732,735
>         if (!$comment->uid && variable_get("comment_anon",1))
>             $comment->name = _comment_anon_namefix($comment,
>                                 unserialize($comment->anon));
> 
696c746
<         }
---
>     }
728c778
<     if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) {
---
>     if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 1)) {
736c786,792
<   return array("access comments", "post comments", "administer comments", "moderate comments", "post comments without approval", "administer moderation");
---
>   switch (variable_get("comment_complex",0)) {
>       case 0:
>       case 1:
>         return array("access comments", "post comments", "administer comments", "post comments without approval");
>       case 2:
>         return array("access comments", "post comments", "administer comments", "moderate comments", "post comments without approval", "administer moderation");
>   }
809c865,866
<       if (user_access("administer moderation")) {
---
>       if (user_access("administer moderation") 
>       && (variable_get("comment_complex",0)>1)) {
903a961,964
>     if (!$comment->uid && variable_get("comment_anon",1))
>         $comment->name = _comment_anon_namefix($comment,
>                             unserialize($comment->anon));
> 
929a991,994
>   if (!$comment->uid && variable_get("comment_anon",1))
>       $comment->name = _comment_anon_namefix($comment,
>                        unserialize($comment->anon));
> 
965a1031,1037
>   $anon = "";
>   if (variable_get("comment_anon",1)) {
>     $anon = serialize(array(
>         'anon_name' => trim(strip_tags($edit['anon_name'])),
>         'anon_mail' => trim(strip_tags($edit['anon_mail'])),
>         'anon_url' => trim(strip_tags($edit['anon_url']))));
>   }
985a1058,1061
>     if (!$comment->uid && variable_get("comment_anon",1))
>         $comment->name = _comment_anon_namefix($comment,
>                             unserialize($comment->anon));
> 
1189c1265,1266
<       if (user_access("administer moderation")) {
---
>       if (user_access("administer moderation")
>       && (variable_get("comment_complex",0)>1)) {
1195c1272,1273
<       if (user_access("administer moderation")) {
---
>       if (user_access("administer moderation")
>       && (variable_get("comment_complex",0)>1)) {
1201c1279,1280
<       if (user_access("administer moderation")) {
---
>       if (user_access("administer moderation")
>       && (variable_get("comment_complex",0)>1)) {
1209c1288,1289
<       if (user_access("administer moderation")) {
---
>       if (user_access("administer moderation")
>       && (variable_get("comment_complex",0)>1)) {
1222a1303,1312
>     case "unpublish":
>       _comment_unpublish(check_query(arg(3)));
>       drupal_goto(comment_referer_load());
>       break;
> 
>     case "publish":
>       _comment_publish(check_query(arg(3)));
>       drupal_goto(comment_referer_load());
>       break;
> 
1244,1245c1334,1345
<   // name field:
<   $form .= form_item(t("Your name"), format_name($user));
---
>   if ($user->name || variable_get("comment_anon",1) == 0) {
>     // name field:
>     $form .= form_item(t("Your name"), format_name($user));
>   } else {
>     $form .= form_textfield(t("Name"), "anon_name", $edit['anon_name'], 30, 64);
>     $form .= form_textfield(t("E-mail Address"), "anon_mail", 
>         $edit['anon_mail'], 30, 64, 
>         variable_get("comment_anon",1) == 2 ? t("You must leave your name and email to post comments.") : "");
>     $form .= form_textfield(t("Homepage"), "anon_url", 
>         $edit['anon_url'], 30, 64, 
>         t("e.g. http://www.drupal.org/ - Your E-mail will not be display if you entered your homepage."));
>   }
1358a1459,1470
>     return $output;
>   }
> 
>   /* simple or partial comment control */
>   if (user_access("administer comments") && variable_get("comment_complex", 0) <= 1) {
>     if ($comment->status == 0) 
>         $output .= l(t("unpublish comment"),
>             "admin/comment/unpublish/".$comment->cid);
>     else if ($comment->status == 1)
>         $output .= l(t("publish comment"),
>             "admin/comment/publish/".$comment->cid);
>     return $output;
1360c1472,1473
<   else if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
---
> 
>   if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
1385a1499
>     return $output;
1388c1502
<   return $output;
---
>   return "";
1485a1600,1602
>           if (!$comment->uid && variable_get("comment_anon",1))
>             $comment->name = _comment_anon_namefix($comment,
>                                 unserialize($comment->anon));
1582c1699,1701
<   return (user_access("moderate comments"));
---
>   return (user_access("moderate comments") 
>       && (variable_get("comment_complex",0)>1));
> 
1690a1810,1855
> }
> 
> /*
>  * Should go into theme.inc?
>  */
> function theme_notmember() {
>     return ' <span class="marker">(non-member)</span>';
> }
> 
> function _comment_anon_namefix($comment,$anon) {
>     $anon_name = trim(strip_tags($anon['anon_name']));
>     $anon_mail = trim(strip_tags($anon['anon_mail']));
>     $anon_url = trim(strip_tags($anon['anon_url']));
> 
>     if (strlen($anon_name)<=0) return $comment->name;
> 
>     if (strlen($anon_url)>0
>     && preg_match(
>         "/^(http|https):\/\/[a-zA-Z0-9\-\.\/\&\/?\=]+$/", $anon_url)) {
>         return "<a href=\"$anon_url\">$anon_name</a> " . theme('notmember');
>     } else if (strlen($anon_mail)>0
>     && preg_match("/^\S+@[a-zA-Z0-9\-\.]+$/", $anon_mail)) {
>         return "<a href=\"mailto:$anon_mail\">$anon_name</a> " . theme('notmember');
>     }
> 
>     return $anon_name ." ". theme('notmember');
> }
> 
> function _comment_publish($cid) {
>   if (!user_access("administer comments")) return;
>   $comment = db_fetch_object(db_query("SELECT * FROM {comments} WHERE cid = %d", $cid));
>   if ($comment) {
>     db_query("UPDATE {comments} SET status = %d WHERE cid = %d", 0, $cid);
>     watchdog("special", "comment: published '".$comment->subject ."'");
>     drupal_set_message(t("Comment '".$comment->subject."' has been publish."));
>   }
> }
> 
> function _comment_unpublish($cid) {
>   if (!user_access("administer comments")) return;
>   $comment = db_fetch_object(db_query("SELECT * FROM {comments} WHERE cid = %d", $cid));
>   if ($comment) {
>     db_query("UPDATE {comments} SET status = %d WHERE cid = %d", 1, $cid);
>     watchdog("special", "comment: unpublished '".$comment->subject ."'");
>     drupal_set_message(t("Comment '".$comment->subject."' has been unpublish."));
>   }
diff -r drupal-4.4.1/modules/trackback.module drupal4blog/modules/trackback.module
7a8,9
>     case 'admin/system/modules/trackback':
>       return t("Trackback can be attached to any node and is treated like comments for all intent and purpose.");
10a13,24
> function trackback_settings() {
>     $output = "";
> 
>     $array_moderate = array(0 => t("No"), 1 => t("Yes"));
>     $output .= form_radios(t("Display Trackback only after approval"), "trackback_moderation", variable_get("trackback_moderation", 0), $array_moderate, t("If yes, all trackback must be moderated before it can be seen by others."));
> 
>     $array_moderate = array(0 => t("No"), 1 => t("Yes"));
>     $output .= form_radios(t("Trackback autodiscovery"), "trackback_autodiscovery", variable_get("trackback_autodiscovery", 1), $array_moderate, t("If yes, insert autodiscovery code for trackback in node."));
> 
>     return $output;
> }
> 
42a57,59
>     $anon = serialize(array(
>             'anon_name' => trim(strip_tags($trackback->name)),
>             'anon_url' => trim(strip_tags($trackback->url))));
45,46c62,63
<     db_query("INSERT INTO comments (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%d/')",
<              $cid, $node->nid, 0, 0, $subject, $comment, getenv("REMOTE_ADDR"), time(), 0, 0, '', $thread);
---
>     db_query("INSERT INTO comments (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, anon, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')",
>              $cid, $node->nid, 0, 0, $subject, $comment, getenv("REMOTE_ADDR"), time(), variable_get("trackback_moderation", 0), 0, $anon, $thread);
66,72c83,99
<   if (is_numeric(arg(1)) && $node = node_load(array("nid" => arg(1)))) {
<     header("Content-Type: text/xml");
<     print trackback_receive($node);
<   }
<   else {
<     drupal_goto();
<   }
---
>     global $base_url;
> 
>     if (arg(1) == "url" && is_numeric(arg(2)) 
>         && $node = node_load(array("nid" => arg(2)))) {
>         $output = t("<p>The Trackback URL for " .
>                     l(t("'$node->title'"),"node/view/$node->nid") .
>                     t(" is :</p><p>") .
>                     l(t($base_url . "/" . url("trackback/$node->nid")),
>                         "trackback/$node->nid") .
>                     t("</p>"));
>         print theme('page', $output, t("Trackback URL"));
>     } elseif (is_numeric(arg(1)) && $node = node_load(array("nid" => arg(1)))) {
>         header("Content-Type: text/xml");
>         print trackback_receive($node);
>     } else {
>         drupal_goto();
>     }
92,93c119,120
<     $link = l(t("trackback url"), "trackback/$node->nid");
<     if (!$main) {
---
>     $link = l(t("trackback url"), "trackback/url/$node->nid");
>     if (!$main && variable_get("trackback_autodiscovery",1)) {
224c251
< ?>
---
> ?>
