Redeclared Function Error

Permalink
I've got a custom block that I need to be able to call twice per page, but I'm getting a PHP error stating that I can't redeclare a function contained in controller.php in the second instance of that block.

How would I get around this? Would includes work? I'm not terribly proficient with PHP.

Thanks!

 
argvader replied on at Permalink Reply
argvader
elenmir

Are you including additional php files in the controller?
If you are then perhaps you can use the include_once directive rather than include.
elenmir replied on at Permalink Reply
Currently nothing is being called via include. I wasn't sure if calling a file that contained the function via include would keep it from being defined twice or not?

Here's a link to the site:
http://www.elenmir.com/index.php?cID=97...

I'm trying to call it once in the top left corner and again in the content section, but eventually I want to move that to the top right side. Just want to get this error fixed first = )
argvader replied on at Permalink Reply
argvader
could you attach or email the controller file?

And in the page you are just using this block twice and getting this error correct?
elenmir replied on at Permalink Reply
When I tried to attach it, I was told .php is an invalid file extension.

Yes, I'm using that block twice.
elenmir replied on at Permalink Reply
I'll post the code here.

<?php 
defined('C5_EXECUTE') or die(_("Access Denied."));
   class EtsyConcreteBlockController extends BlockController 
   {
      var $pobj;
      protected $btDescription = "Test Block to Access Etsy API";
      protected $btName = "Etsy Concrete";
      protected $btTable = 'btEtsyConcrete';
      protected $btInterfaceWidth = "350";
      protected $btInterfaceHeight = "300";
      function __construct($obj = null) {      
         parent::__construct($obj);
         $this->set('showeditmode',$this->showeditmode);
      }
      function url(){ return $this->url; }
elenmir replied on at Permalink Reply
defined('C5_EXECUTE') or die(_("Access Denied."));
   class EtsyConcreteBlockController extends BlockController 
   {
      var $pobj;
      protected $btDescription = "Test Block to Access Etsy API";
      protected $btName = "Etsy Concrete";
      protected $btTable = 'btEtsyConcrete';
      protected $btInterfaceWidth = "350";
      protected $btInterfaceHeight = "300";
      function __construct($obj = null) {      
         parent::__construct($obj);
         $this->set('showeditmode',$this->showeditmode);
      }
      function url(){ return $this->url; }
      function processRequest()