We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

My image replacement plug-in doesnt’ work/doesn’t error

Development and Programming

Dan Lovejoy's avatar
Dan Lovejoy
115 posts
16 years ago
Dan Lovejoy's avatar Dan Lovejoy

Howdy folks - I’ve written a very simple plugin to frontend P+C DTR image replacement in EE. The image replacement script works (thought it’s VERY picky) on my server.

Here’s the code (I haven’t added any of the usage, version, or display stuff into it yet) It’s located in my plug-ins folder, and it’s called: pi.ee_pifr.php

<?php

include '[path to my PCDTR]/class.php'; 

class Ee_pifr
{

var $return_data = "TEST";

  function Ee_pifr()
  {
    global $TMPL;

    $containerType = $TMPL->fetch_param('containerType');
    $graphicText = $TMPL->fetch_param('graphicText');
    $graphicClass = $TMPL->fetch_param('graphicClass');
    $this->return_data = "<".$containerType." class='".$graphicClass."'>".$graphicText."</".$containerType.">";

  
    }

}
ob_end_flush(); 
?>

and here’s my test template code:

{exp:weblog:entries weblog="agent"}

{exp:ee_pifr containerType="span" graphicText="${prd_streetPrice}" graphicClass="buy"}
{/exp:weblog:entries}

Not sure what I’m doing wrong, but there’s no output, and no error. Your thoughts?

Mod Edit: Moved to the Plugins: Technical Assistance Forum

UPDATE: OK, now it’s outputting (removed the weblog=”agent”, which was wrong) But now it’s outputting text, not images. I’m investigating. I’ll post here when I get it fixed.

       
Greg Salt's avatar
Greg Salt
3,988 posts
16 years ago
Greg Salt's avatar Greg Salt

Hi Dan,

I haven’t replicated your code on my machine but I’d remove the ob_end_flush function since I can’t see where you are initiating the output buffer or adding data to it.

Cheers

Dry

       
fogcity's avatar
fogcity
260 posts
16 years ago
fogcity's avatar fogcity

Dan, did you ever get this to work? I would like to implement it on my site.

       
Dan Lovejoy's avatar
Dan Lovejoy
115 posts
16 years ago
Dan Lovejoy's avatar Dan Lovejoy

Hi fogcity. No, it does not work. I haven’t had time to hack at it. Not sure if it’s an EE,server, or PCDTR problem. PCDTR is quite picky.

       
fogcity's avatar
fogcity
260 posts
16 years ago
fogcity's avatar fogcity

Bummer.

Has anyone made PCDTR work with EE?

Allows non-standard (non-Web-safe) fonts to be used, by watching the PHP output buffer for relevant tags (<h2> etc) and automatically generating replacement graphics using those fonts.

Also, creates alternate graphics for rollovers as well, if I’m not mistaken.

Unlike sIFR, does not require Flash (so it would work on an iPhone).

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.