Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)

  • UrbanFix
    Participant

    @urbanfix

    This is perfect! Thanks @danbp!
    I got it to work!!


    UrbanFix
    Participant

    @urbanfix

    @danbp
    I have attempted to use the ‘little plugin’ you mentioned but when I add the following two lines i get an error! COuld you please add them for me?

    $temp_post = get_post($post_id);
    $user_id = $temp_post->post_author;

    I have sucessfully changed the user id as you mentioned without any trouble.

    public function generate_activity_stream( $atts, $content = null, ) {
            //allow to use all those args awesome!
           $atts=shortcode_atts(array(
                'title'            => 'Latest Activity',//title of the section
                'pagination'       => 'true',//show or not
                'display_comments' => 'threaded',
                'include'          => false,     // pass an activity_id or string of IDs comma-separated
                'exclude'          => false,     // pass an activity_id or string of IDs comma-separated
                'in'               => false,     // comma-separated list or array of activity IDs among which to search
                'sort'             => 'DESC',    // sort DESC or ASC
                'page'             => 1,         // which page to load
                'per_page'         => 5,         //how many per page
                'max'              => false,     // max number to return
    
                // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
                'scope'            => false,
    
                // Filtering
                'user_id'          => $user_id,    // user_id to filter on
                'object'           => false,    // object to filter on e.g. groups, profile, status, friends
                'action'           => false,    // action to filter on e.g. activity_update, new_forum_post, profile_updated
                'primary_id'       => false,    // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
                'secondary_id'     => false,    // secondary object ID to filter on e.g. a post_id
    
                // Searching
                'search_terms'     => false,         // specify terms to search on
                'use_compat'       => bp_use_theme_compat_with_current_theme() 
            ), $atts );
           
            extract( $atts );
    	
          
            
            ob_start(); ?>

    Thanks,
    Urban-fix


    UrbanFix
    Participant

    @urbanfix

    I do not wish to use a plugin due to the current page load times and I have had a lot of issues with conflicts..
    If their is no other way i shall give up and try the plugin, but i have faith yet!


    UrbanFix
    Participant

    @urbanfix

    @henrywright
    that is kind of what i’m trying to do,
    I have very little knowledge of php, and an awful lacking in how all this works!
    On my website bp users add things called ‘listings’ on these listings are a set of tabs.
    See this link:
    http://urban-fix.co.uk/food_and_drink/united-kingdom/merseyside/liverpool/bar/level-nightclub/#my_new_tab

    I have created a new tab in my functions.php using this code:

    <?php add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
     	$tab_array['my_new_tab'] = array( 
    										'heading_text' =>  __('New Tab',GEODIRECTORY_TEXTDOMAIN),
    										'is_active_tab' => false,
    										'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true, 'my_new_tab'),
    										'tab_content' => ''
    									);
    	return $tab_array ;
    }
    add_action('geodir_after_tab_content' ,'geodir_my_new_tab_content');
    function geodir_my_new_tab_content($tab_index)
    {
    	if($tab_index =='my_new_tab')
    	{
    		echo "Hello world!!";
    	}
    }
    ?>

    On this tab I wish to display the activity stream of the bp user who created the listing,
    I didn’t realise it was going to be so complex (or just so hard…)
    Is this something someone could take the time to write for me? I can’t be the first person to want to do this!

    If i could get the activity stream to show on the tab i believe i could work the filters out, but i don’t, i either get a blank space or i create errors!


    UrbanFix
    Participant

    @urbanfix

    @danbp do you mean the grey warnings? they are gone now!
    I think I havent explained this very well, I already have the code which adds the tab (its a tab on a page not bp profile), i just cant work out what code i need to use to add the page authors activity stream to this tab?
    Thankyou


    UrbanFix
    Participant

    @urbanfix

    Same here!
    I dont understand how the activty loop works, ive been trying to do this for 2 days now haha,
    If you get it working please let me know!


    UrbanFix
    Participant

    @urbanfix

    The code im using to add a new tab isnt to add one to buddypress,
    If this is what you are after it is done in a different way look at;

    https://buddypress.org/support/topic/how-do-i-add-a-menu-item-on-the-profile-page/

    or subnav

    https://buddypress.org/support/topic/adding-a-subnav-with-new-page-content-to-the-profileactivity-page/


    UrbanFix
    Participant

    @urbanfix

    the link i added seems to of vanished, the new tab is on the following page;

    http://urban-fix.co.uk/food_and_drink/united-kingdom/merseyside/liverpool/bar/chameleon-bar-liverpool/#my_new_tab


    UrbanFix
    Participant

    @urbanfix

    Sorry I thought I had!

    This is code I have created to add a new tab to a cpt, its on

    <?php add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
     	$tab_array['my_new_tab'] = array( 
    										'heading_text' =>  __('New Tab',GEODIRECTORY_TEXTDOMAIN),
    										'is_active_tab' => false,
    										'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true, 'my_new_tab'),
    										'tab_content' => ''
    									);
    	return $tab_array ;
    }
    add_action('geodir_after_tab_content' ,'geodir_my_new_tab_content');
    function geodir_my_new_tab_content($tab_index)
    {
    	if($tab_index =='my_new_tab')
    	{
    		echo "Hello world!!";
    	}
    }
    ?>

    These pages/cpts are created by buddypress users. So, on this new tab i have created i wish to call the activity stream of the author!
    My php knowledge is almost nill so I am really struggling, I didn’t think it was to hard a thing to do!


    UrbanFix
    Participant

    @urbanfix

    I do not have a clue what i’m doing if im honest,
    this is the code i have to create a new tab, how would i add the above code to this?
    Thanks


    UrbanFix
    Participant

    @urbanfix

    Ah okay thankyou!


    UrbanFix
    Participant

    @urbanfix

    Sorry!
    I was trying to just post one but it kept saying error so i posted again!
    It worked perfectly, just for future reference, why am i using the urbanfix_remove etc?
    Thanks a bunch!


    UrbanFix
    Participant

    @urbanfix

    Please note: i have no legitimate users only spam!

Viewing 13 replies - 1 through 13 (of 13 total)
Skip to toolbar