[SOLVED]Redeclaration error Integrating WordPress into CMSMS

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
postiffm
Forum Members
Forum Members
Posts: 128
Joined: Tue Nov 30, 2010 12:16 am

[SOLVED]Redeclaration error Integrating WordPress into CMSMS

Post by postiffm »

CMS 2.0.1.1. I am trying to show WordPress posts inside a CMSMS page. I started with the following UDT called "Blog".

Code: Select all

require('/xyz/abc/public_html/blog/wp-blog-header.php');

// Get the last 3 posts.
global $post;
$args = array( 'posts_per_page' => 3 );
$myposts = get_posts( $args );

foreach( $myposts as $post ) :	setup_postdata($post);
echo '<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br />';
endforeach;
When I display the page, it says:
Fatal error: Cannot redeclare is_email() (previously declared in /xyz/abc/public_html/lib/misc.functions.php:1058) in /xyz/abc/public_html/blog/wp-includes/formatting.php on line 2450
Is there a way to work around this problem?

In the bigger picture, does my attempt at integrating WordPress this way have any chance of working?
Last edited by postiffm on Thu Jan 14, 2016 6:44 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Redeclaration error while Integrating WordPress into CMS

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
postiffm
Forum Members
Forum Members
Posts: 128
Joined: Tue Nov 30, 2010 12:16 am

Re: Redeclaration error while Integrating WordPress into CMS

Post by postiffm »

First reason: I didn't know there was a tool readily-available like this. Thanks for pointing it out. I should have known to check cmscanbesimple.org before posting here :-)

Second reason: It could work for certain situations, but it doesn't seem like it will do just what I had in mind. I was hoping to replicate the look of an existing WordPress blog into a CMS Made Simple page--including the features you can see at http://www.gmsa.org/sentinel/. Namely: "Sharing buttons" below each post, "Older Entries" navigation, side bar with search box, recent posts, archives, categories, and meta boxes, so that most WordPress functionality would be available without having to do a lot of extra work!

Maybe what I'm trying to do is not "the right thing" or not easy.

Thanks.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Redeclaration error while Integrating WordPress into CMS

Post by calguy1000 »

The Wordpress API conflicts with CMSMS in many ways. Including the wordpress stuff in this way is not recommended.

I would use a restful API to make requests, and cache them for like an hour.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
postiffm
Forum Members
Forum Members
Posts: 128
Joined: Tue Nov 30, 2010 12:16 am

Re: Redeclaration error while Integrating WordPress into CMS

Post by postiffm »

I tried the solution at http://www.cmscanbesimple.org/blog/a-xm ... ain-smarty and I get:
PHP function 'simplexml_load_file' not allowed by security setting
Looks like remote file access has been disabled by default on my server...a2hosting.com. Is that controlled by

Code: Select all

allow_url_fopen = on
in php.ini?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Redeclaration error while Integrating WordPress into CMS

Post by Rolf »

There is a remark about Permissive Smarty in the tutorial about that...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
postiffm
Forum Members
Forum Members
Posts: 128
Joined: Tue Nov 30, 2010 12:16 am

Re: [SOLVED]Redeclaration error Integrating WordPress into C

Post by postiffm »

My solution in the end was to change my blog: add menus via Wordpress and style them and the page layout to look just like the menus produced by CMS Made Simple. Now the Wordpress blog looks like it is integrated into the CMS Made Simple site, but it is really its own standalone thing.
Post Reply

Return to “CMSMS Core”