converting working wordpress code to bbpress code
-
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
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.