Info
- 6 posts
- 2 voices
- Started 3 years ago by Null
- Latest reply from Null
- This topic is not resolved
get_bb_location overite doesn't work
-
- Posted 3 years ago #
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; } -
- Posted 3 years ago #
To make my description easier:
view.phpgives: view-page
view.php?view=portgives: view-page too.I want
view.php?view=portto give: port-pageThx
-
- Posted 3 years ago #
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?
-
- Posted 3 years ago #
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.
-
- Posted 3 years ago #
Aaahhhh that explains a lot :) Going to add the patch en see if it works.
-
- Posted 3 years ago #
Installed the alpha, but it still returns view-page....
-
You must log in to post.