Help using Subscribe2 plugin with Wordpress for Concrete5

Permalink Browser Info Environment
I have Wordpress for Concrete5 installed and I have the Subscribe2 plugin activated to manage email subscriptions to the blog. There is a widget to display the subscribe/unsubscribe form in WP but I'm not sure how to make it show up in c5. If anyone has any ideas on a good way to do this I would really appreciate it.

Type: Discussion
Status: New
annar
View Replies:
elyon replied on at Permalink Reply
elyon
Can you tell if this creates a bit of HTML in WordPress, that you could copy-and-paste into an HTML block in Concrete?

There might be a script or two in the header as well, which you would want to copy into the HTML block as well.
edward replied on at Permalink Reply 1 Attachment
edward
I just had the same problem and worked out a rudimentary hack that allows you to include the Subscribe2 signup form into your Concrete5 site. It's a messy hack, and it's not really ready for publication, but I thought it might be of use.

Basically, you need to do three things:

1. Install the block (see attachment)
2. Adjust the block's "view" file - where it says str_replace("/wordpress", "/blog", $content), make sure to replace it with the appropriate file paths. I have installed Wordpress in "/wordpress", but it's accessible on the site through "/blog". Adjust it to how you have arranged this on your site. Otherwise, your visitors will not be able to use the Subscribe2 signup form.
3. Finally, you have to include all of Wordpress to make this work, and you can only do that outside any functions, blocks, or classes (has to do with the scope of global variables). Anyway, I the following code in my "config/site.php" file:

define('WORDPRESS_CID', 110);
// Initialize wordpress if we're at the blog page 
// -- this has to be done here, because it won't work if you initialize it with a 
//    require_once that is (indirectly) called from within a function or class
if (intval($_GET["cID"])==WORDPRESS_CID || strpos($_SERVER["REQUEST_URI"], '/blog')!==false) {
   if (!function_exists('get_option')) {
      $wordpress = realpath(dirname(__FILE__) . "/../wordpress");
      require_once ("$wordpress/wp-blog-header.php");
   }
}


Obviously, adjust the WORDPRESS_CID define to reflect your setup, and adjust the '/blog' and '/wordpress' parts here as well. Hope this helps. Good luck! And let me know if it worked out.
annar replied on at Permalink Reply
annar
Elyon, yes this is what I ended up doing. I was not able to get it to check if someone is logged in or not though, so it shows a link to register even if someone is already registered and a link to manage subscription settings even if the user hasn't registered yet. Better than nothing though, at least everything is there.

Edward, thank you for your suggestion- I will let you know how it goes if I try it.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.