<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: Rebuilding Movable Type Using PHP</title>
      <link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP/</link>
      <description>Comments on Ask MetaFilter post Rebuilding Movable Type Using PHP</description>
	  	  <pubDate>Fri, 11 Nov 2005 12:09:41 -0800</pubDate>
      <lastBuildDate>Fri, 11 Nov 2005 12:09:41 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Rebuilding Movable Type Using PHP</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP</link>	
  	<description>How do I trigger the rebuild of a MT blog using PHP? I&apos;m working on a way to allow anonymous users to submit suggested entries to my blog (initially as a draft) and then later activate them (switch the status to post, then rebuild the blog), all outside the MovableType interface.&lt;br&gt;
&lt;br&gt;
I&apos;ve gotten everything working right up until the step where I rebuild.  Now I&apos;m stuck.  What I&apos;d really like to do is use MT-Rebuild by following this guy&apos;s process:&lt;br&gt;
http://www.cadenhead.org/workbench/news/2392&lt;br&gt;
 &lt;br&gt;
Unfortunately, I don&apos;t get how I should be modifying his example for my own situation.  Here&apos;s what I&apos;ve tried (among several things) without success:&lt;br&gt;
 &lt;br&gt;
system(&quot;$this-&amp;gt;/usr/bin/perl $this-&amp;gt;/home/myaccount/public_html/mt/mt-rebuild.pl -all&quot;); &lt;br&gt;
&lt;br&gt;
I&apos;m a php novice, so I&apos;m guessing I&apos;ve got an error in that string.&lt;br&gt;
&lt;br&gt;
Can anyone point out my error?  &lt;br&gt;
&lt;br&gt;
I&apos;m also open to other suggestions, as long as it can be achieved from within php and doesn&apos;t expose the user to the Movable Type interface.&lt;br&gt;
&lt;br&gt;
PS--To be clear, I&apos;ve bought an unlimited authors license of MT.  This is more about not wanting to force people to register as authors in order to post.</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.27060</guid>
  	<pubDate>Fri, 11 Nov 2005 12:01:09 -0800</pubDate>
  	<dc:creator>jeanmari</dc:creator>
	
	<category>php</category>
	
	<category>Movable</category>
	
	<category>Type</category>
	
</item>
<item>
  	<title>By: kcm</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP#426173</link>	
  	<description>um.  you&apos;re using the actual paths so you don&apos;t need $this-&amp;gt;.  or you could do what he actually did and use variables, $this-&amp;gt;perl_path.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.27060-426173</guid>
  	<pubDate>Fri, 11 Nov 2005 12:09:41 -0800</pubDate>
  	<dc:creator>kcm</dc:creator>
</item>
<item>
  	<title>By: tumble</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP#426221</link>	
  	<description>system(&amp;quot;/home/myaccount/public_html/mt/mt-rebuild.pl -all&amp;quot;);&lt;br&gt;
&lt;br&gt;
However, I would probably just set a &lt;a href=&quot;http://www.movalog.com/archives/general/scheduled-postings-and-cron-jobs&quot;&gt;cron job&lt;/a&gt; to periodically run.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.27060-426221</guid>
  	<pubDate>Fri, 11 Nov 2005 13:15:23 -0800</pubDate>
  	<dc:creator>tumble</dc:creator>
</item>
<item>
  	<title>By: john m</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP#426352</link>	
  	<description>I just wanted to say hi to jeanmari at this juncture of two of my favorite places online.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.27060-426352</guid>
  	<pubDate>Fri, 11 Nov 2005 15:23:20 -0800</pubDate>
  	<dc:creator>john m</dc:creator>
</item>
<item>
  	<title>By: kcm</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP#426540</link>	
  	<description>yeah, thanks for marking best answers there bud.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.27060-426540</guid>
  	<pubDate>Fri, 11 Nov 2005 21:31:42 -0800</pubDate>
  	<dc:creator>kcm</dc:creator>
</item>
<item>
  	<title>By: jeanmari</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP#426700</link>	
  	<description>kcm - I haven&apos;t gotten a best answer yet.  None of the suggestions so far have worked.&lt;br&gt;
&lt;br&gt;
john m has actually gotten closest...he emailed me this:&lt;br&gt;
&lt;br&gt;
&lt;em&gt;system(&amp;quot;/usr/bin/perl /home/myaccount/public_html/mt/mt-rebuild.pl -mode=&amp;quot;entry&amp;quot; -blog_id=$entry_blog_id -entry_id=$entry_id&amp;quot;);&lt;/em&gt;&lt;br&gt;
&lt;br&gt;
That doesn&apos;t trigger the rebuild either.  What it did uncover though is that if I strip out everything after .pl I can at least get the following to present in the browser:&lt;br&gt;
&lt;br&gt;
&lt;em&gt;mt-rebuild Usage: mt-rebuild.pl -mode=&amp;quot;(all|archive|entry|index)&amp;quot; -blog_id=0 [-archive_type=&amp;quot;(Individual|Daily|Weekly|Monthly|Category)&amp;quot; -no_indexes -entry_id=0 -build_dependencies -template=&amp;quot;your template name&amp;quot; -force ] OR mt-rebuild.pl -all [-no_indexes] See the POD documentation embedded in this script for more detail. success &lt;/em&gt;&lt;br&gt;
&lt;br&gt;
That leads me to believe I&apos;m successfully hitting mt-rebuild.pl but I&apos;m not successfully passing the instructions on.&lt;br&gt;
&lt;br&gt;
I may just have to resort to the chron job suggested by tumble.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.27060-426700</guid>
  	<pubDate>Sat, 12 Nov 2005 08:19:33 -0800</pubDate>
  	<dc:creator>jeanmari</dc:creator>
</item>
<item>
  	<title>By: bschoate</title>
  	<link>http://ask.metafilter.com/27060/Rebuilding-Movable-Type-Using-PHP#427972</link>	
  	<description>The system command you gave looks okay except for the -mode=&amp;quot;entry&amp;quot; part -- do you have those inner &amp;quot; characters with a \ in front of them? Otherwise, you&apos;d get a PHP syntax error.  Also, the $entry_blog_id and $entry_id variables must be set to something valid.&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;# assuming these are valid&lt;br&gt;
$entry_blog_id = 1;&lt;br&gt;
$entry_id = 100;&lt;br&gt;
# the following should be on one line; i&apos;m&lt;br&gt;
# just wrapping it for display purposes&lt;br&gt;
system(&amp;quot;/usr/bin/perl /path/to/mt_dir/mt-rebuild.pl &lt;br&gt;
  -mode=\&amp;quot;entry\&amp;quot;&lt;br&gt;
  -blog_id=$entry_blog_id&lt;br&gt;
  -entry_id=$entry_id&lt;br&gt;
  -build_dependencies&amp;quot;);&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
Note that some shared web hosting companies will restrict PHP functions like system, but it looks like yours does not.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.27060-427972</guid>
  	<pubDate>Mon, 14 Nov 2005 08:23:44 -0800</pubDate>
  	<dc:creator>bschoate</dc:creator>
</item>

    </channel>
</rss>
