Help - Search - Members - Calendar
Full Version: Acquiring Output From Local File.
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
Slow
Hello,

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;

?>
Tim
Currently it's not possible to access remote files over the zymic server. cURL lib was disabled for security reasons as it can execute FTP commands ect.
Bread
QUOTE(Tim @ Aug 28 2008, 11:15 AM) *
Currently it's not possible to access remote files over the zymic server. cURL lib was disabled for security reasons as it can execute FTP commands ect.


More so people were setting up proxies. But yeah, there's currently no way to retrieve a remote source.
Tim
QUOTE(Bread @ Aug 28 2008, 03:15 PM) *
More so people were setting up proxies. But yeah, there's currently no way to retrieve a remote source.


Ah I see, but does zymic allow Fopen on a local level ?
Bread
QUOTE(Tim @ Aug 29 2008, 09:13 AM) *
Ah I see, but does zymic allow Fopen on a local level ?


Yeah, providing the script's owner / group has read/write access to that file, local file access works without a hitch.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.