Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15527
Modified Files:
serendipity_admin_interop.inc.php
serendipity_rss_exchange.inc.php
Log Message:
fixed rss import logic, added new option
Index: serendipity_rss_exchange.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_rss_exchange.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- serendipity_rss_exchange.inc.php 13 Jul 2004 08:49:41 -0000 1.5
+++ serendipity_rss_exchange.inc.php 27 Sep 2004 10:15:37 -0000 1.6
@@ -6,21 +6,26 @@
{
global $serendipity;
- $entry = array();
+ $entry = array();
+ $bodyonly = (isset($serendipity['POST']['bodyonly']) && $serendipity['POST']['bodyonly'] == 'true' ? true : false);
if ($item['description']) {
$entry['body'] = $item['description'];
}
if ($item['content:encoded']) {
- if (!isset($entry['body'])) {
+ if (!isset($entry['body']) || $bodyonly) {
$data = &$entry['body'];
} else {
$data = &$entry['extended'];
}
+ // See if the 'description' element is a substring of the 'content:encoded' part. If it is,
+ // we will only fetch the full 'content:encoded' part. If it's not a substring, we append
+ // the 'content:encoded' part to either body or extended entry (respecting the 'bodyonly'
+ // switch).
if ($entry['body'] != substr($item['content:encoded'], 0, strlen($entry['body']))) {
- $data .= substr($item['content:encoded'], strlen($entry['body']));
+ $data .= $item['content:encoded'];;
} else {
$data = $item['content:encoded'];
}
@@ -70,4 +75,4 @@
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
+?>
\ No newline at end of file
Index: serendipity_admin_interop.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_interop.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- serendipity_admin_interop.inc.php 13 Jul 2004 08:49:41 -0000 1.7
+++ serendipity_admin_interop.inc.php 27 Sep 2004 10:15:24 -0000 1.8
@@ -40,7 +40,8 @@
<select name="serendipity[category]">
<option value="0">[ <?php echo NO_CATEGORY; ?> ]</option>
<?php echo serendipity_generateCategoryList($cats, array(), 1); ?>
- </select>
+ </select><br />
+ <input type="checkbox" name="serendipity[bodyonly]" id="bodyonly" value="true" /><label for="bodylonly"><?php echo RSS_IMPORT_BODYONLY; ?></label><br />
<input type="submit" value="<?php echo IMPORT; ?> RSS" />
</div>
|