I was obtaining the output from my punbb extern.php file to get a list of the recent topics/posts. Recently Zymic has disabled curl, so my method is not working. Below is my code. Please help me to come up with a solution that will work on their servers.
Thanks!
CODE
<?php
$outgoing = "";
$curl = curl_init('http://bleach.vndv.com/punbb/extern.php?action=new&show=10&type=RSS');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$new_topics = curl_exec($curl);
$new_topics = strstr($new_topics, "<item>");
$new_topics = str_replace("<title>","<legend>",$new_topics);
$new_topics = str_replace("</title>","</legend>",$new_topics);
$new_topics = str_replace("<![CDATA[","",$new_topics);
$new_topics = str_replace("]]>","",$new_topics);
$new_topics = str_replace("<description>","",$new_topics);
$new_topics = str_replace("</description>","",$new_topics);
$new_topics = str_replace("<item>","<fieldset>",$new_topics);
$new_topics = str_replace("</item>","</fieldset> ==||==",$new_topics);
$topic_array = explode("==||==", $new_topics);
$new_topics = "";
foreach($topic_array as $key => $value){
$str = strstr($value, "<fieldset");
//echo $str;
$pattern = '/<legend>(.*)<\/legend>/';
preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE);
$title = $matches[1][0];
$pattern = '/Author:(.*)</';
preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE);
$author = $matches[1][0];
$pattern = '/<link>(.*)<\/link>/';
preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE);
$link = $matches[1][0];
if($title != "" && $author != ""){$outgoing .= "<li class='light'><a href='$link'>$title</a> by: $author</li>";
$outgoing .= "
";}
}
echo $outgoing;
?>
$outgoing = "";
$curl = curl_init('http://bleach.vndv.com/punbb/extern.php?action=new&show=10&type=RSS');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$new_topics = curl_exec($curl);
$new_topics = strstr($new_topics, "<item>");
$new_topics = str_replace("<title>","<legend>",$new_topics);
$new_topics = str_replace("</title>","</legend>",$new_topics);
$new_topics = str_replace("<![CDATA[","",$new_topics);
$new_topics = str_replace("]]>","",$new_topics);
$new_topics = str_replace("<description>","",$new_topics);
$new_topics = str_replace("</description>","",$new_topics);
$new_topics = str_replace("<item>","<fieldset>",$new_topics);
$new_topics = str_replace("</item>","</fieldset> ==||==",$new_topics);
$topic_array = explode("==||==", $new_topics);
$new_topics = "";
foreach($topic_array as $key => $value){
$str = strstr($value, "<fieldset");
//echo $str;
$pattern = '/<legend>(.*)<\/legend>/';
preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE);
$title = $matches[1][0];
$pattern = '/Author:(.*)</';
preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE);
$author = $matches[1][0];
$pattern = '/<link>(.*)<\/link>/';
preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE);
$link = $matches[1][0];
if($title != "" && $author != ""){$outgoing .= "<li class='light'><a href='$link'>$title</a> by: $author</li>";
$outgoing .= "
";}
}
echo $outgoing;
?>
