rendered paste bodyfunction endElement($xp,$name) { global $image,$stop,$tdate,$num,$item,$currentElement,$title,$description,$link; if ($name == 'ITEM') { if(preg_match("/(<img)(.+)(\/>)/i",$description) && $_GET['id']=="2"){ $image = true; $description = preg_replace("/(<img)(.+)(\/>)(.+)/i","<tr>\n<td align=\"center\" valign=\"top\" bgcolor=\"#f8ffdf\" width=\"50\">$1$2border=\"1\" $3</td>\n<td width=\"0\" bgcolor=\"#f8ffdf\"></td>\n<td align=\"left\" valign=\"top\" bgcolor=\"#f8ffdf\">$4</td>\n</tr>\n",$description); } echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">\n<tr>\n<td bgcolor=\"#d7e79f\" valign=\"top\" colspan=\""; if($image){echo "3"; } else { echo "2"; } echo "\">\n <span style=\"{color: #FF0000; font-weight: bold;}\">".sprintf("%02d",$num). ") </span><b>$title</b> <small>\n<i>".$tdate."</i></small>\n</td>\n</tr>\n\n"; if($description!=''){ if($image){ echo $description; } else { echo "<tr>\n<td align=\"left\" valign=\"top\" bgcolor=\"#f8ffdf\">$description</td>\n</tr>"; } } if($description==''){ echo "<tr>\n<td align=\"left\" valign=\"top\" bgcolor=\"#f8ffdf\">No description available. Please click the 'read more' link.</td>\n</tr>"; } echo "<tr>\n<td align=\"right\" bgcolor=\"#f8ffdf\" colspan=\""; if($image){echo "3"; } else { echo "2"; } echo "\">\n <a href=\"$link\" target=\"_blank\">read more</a>\n</td>\n</tr>\n</table>\n"; if($title!=''){ echo "<br>"; } $title = ''; $description = ''; $link = ''; $tdate=''; $item = false; $image = false; $num++; //if($num>=$stop+1) { exit; } }}