Forums

Join
bbPress Support ForumsTroubleshootingget_bb_location overite doesn't work

Info

Tags

get_bb_location overite doesn't work

  1. If you have a complete new php file that acts like a new page, you can add it's location with the below code, BUT I want to rename a existing php file. The problem is that its a filtered page: view.php?view=port. The problem is that this is still seen as view.php. How do I change this so that view.php?view=port is seen as a total new page so that the code below works and the location is added?

    function bbport_location() {
    	if (bb_find_filename($_SERVER['PHP_SELF']) == "view.php?view=port"):
    		return "port-page";
    	endif;
    }
    
    add_filter( 'get_bb_location', 'bbport_location' );
    
    function is_bbport() {
    	if ( 'port-page' == get_bb_location() )
    		return true;
    	else
    		return false;
    }
  2. To make my description easier:

    view.php gives: view-page
    view.php?view=port gives: view-page too.

    I want view.php?view=port to give: port-page

    Thx

  3. Update:

    Tested some stuff. I have this now:

    function bbport_location() {
    	if (substr($_SERVER["REQUEST_URI"],strrpos($_SERVER["REQUEST_URI"],"/")+1) == "view.php?view=port"):
    		return "port-page";
    	endif;
    }
    
    add_filter( 'get_bb_location', 'bbport_location' );

    The problem is that it doesn't return port-page. If I echo get_bb_location tis will still show: view-page instead of port-page. So why isn''t it updated? Why isn't it returned?

  4. Yes there is a caching bug in bb_location that is fixed in the newest 1.0 alphas but remains in the earlier versions. I caught the problem a month or two ago and Sam patched it.

    http://trac.bbpress.org/ticket/999

    So it's impossible to add locations in bbPress 0.8-0.9. You have to work around it manually.

  5. Aaahhhh that explains a lot :) Going to add the patch en see if it works.

  6. Installed the alpha, but it still returns view-page....

  7. You must log in to post.