bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

converting working wordpress code to bbpress code

(2 posts)
  • Started 3 months ago by Null
  • Latest reply from Null
  • This topic is not resolved

No tags yet.

  1. 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 months ago #
  2. This is the problem: $bb->query_vars, what is the proper bb code?

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.