Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Display the whole RSS content with HTML Formating

Status
Not open for further replies.

Themb

IS-IT--Management
Jul 29, 2008
1
US
Geeks and XML Freaks I need your help.
I have a CMS with teaser RSS Feeds I want to make it where it will display the whole article with all its content in a HTML Format... Done a lot of reading tried different things so I appealing to your help.
Here is what I have:
Free internet marketing content SEO Articles
This is what I want:
http://labs.echoditto.com/projects/fulltextrss/?url=http%3A%2F%2Fwww.internet-marketing-cafe.com%2Frss.php%3Frss%3D299"]FULL Feed[/URL]
How I got there:
Full-Text RSS | EchoDitto Labs (he is using FeedCreator)

I have attached the files with the code... Thank for your much appreciated help.
Code:
Code:
Here is the code that is generating the articles:
ArticleDetail.php
<?php
include('func/art_func.inc.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<title>
<?php echo $artname ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="DESCRIPTION" CONTENT="Article from <?php echo $title ?> and entitled <?php echo $artname ?> - By <?php echo $authorname ?>">
<?php
if(isset($keywords))
{
?>
<META NAME="KEYWORDS" CONTENT="<?php echo $keywords ?>">
<?php
}else{
?>
<META NAME="KEYWORDS" CONTENT="<?php echo $meta_key ?>">
<?php
}
?>
<meta name="robots" content="index, follow">
<meta name="distribution" content="Global">
<META NAME="rating" CONTENT="General">
<link rel="alternate" type="application/rss+xml" title="<?php echo $artname ?>" href="<?php echo $site_URL ?>rss.php?rss=<?php echo $categid ?> ">
<script language="javascript" type="text/javascript" src="/js/clipboard.js"></script>
<link href="/css/articles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table id="width" border="0" align="center" cellpadding="0" cellspacing="0" class="greyborder">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="80">
<?php require_once(INC."top.inc.php"); ?></td>
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="fonttitle">
<td valign="top" class="fonttitle">&nbsp; </td>
<td valign="top" align="center" bgcolor="#FFFFFF" class="fonttitle" > Number Times Read :
<?php echo $reader ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php if($wordcount > '0') echo "Word Count: ".$wordcount; ?></td>
<td valign="top" class="fonttitle">&nbsp; </td>
</tr>
<tr>

<?php require_once(INC."left.inc.php"); ?></td>
<td valign="top" class="main_table">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="10" cellspacing="1">
<tr>
<td>
<br>
<br>
<b>
<?php if ($photo) echo "<img src='".$site_URL."author/".$photo."' style='border:1px solid;color: black;' alt='Article Friendly Author Photo'>"; ?> &nbsp;&nbsp;&nbsp;
<h1 class="h1article_title"><?php echo $artname ?></h1></b>
<br><br>
<div align="left" valign="top"><a href="<?php echo SITE_DOMAIN ?>rss.php?rss=<?php echo $categid ?>" target="_blank" style="text-decoration: none;"><img src="/images/icon_Rss.png" alt="[Valid RSS feed]" title="XML Feed For RSS" border="0">&nbsp;&nbsp;Category Rss Feed</a> - <font size="1"><?php echo $site_URL ?>rss.php?rss=<?php echo $categid ?></font></div>
</td>
</tr>
<tr>
<td> By :
<a href="/Author/<?php echo $authorId ?>/<?php echo $new_name; ?>.html"> <!-- THIS IS A MOD_REWRITE URL. DONOT CHANGE!! -->
<?php echo $authorname ?></a> &nbsp;&nbsp;
<?php
include('func/art_pop.inc.php');
?>

<?
$arttext=str_replace("\n","<BR>",$arttext);
$tip="";
///Select tip ////////////
require_once('inc/databaseFunctions.php');
$dbf = new DatabaseFunctions;

$querys="Select count(*)as total from tbltips where category_id=".$_REQUEST['catid'];
$results=$dbf->queryDb("mysql", $querys,"select Tips");
while($rows=$dbf->returnDBarray("mysql",$results))
{
$count=$rows['total'];
}

$i=rand(0,$count-1);

$querys="Select * from tbltips where category_id=".$_REQUEST['catid']." LIMIT $i , 1";
$results=$dbf->queryDb("mysql", $querys,"select Tips");
while($rows=$dbf->returnDBarray("mysql",$results))
{
$tip=$rows['description'];
}

//$tip=$rows[0];
///////////////////////
//echo "Tip id :$i ";
$arrStr=explode("<BR>",$arttext);
$newStr="";
$status=0;

$count=count($arrStr);
for($i=0;$i<$count;$i++)
{
if($i==3)
{
$newStr.="<BR>".$tip;
$status=1;

}
$newStr.="<BR>".$arrStr[$i];
}

if($status==0)
{
$newStr.=$tip;
}

echo $newStr;
//////////////////////
?>


<? //str_replace("\n","<BR>",$arttext)?>


<!-- google_ad_section_end --></td>
</tr>
<tr>
<td>
<span class="head_bold"> Author Resource:-
</span>
<?php echo str_replace("\n","<br>", preg_replace('#<a(.*)>(.*)</a>#iU', '<a$1 rel="nofollow">$2</a>', $html)) ?>
<br></td>
</tr>
<tr>
<td>
<?php echo "Article From <a href='".$site_URL."'>".$title."</a>"; ?></td>
</tr>
<tr>
<td>
<tr>
<td>
<?php


include_once "markdown.php";
//$my_html = Markdown($arttext);
$my_html = Markdown($newStr);
?>

<form name="myform" action="">
</td>
</tr>
<tr>
<td>
<p>
<b>HTML Ready Article. Click on the "Copy" button to copy into your clipboard.</b>
<br>
<br>
<textarea cols="60" rows="30" title="Article Friendly Ezine Ready Article" name="txtMessage">
<?php echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' ' ?>;
<html><head><title><?php echo $title; ?> | <?php echo $artname ?></title></head><body><h3><?php echo $artname ?></h3><br><br> By: <?php echo $authorname ?><br><br><?php echo $my_html ?><br><br> <b>Author Resource:-></b>&nbsp;&nbsp;<?php echo str_replace("\n","<br>",$html) ?><br><br><?php echo "<b>Article From</b> <a href='".$site_URL."'>".$title."</a>"; ?><br></body></html></textarea>
</p><br />
<center>
<input type="button" onclick='return copy_clip(document.myform.txtMessage.value)' value="Copy!">
<br>
<br>
<font color="gray" size="1">
Firefox users please select/copy/paste as usual
</font>
</center></td>
</tr>
</table>
</form></td>
</tr>
</table></td>

<?php require_once(INC."extra_rlinks.inc.php"); ?></td>
</tr>
</table>
<div align="center" class="head_bold">
<?php require_once(INC."bottom.inc.php"); ?>
</div>
</body>
</html>
<?php
ob_end_flush();
?>
+++++++++++++++++++++++++++++++++++++++++++++++++++
rss.php

<?php
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", false);
include("system/config.inc.php");
$strip1 = "";
$strip11 = "";
$leadin = "";
$strip2 = "";
$sting22 = "";
$string = "";
$step = "";
$categid = "";
$result = "";
$rsstitle = "";
$rssdesc = "";
$rsslink = "";

/**
* Strip punctuation from text.
*/

function CleanupSmartQuotes($text)
{
$badwordchars=array(
chr(46),
chr(145),
chr(146),
chr(147),
chr(148),
chr(151)
);
$fixedwordchars=array(
" ",
"'",
"'",
'&quot;',
'&quot;',
'&mdash;'
);
return str_replace($badwordchars,$fixedwordchars,$text);
}

function strip_punctuation( $text )
{
$urlbrackets = '\[\]\(\)';
$urlspacebefore = ':;\'_\*%@&?!' . $urlbrackets;
$urlspaceafter = '\.,:;\'\-_\*@&\/\\\\\?!#' . $urlbrackets;
$urlall = '\.,:;\'\-_\*%@&\/\\\\\?!#' . $urlbrackets;

$specialquotes = '\'"\*<>';

$fullstop = '\x{002E}\x{FE52}\x{FF0E}';
$comma = '\x{002C}\x{FE50}\x{FF0C}';
$arabsep = '\x{066B}\x{066C}';
$numseparators = $fullstop . $comma . $arabsep;

$numbersign = '\x{0023}\x{FE5F}\x{FF03}';
$percent = '\x{066A}\x{0025}\x{066A}\x{FE6A}\x{FF05}\x{2030}\x{2031}';
$prime = '\x{2032}\x{2033}\x{2034}\x{2057}';
$nummodifiers = $numbersign . $percent . $prime;

return preg_replace(
array(
// Remove separator, control, formatting, surrogate,
// open/close quotes.
'/[\p{Z}\p{Cc}\p{Cf}\p{Cs}\p{Pi}\p{Pf}]/u',
// Remove other punctuation except special cases
'/\p{Po}(?<![' . $specialquotes .
$numseparators . $urlall . $nummodifiers . '])/u',
// Remove non-URL open/close brackets, except URL brackets.
'/[\p{Ps}\p{Pe}](?<![' . $urlbrackets . '])/u',
// Remove special quotes, dashes, connectors, number
// separators, and URL characters followed by a space
'/[' . $specialquotes . $numseparators . $urlspaceafter .
'\p{Pd}\p{Pc}]+((?= )|$)/u',
// Remove special quotes, connectors, and URL characters
// preceded by a space
'/((?<= )|^)[' . $specialquotes . $urlspacebefore . '\p{Pc}]+/u',
// Remove dashes preceded by a space, but not followed by a number
'/((?<= )|^)\p{Pd}+(?![\p{N}\p{Sc}])/u',
// Remove consecutive spaces
'/ +/',
),
' ',
$text );
}


$categid = $_GET['rss'];
if ($categid > 0){
$result = $obj_db->select("SELECT * FROM `tblarticles` where intCategory = '$categid' AND intStatus = 1 ORDER BY ttSubmitDate DESC LIMIT 10");
}else{
$result = $obj_db->select("SELECT * FROM `tblarticles` where intStatus = 1 ORDER BY ttSubmitDate DESC LIMIT 10");
}

// Config file for the script, edit when needed.


$rsstitle = $title;
$rssdesc = "Fresh articles from $title";
$rsslink = $site_URL;

header("Content-type: text/xml");




echo '<rss version="2.0">';

echo '<channel>';
echo '<title>'.htmlentities(strip_tags($rsstitle)).'</title><description>'.htmlentities(strip_tags($rssdesc)).'</description><link>'.htmlentities($rsslink).'</link>';

foreach ($result as $row)
{
$temp_var = stripslashes($row['varArticleTitle']);;
$the_title = _prepare_url_text($temp_var);
$lead2 = ereg_replace("[^A-Za-z0-9_]", " ", $temp_var);
$strip2 = stripslashes($row['textSummary']);
$string22 = CleanupSmartQuotes($strip2);
$string = str_replace('"',"&quot;",$string22);
$step = $string;
?>
<item>
<title><?php echo $lead2 ?></title>
<guid><?php echo $rsslink."Art/".htmlentities(strip_tags($row['intId']))."/".htmlentities(strip_tags($row['intCategory']))."/".$the_title.".html" ?></guid>
<description><?php echo $step ?></description>
<link><?php echo $rsslink."Art/".htmlentities(strip_tags($row['intId']))."/".htmlentities(strip_tags($row['intCategory']))."/".$the_title.".html" ?></link>
</item>
<?php
}
?>
</channel></rss>

http://www.seo-1-marketing-services.com"]SEO Services[/URL] | http://www.internet-marketing-cafe.com"]Free Internet Marketing Articles[/URL] | http://www.themoroccanbazaar.com"]Moroccan Furniture[/URL]| http://www.moroccan-recipes.com"]Moroccan Recipes[/URL] | http://www.seo-marketing-guide.org"]SEO Marketing[/UR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top