• Resolved thefluffyshrimp

    (@thefluffyshrimp)


    Hello,

    I recently installed a php-based Mailing List script (Ccmail). I would like to incorporate it onto one of my WordPress pages.

    Basically, I’d like this to appear on this page.

    I’d even be open to using frames if I can just incorporate the same CSS.

    How can I go about doing this?

    Thank you for your help! 🙂

Viewing 14 replies - 1 through 14 (of 14 total)
  • Use Exec-PHP plugin for WordPress – you can then put the php code in your post/page.

    Or you can edit the php file i.e index.php – page.php and add the code where you want the form to appear.

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    So far an improvement, except I’m getting the following error:

    `Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/xxxx/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 1

    Warning: include(http://thefluffyshrimp.com/ccmail/include.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/xxxx/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 1

    Warning: include() [function.include]: Failed opening ‘http://thefluffyshrimp.com/ccmail/include.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/xxxx/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 1
    `

    Thank you so much for the help! 🙂

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    Thanks iridiax, but will that result in the include on all my WordPress pages? I’m only looking to put the include on just one of my pages. Is that possible with this? Thank you!

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    As of now, I’m getting the following error message:

    Warning: include(ccmail/include.php) [function.include]: failed to open stream: No such file or directory in /home/xxxx/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 1

    Warning: include() [function.include]: Failed opening ‘ccmail/include.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/xxxx/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 1

    I’m only looking to put the include on just one of my pages.

    Check the link I gave. You’d need to create a custom page template and then only assign it to that one page.

    I don’t know about the plugin errors you are getting, but it looks like the include server path is wrong… Or the plugin just won’t work with includes.

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    Hey iridiax,

    I think I’m getting close to solving the problem.

    I’ve done this:

    Created a custom page template and assigned it to that one page.

    And I’ve done this:

    You may find it more convenient to copy some other Template (perhaps page.php or index.php) to snarfer.php and then add the above five lines of code to the beginning of the file. That way, you will only have to alter the HTML and PHP code, instead of creating it all from scratch.

    However, the only thing that I’m having trouble with now seems to be where in the custom page template file to place the include:

    <?php include “ccmail/include.php”; ?>

    So far I’ve placed the include here:

    <div class=”entry”>

    <?php include “ccmail/include.php”; ?>

    <?php the_content(‘Read the rest of this entry »’); ?>

    </div>

    <div class=”spacer”></div>

    But I get the following error (this time, only one):

    Fatal error: Cannot redeclare get_settings() (previously declared in /home/xxxxx/wp-includes/deprecated.php:887) in /home/xxxxx/wp-content/themes/e-storage-plus/ccmail/functions/shared.php on line 238

    Any idea on how to fix it?

    Thank you so much for your help! 🙂

    where in the custom page template file to place the include

    The include needs to come before you try to use any of the functions included. Other than that it doesn’t really matter, but putting includes at the top keeps it neat.

    About the error, ccmail is apparently declaring a function that has already been declared by WordPress. That isn’t allowed. Function names have to be unique. I think you’ll probably need to rename the ccmail function to something else– ccmail_get_settings, or something like that so that there is no longer a conflict. But you’ll have to rename every instance of the function.

    For my includes, I put the php include files in my chosen theme’s folder and then use TEMPLATEPATH. If possible, move the ccmail folder there and try:

    <?php include (TEMPLATEPATH . '/ccmail/include.php'); ?>

    You need to use full paths (not relative ones) with WordPress.

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    Hmm, I have the include files in my chosen theme’s folder (e-storage-plus) and am using TEMPLATEPATH, but I’m still getting this error:

    Fatal error: Cannot redeclare get_settings() (previously declared in /home/xxxx/wp-includes/deprecated.php:887) in /home/xxxx/wp-content/themes/e-storage-plus/ccmail/functions/shared.php on line 238

    It looks like I have two “get_settings” being declared. Is that the problem? If so, how should I change that?

    Once again, thanks for all your help. 🙂

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    WOOT! I got it to work.

    Check It Out

    The only thing left I need to do is get the style sheet to affect it (you can see the text is a little wonky looking). Any ideas?

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    Wait, false alarm. The text appears, but now the script is broken. One second, let me try something else.

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    Well, I’m thinking of resorting to just using a frame for this particular script.

    To do this, I’ll need to apply the style.css from my selected WordPress theme to this. Is there a way to do this?

    And if not, is there a way to change the font style, color, and size of the following?

    <?php

    include “wp-content/themes/e-storage-plus/ccmail/include.php”;

    ?>

    Thank you for your help.

    Thread Starter thefluffyshrimp

    (@thefluffyshrimp)

    Fixed it! I wound up resorting to an old-school iframe. Thank you again iridiax.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Incorporating a PHP Script Into a WordPress Page’ is closed to new replies.