Forum Replies Created
-
Ahhh moving it to the top worked.
Thanks Paul
Paul, I tried that and still no joy.
I added it to the bottom of wp-config.php and still it jumps to activity.
Is there any reason why this wouldnt work?
Cheers
Could I just have multiple slugs pointing to the same component? And where is the members component located?
Thanks
no luck with this yet mate. What ever I do seems to add the link to both the userbar and options bar!
Man this one is still killing me!
the code you have given me works. but it puts the link in all 3 levels (buddybar, userbar & options bar)
After looking in the docs $bp->bp_users_nav seems to do what i want (which apparently works the same as $bp-bp_nav)
However nothing gets returned
cheres brajesh. will have a go with those now
AHH ok.
It looks like the core function I need to modify is bp_get_displayed_user_nav(); Which is called in the options bar.
Is it possible to modify that function without going into the core component? ie could i just re-write it and place it in bp-custom.php?
Thanks for the help so far
OK basically I want to do this;
Add an item to the optionbar for this;
http://example.org/members/XXXXX/
So when I’m viewing someone elses profile I would like to add an item to the options bar which by defualt includes;
Activity
Profile
Blogs
Wire
Friends
Groups
I don’t want to add the new item to the usersbar or the buddy bar
Cool thanks.
Ok thats not the set of files i need. I’m looking for the template that outputs the optionsbar.
The output is something like;
<div id=”optionsbar”>
<h3>Jebel Ali Golf Resort</h3>
<ul id=”options-nav”>
……
</div>
Hey so I gave up in the end and will continue tonight.
Does anybody know how I can get something to the options bar of the members section with out adding it to the users bar?
Just to add to this, after further searching I think what I need to do is add only a menu item to the the options bar only.
Ok so now my next question.
What would I need to do to only make this visible on certain profiles (ie ones where a certain field in xprofile_data is present)?
Currently I have the extra component visible on;
My Account on the buddybar
The Me section
and a users profile menu.
I put an if statement around the part that sets up the nav. but that doesnt work. It just either shows it in all 3 or none at all
Oh great, that was simple!
cool, already looking into that now.
although (correct me if im wrong), that seems to create a standalone component accessed via;
However I was wanting to create one that ties into the users profile…. such as
http://example.com/members/some-member/my-custom-component/
Could you give me some pointers on to how I should get started?
Cheers
Thanks for the help Jeff.
The reason I posted is due to not finding anything definitive in the search… all results I have found on “deep integration” are either people saying you need it or are they using it….
however one of the results gave me an idea.
What if I keep bbpress as the group forum. but then use simplepress to handle the more traditional forum?
That way im guessing it would be treated as 2 seperate forums – all i would need to do then is share the user data?
Thanks Jeff.
I’ve followed that link and got stuck a bit.
I have the one-click-install working without a problem.
I then uploaded BBPRESS to a new directory off the root (called it /forum/). browsed to that directory and didnt get taken to an install page….
Am I missing something?
Thanks
I called the function incorrectly
$bp->bp_check_usertype($bp->displayed_user->id);
should have be
bp_check_usertype($bp->displayed_user->id);
works a charm
Ok so I created;
/wp-content/plugins/bp-custom.php with the below in it;
/**
* bp_check_usertype()
* TEMPLATE TAG
*
*/
function bp_check_usertype($userID) {
global $bp, $wpdb;
$qry = $wpdb->get_var("SELECT value FROM wp_bp_xprofile_data WHERE field_id = 5 AND user_id = " . $userID);
/* Sort the nav by key as the array has been put together in different locations */
echo $qry;
}However when I call it in /bp-themes/mymember/profile/index.php like so;
$bp->bp_check_usertype($bp->displayed_user->id);
I get the following error
Fatal error: Call to undefined function: bp_check_usertype() in /html/wp-content/bp-themes/mymember/profile/index.php on line 31
Am I missing something?
I think I’ve solved it (but havent built it yet). This is what I’m going to do;
-Write a function in bp-custom.php
– Function takes the current ID and passes that to the db returning the usertype (which is a custom profile field)
– Run the function on profile/index.php
– then do a simple switch statement to show the appropriate template
ahhhhh you’d don’t know how long I stayed up trying to work out how to get it to work.
adding the global got it working.
Thanks hugely
Jeff that sounds more logical.
and in fact i was trying to get that to work last night.
why would it be <?php echo $bp->displayed_user->id; ?> added into /profile/index.php doesn’t output the id?
Thanks
I had similar that needed that recently.
Have you tried
global $wpdb;
$row = $wpdb->get_results( $wpdb->prepare(“SELECT user_login FROM $wpdb->users WHERE u.ID = %s”, $username) );
print_r($row);
I think you access each individual column like this
$row[“coloumRow”];
see if this helps https://codex.wordpress.org/Function_Reference/wpdb_Class
just a guess but is it get_row you need?
I would also like to know this