sweetpotato
Active member
this add-on is no longer support. It waste me 2 weeks to make it work but no luck. Have emailed the author but waste of time. I don't ask for refund but please Xenforo delete it out of here.
Can anybody help me with this problem?
http://xenforo.com/community/threads/login-bar-on-wordpress-pages.46881/
Thanks in advance.
<fieldset id="header_bar">
<div class="pageWidth">
<div class="pageContent">
<?php
if ( is_user_logged_in() ) {
global $current_user, $XF;
get_currentuserinfo();
echo '
<span id="member" class="loggedIn_menu_class"><a href="/community/conversations/">Inbox</a> <strong class="itemCount">' . $XF->visitor->get('conversations_unread') . ' </strong>
<a href="/community/account/alerts">Alerts</a> <strong class="itemCount">' . $XF->visitor->get('alerts_unread') . ' </strong>
<a href="/community/logout">Log Out</a></span>
';
echo '
<span id="member" class="loggedIn_menu_class">
';
echo '
<a href="/community/members/' . strtolower($XF->visitor->get('username')) . '.' . $XF->visitor->get('user_id') .'"> '. $current_user->display_name .'</a></span>
';
if ( $site_admins = array ( 'List your admins' ) ){
echo '
<span id="member" class="admin"><a href="/wp-admin">WordPress Admin Panel</a>
<a href="/wp-admin/post-new.php">WordPress Add New Blog Post</a>
<a href="/community/admin.php">XenForo Admin Panel</a></span>
';
}
} else {
echo '
<script>XenForo.LoginBar = function(a){};</script>
';
if ($_SERVER['HTTP_HOST'] == 'tuxnotes.tuxreportsnetwork.com') {
echo '<span id="member" class="logIn_menu_class"><a href="http://www.tuxreportsnetwork.com/community/login" class="OverlayTrigger inner">Log In or Sign Up</a></span>';
} else {
echo '<span id="member" class="logIn_menu_class"><a href="/community/login" class="OverlayTrigger inner">Log In or Sign Up</a></span>
';
} } ?>
</div>
</div>
</fieldset>
There are HowTo explanations on my site which might help you out with matching WP and XF styles. But the work will take time.
As you will see on my site, I heavily modified the navigation and navigation.css in XenForo and moved information to a header fieldset. The header code I use on the WP side has been posted a few times but I never wrote up my instructions on the XenForo side. Sorry - maybe I'll do that when I have time.
Hope this information helps. Modify the WP child theme header.php file. Add the following code below the body tag:
PHP:<fieldset id="header_bar"> <div class="pageWidth"> <div class="pageContent"> <?php if ( is_user_logged_in() ) { global $current_user, $XF; get_currentuserinfo(); echo ' <span id="member" class="loggedIn_menu_class"><a href="/community/conversations/">Inbox</a> <strong class="itemCount">' . $XF->visitor->get('conversations_unread') . ' </strong> <a href="/community/account/alerts">Alerts</a> <strong class="itemCount">' . $XF->visitor->get('alerts_unread') . ' </strong> <a href="/community/logout">Log Out</a></span> '; echo ' <span id="member" class="loggedIn_menu_class"> '; echo ' <a href="/community/members/' . strtolower($XF->visitor->get('username')) . '.' . $XF->visitor->get('user_id') .'"> '. $current_user->display_name .'</a></span> '; if ( $site_admins = array ( 'List your admins' ) ){ echo ' <span id="member" class="admin"><a href="/wp-admin">WordPress Admin Panel</a> <a href="/wp-admin/post-new.php">WordPress Add New Blog Post</a> <a href="/community/admin.php">XenForo Admin Panel</a></span> '; } } else { echo ' <script>XenForo.LoginBar = function(a){};</script> '; if ($_SERVER['HTTP_HOST'] == 'tuxnotes.tuxreportsnetwork.com') { echo '<span id="member" class="logIn_menu_class"><a href="http://www.tuxreportsnetwork.com/community/login" class="OverlayTrigger inner">Log In or Sign Up</a></span>'; } else { echo '<span id="member" class="logIn_menu_class"><a href="/community/login" class="OverlayTrigger inner">Log In or Sign Up</a></span> '; } } ?> </div> </div> </fieldset>
You will want to clean up some of the if statements to match your needs.
Well, first of all thanks for your help. I have that bad feeling that you're way more active than the author itself.
But I just noticed, that the bridge doesn't promote the blog posts anymore. (It's not the first time, that I have problems like this.)
Yes, new version soon =)
So you working again on it? Nice to hear. Maybe I'll reinstall it in that case. But I guess it still isn't compatible with W3TC, right?
if ( function_exists('w3tc_pgcache_flush') ) {
w3tc_pgcache_flush();
} else if ( function_exists('wp_cache_clear_cache') ) {
wp_cache_clear_cache();
}
if ( function_exists( 'w3tc_pgcache_flush' ) )
w3tc_pgcache_flush();
if ( function_exists( 'w3tc_dbcache_flush' ) )
w3tc_dbcache_flush();
if ( function_exists( 'w3tc_minify_flush' ) )
w3tc_minify_flush();
if ( function_exists( 'w3tc_objectcache_flush' ) )
w3tc_objectcache_flush();
if ( function_exists( 'wp_cache_clear_cache' ) )
wp_cache_clear_cache();
Actually, would you try to add this code into the plugin/include/xf_replacement_user_functions.php file:
PHP:if ( function_exists('w3tc_pgcache_flush') ) { w3tc_pgcache_flush(); } else if ( function_exists('wp_cache_clear_cache') ) { wp_cache_clear_cache(); }
Enable W3TC and please report back ....
Update: I guess the flush should be much more powerful.
PHP:if ( function_exists( 'w3tc_pgcache_flush' ) ) w3tc_pgcache_flush(); if ( function_exists( 'w3tc_dbcache_flush' ) ) w3tc_dbcache_flush(); if ( function_exists( 'w3tc_minify_flush' ) ) w3tc_minify_flush(); if ( function_exists( 'w3tc_objectcache_flush' ) ) w3tc_objectcache_flush(); if ( function_exists( 'wp_cache_clear_cache' ) ) wp_cache_clear_cache();
Sorry, can't test it right now, since I don't use it atm. I'll wait for the new version and test it than. Thanks for your great work.
Please realize that this will not be put in a new version until it is tested. Since I do not use caching plugins then maybe someone else will test.
if ( function_exists( 'w3tc_pgcache_flush' ) )
w3tc_pgcache_flush();
if ( function_exists( 'w3tc_dbcache_flush' ) )
w3tc_dbcache_flush();
if ( function_exists( 'w3tc_minify_flush' ) )
w3tc_minify_flush();
if ( function_exists( 'w3tc_objectcache_flush' ) )
w3tc_objectcache_flush();
if ( function_exists( 'wp_cache_clear_cache' ) )
wp_cache_clear_cache();
Where doesn't matter, right?plugin/include/xf_replacement_user_functions.php
Actually, let me spend more time looking for the best place to flush the cache.
@lph - can you help me out with something I am trying to achieve. Since after the integration the WP profile is inaccessible, I am not able to insert the author google plus profile into their posts. Would it be possible to save this URL into XF and then call it from the user posts?
Or any other suggestions to do this?
With Wordpress 3.6 on the horizon, future versions should be tested against the current beta.
We use essential cookies to make this site work, and optional cookies to enhance your experience.