WordPress.org

Forums

BuddyPress Group Tags
[resolved] Cloud Tag URL's not working (26 posts)

  1. Scott
    Member
    Posted 2 years ago #

    WordPress multisite 3.5.1, Buddypress 1.7. Clean install with just this plugin and the groupblog plugin.

    The tags at the top of groups page go to a page not found when clicked. The links are going to http://mysite.com/groups/tag/mytag . When I hover over the links it is giving me the correct post count so that is working it is just the link is not working.

    Any ideas?

    http://wordpress.org/extend/plugins/buddypress-group-tags/

  2. Scott
    Member
    Posted 2 years ago #

    I am on the right track. It is an issue with non-buddypress themes and ajax links. With buddypress 1.7 we are not suppose to need a buddypress enabled theme as it is suppose to just work. So there is something in the plugin I think that will need to be changed to make it work with a non buddypress custom theme. I am looking into it but any help would be appreciated.

  3. epawel
    Member
    Posted 2 years ago #

    I think I've solved this issue by adding in a file: bp-group-tags.php (function bp_gtags_setup_globals line 23)
    $bp->gtags = new stdClass;
    It works for me: BGT 2.0.3, BP 1.7.1, WP 3.5.1

  4. sielwolf
    Member
    Posted 2 years ago #

    Same issue but your trick didn't work on my bp 1.7.1 epawel :-\

  5. Fourmi
    Member
    Posted 2 years ago #

    Same issue.
    The URL is working with the fix from epawel but the page is empty.

    Is there someone who found out how to make it work?

  6. investoreports
    Member
    Posted 2 years ago #

    I have a similar problem,

    For me the links work when in the tag cloud at the top of the page - but dont work when in the sidebar via the widget.

    URL is exactly the same,

  7. hieronymusdesign
    Member
    Posted 2 years ago #

    Hello mate.

    At the moment i got the same problem. The links in the BuddyPress Group Tags is working. But the page shows up as a 404, page not found.

    I tried adding the "$bp->gtags = new stdClass;" in the file but did nothing for me. Perhaps we got some response from the developer.

  8. nguyendam
    Member
    Posted 2 years ago #

    I have same Problem? Anyone can help me!

  9. bendm
    Member
    Posted 2 years ago #

    Same problem here. Someone, anyone? Please help

  10. HeleneFi
    Member
    Posted 2 years ago #

    Same here. The general cloud works, but the tag lists on the individual group pages lead to error not found page.

  11. PauloASilva
    Member
    Posted 1 year ago #

    Hi,
    I'm having the same problem with BuddyPress 1.8, BuddyPress Group Tags 2.0.3 and a non BuddyPress theme.

    I was able to get AJAX tag cloud links working, but the "static" page at /groups/tag/tag-name does not work. It seams that nothing catches the /groups/tag/ URL.

    $bp->gtags is not the problem, but it raises a PHP Notice because you can not set properties in runtime. You can fix it replacing

    $bp->gtags->id = 'gtags';
    $bp->gtags->slug = 'tag';

    by

    $bp->options['gtags'] = (object)Array(
    	'id' => 'gtags',
    	'slug' => 'tag'
    );

    and than fixing the bp_core_new_subnav_item call like

    bp_core_new_subnav_item( array( 'name' => ' ', 'slug' => $bp->options['gtags']->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => $bp->root_domain .'/'. BP_GROUPS_SLUG . '/', 'screen_function' => 'gtags_display_hook', 'position' => -1 ) );

    I will keep debugging, looking for a fix.

  12. HeleneFi
    Member
    Posted 1 year ago #

    Hi has someone found a fix for this (and can explain in fix for dummies mode :)

    Thanks!

  13. hieronymusdesign
    Member
    Posted 1 year ago #

    Hi PauloASilva,

    In what file did you change

    $bp->gtags->id = 'gtags';
    $bp->gtags->slug = 'tag';

    into

    $bp->options['gtags'] = (object)Array(
    	'id' => 'gtags',
    	'slug' => 'tag'
    );

    and where did you add the

    bp_core_new_subnav_item( array( 'name' => ' ', 'slug' => $bp->options['gtags']->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => $bp->root_domain .'/'. BP_GROUPS_SLUG . '/', 'screen_function' => 'gtags_display_hook', 'position' => -1 ) );

  14. PauloASilva
    Member
    Posted 1 year ago #

    Hi hieronymusdesign,
    I did a "DON'T": I did change a core plugin file.

    First the "bp-group-tags.php", lines 30 and 31, and than line 43

  15. hieronymusdesign
    Member
    Posted 1 year ago #

    Dude, you are my saviour. That did the trick !

  16. chancharles
    Member
    Posted 1 year ago #

    I changed the following (in addition to PauloASilva's suggestion) and the group's page shows up properly:

    add any where in "bp-groups-tags.php":

    function gtags_return_blank() {
        return '';
    }

    modify "gtags_display_hooks()" to look like this:

    function gtags_display_hook() {
      add_filter('bp_current_action', 'gtags_return_blank');
      bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/index' ) );
      remove_filter('bp_current_action', 'gtags_return_blank');
    }

    Post BuddyPress 1.7 (theme compatibility), if the current action is not empty (in this case, it's set to 'tag'), then BuddyPress will not treat it as a group directory page.

    I wish this plugin is in github somewhere so that we can at least put the fixes in there.

    Btw, I tested the above with BuddyPress 1.9 Beta 2. It should work with 1.8 as well.

  17. PauloASilva
    Member
    Posted 1 year ago #

    @chancharles: I could not get gTags to work with your changes. I'm running BuddyPress 1.8.1 and gtags 2.0.3

    Could you please provide your plugin modified source code?

    I wish this plugin is in github somewhere so that we can at least put the fixes in there.

    Plugin is provided with no license, but I'm sure that its author will be interested about fixes. As soon as we can get it to work fully, I will try to contacto him.

  18. chancharles
    Member
    Posted 1 year ago #

    diff bp-group-tags.php bp-group-tags_php.original
    23,26c23,24
    <   $bp->options['gtags'] = (object)Array(
    <     'id' => 'gtags',
    <     'slug' => 'tag'
    <   );
    ---
    > 	$bp->gtags->id = 'gtags';
    > 	$bp->gtags->slug = 'tag';
    34,36c32
    <   bp_core_new_subnav_item(array( 'name' => '&nbsp;', 'slug' => $bp->options['gtags']->slug,
    <                           'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => $bp->root_domain .'/'. BP_GROUPS_SLUG .
    <                           '/', 'screen_function' => 'gtags_display_hook', 'position' => -1 ) );
    ---
    > 	bp_core_new_subnav_item( array( 'name' => '&nbsp;', 'slug' => $bp->gtags->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => $bp->root_domain .'/'. BP_GROUPS_SLUG . '/', 'screen_function' => 'gtags_display_hook', 'position' => -1 ) );
    47,49d42
    < function gtags_return_blank() {
    <     return '';
    < }
    52d44
    <   add_filter('bp_current_action', 'gtags_return_blank');
    54d45
    <   remove_filter('bp_current_action', 'gtags_return_blank');
    179c170
    < 		"SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE meta_key = %s", 'gtags_group_tags' ) );
    ---
    > 		"SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE meta_key = 'gtags_group_tags' " ) );
  19. chancharles
    Member
    Posted 1 year ago #

    Paulo, if you want more than the diff, let me know.

  20. Profusion
    Member
    Posted 1 year ago #

    Hi @chancharles

    Thanks for the effort. However, it is really tough working from your diff without making mistakes. Could you perhaps post your full altered code, perhaps in 2 blocks, i.e.

    replace lines 23 to 45 with

    XXX

    and replace line 170

    "SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE meta_key = %s", 'gtags_group_tags' ) );

    with

    "SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE meta_key = 'gtags_group_tags' " ) );

    That should make it much clearer.

  21. Profusion
    Member
    Posted 1 year ago #

    o.m.g. that was painful - but it works.

    Thanks to @chancharles and @PauloASilva

    To fix this plugin you would need to edit the file:
    ../wp-content/plugins/buddypress-group-tags/bp-group-tags.php

    Replace from line 21 which should read:

    function bp_gtags_setup_globals() {

    up to and including lines 44, 45 which should read:

    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/index' ) );
    }

    with this:

    function bp_gtags_setup_globals() {
    	global $bp;
    		$bp->options['gtags'] = (object)Array(
    		'id' => 'gtags',
    		'slug' => 'tag'
    		);
    }
    add_action( 'bp_setup_globals', 'bp_gtags_setup_globals' );
    
    // in order for tags to show as /groups/tag/mytag I am using this function. however it is not optimal because it's not really a sub menu item
    function bp_gtags_setup_nav() {
    	global $bp;
    	bp_core_new_subnav_item( array( 'name' => ' ', 'slug' => $bp->options['gtags']->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => $bp->root_domain .'/'. BP_GROUPS_SLUG . '/', 'screen_function' => 'gtags_display_hook', 'position' => -1 ) );
    }
    add_action( 'bp_setup_nav', 'bp_gtags_setup_nav', 1000 );
    
    // a hack to remove the group tags menu item before the admin bar is displayed. it works because the admin bar is called last
    function gtags_remove_tags_from_admin_bar() {
    	global $bp;
    	unset ( $bp->bp_options_nav['groups']['98564'] );
    }
    function gtags_return_blank() {
        return '';
    }
    add_action( 'bp_adminbar_menus', 'gtags_remove_tags_from_admin_bar', 3 );
    
    function gtags_display_hook() {
      add_filter('bp_current_action', 'gtags_return_blank');
      bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/index' ) );
      remove_filter('bp_current_action', 'gtags_return_blank');
    }

    Then also replace line somewhere around 170 to 180 which reads:

    "SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE meta_key = 'gtags_group_tags' " ) );

    with

    "SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE meta_key = %s", 'gtags_group_tags' ) );
  22. chancharles
    Member
    Posted 1 year ago #

    Glad it works @Profusion.

    I notice I should have diff'ed the original against the new rather than the other way around. :)

    Cheers.

  23. Dwenaus
    Member
    Plugin Author

    Posted 1 year ago #

    thank you chancharles for your effort. I've included your changes in the latest version of the plugin 2.1 sorry for the long delay.

  24. Anton
    Member
    Posted 1 year ago #

    Hi. I made some changes here too, to get the slug working when translated.

    Line 27-28:

    $bp->gtags->slug = 'tagg';
    	$bp->gtags->groups_slug = isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG;

    And, make sure we use these later on, e.g. on line 94-96:

    if ( isset( $_POST[$bp->gtags->slug] ) && $_POST[$bp->gtags->slug] )
    		$tag = urldecode( $_POST[$bp->gtags->slug] ); // this is what ajax sends if we are in group directory
    	else if ( $bp->current_action == $bp->gtags->slug )

    …and on line 227:

    $link = $bp->root_domain . '/' . $bp->gtags->groups_slug . '/' . $bp->gtags->slug . '/' . urlencode( $tag ) ;

    …and on line 437:

    $link = $bp->root_domain . '/' . $bp->gtags->groups_slug . '/' . $bp->gtags->slug . '/' . urlencode( $item );

    Hope it works for you too, and that I didn't miss any edits I made.

  25. bdietderich
    Member
    Posted 1 year ago #

    Hi there,

    Even though this problem says "resolved" I am stil having the same issue even with the suggestions you guys said before and the update the plugin author has just provided.

    Does anybody have any guidance as to how I can fix this problem.

    Here is a link to my site which displays this issue:
    http://ksnvienna.com/project-badass/groups-2/

    Thanks!

  26. Anton
    Member
    Posted 1 year ago #

    bdietderich: Did you edit with my code too? Seems like you have the default group slug in the URL ("groups") but a custom one on your page ("groups-2"). Either you activate the feature on your "groups" page or you fix the slug issue using my code. That worked for me anyway.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Group Tags
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.