<?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>Moo2u.com - Free Tutorials &#38; the latest VFX news. &#187; Active Worlds</title>
	<atom:link href="http://www.moo2u.com/category/tutorials/active-worlds-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.moo2u.com</link>
	<description>free tutorials for autodesk, adobe, eyeon, imagineer systems, photoshop, 3ds max, maya, after effects, digital fusion,</description>
	<lastBuildDate>Mon, 30 Aug 2010 23:41:30 +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>Object Multipath Script Tutorial for Active Worlds</title>
		<link>http://www.moo2u.com/2009/02/21/object-multipath-script-tutorial-for-active-worlds/</link>
		<comments>http://www.moo2u.com/2009/02/21/object-multipath-script-tutorial-for-active-worlds/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 03:35:45 +0000</pubDate>
		<dc:creator>Digital4D</dc:creator>
				<category><![CDATA[Active Worlds]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[active worlds]]></category>
		<category><![CDATA[activeworlds]]></category>
		<category><![CDATA[aw]]></category>
		<category><![CDATA[multi path]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[object path]]></category>
		<category><![CDATA[op]]></category>
		<category><![CDATA[op script]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[universe]]></category>
		<category><![CDATA[world features]]></category>

		<guid isPermaLink="false">http://www.moo2u.com/?p=432</guid>
		<description><![CDATA[Using the multipath script shown below, copy it all to notepad then edit the path url&#8217;s and add your world name in the field that says &#8220;ENTERWORLDNAMEHERE.&#8221; Be sure that your first op path url entered is the one you wish to use that holds&#8230;]]></description>
			<content:encoded><![CDATA[<p>Using the multipath script shown below, copy it all to notepad then edit the path url&#8217;s and add your world  name in the field that says &#8220;ENTERWORLDNAMEHERE.&#8221; Be sure that your first op path url  entered is the one you wish to use that holds your ground textures and main  world textures. Next, save the notpad document as multipath.php. Now place the  multipath.php file in a directory on your op web host (PHP Required). Lastly, point your op in active worlds  to the multipath.php file (eg: http://www.moo2u.com/op/multipath.php?) and you&#8217;re set to go. Enjoy!</p>
<p>&lt;?php</p>
<p>// your local path is the base folder name you have the avatars,models,textures, etc. folders. If it is at your root then set to empty: $Local=&#8221;";</p>
<p>$Local=&#8221;../&#8221;;</p>
<p>// list here all external pathes you want to use (note the MISSING trailing / character!).</p>
<p>// the sequence is important, the script will return the FIRST file found</p>
<p>$aPath = array (</p>
<p>&#8216;http://main_url_to_op_with_ground_textures/&#8217;,</p>
<p>&#8216;http://objects.activeworlds.com/aw/&#8217;,</p>
<p>&#8216;http://url3/&#8217;,</p>
<p>&#8216;http://url4/&#8217;</p>
<p>);</p>
<p>// Add here your world name (and have the Enable Referer checked on the world options menu!!)</p>
<p>// this will protect your path used by another world</p>
<p>$Worlds= array (</p>
<p>&#8216;ENTERWORLDNAMEHERE&#8217;</p>
<p>);</p>
<p>function url_exists($url)</p>
<p>{</p>
<p>$a_url = parse_url($url);</p>
<p>if (!isset($a_url['port'])) $a_url['port'] = 80;</p>
<p>$errno = 0;</p>
<p>$errstr = &#8221;;</p>
<p>$timeout = 30;</p>
<p>if(isset($a_url['host']) &amp;&amp; $a_url['host']!=gethostbyname($a_url['host']))</p>
<p>{</p>
<p>$fid = fsockopen($a_url['host'], $a_url['port'], $errno, $errstr, $timeout);</p>
<p>if (!$fid) return false;</p>
<p>$page = isset($a_url['path'])  ?$a_url['path']:&#8221;;</p>
<p>$page .= isset($a_url['query'])?&#8217;?&#8217;.$a_url['query']:&#8221;;</p>
<p>fputs($fid, &#8216;HEAD &#8216;.$page.&#8217; HTTP/1.1&#8242;.&#8221;\r\n&#8221;.&#8217;Host: &#8216;.$a_url['host'].&#8221;\r\n\r\n&#8221;);</p>
<p>$head = fread($fid, 4096);</p>
<p>fclose($fid);</p>
<p>return  stristr($head, &#8216; 200 ok&#8217;);</p>
<p>} else</p>
<p>{</p>
<p>return false;</p>
<p>}</p>
<p>}</p>
<p>// check for illegal use first</p>
<p>// First check on user agent (Active Worlds Browser &#8211; for the old browser, ActiveWorlds/3.60 for the new ones):</p>
<p>$agent=$_SERVER['HTTP_USER_AGENT'];</p>
<p>if (!isset($agent))</p>
<p>{</p>
<p>// no user agent &#8211; we hate it!</p>
<p>header(&#8216;HTTP/1.1 403 Forbidden&#8217;);</p>
<p>exit();</p>
<p>}</p>
<p>if (!stristr($agent,&#8221;Active&#8221;))</p>
<p>{</p>
<p>// it is not an AW browser &#8211; kick him out!!</p>
<p>header(&#8216;HTTP/1.1 403 Forbidden&#8217;);</p>
<p>exit();</p>
<p>}</p>
<p>// Uncomment between the ======= lines (remove the /* and the */ lines to enable checking the referer for your world:</p>
<p>$rqname=substr(strstr($_SERVER['REQUEST_URI'],basename(__FILE__)),strlen(basename(__FILE__))+1);</p>
<p>if (strstr($rqname,&#8217;../../&#8217;))</p>
<p>{</p>
<p>// someone tries to read files beyond their jurisdiction</p>
<p>header(&#8216;HTTP/1.1 403 Forbidden&#8217;);</p>
<p>exit();</p>
<p>}</p>
<p>$filename=$_SERVER['DOCUMENT_ROOT'] . $Local . $_SERVER['PATH_INFO'];;</p>
<p>if (!file_exists($filename))</p>
<p>{</p>
<p>// not a local file, try the other servers</p>
<p>foreach ($aPath as $otherpath)</p>
<p>{</p>
<p>$filename=$otherpath . $_SERVER['PATH_INFO'];</p>
<p>if (url_exists($filename))</p>
<p>{</p>
<p>header(&#8220;Location: $filename&#8221;);</p>
<p>#  Redirect it to the other OP</p>
<p>exit ();</p>
<p>}</p>
<p>}</p>
<p>header(&#8216;HTTP/1.1 404 Not Found&#8217;);</p>
<p>exit();</p>
<p>}</p>
<p>// local file, do all checking</p>
<p>$headers = getallheaders();</p>
<p>if(isset($headers["If-Modified-Since"]))</p>
<p>{</p>
<p>// check if the modification time is more recent</p>
<p>$currentModified = filemtime($filename);</p>
<p>$rqtime=strtotime($headers["If-Modified-Since"]);</p>
<p>if ($currentmodified&lt;$rqtime)</p>
<p>{</p>
<p>// send &#8220;Not modified&#8221; header back</p>
<p>header(&#8216;HTTP/1.1 304 Not Modified&#8217;);</p>
<p>exit();</p>
<p>}</p>
<p>}</p>
<p>// check the extension to set the proper mime type</p>
<p>if (substr($rqname, strrpos($rqname, &#8216;.&#8217;)) == &#8216;.zip&#8217;)</p>
<p>{</p>
<p>$ctype=&#8221;application/zip&#8221;;</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>if (substr($rqname, strrpos($rqname, &#8216;.&#8217;)) == &#8216;.jpg&#8217;)</p>
<p>{</p>
<p>$ctype=&#8221;image/jpeg&#8221;;</p>
<p>}</p>
<p>else</p>
<p>$ctype=&#8221;application/download&#8221;;        // unknown extension</p>
<p>}</p>
<p>$handle = fopen($filename, &#8220;rb&#8221;);</p>
<p>header(&#8220;Content-type: &#8221; . $ctype);</p>
<p>header(&#8220;Content-Length: &#8221; . filesize($filename));</p>
<p>fpassthru($handle);</p>
<p>exit ();</p>
<p>?&gt;</p>
<p>Related links:</p>
<p><a href="http://www.andras.net/" target="_blank">http://www.andras.net/</a></p>
<p><a href="http://www.activeworlds.com" target="_blank">http://www.activeworlds.com<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moo2u.com/2009/02/21/object-multipath-script-tutorial-for-active-worlds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

