Ok, there is a whole lot to learn for one to get caught up to speed when it comes to code and stuff like that. I am no where near even beginning. I found Essential Blogging in my school library and the Advanced Movable Type section had a PHP script to run a feature that provided someone with a random archived post of mine. I followed the instructions as best I could. I created a new index template, named it Random Entry Pool and set the output file to entry-pool.dump.
In the template body I put the following
CODE
<MTEntries lastn-"100">
<$MTEntryTitle$>
<$MTEntryLink$>
<$MTEntryExcerpt$>
------------
</MTEntries>
<$MTEntryTitle$>
<$MTEntryLink$>
<$MTEntryExcerpt$>
------------
</MTEntries>
I saved that. Then the book said to write a script that would grab the random entry. It provided PHP script to do this and said to put it directly into your template. I assumed this meant my Main Index template since this is where I want the link to be displayed. I wanted it under the Archive sidetitle after the months. So that's where I typed the script.
CODE
<div class="sidetitle">
Archives
</div>
<div class="side">
<MTArchiveList archive_type="Monthly">
<a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a><br
/>
</MTArchiveList>
<?php
$filename = "entry-pool.dump";
$posts = explode('--------', implode('', file($filename)));
srand((double) microtime() * 1000000);
list($num, $it) = each($posts);
$it = trim($it);
while (list($num, $line) = each($posts)) {
$line = trim($line);
if ($line != '')
if (rand(0, $num+1) < 1)
$it = $line;
}
list($title, $url, $excerpt) = explode("\n", $it, 3);
echo "<a href=\"$url\">$title</a> - $excerpt<br />";
?>
</div>
<div id="llinks">
<div class="sidetitle">other blogs</div>
<div class="side">
<a href="http://furst.bigwhoop.org" target=_blank>the Words of E1st</a><br />
<a href="http://bigwhoop.org" target=_blank>the entire Bigwhoop organization</a><br />
<a href="http://www.me3dia.com/cinnamon" target=_blank>Did You Know...?</a><br />
</div>
Archives
</div>
<div class="side">
<MTArchiveList archive_type="Monthly">
<a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a><br
/>
</MTArchiveList>
<?php
$filename = "entry-pool.dump";
$posts = explode('--------', implode('', file($filename)));
srand((double) microtime() * 1000000);
list($num, $it) = each($posts);
$it = trim($it);
while (list($num, $line) = each($posts)) {
$line = trim($line);
if ($line != '')
if (rand(0, $num+1) < 1)
$it = $line;
}
list($title, $url, $excerpt) = explode("\n", $it, 3);
echo "<a href=\"$url\">$title</a> - $excerpt<br />";
?>
</div>
<div id="llinks">
<div class="sidetitle">other blogs</div>
<div class="side">
<a href="http://furst.bigwhoop.org" target=_blank>the Words of E1st</a><br />
<a href="http://bigwhoop.org" target=_blank>the entire Bigwhoop organization</a><br />
<a href="http://www.me3dia.com/cinnamon" target=_blank>Did You Know...?</a><br />
</div>
What I got on my webpage was an unlinked bit of code text: $title - $excerpt
"; ?>
Obviously I'm a extreme novice, but can someone tell me where I went wrong? If I was supposed to put the PHP script in the new index template I created, then what do I use to display it on the Main Index? Thanks for the help.
sps
(parenthetical digressions)