Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-06-11 13:41:03
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Next baby step: PHP errors
I’m getting this error:
Tag error: -> Textpattern Warning: Raw PHP tags are deprecated on line 1011
and I do sort of understand what’s causing it, but is there a way to fix it? The only way I’ve tried to far was to manually change the <?php to <txp:php, but I suspect there might be something different (and less potentially risky) I can do.
Thanks, folks. This forum has helped me a megaton.
Offline
Re: Next baby step: PHP errors
brokenumbrella wrote:
I’ve tried to far was to manually change the <?php to <txp:php, but I suspect there might be something different (and less potentially risky) I can do.
<?php
is indeed disallowed and <txp:php> //code here </txp:php>
is the correct way of embedding PHP in a page.
As to whether there is something different you can do (perhaps with some built-in tags instead of dropping into PHP), you’d have to enlighten us in what it is you’re trying to achieve ;-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2008-06-11 13:54:23
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Re: Next baby step: PHP errors
Hm… In short, a very interesting fellow built the site for me about four years ago and then dropped off the face of the planet. I know very basic html, but things like php are beyond me at the present. ;)
Basically, I just want the error message to go away (if you go to www.brokenumbrella.com you’ll probably see it) so I can get to following some basic tutorials and teaching myself a little more.
Last edited by brokenumbrella (2008-06-11 13:54:41)
Offline
#4 2008-06-11 13:58:41
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Re: Next baby step: PHP errors
update: changed site from ‘debugging’ to ‘live’, so you may not see the error now. (thanks, mike!)
Offline
Re: Next baby step: PHP errors
I was going to say… your site appears rather devoid of errors right now. Thought I was going blind or something, then spotted your latest post.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#6 2008-06-11 22:24:06
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Re: Next baby step: PHP errors
Okay, so I’m trying to re-write this:
<?php
if (!$GLOBALS[‘c’]) { ?>
<txp:output_form form=“gallery_intro” />
<?php } else { ?>
<txp:output_form form=“gallery_internal” />
<?php } ?>
So that it works. Is there a way?
Offline
Re: Next baby step: PHP errors
Since $GLOBALS['c']
is, I believe, the TXP category you should be able to do away with the ugly PHP and use a beautiful built-in tag:
<txp:if_category>
<txp:output_form form=“gallery_internal” />
<txp:else />
<txp:output_form form=“gallery_intro” />
</txp:if_category>
Someone (Els?) correct me if I’m wrong.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#8 2008-06-11 22:43:15
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Re: Next baby step: PHP errors
Ooo, shiny. :)
Offline
#9 2008-06-12 02:54:21
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Re: Next baby step: PHP errors
Okay, I tried to tackle this monstrosity as well, to no avail.
<li class=”<?php
if (eregi (“paint”, $GLOBALS[‘c’])) {
print ‘gallery_active’;} else {print ‘inactive’;}
print ‘”’;
?>><a href=”/gallery/?c=paint&p=39”><span class=“menu”>P</span>aintings</a></li>
Offline
Offline
#11 2008-06-12 21:32:07
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Next baby step: PHP errors
Looks like it’s txp:category_list that you need. For example:
<txp:category_list categories="paint,another-cat,category3,etcetera" wraptag="ul" break="li" section="gallery" class="inactive" active_class="gallery_active" />
(I’m just guessing what it is you need to display, it might of course need some changes.)
Offline
#12 2008-06-12 21:34:15
- brokenumbrella
- Member
- Registered: 2008-06-09
- Posts: 36
Re: Next baby step: PHP errors
Heh, I sort of gave up on it. I’ve been playing around with the ‘maple leaf forever’ template, which has been helping me learn some things. Whee!
Offline
Pages: 1