Forum Moderators: coopster

Message Too Old, No Replies

Smarty and Movable Type

Error wont go

         

morpheus83

8:23 am on Jun 6, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



Just installed Smarty for pagination for my Movable Type Blog. However I get the following error.
Parse error: parse error,

unexpected T_STRING in /home/content/mywebsite/html/index.php on line 197

This is what I have entered in my code

<?php
{{capture assign="count"}}<$MTBlogEntryCount$>{{/capture}}
{{if $smarty.request.offset > 0}}
<a href="?offset={{math equation="max(x-12,0)" x=$smarty.request.offset}}">Previous</a>
{{/if}}
{{if $smarty.request.offset < $count-12}}
{{if $smarty.request.offset > 0}}
¦
{{/if}}
<a href="?offset={{$smarty.request.offset+12}}">Next</a>
{{/if}}
<MTEntries lastn="12" offset="`$smarty.request.offset`">
?>

Thanks in advance

mincklerstraat

3:10 pm on Jun 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This'd be a template file.

Some template systems have php files as their 'template files'; others have got text files as their text files.

Anyways, if you've saved this file with the .php extension or any other extension you've told your server to parse as php (ignore if you haven't done anything special in this department), the <?php part will tell PHP to parse this as php code. But it isn't php code, it's template code that your template engine reads (not as php), and figures out what to output. So remove the
<?php
and the
?>
at the end
and see what you get.

morpheus83

4:48 am on Jun 7, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



If I remove the <?php and?> the PHP code is displayed as it is. It wont get parsed.

mincklerstraat

7:16 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it's supposed to be parsed by a php script 'parsed' meaning the php script reads it in, replaces stuff, and spits it out with your content added to places), and not parsed by php itself (in which case it'd need to be php code, but this is template code). Must be wrong with something in your script (nb, you do have some kind of php script running with MT? MT's in perl), so it isn't reading this and substituting the stuff and then spitting it out, but just spitting this out by itself. Sorry I can't be of more help than this.