diff -r drupal4blog/database/database.mysql drupal-4.4.1/database/database.mysql
131d130
<   anon longtext,
305,316d303
< -- 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;
< 
< --
525d511
<   homepage varchar(128) default '',
587,597d572
< -- Table structure for table 'tb'
< --
< 
< CREATE TABLE tb (
<   nid int(10) unsigned NOT NULL default '0',
<   pinged longtext,
<   toping longtext,
<   PRIMARY KEY  (nid)
< ) TYPE=MyISAM;
< 
< --
606,607c581,582
< INSERT INTO system VALUES ('modules/blog.module','blog','module','',1,0,0);
< INSERT INTO system VALUES ('modules/ping.module','ping','module','',1,0,0);
---
> INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0);
> INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
609,610d583
< INSERT INTO system VALUES ('modules/trackback.module','trackback','module','',1,0,0);
< 
612d584
< 
616c588
< INSERT INTO permission VALUES (1,'access comments, access content, access trackback, post trackback, post comments',0);
---
> INSERT INTO permission VALUES (1,'access content',0);
619,622c591
< 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);
---
> INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
629d597
< REPLACE blocks SET module = 'blog', delta = '0', status = '1';
631d598
< 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 drupal4blog/modules/blog.module drupal-4.4.1/modules/blog.module
5,12c5,6
<   $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);
< 
---
>   $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."));
17c11
<   return t("blog entry");
---
>   return t("personal blog entry");
21c15
<   return array("create blog entry", "edit own blog");
---
>   return array("edit own blog");
32c26
<     return user_access("create blog entry");
---
>     return user_access("edit own blog") && $user->uid;
45,72d38
< /**
<  * Respond to node insertion.
<  */
< function blog_insert($node) {
<   db_query("INSERT INTO {blog} (nid, extended, excerpt, format, status) VALUES (%d, '%s', '%s', %d, %d)", $node->nid, $node->extended, $node->excerpt, $node->format, $node->status);
< }
< 
< /**
<  * Respond to node updating.
<  */
< function blog_update($node) {
<   db_query("UPDATE {blog} SET extended = '%s', excerpt = '%s', format = %d, status = %d WHERE nid = %d", $node->extended, $node->excerpt, $node->format, $node->status, $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, status FROM {blog} WHERE nid = %d", $node->nid));
< }
< 
75,76d40
<     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.")));
79,82d42
<       $output = "";
<       if ($user->homepage) {
<           $output .= form_item(t("Homepage"), "<a href=\"$user->homepage\">$user->homepage</a>");
<       }
84c44
<         $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)))));
---
>         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)))));
86d45
<       return $output;
98c57
<       <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>
---
>       <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>
214,221c173
<   $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."));
---
>   $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : filter_tips_short());
248c200
<   return _blog_prepare($node, $main);
---
>   return node_prepare($node, $main);
274c226
<       menu("blog/". $user->uid, t("blog archives"), "blog_page", 1);
---
>       menu("blog/". $user->uid, t("my blog"), "blog_page", 1);
286c238
<     if (blog_access("update", $node) && !user_access('administer nodes')) {
---
>     if (blog_access("update", $node)) {
305c257
<       $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)));
---
>       $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));
307c259
<       $block["subject"] = variable_get("blog_block_title", "Recent Entries");
---
>       $block["subject"] = t("Blogs");
311,404d262
< }
< 
< 
< /*
<  * 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 drupal4blog/modules/comment.module drupal-4.4.1/modules/comment.module
12d11
<       <p>(<i>Only for Partial of Full Comment Control</i>)</p>
44d42
<       <p>(<i>Only for Full Comment Control</i>)</p>
50d47
<       <p>(<i>Only for Full Comment Control</i>)</p>
64c61
<       <p>(<i>Only for Full Comment Control</i>)</p>
---
> 
68d64
<       <p>(<i>Only for Full Comment Control</i>)</p>
74d69
<       <p>(<i>Only for Full Comment Control</i>)</p>
122,147c117,133
<   $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);
<       }
<     }
---
>   $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);
204,208d189
< 
<   if (!$comment->uid && variable_get("comment_anon",1))
<       $comment->name = _comment_anon_namefix($comment,
<                        unserialize($comment->anon));
< 
227,229d207
<       if (!$comment->uid && variable_get("comment_anon",1))
<         $comment->name = _comment_anon_namefix($comment,
<                            unserialize($comment->anon));
275,278d252
<   if (!$user->uid 
<    && variable_get("comment_anon",1))
<       $comment->name = _comment_anon_namefix($comment,$edit);
< 
289,291d262
<     if (!$comment->uid && variable_get("comment_anon",1))
<           $comment->name = _comment_anon_namefix($comment,
<                             unserialize($comment->anon));
460,468c431
<         $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);
---
>         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);
572d534
<       if (variable_get("comment_complex",0) == 0) $mode = 2;
602,604d563
<         if (!$comment->uid && variable_get("comment_anon",1))
<             $comment->name = _comment_anon_namefix($comment,
<                             unserialize($comment->anon));
619,624c578
<       $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)";
---
>       $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";
720c674
<       if (db_num_rows($result) && ((variable_get("comment_controls", 0) == 0 && variable_get("comment_complex",0)) || variable_get("comment_controls", 0) == 2)) {
---
>       if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) {
732,735d685
<         if (!$comment->uid && variable_get("comment_anon",1))
<             $comment->name = _comment_anon_namefix($comment,
<                                 unserialize($comment->anon));
< 
746c696
<     }
---
>         }
778c728
<     if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 1)) {
---
>     if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) {
786,792c736
<   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");
<   }
---
>   return array("access comments", "post comments", "administer comments", "moderate comments", "post comments without approval", "administer moderation");
809d752
<         $unp = comment_num_unpublish($node->nid);
812,821c755
<           if ($new && $unp)
<               $title = sprintf("%d new and %d unpublish comments", $new, $unp);
<           else if ($new)
<               $title .= format_plural($new, "1 new comment", 
<                             "%count new comments");
<           else if ($unp)
<               $title .= format_plural($unp, "1 unpublish comment", 
<                             "%count unpublish comments");
<           else
<               $title = "Jump to the first comment of this posting.";
---
>           $links[] = l(format_plural($all, "1 comment", "%count comments"), "node/view/$node->nid", array("title" => t("Jump to the first comment of this posting.")), NULL, "comment");
823c757,759
<           $links[] = l(format_plural($all, "1 comment", "%count comments"), "node/view/$node->nid", array("title" => t($title)), NULL, "comment");
---
>           if ($new) {
>             $links[] = l(format_plural($new, "1 new comment", "%count new comments"), "node/view/$node->nid", array("title" => t("Jump to the first new comment of this posting.")), NULL, "new");
>           }
873,874c809
<       if (user_access("administer moderation") 
<       && (variable_get("comment_complex",0)>1)) {
---
>       if (user_access("administer moderation")) {
969,972d903
<     if (!$comment->uid && variable_get("comment_anon",1))
<         $comment->name = _comment_anon_namefix($comment,
<                             unserialize($comment->anon));
< 
999,1002d929
<   if (!$comment->uid && variable_get("comment_anon",1))
<       $comment->name = _comment_anon_namefix($comment,
<                        unserialize($comment->anon));
< 
1039,1045d965
<   $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']))));
<   }
1066,1069d985
<     if (!$comment->uid && variable_get("comment_anon",1))
<         $comment->name = _comment_anon_namefix($comment,
<                             unserialize($comment->anon));
< 
1273,1274c1189
<       if (user_access("administer moderation")
<       && (variable_get("comment_complex",0)>1)) {
---
>       if (user_access("administer moderation")) {
1280,1281c1195
<       if (user_access("administer moderation")
<       && (variable_get("comment_complex",0)>1)) {
---
>       if (user_access("administer moderation")) {
1287,1288c1201
<       if (user_access("administer moderation")
<       && (variable_get("comment_complex",0)>1)) {
---
>       if (user_access("administer moderation")) {
1296,1297c1209
<       if (user_access("administer moderation")
<       && (variable_get("comment_complex",0)>1)) {
---
>       if (user_access("administer moderation")) {
1311,1320d1222
<     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;
< 
1342,1353c1244,1245
<   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."));
<   }
---
>   // name field:
>   $form .= form_item(t("Your name"), format_name($user));
1467d1358
<     return $output;
1469,1481c1360
< 
<   /* 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;
<   }
< 
<   if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
---
>   else if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
1507d1385
<     return $output;
1510c1388
<   return "";
---
>   return $output;
1608,1610d1485
<           if (!$comment->uid && variable_get("comment_anon",1))
<             $comment->name = _comment_anon_namefix($comment,
<                                 unserialize($comment->anon));
1656,1660c1531
<     if (user_access("administer comments")) {
<         $cache[$nid] = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE nid = %d", $nid));
<     } else {
<         $cache[$nid] = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE nid = %d AND status = 0", $nid));
<     }
---
>     $cache[$nid] = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE nid = %d AND status = 0", $nid));
1665,1668d1535
< function comment_num_unpublish($nid) {
<   return db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE nid = %d AND status = 1", $nid));
< }
< 
1703,1707c1570
<     if (user_access("administer comments")) {
<         $result = db_result(db_query("SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = %d AND timestamp > %d", $nid, $timestamp));
<     } else {
<         $result = db_result(db_query("SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = %d AND timestamp > %d AND c.status = 0", $nid, $timestamp));
<     }
---
>     $result = db_result(db_query("SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = %d AND timestamp > %d AND c.status = 0", $nid, $timestamp));
1719,1721c1582
<   return (user_access("moderate comments") 
<       && (variable_get("comment_complex",0)>1));
< 
---
>   return (user_access("moderate comments"));
1830,1875d1690
< }
< 
< /*
<  * 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 drupal4blog/modules/ping.module drupal-4.4.1/modules/ping.module
20,30d19
< 
<     case 'admin/system/modules/ping':
<       $output = t("
<         <p>There are three different ways to notify different search engine
<         or websphere trackers. If you don't know what these means, then
<         just leave it as-is.</p>
<         <p>Pings are send out once every few hours, depending how frequent
<         you set your cron.php (see Section 6 on CRON TASKS in INSTALL).
<         Pings <b>will not</b> be send unless you configure your the name
<         and 'slogan' of your site. See configuration.</p>", 
<             array("configuration" => l(t("configuration"),"admin/system")));
36,43d24
< function ping_settings() {
<     $output = "";
<     $output .= form_textarea(t("Sites to alert (ping)"), "ping_ping", variable_get("ping_ping", "http://rpc.weblogs.com/RPC2"), 70, 4, t("Send weblogUpdates.ping to these sites"));
<     $output .= form_textarea(t("Sites to alert (advance ping)"), "ping_extping", variable_get("ping_extping", "http://ping.blo.gs/\nhttp://rpc.technorati.com/rpc/ping/"), 70, 4, t("Send weblogUpdates.extendedPing to these sites"));
<     $output .= form_textarea(t("Sites to alert (rss update)"), "ping_rss", variable_get("ping_rss", "http://rssrpc.weblogs.com/RPC2"), 70, 4, t("Send rssUpdate to these sites"));
<     return $output;
< }
< 
63,73c44
<   $urls = preg_split("/\s+/",
<     variable_get("ping_ping", "http://rpc.weblogs.com/RPC2"));
<   foreach ($urls as $pingurl) {
<       $purl = parse_url($pingurl);
<       $path = $purl['path'];
<       if (strlen($purl['query'])>0)     $path .= "?".$purl['query'];
<       if (strlen($purl['fragment'])>0)   $path .= "#".$purl['fragment'];
< 
<       $client = new xmlrpc_client($path,$purl['host'],$purl['port']);
< 
<       $message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($name), new xmlrpcval($url)));
---
>   $client = new xmlrpc_client("/RPC2", "rpc.weblogs.com", 80);
75c46
<       $result = $client->send($message);
---
>   $message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($name), new xmlrpcval($url)));
77,79c48
<       if (!$result || $result->faultCode()) {
<         watchdog("error", "weblogUpdates.ping: failed to notify ".$pingurl);
<       } 
---
>   $result = $client->send($message);
81c50,51
<       unset($client);
---
>   if (!$result || $result->faultCode()) {
>     watchdog("error", "failed to notify 'weblogs.com' (site)");
84,90c54
<   $urls = preg_split("/\s+/",
<     variable_get("ping_extping", "http://ping.blo.gs/\nhttp://rpc.technorati.com/rpc/ping/"));
<   foreach ($urls as $pingurl) {
<       $purl = parse_url($pingurl);
<       $path = $purl['path'];
<       if (strlen($purl['query'])>0)     $path .= "?".$purl['query'];
<       if (strlen($purl['fragment'])>0)   $path .= "#".$purl['fragment'];
---
>   unset($client);
92c56
<       $client = new xmlrpc_client($path,$purl['host'],$purl['port']);
---
>   $client = new xmlrpc_client("/RPC2", "rssrpc.weblogs.com", 80);
94c58
<       $message = new xmlrpcmsg("weblogUpdates.extendedPing", array(new xmlrpcval($name), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval($feed)));
---
>   $message = new xmlrpcmsg("rssUpdate", array(new xmlrpcval($name), new xmlrpcval($feed)));
96c60
<       $result = $client->send($message,0,$purl['scheme']);
---
>   $result = $client->send($message);
98,102c62,63
<       if (!$result || $result->faultCode()) {
<         watchdog("error", "weblogUpdates.extendedPing: failed to notify ".$pingurl);
<       } 
< 
<       unset($client);
---
>   if (!$result || $result->faultCode()) {
>     watchdog("error", "failed to notify 'weblogs.com' (RSS)");
105,113c66
<   $urls = preg_split("/\s+/",
<     variable_get("ping_rss", "http://rssrpc.weblogs.com/RPC2"));
<   foreach ($urls as $pingurl) {
<       $purl = parse_url($pingurl);
<       $path = $purl['path'];
<       if (strlen($purl['query'])>0)     $path .= "?".$purl['query'];
<       if (strlen($purl['fragment'])>0)   $path .= "#".$purl['fragment'];
< 
<       $client = new xmlrpc_client($path,$purl['host'],$purl['port']);
---
>   unset($client);
115c68
<       $message = new xmlrpcmsg("rssUpdate", array(new xmlrpcval($name), new xmlrpcval($feed)));
---
>   $client = new xmlrpc_client("/", "ping.blo.gs", 80);
117c70
<       $result = $client->send($message,0,$purl['scheme']);
---
>   $message = new xmlrpcmsg("weblogUpdates.extendedPing", array(new xmlrpcval($name), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval($feed)));
119,121c72
<       if (!$result || $result->faultCode()) {
<         watchdog("error", "rssUpdate: failed to notify ".$pingurl);
<       } 
---
>   $result = $client->send($message);
123c74,75
<       unset($client);
---
>   if (!$result || $result->faultCode()) {
>     watchdog("error", "failed to notify 'blo.gs' ");
125d76
< }
126a78
> }
diff -r drupal4blog/modules/trackback.module drupal-4.4.1/modules/trackback.module
8,9d7
<     case 'admin/system/modules/trackback':
<       return t("Trackback can be attached to any node and is treated like comments for all intent and purpose.");
13,24d10
< 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, any external links will be extracted and the appropriate sites will be sent a Trackback ping. Take note it might slowdown your posting esp. if there is a lot of external links."));
< 
<     return $output;
< }
< 
37,86c23,28
<   $node->toping = ""; # Start from scratch
< 
<   $tb_urls = $node->tb_url;
<   if (variable_get("trackback_autodiscovery",1)) {
<     $text = $node->body; 
<     if ($node->type == 'blog')
<       $text .= " ".$node->extended." ".$node->excerpt;
<     preg_match_all("|http://[\w\.\-\+\&\+\=\/\#\%]+|",$text,$murl);
<     $links = array_unique($murl[0]);
<     foreach ($links as $url) {
<       $result = drupal_http($url);
<       $result->data = preg_replace("/[\n\r]/"," ",$result->data);
<       $tb = preg_replace("/.*<rdf\:RDF.*trackback\:ping\=\"([^\"]+)\".*<\/rdf\:RDF>.*/","\\1",$result->data);
<       $tb_urls .= " ".$tb;
<     }
<   }
< 
<   $urls = preg_split("/\s+/",$tb_urls);
<   foreach($urls as $url) {
<     # No need to ping empty URL
<     if (strlen($url)<=0) continue;
< 
<     # Do not ping those already ping'ed unless explicitly specified 
<     if (strstr($node->pinged,$url) && !strstr($node->tb_url,$url)) continue;
< 
<     $result = drupal_http(
<         $url,
<         $headers = array("Content-Type" => "application/x-www-form-urlencoded"),
<         "POST",
<         implode("&", $str)
<     );
< 
<     if (strlen(trim($result->error))>0) {
<       drupal_set_message("Error! Unable to send Trackback ping to ".$url);
<       if (!strstr($node->toping,$url))
<         $node->toping .= "\n".$url; $node->toping = trim($node->toping);
<     } else {
<       drupal_set_message("Success! Trackback ping send to ".$url);
<       if (!strstr($node->pinged,$url))
<         $node->pinged .= "\n".$url; $node->pinged = trim($node->pinged);
<     }
<   }
< 
<   $c = db_result(
<     db_query("SELECT COUNT(nid) FROM {tb} WHERE nid = %d", $node->nid));
< 
<   if ($c>0) 
<       trackback_update($node);
<   else 
<       trackback_insert($node);
---
>   return drupal_http(
>     $node->tb_url,
>     $headers = array("Content-Type" => "application/x-www-form-urlencoded"),
>     "POST",
>     implode("&", $str)
>   );
101,103d42
<     $anon = serialize(array(
<             'anon_name' => trim(strip_tags($trackback->name)),
<             'anon_url' => trim(strip_tags($trackback->url))));
106,107c45,46
<     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);
---
>     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);
127,158c66,72
<     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 node is:<br/><blockquote>url</blockquote></p>",
<                     array("node" => l("'$node->title'","node/view/$node->nid"),
<                           "url" => l($base_url . "/" . url("trackback/$node->nid"),
<                             "trackback/$node->nid")));
< 
<         if (user_access("administer nodes")) {
<           $node = trackback_load_node($node);
<           $urls = preg_split("/\s+/",$node->pinged);
<           $head = 0;
<           foreach ($urls as $url) {
<             if (strlen(trim($url))<=0) continue;
<             if ($head == 0) {
<               $output .=  "<p>".
<                 t("Trackback pings have been sent to the following URLs:");
<               $head = 1;
<             }
<             $output .= "<li>$url</li>\n";
<           }
<           if ($head) $output .= "</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();
<     }
---
>   if (is_numeric(arg(1)) && $node = node_load(array("nid" => arg(1)))) {
>     header("Content-Type: text/xml");
>     print trackback_receive($node);
>   }
>   else {
>     drupal_goto();
>   }
162d75
<   $node = trackback_load_node($node);
165,166c78
<       $node->tb_url = $node->toping;
<       return form_textarea(t("Trackback URL"), "tb_url", $node->tb_url, 70, 3, t("Enter URLs to send the trackback to."));
---
>       return form_textfield(t("Trackback URL"), "tb_url", $node->tb_url, 40, 255, t("Enter a URL to send the trackback to."));
169,170c81
<       if ($node->nid 
<         && ($node->tb_url || variable_get("trackback_autodiscovery",1)))
---
>       if ($node->tb_url && $node->nid) {
171a83
>       }
175,200d86
< function trackback_insert($node) {
<   db_query("INSERT INTO tb (pinged, toping, nid) VALUES ('%s', '%s', %d)",
<     $node->pinged, $node->toping, $node->nid);
< }
< 
< function trackback_update($node) {
<   db_query("UPDATE {tb} SET pinged = '%s', toping = '%s' WHERE nid = %d",
<     $node->pinged, $node->toping, $node->nid);
< }
< 
< function trackback_delete(&$node) {
<   db_query("DELETE FROM {tb} WHERE nid = %d", $node->nid);
< }
< 
< function trackback_load($node) {
<   return db_fetch_object(db_query("SELECT pinged, toping FROM {tb} WHERE nid = %d", $node->nid));
< }
< 
< function trackback_load_node($node) {
<   if ($result = trackback_load($node)) {
<     foreach ($result as $key => $value)
<       $node->$key = $value;
<   }
<   return $node;
< }
< 
202d87
<   global $base_url;
207c92
<     $link = l(t("trackback url"), "trackback/url/$node->nid");
---
>     $link = l(t("trackback url"), "trackback/$node->nid");
209,210c94,95
<       $url = $base_url . "/" . url("node/view/$node->nid");
<       $tb_url = $base_url . "/" . url("trackback/$node->nid");
---
>       $url = url("node/view/$node->nid");
>       $tb_url = url("trackback/$node->nid");
339c224
< ?>
---
> ?>
