Oh man, I've just figured it out now... wow, and all this info was available out there, and I've used a lot of it, but never put two and two together. So, after all the useless patching and trying to incorporate php code into smarty templates and vice versa, I've finally done it. I am not sure what the implications of it are as far as security goes, but to be quite honest, I really don't care... it looks good to me as it is! So, what I've done is this... quite simple. If you have a wordpress powered website, and a theme/template already developed, here's what you do: Step 1 Open up your /amember/config.inc.php Assuming that your wordpress is installed in the root folder, and amember in a subfolder, you add these two lines just before the last closing curly bracket, or at the end of the file to be safe after all the brackets and whatnot: Code: define('WP_USE_THEMES', false); require("../wp-blog-header.php"); Step 2 Open up page.php in your wordpress theme folder. If it hasn't been customized heavily, and looks pretty much like the default themes look like, copy the first line or two that call the header info: Code: <?php get_header(); ?> <div id="main"> and paste them into your amember's header.html (in templates folder), overwriting all the amember code (except for the calls to CSS files, you might wanna save those and paste them right after the code below): Code: {php}get_header();{/php} <div id="main"> Step 3 Do the same for your footer.html as well - copy the closing code from your page.php: Code: </div> <?php get_sidebar(); ?> <?php get_footer(); ?> into the footer.html like this (overwriting all that code in there): Code: </div> {php}get_sidebar();{/php} {php}get_footer();{/php} And from there on, it would be nice if you integrated the amember-sidebar-widget wordpress plugin from one of the members here (also posted on www.wordpress.org/extend/plugins) and plug that into your sidebar, thus giving users quick access to the login/logout/member links (I've customized that widget quite a bit, listing affiliate links as well and styling it in a custom fashion). And you're set! All you have to do from now on is update/change your wordpress templates and your amember templates will be automatically updated too... just stupid easy. All I'm having a problem right now is properly integrating $title variables from smarty templates into the pages, so I've actually created a custom header2.php file in wordpress to get around this issue, until I run into a better solution.
the only problem I see with this method of integration is when I try to logout, and logout.php file gives me this error: Code: Fatal error: Call to a member function assign() on a non-object in /home/naturals/public_html/members/common.inc.php on line 1250 in function html_redirect and it has something to do with the redirect page that should get displayed, even though I get logged out just fine, as far as cookies/session goes.
This is a great tip. I tested this and it works great under WordPress 2.5, with the exception of actually being able to login?? I'm not quite sure if session is not being established or what the deal is..
for that you should use the updated Wordpress Plugin from aMember (they updated it for wordpress 2.5)
Did anyone else have issues logging into the admin section? I get the following error Fatal error: require() [function.require]: Failed opening required '../wp-blog-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/attitra/public_html/members/config.inc.php on line 56 This is line 56 Code: require("../wp-blog-header.php"); The crazy thing is that I can access the signup form and login areas just fine but if I try to go to the admin section it gives me the error. Could it be that the admin section is one folder "deeper" /member/admin/?
In that case I would just edit config.php and change that require("../wp-..."); into a full path to the file. And again, the only problems I run into with this set up is errors on logout (can't figure out how to get around it) and occasionally the admin backend throws me the frontend layout in the right-hand frame (on an error or something)... which I can deal with, as nobody but me sees it.
Thanks. I tried that between the time I made the post and now, but didn't try "/home/attitra/public_html/wp-blog-header.php" and that worked. However, now I am not able to login to the membership area. The login page is there and I even have a custom page to login but neither of them work. Very strange as it doesn't work in IE or Mozilla. Any suggestions?
Signup page not parsing correctly now. I tried adding the following to the end of my config.inc.php file: Code: define('WP_USE_THEMES', false); require("/the/complete/path/to/wp-blog-header.php"); And changed the header to: Code: {php}get_header();{/php} <DIV ID="aMemberBody"> And the footer to: Code: </DIV> {php}get_sidebar(); get_footer();{/php} And the strangest thing happened... my signup page stopped working. Other pages (the login page, the index, etc.) parse the language tags and make it all the way to the footer, but for some reason this is what I get with my signup: I can't for the life of me figure out why this file isn't parsing properly, but others are. I've switched my wordpress theme back to the default, but that didn't help. Any ideas? Anyone else have this issue?
I am finding that this is not working with a widgetized sidebar. I'm using the exact code posted in this forum and the footer code is picking up my widgets instead of the footer.
I find it much easier to make a hard coded template based on the blog. You mainly need to focus on the header and footer. David
wordpress display smarty variables I have figured out to display {$title} in wordpress. The code is listed bellow: Code: wp header.php file <?php if (substr($_SERVER["REQUEST_URI"], 1, 7) == 'amember') { ?> <title>aMember only | <?php global $t; echo $t->get_template_vars('title'); ?></title> <link rel="stylesheet" ....add amember CSS here/> <?php } else { ?> <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' |'; } ?> <?php bloginfo('name');?></title> <?php } ?> works great!! Thanks every one for sharing John
give absolute path will be OK I fixed it and thanks for point out, Something like "/home/userxxx/public_html/wp/wp-blog-header.php" John
Just found a helpful Video Just found a helpful Video that answered my question: http://www.membershipacademy.com/index.php?option=com_content&task=view&id=59 Hope this helps someone, All the success, Ryan Saville
hey guys... reviving a semi-old thread... I've followed the steps, but i get: Fatal error: Call to undefined function get_header() in /domains/xxxxxxxxxxx.com/html/amember/templates_c/%%190^%%1901021975^header.html.php on line 26 Any direction would be a huge help.
There is an easy fix which is not dependent on your root directory: Code: define('WP_USE_THEMES', false); require("$config[root_dir]/../wp-blog-header.php"); Enjoy.
Nice. That still needs to be edited in case your wordpress/blog is in a different folder... but still nice.
I'm getting two error msgs when I try to do this... 1) WARNING: in_array() [function.in-array]: Wrong datatype for second argument in line 123 of file plugins.inc.php 2) Plugin 'wordpress' is not enabled. Died I've tried everything on this thread... any ideas?