close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

I am getting an error when I use a plugin

Thread began 10/29/2015 11:26 am by office42071 | Last modified 10/30/2015 3:44 pm by Ray Borduin | 314 views | 3 replies |

office42071

I am getting an error when I use a plugin

I am getting the following error:
Fatal error: Cannot redeclare class WA_AltClassIterator in /var/www/html/adminx/members_results.php on line 114

Sign in to reply to this post

Ray BorduinWebAssist

Can I get a copy of the pages to look at? It sounds like a repeated include file, but they should be using require_once... maybe it is a function actually defined on the page itself? If you provide a copy of the plugin page I can look into it and offer a fix.

Sign in to reply to this post

office42071

attached

Sign in to reply to this post

Ray BorduinWebAssist

Please attach the actual file instead of copy/pasting the code. It is much easier to read when I can open it with Dreamweaver.

To fix this problem, replace this code:

php:
<?php

//WA AltClass Iterator
class WA_AltClassIterator     {
  var 
$DisplayIndex;
  var 
$DisplayArray;
  
  function 
WA_AltClassIterator($theDisplayArray = array(1)) {
    
$this->ClassCounter 0;
    
$this->ClassArray   $theDisplayArray;
  }
  
  function 
getClass($incrementClass)  {
    if (
sizeof($this->ClassArray) == 0) return "";
      if (
$incrementClass) {
      if (
$this->ClassCounter >= sizeof($this->ClassArray)) $this->ClassCounter 0;
      
$this->ClassCounter++;
    }
    if (
$this->ClassCounter 0)
      return 
$this->ClassArray[$this->ClassCounter-1];
    else
      return 
$this->ClassArray[0];
  }
}
?>


with this:

php:
<?php

if (!class_exists("WA_AltClassIterator")) {
?>
<?php
//WA AltClass Iterator
class WA_AltClassIterator     {
  var 
$DisplayIndex;
  var 
$DisplayArray;
  
  function 
WA_AltClassIterator($theDisplayArray = array(1)) {
    
$this->ClassCounter 0;
    
$this->ClassArray   $theDisplayArray;
  }
  
  function 
getClass($incrementClass)  {
    if (
sizeof($this->ClassArray) == 0) return "";
      if (
$incrementClass) {
      if (
$this->ClassCounter >= sizeof($this->ClassArray)) $this->ClassCounter 0;
      
$this->ClassCounter++;
    }
    if (
$this->ClassCounter 0)
      return 
$this->ClassArray[$this->ClassCounter-1];
    else
      return 
$this->ClassArray[0];
  }
}
?>
<?php
}
?>



That class must be defined on the main page or another plugin and having it twice is throwing the error. By wrapping it with an if statement that checks if it already exists, it should get around the problem.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...