Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter lifted

    (@lifted)

    And this is the feed-rss file I have hi-jacked:

    <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    
    <xml>
    	<quotes>
    
    <?php while (have_posts()) : the_post(); ?>
    
    		<?php
    			$author = get_post_meta($post->ID, 'postAuthor', true);
    			?>
    
    			<quote>
    
    				<Id><?php the_ID(); ?></Id>
    				<Author><?php if($author == "" || $author == null){ the_author(); }else{ echo $author; } ?></Author>
    				<Text><?php the_excerpt(); ?></Text>
    				<Link><?php the_permalink();  ?></Link>
    
    			</quote>
    
    <?php endwhile; ?>
    
    			</quotes>
    
    </xml>
    Thread Starter lifted

    (@lifted)

    To make things as simple as possible for you all I have pasted in the code for the files associated with this issue.

    QUOTES.PHP

    <?php require('wp-blog-header.php'); ?>
    <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    
    <xml>
    	<quotes>
    
    	<?php
    
    	$args = array(
    		'numberposts' => 5,
    		'post_status' => null,
    		'post_parent' => null, // any parent
    		);
    
     		$posts = get_posts($args); 
    
    		?>
    
    		<?php if( $posts ) : ?>
    
    			<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
    
    				<?php
    					$author = get_post_meta($post->ID, 'postAuthor', true);
    					?>
    
    					<quote>
    
    						<Id><?php the_ID(); ?></Id>
    						<Author><?php if($author == "" || $author == null){ the_author(); }else{ echo $author; } ?></Author>
    						<Text><?php the_excerpt(); ?></Text>
    						<Link><?php the_permalink();  ?></Link>
    
    					</quote>
    
    					<?php endforeach; ?>
    
    				<?php endif; ?>
    
    			</quotes>
    
    </xml>
    Thread Starter lifted

    (@lifted)

    to make it clearer to everyone I have pasted some urls for you all to take a look at. the first is the custom piece of php I wrote to create this custom feed.

    quotes.php

    this next link is to a wordpress rss feed file which I have customized to output the same data structure as the quotes.php file.
    feed=rss

    both of these documents have content type text/html and both appear to be pretty much the same when viewed in the browser or when viewing the page source. Yet strangely enough the Flash is unable to read the data produced by the quotes.php file and it CAN read the data produced by the feed-rss file??

    Can anyone help!?

    Thread Starter lifted

    (@lifted)

    Whoa… easy tiger!
    You’re right, this ended up being the wrong place to post this question, so my apologies for that, but nonetheless I really appreciate your advice on this issue! You have really helped me out scribblerguy and I don’t want you to think I am ungrateful for that!

    In future I will be sure to place my posts in the approproiate forum, so as to not waste anyones time. Thanks again for your help and advice, its people like you that make wordpress so great!

    Thread Starter lifted

    (@lifted)

    Hi Scribblerguy!~
    Thanks so much for replying in such a timely manner!…
    To give you a little more background on what this posting is all about, I will often integrate small flash apps with my wordpress themes, in the past I have simply edited the existing wp-rss.php file to spit out a custom XML structure which I can read in flash.

    The problem that I was experiencing with this was that if someone wanted to subscribe to the RSS feed which I have hijacked they get a bunch of useless info! So I wanted to create a new file which did the same thing as the rss feed, but didn’t hijack any of the actual wordpress feed files.

    SO… to pose a question back to you… if I create a new file with the blog header included, and run a loop to spit out my posts, will I still be able to pass variables to the code such as cat=6??

    this is one of the major reasons why I would hi-jack the RSS feed, because I could call the same feed and dynamically query different categories or tag archives on the fly. Will this still work with the approach you recommend??

    thanks so much for your help and advice!

Viewing 5 replies - 1 through 5 (of 5 total)