Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-11-27 01:45:50
- Natasha
- New Member
- Registered: 2007-11-27
- Posts: 3
Php in textpattern pages - trouble using tags.
I’ve read over the faq regarding this matter and still can’t seem to sort it out, I’m really new to textpattern and I am trying to use the php tags but they don’t seem to work with this code, I keep getting errors.
<?php
include “./home/.hobby/birdmad/corrode/cpmfetch/cpmfetch.php”;
$objCpm = new cpm(“./home/.hobby/birdmad/corrode/cpmfetch/cpmfetch_config.php”);
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
I’ve tried
<txp:php>
include “./home/.hobby/birdmad/corrode/cpmfetch/cpmfetch.php”;
$objCpm = new cpm(“./home/.hobby/birdmad/corrode/cpmfetch/cpmfetch_config.php”);
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
</txp:php>
but it doesn’t seem to work. Help please?
Offline
Re: Php in textpattern pages - trouble using tags.
- Are you sure about the path that your trying to include? Because I ain’t.
- What are those errors saying?
<txp:php>
include("");
$objCpm = new cpm("");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
</txp:php>
But basically it should work.
Cheers!
Offline
Re: Php in textpattern pages - trouble using tags.
You’re path looks wrong – remove the . from in front of /home/...: /home/.hobby/birdmad/corrode/cpmfetch/cpmfetch.php.
Offline
#4 2007-11-27 02:44:47
- Natasha
- New Member
- Registered: 2007-11-27
- Posts: 3
Re: Php in textpattern pages - trouble using tags.
Thanks for the replies guys, I tried removing the dots and now I get this error:
Parse error: syntax error, unexpected ‘.’ in /home/.hobby/birdmad/trembling-adored/textpattern/publish/taghandlers.php(2738) : eval()’d code on line 1
Offline
#5 2007-11-27 03:50:19
- Natasha
- New Member
- Registered: 2007-11-27
- Posts: 3
Re: Php in textpattern pages - trouble using tags.
Got it all sorted out, turns out that snippet of code didn’t like being that close to the search tag … or some such nonsense. It’s working now :) Thanks for your help :)
Offline