I’ve only had a quick glance, and it seems pretty good. Are you or ArHistoryHub on Twitter?
I’m actually joshDjenks on Twitter – no account set up yet for the Hub. I’m not terribly active either.
Kudos on the BP Labs plugin btw! Quick admin got me thinking about other ways to streamline navigation and reduce page calls. The biggest time saver in my mind would be adding ajax to the item nav/subnav in profiles. I tinkered with it last night – still some css clean up to do but it works just fine so far. http://www.arhistoryhub.com/members/joshjenkins
Love the ajax addition. Do you happen to have any code snippets you could share?
I’m only just beginning to work with ajax but have a lot of experience with bp.
Nice site btw, very very clean layout, and easy to follow
Assuming you’re already loading jQuery in your header with something like this ` ` just add the following before the “ tag…
`
jQuery(document).ready(function(){
jQuery(‘#object-nav a, #subnav a’).live(‘click’, function(e){
e.preventDefault();
var link = jQuery(this).attr(‘href’);
jQuery(‘#nav-ajax’).html(‘
Loading
‘);
jQuery(‘#nav-ajax’).load(link+’ #nav-ajax’);
});
});
`
To write this script, I chose what links I wanted to make the call – for profile navigation that’s those in #object-nav and #subnav.
Then you have to wrap the elements you want to get loaded in a div – in this case I used `
` and wrapped it around the entire item-body div in my theme’s members/single/home.php…. Like so
`
<?php
/* If nothing sticks, just load a member front template if one exists. */
locate_template( array( ‘members/single/front.php’ ), true );
?>
`
You also have to do the same thing for the members/single/plugins.php with the same div. Just style the p class=”ajaxing” however you want in your default stylesheet. The process works the same for groups as well. I had problems getting a:active css attributes to show, but besides that it’s worked just fine.
Oh, and thanks for the compliments!
Wow, thanks for the primer!
I fully plan on digging into ajax this week and you have given me a great start. It actually looks a lot easier than I would have thought from the snippets you provided, it actually now makes sense to me. I can tell this is going to be fun.
Yeah, it’s not too tough. I’m it would be easy to write a plugin for this, but not being a developer myself, I’ve no idea how to. Perhaps this could be my first?!
Hey I love your website. I love the member area and the ajax stuff, i think i’m going to embed it as well on my (yet alpha) work in progress website. Thanks
edit: embeddd and working fine but as you said, ” I had problems getting a:active css attributes to show, but besides that it’s worked just fine.” i have the same issue, active button remains on the “activity”
edit: i’ve noticed another “bug”, in the activity, the filter is not working, but it seems to be a WP 3.2 problem
Thanks @n0ise. Yes, the activity and directory filters is a WP 3.2 thing. I think I’ve figured it out – I had fooled around with the directory template tag files and changed “Search anything…” to something else – which for some reason broke sorting, but not the search function. It’s fixed now.
I couldn’t figure out the active state thing, but felt it was an important enough feature that I changed my design to accommodate this issue. If you ever figure it out, let me know!
@ARHistoryHub thanks for the hint…but where i can find the “search anything” ? (i’m using buddybase too)
That will actually be in the core files – plugins/buddypress/bp-core.php, buddypress/bp-groups/bp-groups-templatetags.php, and the same for forums. This is a great example of why you shouldn’t mess with core files (and why I’m a fool for doing so), but it’s probably not your problem at all. I think most people’s problems are stemming from other plugin’s or the theme loading another version of jquery. I’d check the source code from the offending pages and see if any other jquery libraries are being loaded.
I rarely edit the core because im such a messy and when there’s an update I always forgot what i’ve edited lol…
btw..i changed the value with ‘Search here…’ but the problem still remains, tried also to disable all plugins, so i guess it’s something else in my website (i use a custom google map using “)
I’ve fixed the theme, just copy the ajax.php and global.js from the bp-default theme into your custom theme in _inc/ and it’s done. YAY
edit: it seems it’s partially fixed (i’ve just copy pasted without comparing, i will check better tomorrow:) )