Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#2 2007-11-27 02:03:43

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#3 2007-11-27 02:12:06

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

Board footer

Powered by FluxBB