Make WordPress Core

Changeset 771 for trunk/wp-mail.php


Ignore:
Timestamp:
01/13/2004 09:23:41 AM (22 years ago)
Author:
saxmatt
Message:

Fix ups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-mail.php

    r628 r771  
    210210
    211211            $post_title = xmlrpc_getposttitle($content);
    212             $post_category = xmlrpc_getpostcategory($content);
     212            $post_categories[] = xmlrpc_getpostcategory($content);
    213213
    214214            if ($post_title == '') {
    215215                $post_title = $subject;
    216216            }
    217             if ($post_category == '') {
    218                 $post_category = $default_category;
     217            if (empty($post_categories)) {
     218                $post_categories[] = $default_category;
    219219            }
    220220
    221221            if (!$thisisforfunonly) {
    222222                $post_title = addslashes(trim($post_title));
     223                $content = preg_replace("|\n([^\n])|", " $1", $content);
    223224                $content = addslashes(trim($content));
    224225                if($flat > 500) {
     
    238239                    pingGeoUrl($post_ID);   
    239240                }
    240                 // HACK HACK HACK this next line is commented out because I don't know what the word-press replacement
    241                 // is.  right now it's undefined and does not work             
    242                 //rss_update($blog_ID);
     241
    243242                pingWeblogs($blog_ID);
    244                 pingCafelog($cafelogID, $post_title, $post_ID);
    245243                pingBlogs($blog_ID);
    246244                pingback($content, $post_ID);
     
    248246            echo "\n<p><b>Posted title:</b> $post_title<br />";
    249247            echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>';
     248
     249        if (!$post_categories) $post_categories[] = 1;
     250        foreach ($post_categories as $post_category) {
     251            // Double check it's not there already
     252            $exists = $wpdb->get_row("SELECT * FROM $tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");
     253
     254             if (!$exists && $result) {
     255                $wpdb->query("
     256                INSERT INTO $tablepost2cat
     257                (post_id, category_id)
     258                VALUES
     259                ($post_ID, $post_category)
     260                ");
     261            }
     262        }
    250263
    251264            if(!$pop3->delete($iCount)) {
Note: See TracChangeset for help on using the changeset viewer.