<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fast Membership Sites &#187; spin articles</title>
	<atom:link href="http://www.fastmembershipsites.com/innercircle/tag/spin-articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fastmembershipsites.com/innercircle</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jan 2009 09:11:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Create Tons of Unique Content Using the FAST Article Spinner</title>
		<link>http://www.fastmembershipsites.com/innercircle/fast-article-spinner/</link>
		<comments>http://www.fastmembershipsites.com/innercircle/fast-article-spinner/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 17:43:35 +0000</pubDate>
		<dc:creator>Charles Amith</dc:creator>
				<category><![CDATA[Creating Content]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[article marketing]]></category>
		<category><![CDATA[article spinner]]></category>
		<category><![CDATA[article submissions]]></category>
		<category><![CDATA[spin articles]]></category>
		<category><![CDATA[spun articles]]></category>

		<guid isPermaLink="false">http://www.fastmembershipsites.com/innercircle/?p=185</guid>
		<description><![CDATA[As a member, you can use the FAST Article Spinner to create unique content. Instructions for the Article Spinner - Keep in mind that you&#8217;re sharing this with other members. So make sure that you try to create unique article titles in the article title below. This will insure that your article project doesn&#8217;t conflict [...]]]></description>
			<content:encoded><![CDATA[<p>As a member, you can use the FAST Article Spinner to create unique content.<br />
<span id="more-185"></span><!--fms--><br />
<strong>Instructions for the Article Spinner</strong><br />
- Keep in mind that you&#8217;re sharing this with other members.  So make sure that you try to create unique article titles in the article title below.  This will insure that your article project doesn&#8217;t conflict with another members.</p>
<p><em>Spinning format example (3 alternates):</em><br />
{The dog ate my homework|My dog went into my bedroom and chewed up my math homework.|I can&#8217;t believe it.  I went into my bedroom and I caught my dog Benji chomping down my math assignment.}</p>
<p>So each group is within the curly brackets.  Each alternate is been a pipe |.  You can alternate sentences, groups of sentences, or paragraphs.</p>
<p>What you&#8217;ll want to do is create and save your content in a text editor like Notepad plus.  MS Word unfortunately adds a bunch of messed up characters.  Then when you&#8217;re done, paste the content into the fields.</p>
<p>So after you press submit, scroll down to the spinner and you&#8217;ll be able to download the zip archive with all of the spun articles.</p>
<h2>The Article Spinner</h2>
<p><?php<br />
  function Gen_Text($str)<br />
  {<br />
    $copy = $str;<br />
	preg_match_all("/{(.*?)}/is", $str, $Pieces);<br />
	foreach($Pieces[1] as $v)<br />
	{<br />
	  $options = array_map('trim', explode('|', $v));<br />
	  $key = mt_rand(0, count($options)-1);<br />
	  $escape = array("\\", "|", "?", "<", "*", "$", "^", "+", "/", "(", ")");<br />
	  $replace = array("\\\\", "\\|", "\\?", "\\<", "\\*", "\\$", "\\^", "\\+", "\\/", "\\(", "\\)");<br />
        $pattern = "/{".str_replace($escape, $replace, $v)."}/";<br />
	  $copy = preg_replace($pattern, $options[$key], $copy, 1);<br />
	}<br />
	return $copy;<br />
  }</p>
<p>  function Remove_empty($arr)<br />
  {<br />
    for($ctr=0; $ctr < count($arr); $ctr++)<br />
	{<br />
	  if($arr[$ctr] == "")<br />
	    unset($arr[$ctr]);<br />
	}<br />
	return array_values($arr);<br />
  }</p>
<p>  if(get_magic_quotes_gpc() == 1)<br />
  {<br />
    $_GET = array_map('stripslashes', $_GET);<br />
    $_POST = array_map('stripslashes', $_POST);<br />
  }</p>
<p>  if(!isset($_POST['Create']))<br />
  {</p>
<p>    if(!file_exists("./data"))<br />
      echo "<br />
<h1 style=\"color:red\">WARNING the data folder does not exist, articles will not be saved.</h1>
<p>&#8220;;<br />
    if(!is_writable(&#8220;./data&#8221;))<br />
      echo &#8220;<br />
<h1 style=\"color:red\">WARNING the data folder is not writable, articles will not be saved.</h1>
<p>&#8220;;</p>
<p>    $Arts = array();<br />
    if ($dir = opendir(&#8216;./data&#8217;))<br />
    {<br />
      while (false !== ($file = readdir($dir)))<br />
      {<br />
         if(is_dir(&#8220;./data/&#8221;.$file) &#038;&#038; $file != &#8220;.&#8221; &#038;&#038; $file != &#8220;..&#8221;)<br />
         {<br />
           $Arts[] = &#8220;<br />
<option value=\"$file\">$file&#8221;;<br />
         }<br />
      }<br />
      closedir($dir);<br />
    }<br />
    echo &#8221; &#8220;;<br />
	if(count($Arts) > 0)<br />
	{</p>
<p>	}<br />
	else<br />
	  echo &#8220;<br/><br/>&#8220;;</p>
<p>    $Data = array(&#8220;&#8221;,&#8221;",&#8221;",&#8221;100&#8243;,&#8221;unique-article-title&#8221;);<br />
    if(isset($_GET['Load']))<br />
    {<br />
      $fp = fopen(&#8220;./data/&#8221; . $_GET['load'] . &#8220;/&#8221;. $_GET['load']. &#8220;.dat&#8221;, &#8220;r&#8221;);<br />
	  $Data = fread($fp, filesize(&#8220;./data/&#8221; . $_GET['load'] . &#8220;/&#8221; . $_GET['load'] . &#8220;.dat&#8221;));<br />
  	  fclose($fp);<br />
  	  $Data = explode(&#8220;#SEP#&#8221;, $Data);<br />
    }</p>
<p>    if(isset($_GET['Delete']))<br />
    {<br />
	  unlink(&#8220;./data/&#8221;.$_GET['load'].&#8221;/&#8221;.$_GET['load'].&#8221;.dat&#8221;);<br />
	  @unlink(&#8220;./data/&#8221;.$_GET['load'].&#8221;/&#8221;.$_GET['load'].&#8221;.zip&#8221;);<br />
	  rmdir(&#8220;./data/&#8221;.$_GET['load']);</p>
<p>	  echo $_GET['load'] . &#8221; Deleted</br></br>&#8220;;<br />
	}</p>
<p>?></p>
<form method="post">
Content:<br/><br />
<textarea name="article" rows=20 cols=80><?=$Data[1];?></textarea><br />
<br/><br/><br />
Create<br />
<input type="text" name="num" value="<?=$Data[3];?>&#8220;> articles.<br />
<br/><br/><br />
Filename:<br />
<input type="text" name="filename" value="<?=$Data[4];?>&#8220;><br />
<br/><br/></p>
<input type="submit" name ="Create" value="Create">
</form>
<p><? } else {</p>
<p>  @mkdir("./data/".$_POST['filename']);<br />
  chmod("./data/".$_POST['filename'], 0777);<br />
  $Data = array($_POST['titles'], $_POST['article'], $_POST['boxes'], $_POST['num'], $_POST['filename']);<br />
  $Data = implode("#SEP#", $Data);<br />
  $fp = fopen("./data/".$_POST['filename']."/".$_POST['filename'].".dat", "w+");<br />
  fwrite($fp, $Data);<br />
  fclose($fp);<br />
  echo "<a href=\"http://www.fastmembershipsites.com/fast/data/".$_POST['filename']."/". $_POST['filename'] . ".zip\">Download Zip &raquo;</a><br/><br/>&#8220;;<br />
  echo &#8216;<br/><a href="http://www.fastmembershipsites.com/fast/article-spinner/">&laquo; Work on another spin</a><br/>&#8216;;<br />
  $Titles = Remove_empty(array_map(&#8216;trim&#8217;, explode(&#8220;/n&#8221;, $_POST['titles'])));<br />
  $Boxes = Remove_empty(array_map(&#8216;trim&#8217;, explode(&#8220;/n&#8221;, $_POST['boxes'])));<br />
  $RSS2Blog = &#8220;&#8221;;<br />
  for($ctr=0; $ctr < $_POST['num']; $ctr++)<br />
  {<br />
    $Key = mt_rand(0, count($Titles)-1);</p>
<p>    $Article = "";<br />
    if(trim($_POST['article']) != "")<br />
      $Article = Gen_Text($Titles[$Key]) . "";</p>
<p>    $Article .= Gen_Text($_POST['article']) . "";</p>
<p>    $Key = mt_rand(0, count($Boxes)-1);<br />
    $Article .= Gen_Text($Boxes[$Key]);<br />
    echo "Article " . ($ctr+1) . ": <br/><textarea cols=40 rows=10>&#8221; . substr($Article, 0, 300) . &#8220;</textarea><br/><br/>&#8220;;<br />
    $fp = fopen(&#8220;./data/&#8221; . $_POST['filename'] .&#8221;/&#8221;. $_POST['filename'] . &#8216;_&#8217; . ($ctr+1) . &#8220;.txt&#8221;, &#8220;w+&#8221;);<br />
    fwrite($fp, $Article);<br />
    fclose($fp);<br />
  }<br />
   @unlink(&#8220;./data/&#8221;.$_POST['filename'].&#8221;/&#8221;.$_POST['filename'].&#8221;.zip&#8221;);<br />
  $zip = new zip_file(&#8220;./data/&#8221; . $_POST['filename'] . &#8220;/&#8221; . $_POST['filename'] . &#8220;.zip&#8221;);<br />
  $zip->set_options(array(&#8216;inmemory&#8217; => 0, &#8216;recurse&#8217; => 0, &#8216;storepaths&#8217; => 0));<br />
  $zip->add_files(&#8220;./data/&#8221;.$_POST['filename'].&#8221;/*.txt&#8221;);<br />
  $zip->create_archive();</p>
<p>  for($ctr=0; $ctr < $_POST['num']; $ctr++)<br />
    @unlink("./data/".$_POST['filename']."/".$_POST['filename'].'_'.($ctr+1).".txt");<br />
}</p>
<p>/*--------------------------------------------------<br />
 | TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.1<br />
 | By Devin Doucette<br />
 | Copyright (c) 2005 Devin Doucette<br />
 | Email: darksnoopy@shaw.ca<br />
 +--------------------------------------------------<br />
 | Email bugs/suggestions to darksnoopy@shaw.ca<br />
 +--------------------------------------------------<br />
 | This script has been created and released under<br />
 | the GNU GPL and is free to use and redistribute<br />
 | only if this copyright statement is not removed<br />
 +--------------------------------------------------*/</p>
<p>class archive<br />
{<br />
	function archive($name)<br />
	{<br />
		$this->options = array (<br />
			&#8216;basedir&#8217; => &#8220;.&#8221;,<br />
			&#8216;name&#8217; => $name,<br />
			&#8216;prepend&#8217; => &#8220;&#8221;,<br />
			&#8216;inmemory&#8217; => 0,<br />
			&#8216;overwrite&#8217; => 0,<br />
			&#8216;recurse&#8217; => 1,<br />
			&#8216;storepaths&#8217; => 1,<br />
			&#8216;followlinks&#8217; => 0,<br />
			&#8216;level&#8217; => 3,<br />
			&#8216;method&#8217; => 1,<br />
			&#8216;sfx&#8217; => &#8220;&#8221;,<br />
			&#8216;type&#8217; => &#8220;&#8221;,<br />
			&#8216;comment&#8217; => &#8220;&#8221;<br />
		);<br />
		$this->files = array ();<br />
		$this->exclude = array ();<br />
		$this->storeonly = array ();<br />
		$this->error = array ();<br />
	}</p>
<p>	function set_options($options)<br />
	{<br />
		foreach ($options as $key => $value)<br />
			$this->options[$key] = $value;<br />
		if (!empty ($this->options['basedir']))<br />
		{<br />
			$this->options['basedir'] = str_replace(&#8220;\\&#8221;, &#8220;/&#8221;, $this->options['basedir']);<br />
			$this->options['basedir'] = preg_replace(&#8220;/\/+/&#8221;, &#8220;/&#8221;, $this->options['basedir']);<br />
			$this->options['basedir'] = preg_replace(&#8220;/\/$/&#8221;, &#8220;&#8221;, $this->options['basedir']);<br />
		}<br />
		if (!empty ($this->options['name']))<br />
		{<br />
			$this->options['name'] = str_replace(&#8220;\\&#8221;, &#8220;/&#8221;, $this->options['name']);<br />
			$this->options['name'] = preg_replace(&#8220;/\/+/&#8221;, &#8220;/&#8221;, $this->options['name']);<br />
		}<br />
		if (!empty ($this->options['prepend']))<br />
		{<br />
			$this->options['prepend'] = str_replace(&#8220;\\&#8221;, &#8220;/&#8221;, $this->options['prepend']);<br />
			$this->options['prepend'] = preg_replace(&#8220;/^(\.*\/+)+/&#8221;, &#8220;&#8221;, $this->options['prepend']);<br />
			$this->options['prepend'] = preg_replace(&#8220;/\/+/&#8221;, &#8220;/&#8221;, $this->options['prepend']);<br />
			$this->options['prepend'] = preg_replace(&#8220;/\/$/&#8221;, &#8220;&#8221;, $this->options['prepend']) . &#8220;/&#8221;;<br />
		}<br />
	}</p>
<p>	function create_archive()<br />
	{<br />
		$this->make_list();</p>
<p>		if ($this->options['inmemory'] == 0)<br />
		{<br />
			$pwd = getcwd();<br />
			chdir($this->options['basedir']);<br />
			if ($this->options['overwrite'] == 0 &#038;&#038; file_exists($this->options['name'] . ($this->options['type'] == &#8220;gzip&#8221; || $this->options['type'] == &#8220;bzip&#8221; ? &#8220;.tmp&#8221; : &#8220;&#8221;)))<br />
			{<br />
				$this->error[] = &#8220;File {$this->options['name']} already exists.&#8221;;<br />
				chdir($pwd);<br />
				return 0;<br />
			}<br />
			else if ($this->archive = @fopen($this->options['name'] . ($this->options['type'] == &#8220;gzip&#8221; || $this->options['type'] == &#8220;bzip&#8221; ? &#8220;.tmp&#8221; : &#8220;&#8221;), &#8220;wb+&#8221;))<br />
				chdir($pwd);<br />
			else<br />
			{<br />
				$this->error[] = &#8220;Could not open {$this->options['name']} for writing.&#8221;;<br />
				chdir($pwd);<br />
				return 0;<br />
			}<br />
		}<br />
		else<br />
			$this->archive = &#8220;&#8221;;</p>
<p>		switch ($this->options['type'])<br />
		{<br />
		case &#8220;zip&#8221;:<br />
			if (!$this->create_zip())<br />
			{<br />
				$this->error[] = &#8220;Could not create zip file.&#8221;;<br />
				return 0;<br />
			}<br />
			break;<br />
		case &#8220;bzip&#8221;:<br />
			if (!$this->create_tar())<br />
			{<br />
				$this->error[] = &#8220;Could not create tar file.&#8221;;<br />
				return 0;<br />
			}<br />
			if (!$this->create_bzip())<br />
			{<br />
				$this->error[] = &#8220;Could not create bzip2 file.&#8221;;<br />
				return 0;<br />
			}<br />
			break;<br />
		case &#8220;gzip&#8221;:<br />
			if (!$this->create_tar())<br />
			{<br />
				$this->error[] = &#8220;Could not create tar file.&#8221;;<br />
				return 0;<br />
			}<br />
			if (!$this->create_gzip())<br />
			{<br />
				$this->error[] = &#8220;Could not create gzip file.&#8221;;<br />
				return 0;<br />
			}<br />
			break;<br />
		case &#8220;tar&#8221;:<br />
			if (!$this->create_tar())<br />
			{<br />
				$this->error[] = &#8220;Could not create tar file.&#8221;;<br />
				return 0;<br />
			}<br />
		}</p>
<p>		if ($this->options['inmemory'] == 0)<br />
		{<br />
			fclose($this->archive);<br />
			if ($this->options['type'] == &#8220;gzip&#8221; || $this->options['type'] == &#8220;bzip&#8221;)<br />
				unlink($this->options['basedir'] . &#8220;/&#8221; . $this->options['name'] . &#8220;.tmp&#8221;);<br />
		}<br />
	}</p>
<p>	function add_data($data)<br />
	{<br />
		if ($this->options['inmemory'] == 0)<br />
			fwrite($this->archive, $data);<br />
		else<br />
			$this->archive .= $data;<br />
	}</p>
<p>	function make_list()<br />
	{<br />
		if (!empty ($this->exclude))<br />
			foreach ($this->files as $key => $value)<br />
				foreach ($this->exclude as $current)<br />
					if ($value['name'] == $current['name'])<br />
						unset ($this->files[$key]);<br />
		if (!empty ($this->storeonly))<br />
			foreach ($this->files as $key => $value)<br />
				foreach ($this->storeonly as $current)<br />
					if ($value['name'] == $current['name'])<br />
						$this->files[$key]['method'] = 0;<br />
		unset ($this->exclude, $this->storeonly);<br />
	}</p>
<p>	function add_files($list)<br />
	{<br />
		$temp = $this->list_files($list);<br />
		foreach ($temp as $current)<br />
			$this->files[] = $current;<br />
	}</p>
<p>	function exclude_files($list)<br />
	{<br />
		$temp = $this->list_files($list);<br />
		foreach ($temp as $current)<br />
			$this->exclude[] = $current;<br />
	}</p>
<p>	function store_files($list)<br />
	{<br />
		$temp = $this->list_files($list);<br />
		foreach ($temp as $current)<br />
			$this->storeonly[] = $current;<br />
	}</p>
<p>	function list_files($list)<br />
	{<br />
		if (!is_array ($list))<br />
		{<br />
			$temp = $list;<br />
			$list = array ($temp);<br />
			unset ($temp);<br />
		}</p>
<p>		$files = array ();</p>
<p>		$pwd = getcwd();<br />
		chdir($this->options['basedir']);</p>
<p>		foreach ($list as $current)<br />
		{<br />
			$current = str_replace(&#8220;\\&#8221;, &#8220;/&#8221;, $current);<br />
			$current = preg_replace(&#8220;/\/+/&#8221;, &#8220;/&#8221;, $current);<br />
			$current = preg_replace(&#8220;/\/$/&#8221;, &#8220;&#8221;, $current);<br />
			if (strstr($current, &#8220;*&#8221;))<br />
			{<br />
				$regex = preg_replace(&#8220;/([\\\^\$\.\[\]\|\(\)\?\+\{\}\/])/&#8221;, &#8220;\\\\\\1&#8243;, $current);<br />
				$regex = str_replace(&#8220;*&#8221;, &#8220;.*&#8221;, $regex);<br />
				$dir = strstr($current, &#8220;/&#8221;) ? substr($current, 0, strrpos($current, &#8220;/&#8221;)) : &#8220;.&#8221;;<br />
				$temp = $this->parse_dir($dir);<br />
				foreach ($temp as $current2)<br />
					if (preg_match(&#8220;/^{$regex}$/i&#8221;, $current2['name']))<br />
						$files[] = $current2;<br />
				unset ($regex, $dir, $temp, $current);<br />
			}<br />
			else if (@is_dir($current))<br />
			{<br />
				$temp = $this->parse_dir($current);<br />
				foreach ($temp as $file)<br />
					$files[] = $file;<br />
				unset ($temp, $file);<br />
			}<br />
			else if (@file_exists($current))<br />
				$files[] = array (&#8216;name&#8217; => $current, &#8216;name2&#8242; => $this->options['prepend'] .<br />
					preg_replace(&#8220;/(\.+\/+)+/&#8221;, &#8220;&#8221;, ($this->options['storepaths'] == 0 &#038;&#038; strstr($current, &#8220;/&#8221;)) ?<br />
					substr($current, strrpos($current, &#8220;/&#8221;) + 1) : $current),<br />
					&#8216;type&#8217; => @is_link($current) &#038;&#038; $this->options['followlinks'] == 0 ? 2 : 0,<br />
					&#8216;ext&#8217; => substr($current, strrpos($current, &#8220;.&#8221;)), &#8216;stat&#8217; => stat($current));<br />
		}</p>
<p>		chdir($pwd);</p>
<p>		unset ($current, $pwd);</p>
<p>		usort($files, array (&#8220;archive&#8221;, &#8220;sort_files&#8221;));</p>
<p>		return $files;<br />
	}</p>
<p>	function parse_dir($dirname)<br />
	{<br />
		if ($this->options['storepaths'] == 1 &#038;&#038; !preg_match(&#8220;/^(\.+\/*)+$/&#8221;, $dirname))<br />
			$files = array (array (&#8216;name&#8217; => $dirname, &#8216;name2&#8242; => $this->options['prepend'] .<br />
				preg_replace(&#8220;/(\.+\/+)+/&#8221;, &#8220;&#8221;, ($this->options['storepaths'] == 0 &#038;&#038; strstr($dirname, &#8220;/&#8221;)) ?<br />
				substr($dirname, strrpos($dirname, &#8220;/&#8221;) + 1) : $dirname), &#8216;type&#8217; => 5, &#8216;stat&#8217; => stat($dirname)));<br />
		else<br />
			$files = array ();<br />
		$dir = @opendir($dirname);</p>
<p>		while ($file = @readdir($dir))<br />
		{<br />
			$fullname = $dirname . &#8220;/&#8221; . $file;<br />
			if ($file == &#8220;.&#8221; || $file == &#8220;..&#8221;)<br />
				continue;<br />
			else if (@is_dir($fullname))<br />
			{<br />
				if (empty ($this->options['recurse']))<br />
					continue;<br />
				$temp = $this->parse_dir($fullname);<br />
				foreach ($temp as $file2)<br />
					$files[] = $file2;<br />
			}<br />
			else if (@file_exists($fullname))<br />
				$files[] = array (&#8216;name&#8217; => $fullname, &#8216;name2&#8242; => $this->options['prepend'] .<br />
					preg_replace(&#8220;/(\.+\/+)+/&#8221;, &#8220;&#8221;, ($this->options['storepaths'] == 0 &#038;&#038; strstr($fullname, &#8220;/&#8221;)) ?<br />
					substr($fullname, strrpos($fullname, &#8220;/&#8221;) + 1) : $fullname),<br />
					&#8216;type&#8217; => @is_link($fullname) &#038;&#038; $this->options['followlinks'] == 0 ? 2 : 0,<br />
					&#8216;ext&#8217; => substr($file, strrpos($file, &#8220;.&#8221;)), &#8216;stat&#8217; => stat($fullname));<br />
		}</p>
<p>		@closedir($dir);</p>
<p>		return $files;<br />
	}</p>
<p>	function sort_files($a, $b)<br />
	{<br />
		if ($a['type'] != $b['type'])<br />
			if ($a['type'] == 5 || $b['type'] == 2)<br />
				return -1;<br />
			else if ($a['type'] == 2 || $b['type'] == 5)<br />
				return 1;<br />
		else if ($a['type'] == 5)<br />
			return strcmp(strtolower($a['name']), strtolower($b['name']));<br />
		else if ($a['ext'] != $b['ext'])<br />
			return strcmp($a['ext'], $b['ext']);<br />
		else if ($a['stat'][7] != $b['stat'][7])<br />
			return $a['stat'][7] > $b['stat'][7] ? -1 : 1;<br />
		else<br />
			return strcmp(strtolower($a['name']), strtolower($b['name']));<br />
		return 0;<br />
	}</p>
<p>	function download_file()<br />
	{<br />
		if ($this->options['inmemory'] == 0)<br />
		{<br />
			$this->error[] = &#8220;Can only use download_file() if archive is in memory. Redirect to file otherwise, it is faster.&#8221;;<br />
			return;<br />
		}<br />
		switch ($this->options['type'])<br />
		{<br />
		case &#8220;zip&#8221;:<br />
			header(&#8220;Content-Type: application/zip&#8221;);<br />
			break;<br />
		case &#8220;bzip&#8221;:<br />
			header(&#8220;Content-Type: application/x-bzip2&#8243;);<br />
			break;<br />
		case &#8220;gzip&#8221;:<br />
			header(&#8220;Content-Type: application/x-gzip&#8221;);<br />
			break;<br />
		case &#8220;tar&#8221;:<br />
			header(&#8220;Content-Type: application/x-tar&#8221;);<br />
		}<br />
		$header = &#8220;Content-Disposition: attachment; filename=\&#8221;";<br />
		$header .= strstr($this->options['name'], &#8220;/&#8221;) ? substr($this->options['name'], strrpos($this->options['name'], &#8220;/&#8221;) + 1) : $this->options['name'];<br />
		$header .= &#8220;\&#8221;";<br />
		header($header);<br />
		header(&#8220;Content-Length: &#8221; . strlen($this->archive));<br />
		header(&#8220;Content-Transfer-Encoding: binary&#8221;);<br />
		header(&#8220;Cache-Control: no-cache, must-revalidate, max-age=60&#8243;);<br />
		header(&#8220;Expires: Sat, 01 Jan 2000 12:00:00 GMT&#8221;);<br />
		print($this->archive);<br />
	}<br />
}</p>
<p>class tar_file extends archive<br />
{<br />
	function tar_file($name)<br />
	{<br />
		$this->archive($name);<br />
		$this->options['type'] = &#8220;tar&#8221;;<br />
	}</p>
<p>	function create_tar()<br />
	{<br />
		$pwd = getcwd();<br />
		chdir($this->options['basedir']);</p>
<p>		foreach ($this->files as $current)<br />
		{<br />
			if ($current['name'] == $this->options['name'])<br />
				continue;<br />
			if (strlen($current['name2']) > 99)<br />
			{<br />
				$path = substr($current['name2'], 0, strpos($current['name2'], &#8220;/&#8221;, strlen($current['name2']) &#8211; 100) + 1);<br />
				$current['name2'] = substr($current['name2'], strlen($path));<br />
				if (strlen($path) > 154 || strlen($current['name2']) > 99)<br />
				{<br />
					$this->error[] = &#8220;Could not add {$path}{$current['name2']} to archive because the filename is too long.&#8221;;<br />
					continue;<br />
				}<br />
			}<br />
			$block = pack(&#8220;a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12&#8243;, $current['name2'], sprintf(&#8220;%07o&#8221;,<br />
				$current['stat'][2]), sprintf(&#8220;%07o&#8221;, $current['stat'][4]), sprintf(&#8220;%07o&#8221;, $current['stat'][5]),<br />
				sprintf(&#8220;%011o&#8221;, $current['type'] == 2 ? 0 : $current['stat'][7]), sprintf(&#8220;%011o&#8221;, $current['stat'][9]),<br />
				&#8221;        &#8220;, $current['type'], $current['type'] == 2 ? @readlink($current['name']) : &#8220;&#8221;, &#8220;ustar &#8220;, &#8221; &#8220;,<br />
				&#8220;Unknown&#8221;, &#8220;Unknown&#8221;, &#8220;&#8221;, &#8220;&#8221;, !empty ($path) ? $path : &#8220;&#8221;, &#8220;&#8221;);</p>
<p>			$checksum = 0;<br />
			for ($i = 0; $i < 512; $i++)<br />
				$checksum += ord(substr($block, $i, 1));<br />
			$checksum = pack("a8", sprintf("%07o", $checksum));<br />
			$block = substr_replace($block, $checksum, 148, 8);</p>
<p>			if ($current['type'] == 2 || $current['stat'][7] == 0)<br />
				$this->add_data($block);<br />
			else if ($fp = @fopen($current['name'], &#8220;rb&#8221;))<br />
			{<br />
				$this->add_data($block);<br />
				while ($temp = fread($fp, 1048576))<br />
					$this->add_data($temp);<br />
				if ($current['stat'][7] % 512 > 0)<br />
				{<br />
					$temp = &#8220;&#8221;;<br />
					for ($i = 0; $i < 512 - $current['stat'][7] % 512; $i++)<br />
						$temp .= "\0";<br />
					$this->add_data($temp);<br />
				}<br />
				fclose($fp);<br />
			}<br />
			else<br />
				$this->error[] = &#8220;Could not open file {$current['name']} for reading. It was not added.&#8221;;<br />
		}</p>
<p>		$this->add_data(pack(&#8220;a1024&#8243;, &#8220;&#8221;));</p>
<p>		chdir($pwd);</p>
<p>		return 1;<br />
	}</p>
<p>	function extract_files()<br />
	{<br />
		$pwd = getcwd();<br />
		chdir($this->options['basedir']);</p>
<p>		if ($fp = $this->open_archive())<br />
		{<br />
			if ($this->options['inmemory'] == 1)<br />
				$this->files = array ();</p>
<p>			while ($block = fread($fp, 512))<br />
			{<br />
				$temp = unpack(&#8220;a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp&#8221;, $block);<br />
				$file = array (<br />
					&#8216;name&#8217; => $temp['prefix'] . $temp['name'],<br />
					&#8216;stat&#8217; => array (<br />
						2 => $temp['mode'],<br />
						4 => octdec($temp['uid']),<br />
						5 => octdec($temp['gid']),<br />
						7 => octdec($temp['size']),<br />
						9 => octdec($temp['mtime']),<br />
					),<br />
					&#8216;checksum&#8217; => octdec($temp['checksum']),<br />
					&#8216;type&#8217; => $temp['type'],<br />
					&#8216;magic&#8217; => $temp['magic'],<br />
				);<br />
				if ($file['checksum'] == 0&#215;00000000)<br />
					break;<br />
				else if (substr($file['magic'], 0, 5) != &#8220;ustar&#8221;)<br />
				{<br />
					$this->error[] = &#8220;This script does not support extracting this type of tar file.&#8221;;<br />
					break;<br />
				}<br />
				$block = substr_replace($block, &#8221;        &#8220;, 148, 8);<br />
				$checksum = 0;<br />
				for ($i = 0; $i < 512; $i++)<br />
					$checksum += ord(substr($block, $i, 1));<br />
				if ($file['checksum'] != $checksum)<br />
					$this->error[] = &#8220;Could not extract from {$this->options['name']}, it is corrupt.&#8221;;</p>
<p>				if ($this->options['inmemory'] == 1)<br />
				{<br />
					$file['data'] = fread($fp, $file['stat'][7]);<br />
					fread($fp, (512 &#8211; $file['stat'][7] % 512) == 512 ? 0 : (512 &#8211; $file['stat'][7] % 512));<br />
					unset ($file['checksum'], $file['magic']);<br />
					$this->files[] = $file;<br />
				}<br />
				else if ($file['type'] == 5)<br />
				{<br />
					if (!is_dir($file['name']))<br />
						mkdir($file['name'], $file['stat'][2]);<br />
				}<br />
				else if ($this->options['overwrite'] == 0 &#038;&#038; file_exists($file['name']))<br />
				{<br />
					$this->error[] = &#8220;{$file['name']} already exists.&#8221;;<br />
					continue;<br />
				}<br />
				else if ($file['type'] == 2)<br />
				{<br />
					symlink($temp['symlink'], $file['name']);<br />
					chmod($file['name'], $file['stat'][2]);<br />
				}<br />
				else if ($new = @fopen($file['name'], &#8220;wb&#8221;))<br />
				{<br />
					fwrite($new, fread($fp, $file['stat'][7]));<br />
					fread($fp, (512 &#8211; $file['stat'][7] % 512) == 512 ? 0 : (512 &#8211; $file['stat'][7] % 512));<br />
					fclose($new);<br />
					chmod($file['name'], $file['stat'][2]);<br />
				}<br />
				else<br />
				{<br />
					$this->error[] = &#8220;Could not open {$file['name']} for writing.&#8221;;<br />
					continue;<br />
				}<br />
				chown($file['name'], $file['stat'][4]);<br />
				chgrp($file['name'], $file['stat'][5]);<br />
				touch($file['name'], $file['stat'][9]);<br />
				unset ($file);<br />
			}<br />
		}<br />
		else<br />
			$this->error[] = &#8220;Could not open file {$this->options['name']}&#8221;;</p>
<p>		chdir($pwd);<br />
	}</p>
<p>	function open_archive()<br />
	{<br />
		return @fopen($this->options['name'], &#8220;rb&#8221;);<br />
	}<br />
}</p>
<p>class gzip_file extends tar_file<br />
{<br />
	function gzip_file($name)<br />
	{<br />
		$this->tar_file($name);<br />
		$this->options['type'] = &#8220;gzip&#8221;;<br />
	}</p>
<p>	function create_gzip()<br />
	{<br />
		if ($this->options['inmemory'] == 0)<br />
		{<br />
			$pwd = getcwd();<br />
			chdir($this->options['basedir']);<br />
			if ($fp = gzopen($this->options['name'], &#8220;wb{$this->options['level']}&#8221;))<br />
			{<br />
				fseek($this->archive, 0);<br />
				while ($temp = fread($this->archive, 1048576))<br />
					gzwrite($fp, $temp);<br />
				gzclose($fp);<br />
				chdir($pwd);<br />
			}<br />
			else<br />
			{<br />
				$this->error[] = &#8220;Could not open {$this->options['name']} for writing.&#8221;;<br />
				chdir($pwd);<br />
				return 0;<br />
			}<br />
		}<br />
		else<br />
			$this->archive = gzencode($this->archive, $this->options['level']);</p>
<p>		return 1;<br />
	}</p>
<p>	function open_archive()<br />
	{<br />
		return @gzopen($this->options['name'], &#8220;rb&#8221;);<br />
	}<br />
}</p>
<p>class bzip_file extends tar_file<br />
{<br />
	function bzip_file($name)<br />
	{<br />
		$this->tar_file($name);<br />
		$this->options['type'] = &#8220;bzip&#8221;;<br />
	}</p>
<p>	function create_bzip()<br />
	{<br />
		if ($this->options['inmemory'] == 0)<br />
		{<br />
			$pwd = getcwd();<br />
			chdir($this->options['basedir']);<br />
			if ($fp = bzopen($this->options['name'], &#8220;wb&#8221;))<br />
			{<br />
				fseek($this->archive, 0);<br />
				while ($temp = fread($this->archive, 1048576))<br />
					bzwrite($fp, $temp);<br />
				bzclose($fp);<br />
				chdir($pwd);<br />
			}<br />
			else<br />
			{<br />
				$this->error[] = &#8220;Could not open {$this->options['name']} for writing.&#8221;;<br />
				chdir($pwd);<br />
				return 0;<br />
			}<br />
		}<br />
		else<br />
			$this->archive = bzcompress($this->archive, $this->options['level']);</p>
<p>		return 1;<br />
	}</p>
<p>	function open_archive()<br />
	{<br />
		return @bzopen($this->options['name'], &#8220;rb&#8221;);<br />
	}<br />
}</p>
<p>class zip_file extends archive<br />
{<br />
	function zip_file($name)<br />
	{<br />
		$this->archive($name);<br />
		$this->options['type'] = &#8220;zip&#8221;;<br />
	}</p>
<p>	function create_zip()<br />
	{<br />
		$files = 0;<br />
		$offset = 0;<br />
		$central = &#8220;&#8221;;</p>
<p>		if (!empty ($this->options['sfx']))<br />
			if ($fp = @fopen($this->options['sfx'], &#8220;rb&#8221;))<br />
			{<br />
				$temp = fread($fp, filesize($this->options['sfx']));<br />
				fclose($fp);<br />
				$this->add_data($temp);<br />
				$offset += strlen($temp);<br />
				unset ($temp);<br />
			}<br />
			else<br />
				$this->error[] = &#8220;Could not open sfx module from {$this->options['sfx']}.&#8221;;</p>
<p>		$pwd = getcwd();<br />
		chdir($this->options['basedir']);</p>
<p>		foreach ($this->files as $current)<br />
		{<br />
			if ($current['name'] == $this->options['name'])<br />
				continue;</p>
<p>			$timedate = explode(&#8221; &#8220;, date(&#8220;Y n j G i s&#8221;, $current['stat'][9]));<br />
			$timedate = ($timedate[0] &#8211; 1980 << 25) | ($timedate[1] << 21) | ($timedate[2] << 16) |<br />
				($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]);</p>
<p>			$block = pack("VvvvV", 0x04034b50, 0x000A, 0x0000, (isset($current['method']) || $this->options['method'] == 0) ? 0&#215;0000 : 0&#215;0008, $timedate);</p>
<p>			if ($current['stat'][7] == 0 &#038;&#038; $current['type'] == 5)<br />
			{<br />
				$block .= pack(&#8220;VVVvv&#8221;, 0&#215;00000000, 0&#215;00000000, 0&#215;00000000, strlen($current['name2']) + 1, 0&#215;0000);<br />
				$block .= $current['name2'] . &#8220;/&#8221;;<br />
				$this->add_data($block);<br />
				$central .= pack(&#8220;VvvvvVVVVvvvvvVV&#8221;, 0x02014b50, 0&#215;0014, $this->options['method'] == 0 ? 0&#215;0000 : 0x000A, 0&#215;0000,<br />
					(isset($current['method']) || $this->options['method'] == 0) ? 0&#215;0000 : 0&#215;0008, $timedate,<br />
					0&#215;00000000, 0&#215;00000000, 0&#215;00000000, strlen($current['name2']) + 1, 0&#215;0000, 0&#215;0000, 0&#215;0000, 0&#215;0000, $current['type'] == 5 ? 0&#215;00000010 : 0&#215;00000000, $offset);<br />
				$central .= $current['name2'] . &#8220;/&#8221;;<br />
				$files++;<br />
				$offset += (31 + strlen($current['name2']));<br />
			}<br />
			else if ($current['stat'][7] == 0)<br />
			{<br />
				$block .= pack(&#8220;VVVvv&#8221;, 0&#215;00000000, 0&#215;00000000, 0&#215;00000000, strlen($current['name2']), 0&#215;0000);<br />
				$block .= $current['name2'];<br />
				$this->add_data($block);<br />
				$central .= pack(&#8220;VvvvvVVVVvvvvvVV&#8221;, 0x02014b50, 0&#215;0014, $this->options['method'] == 0 ? 0&#215;0000 : 0x000A, 0&#215;0000,<br />
					(isset($current['method']) || $this->options['method'] == 0) ? 0&#215;0000 : 0&#215;0008, $timedate,<br />
					0&#215;00000000, 0&#215;00000000, 0&#215;00000000, strlen($current['name2']), 0&#215;0000, 0&#215;0000, 0&#215;0000, 0&#215;0000, $current['type'] == 5 ? 0&#215;00000010 : 0&#215;00000000, $offset);<br />
				$central .= $current['name2'];<br />
				$files++;<br />
				$offset += (30 + strlen($current['name2']));<br />
			}<br />
			else if ($fp = @fopen($current['name'], &#8220;rb&#8221;))<br />
			{<br />
				$temp = fread($fp, $current['stat'][7]);<br />
				fclose($fp);<br />
				$crc32 = crc32($temp);<br />
				if (!isset($current['method']) &#038;&#038; $this->options['method'] == 1)<br />
				{<br />
					$temp = gzcompress($temp, $this->options['level']);<br />
					$size = strlen($temp) &#8211; 6;<br />
					$temp = substr($temp, 2, $size);<br />
				}<br />
				else<br />
					$size = strlen($temp);<br />
				$block .= pack(&#8220;VVVvv&#8221;, $crc32, $size, $current['stat'][7], strlen($current['name2']), 0&#215;0000);<br />
				$block .= $current['name2'];<br />
				$this->add_data($block);<br />
				$this->add_data($temp);<br />
				unset ($temp);<br />
				$central .= pack(&#8220;VvvvvVVVVvvvvvVV&#8221;, 0x02014b50, 0&#215;0014, $this->options['method'] == 0 ? 0&#215;0000 : 0x000A, 0&#215;0000,<br />
					(isset($current['method']) || $this->options['method'] == 0) ? 0&#215;0000 : 0&#215;0008, $timedate,<br />
					$crc32, $size, $current['stat'][7], strlen($current['name2']), 0&#215;0000, 0&#215;0000, 0&#215;0000, 0&#215;0000, 0&#215;00000000, $offset);<br />
				$central .= $current['name2'];<br />
				$files++;<br />
				$offset += (30 + strlen($current['name2']) + $size);<br />
			}<br />
			else<br />
				$this->error[] = &#8220;Could not open file {$current['name']} for reading. It was not added.&#8221;;<br />
		}</p>
<p>		$this->add_data($central);</p>
<p>		$this->add_data(pack(&#8220;VvvvvVVv&#8221;, 0x06054b50, 0&#215;0000, 0&#215;0000, $files, $files, strlen($central), $offset,<br />
			!empty ($this->options['comment']) ? strlen($this->options['comment']) : 0&#215;0000));</p>
<p>		if (!empty ($this->options['comment']))<br />
			$this->add_data($this->options['comment']);</p>
<p>		chdir($pwd);</p>
<p>		return 1;<br />
	}<br />
}<br />
?><!--/fms--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fastmembershipsites.com/innercircle/fast-article-spinner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
