Info
- 2 posts
- 1 voice
- Started 3 years ago by Null
- Latest reply from Null
- This topic is not resolved
converting working wordpress code to bbpress code
-
- Posted 3 years ago #
Hi,
I have the following code that works in wordpress:
<?php $homepage = get_settings('siteurl')."/search.php/"; global $wp; $wp_received_argument = false; foreach ($wp->query_vars as $k=>$v) if ($v) $wp_received_argument = true; if ($wp_received_argument) require(TEMPLATEPATH . “/index.php”); else { wp_redirect($homepage); exit(); } ?>Now this wont work in bbpress, so I've made some modifications:
<?php $homepage = bb_get_option( 'uri' )."/search.php/"; global $bb; $bb_received_argument = false; foreach ($bb->query_vars as $k=>$v) if ($v) $bb_received_argument = true; if ($bb_received_argument) require(TEMPLATEPATH . “/index.php”); else { bb_redirect($homepage); exit(); } ?>It now crashes at the foreach. What am I missing?
Thx
-
- Posted 3 years ago #
This is the problem:
$bb->query_vars, what is the proper bb code? -
You must log in to post.