Helping you Build Your Own Social Network!

Faster, better and easier!

simple question

(8 posts) (2 voices)

Tags:

No tags yet.


  1. I want to have a link on the member-header.php. This link should open up a page (a separate php file within the /members/single/ folder) which will show the profile fields.

    The link is a resume link, which should open up /members/single/resume.php in which i plan to copy the code from profile-loop.php

    thanks,
    Gwu

    Posted 1 year ago #
  2. It should be similar to the view link besides the activity, which opens up a new page with the activity.
    can anyone help please

    Thanks,

    Posted 1 year ago #
  3. Hi Gwu,
    It's not that difficult But I am not sure what you want. Does that open a new page ? or does It open a popup. Further, how will you get the data in that page, are they coming from profile fields ?

    Posted 1 year ago #
  4. yes. I want it to work just like the view link besides the activity, instead of the activity showing up I want the profile fields to be displayed.
    I want to put his link on the member header file.

    Posted 1 year ago #
  5. any help?

    Posted 1 year ago #
  6. Hi Gwu,
    Please put the following code in some file and activate it as plugin.

    /**
    Plugin Name: User resume
    */
    
    //put a link to member profile usig item meta
    add_action("bp_profile_header_meta","show_resume_link");
    
    function show_resume_link(){
    ?>
    <a href="<?php bp_user_link() ?>resume"> View resume</a>
    <?php
    }
    //now the code to handle /resume url
    
    function bp_resume_screen_function() {
        global $bp;
       if(bp_is_member()&&$bp->current_component=="resume"){
     bp_core_load_template( apply_filters( "resume_my_resume", 'members/single/home' ) );
    
    }
    }
    
    add_action( 'wp', 'bp_resume_screen_function',5);
    
    function bp_is_resume(){
    global $bp;
     if($bp->current_component=="resume")
     return true;
     return false;
    }

    //Now edit your members/single/home.php

    make sure the item-body div looks like this

    <div id="item-body">
    				<?php do_action( 'bp_before_member_body' ) ?>
    
    				<?php if ( bp_is_user_activity() || !bp_current_component() ) : ?>
    					<?php locate_template( array( 'members/single/activity.php' ), true ) ?>
    
    				<?php elseif ( bp_is_user_blogs() ) : ?>
    					<?php locate_template( array( 'members/single/blogs.php' ), true ) ?>
    
    				<?php elseif ( bp_is_user_friends() ) : ?>
    					<?php locate_template( array( 'members/single/friends.php' ), true ) ?>
    
    				<?php elseif ( bp_is_user_groups() ) : ?>
    					<?php locate_template( array( 'members/single/groups.php' ), true ) ?>
    
    				<?php elseif ( bp_is_user_messages() ) : ?>
    					<?php locate_template( array( 'members/single/messages.php' ), true ) ?>
    
    				<?php elseif ( bp_is_user_profile() ) : ?>
    					<?php locate_template( array( 'members/single/profile.php' ), true ) ?>
    				<?php elseif ( bp_is_resume() ) : ?>
    					<?php locate_template( array( 'members/single/resume.php' ), true ) ?>
    				<?php else : ?>
    					<?php
    						/* If nothing sticks, just load a member front template if one exists. */
    						locate_template( array( 'members/single/front.php' ), true );
    					?>
    				<?php endif; ?>
    
    				<?php do_action( 'bp_after_member_body' ) ?>
    
    			</div><!-- #item-body -->

    Note the last couple of lines I have changes

    and Now, create a resume.php in members/single/ and put the code to show the data you want o show there.

    I am sure it is a little longer, but It was the easiest way.

    Posted 1 year ago #
  7. amazing..just perfect. Thanks Brajesh.

    One thing i changes was to load this page separately rather than through the members/single/home.php

    Thank you so much.

    Posted 1 year ago #
  8. you are most welco0me :) Glad you got it working :)

    Posted 1 year ago #

Reply

You must log in to post.