Currently I run a weblog using moveable type, and all my pages are php.
I have a hyperlink to my comments on each entry saying "read and add more" the problem is that when there are 0 comments this doesn't make sense
(you can see this at www.iamsparticus.co.uk)
I created a php function so that when the comment count = 0 then the page will display one link, and when it is anything else it will display another link. I thought it would be fairly simple and this is the code I used
<?php
$comments = "<$MTEntryCommentCount$>"
if ($comments == 0)
{
echo "<a href=\"/archives/individual/000001.php?commentonly=1\" onclick=\"OpenComments(this.href)\; return false\">Be the first to add a comment</a>";
}
else
{
echo "<a href=\"/archives/individual/000001.php?commentonly=1\" onclick=\"OpenComments(this.href)\; return false\">Read more and add</a>";
}
?>
Anyone know why this doesn't work? I'm not sure what (if any) special characters need to be ommited
On a side note for anyone not familar with movable type the <$MTEntryCommentCount$> will make movable type print the number of comments on this entry. This will take place before any php is executed, so in the php on the server there will be a number there instead depending on how many comments
thanks very much
Sparticus