+ Reply to Thread
Results 1 to 3 of 3

Thread: Two scripts on one page

  1. Join Date
    Aug 2005
    Posts
    2

    Two scripts on one page

    When I try to put 2 scripts on one page, I get an error on the second script, which worked fine by itself:
    Code:
    Fatal error: Cannot redeclare class ep_dev_forum_news in /home/pecnut/public_html/forums/forum-news/news.php on line 26
    How can I tweak the script to allow 2 EP-Dev Forum News scripts to work on the same page?

    I am using the script on a .html page, with PHP enabled through a Frontpage extension.

  2. Join Date
    Aug 2005
    Posts
    2

    Two scripts on one page

    Actually, I've managed to solve the problem myself.

    For anyone else with a similar problem, use the SAME epdev module and configure 2 different news sources. That's what's fixed mine.

  3. Join Date
    Aug 2004
    Posts
    781

    Two scripts on one page

    Actually, I've managed to solve the problem myself.

    For anyone else with a similar problem, use the SAME epdev module and configure 2 different news sources. That's what's fixed mine.
    Exactly. This is preferred.

    For anyone who has this problem in the future:

    For anyone who still wants to use two different installs on the same page, simply remove the include_once("/abs/path/to/news.php"); from the generated code.

    Still, the preferred method would be to use the same news object, like:
    Code:
    <?php include_once("/abs/path/to/news.php");
    $forum_obj = new EP_Dev_Forum_News();
    $forum_obj->display_News("", "1", "0", "0"); ?>
    for the first one, and then just:

    Code:
    <?php $forum_obj->display_News("", "1", "1", "0"); ?>
    For the second one (further down the page as far as source code goes).


+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts