Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14984
Modified Files:
Tag: branch-smarty
serendipity_admin_interop.inc.php
serendipity_rss_exchange.inc.php
Log Message:
Modified RSS import parser to respect putting import text only to a single
field. Fixed buggy substr() logic. Someone care to test this with a 'live'
import?
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.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- serendipity_rss_exchange.inc.php 13 Jul 2004 08:49:41 -0000 1.5
+++ serendipity_rss_exchange.inc.php 27 Sep 2004 10:13:39 -0000 1.5.2.1
@@ -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.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- serendipity_admin_interop.inc.php 13 Jul 2004 08:49:41 -0000 1.7
+++ serendipity_admin_interop.inc.php 27 Sep 2004 10:13:39 -0000 1.7.2.1
@@ -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>
|