Page 1 of 1

[SOLVED]Redeclaration error Integrating WordPress into CMSMS

Posted: Tue Nov 24, 2015 11:43 am
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?

Re: Redeclaration error while Integrating WordPress into CMS

Posted: Tue Nov 24, 2015 12:37 pm
by Rolf

Re: Redeclaration error while Integrating WordPress into CMS

Posted: Tue Nov 24, 2015 12:47 pm
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.

Re: Redeclaration error while Integrating WordPress into CMS

Posted: Tue Nov 24, 2015 3:40 pm
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.

Re: Redeclaration error while Integrating WordPress into CMS

Posted: Tue Nov 24, 2015 11:03 pm
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?

Re: Redeclaration error while Integrating WordPress into CMS

Posted: Wed Nov 25, 2015 8:32 am
by Rolf
There is a remark about Permissive Smarty in the tutorial about that...

Re: [SOLVED]Redeclaration error Integrating WordPress into C

Posted: Thu Jan 14, 2016 6:46 pm
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.